wt.epm.util
Class EPMContainerHelper

java.lang.Object
  extended bywt.epm.util.EPMContainerHelper

public class EPMContainerHelper
extends Object

The EPMContainerHelper class provides set of static methods to help working with WTContainers

Supported API: false

Extendable: false


Field Summary
private static Class[] PDMLinkContainerClasses
          List of WTContainer classes that could be in a PDMLink Solution
private static String[] projectSubclasses
           
 
Constructor Summary
EPMContainerHelper()
           
 
Method Summary
static boolean canCreateLink(WTContainerRef fromContainerRef, WTContainerRef toContainerRef)
          Given two containers, tells if is valid to create link from fromContainer to toContainer

Supported API: false
private static Collection findInPackage(String pckgName, Class superClass)
          Find all the classes inheriting or implementing a given class in a given package.
static WTContainerRef getCADNamespaceReference(EPMDocumentMaster master)
          Returns the WTContainerRef to be used for CADNamespace
static Folder getContainerDefaultCabinet(Workable workable)
          Returns default cabinet of the container to which the workable belongs to
static String[] getProjectClasses()
          Returns all class names of all classes implementing the project functionality
static QueryResult getSBWorkspaceCheckpoints(WTContainerRef sandbox)
          Returns all the epmcheckpoints associated to workspaces in sandbox.
private static String[] getSubclasses(Class superClass)
          Get all the sub classes for a given class
static boolean inPDMLinkContainer(WTContained contained)
          Returns true if the given contained object is in a PDM Link container
static boolean inProject(WTContained contained)
          Returns true if the given container is a Project container
static boolean inSameContainer(WTContained containedOne, WTContained containedTwo)
          Returns true if both contained objects are in the same container.
private static boolean isAssignableFromPDMLinkContainerClasses(Class aClass)
          Returns true if the given class is assignable from one of the classes in PDMLinkContainerClasses.
static boolean isCreatedInSandbox(WTContained contained)
          Returns true if Object was created in Sandbox
static boolean isPDMLinkContainer(WTContainerRef containerRef)
          Returns true if the given container is PDMLink container.
static boolean isProject(WTContainerRef containerRef)
          Returns true if the given container is a Project container
static boolean isSameSolution(WTContainerRef firstRef, WTContainerRef secondRef)
          Returns true if given containers are part of same solution
static boolean isSandboxWorkingCopy(Versioned sandboxObject)
          Returns true if the given object is sandbox checked out copy or sandbox wip checked out copy.
private static boolean isSharingAllowed(WTContainerRef roleAContainerRef, WTContainerRef roleBContainerRef)
          Returns true if given container can refer/use objects in other container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDMLinkContainerClasses

private static final Class[] PDMLinkContainerClasses
List of WTContainer classes that could be in a PDMLink Solution


projectSubclasses

private static String[] projectSubclasses
Constructor Detail

EPMContainerHelper

public EPMContainerHelper()
Method Detail

canCreateLink

public static boolean canCreateLink(WTContainerRef fromContainerRef,
                                    WTContainerRef toContainerRef)
                             throws WTException
Given two containers, tells if is valid to create link from fromContainer to toContainer

Supported API: false

Returns:
boolean true if it is legal to create link, false otherwise
Throws:
WTException

getCADNamespaceReference

public static WTContainerRef getCADNamespaceReference(EPMDocumentMaster master)
                                               throws WTException
Returns the WTContainerRef to be used for CADNamespace

Parameters:
master - EPMDocumentMaster
Returns:
WTContainerRef ObjectReference of namespace container to be used or null if CADName is to be unique throughout the database

Supported API: false
Throws:
WTException

isSameSolution

public static boolean isSameSolution(WTContainerRef firstRef,
                                     WTContainerRef secondRef)
Returns true if given containers are part of same solution


inSameContainer

public static boolean inSameContainer(WTContained containedOne,
                                      WTContained containedTwo)
                               throws WTException
Returns true if both contained objects are in the same container.

Throws:
WTException

isCreatedInSandbox

public static boolean isCreatedInSandbox(WTContained contained)
                                  throws WTException
Returns true if Object was created in Sandbox

Returns:
true if object is created in Sandbox, false otherwise
Throws:
ClassCastException - if WTContained object is Iterated but it's master is not WTContained
WTException

isSharingAllowed

private static boolean isSharingAllowed(WTContainerRef roleAContainerRef,
                                        WTContainerRef roleBContainerRef)
                                 throws WTException
Returns true if given container can refer/use objects in other container

Throws:
WTException

isAssignableFromPDMLinkContainerClasses

private static boolean isAssignableFromPDMLinkContainerClasses(Class aClass)
Returns true if the given class is assignable from one of the classes in PDMLinkContainerClasses.

Returns:
true if the given class is assignable from one of the classes in PDMLinkContainerClasses.

isPDMLinkContainer

public static boolean isPDMLinkContainer(WTContainerRef containerRef)
Returns true if the given container is PDMLink container.

Returns:
true of containerRef is a PDMLink containerRef.

Supported API: false

inPDMLinkContainer

public static boolean inPDMLinkContainer(WTContained contained)
                                  throws WTException
Returns true if the given contained object is in a PDM Link container

Returns:
true if the given contained object is in PDM Link

Supported API: false
Throws:
WTException

isProject

public static boolean isProject(WTContainerRef containerRef)
Returns true if the given container is a Project container

Returns:
true if containerRef is a Project ContainerRef

Supported API: false

inProject

public static boolean inProject(WTContained contained)
                         throws WTException
Returns true if the given container is a Project container

Returns:
true if containerRef is a Project ContainerRef

Supported API: false
Throws:
WTException

getSBWorkspaceCheckpoints

public static QueryResult getSBWorkspaceCheckpoints(WTContainerRef sandbox)
                                             throws WTException,
                                                    WTPropertyVetoException
Returns all the epmcheckpoints associated to workspaces in sandbox. SERVER ONLY

Parameters:
sandbox - containerRef
Throws:
WTException, - WTPropertyVetoException
WTException
WTPropertyVetoException

getContainerDefaultCabinet

public static Folder getContainerDefaultCabinet(Workable workable)
                                         throws WTException
Returns default cabinet of the container to which the workable belongs to

Throws:
WTException

isSandboxWorkingCopy

public static boolean isSandboxWorkingCopy(Versioned sandboxObject)
                                    throws WTException
Returns true if the given object is sandbox checked out copy or sandbox wip checked out copy.

Parameters:
sandboxObject - sandbox version to make determination for
Returns:
boolean
Throws:
WTException

findInPackage

private static Collection findInPackage(String pckgName,
                                        Class superClass)
Find all the classes inheriting or implementing a given class in a given package.

Parameters:
pckgName - the full package name
superClass - the super Class the descendants of which we are looking for
Returns:
list of subclasses in the package

getSubclasses

private static String[] getSubclasses(Class superClass)
Get all the sub classes for a given class

Parameters:
superClass - the super Class the descendants of which we are looking for

getProjectClasses

public static String[] getProjectClasses()
Returns all class names of all classes implementing the project functionality

Returns:
class names of all classes implementing the project