com.ptc.windchill.cadx.common.util
Class ContainerUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.util.ContainerUtilities

public class ContainerUtilities
extends Object


Field Summary
static String CONTAINER_OID_AS_CONTEXT_OBJECT
           
static String CONTAINER_OID_AS_PARAMETER
           
private static String DEFAULT_CONTAINER_PARAM
           
private static String PROJECLINK_TOKENS_SEPARATOR
           
private static String PROJECLINK_VALUE_SEPARATOR
           
private static String PROJECT_CONTAINEROID_PREFIX
           
static String PROWT_CONTEXTTYPE_LIBRARY
           
static String PROWT_CONTEXTTYPE_MAX_J03
           
static String PROWT_CONTEXTTYPE_ORGANIZATION
           
static String PROWT_CONTEXTTYPE_PRODUCT
           
static String PROWT_CONTEXTTYPE_PROJECTLINK
           
static String PROWT_CONTEXTTYPE_SITE
           
static String PROWT_CONTEXTTYPE_UNKNOWN
           
static String PROWT_CONTEXTTYPE_WINDCHILL
           
private static boolean VERBOSE
           
static String WS_AS_PARAMETER
           
 
Constructor Summary
ContainerUtilities()
           
 
Method Summary
static boolean areInSameDomain(WTContainer container1, WTContainer container2)
          Checks if passed containers are in same 'domain' If both the container are PDMLink containers, they are in same domain.
static boolean areInSameSolution(WTContainer cnt1, WTContainer cnt2)
          spatanka : Added the following method : Find out if the specified container is in one of the solutions
static boolean areSame(WTContainer cnt1, WTContainer cnt2)
          spatanka : Added the following method : Tests whether given conntainers are in same Organization.
static WTContainer getActiveWorkspaceContainer(HTTPRequest aHTTPRequest)
          Get the active workspace's container context based upon the specified request object.
static WTContainer getActiveWorkspaceContainer(HTTPState aHTTPState)
          Get the active workspace's container context based upon the specified state object.
static WTContainer getContainerForBusinessObject(Object businessObject)
          Get owning container for the specified business object.
static WTContainer getContainerForBusinessObject(Object businessObject, HTTPRequest request)
          Get owning container for the specified business object.
static WTContainer getContainerForBusinessObject(Object businessObject, HTTPState aHTTPState)
          Get owning container for the specified business object.
static Vector getContainerNames(Vector containersVector)
          For the specified query result of WTContainer objects, return back a vector of container name.
static Vector getContainerOids(Vector containersVector)
          For the specified query result of WTContainer objects, return back a vector of string form of the container object id.
static WTContainer getContextContainerForAction(HTTPState aHTTPState)
          Get the context container for the solution environemnt in which this action is launched.
static WTContainer getContextContainerForAction(HTTPState aHTTPState, boolean considerActiveWorkspaceContainerContext)
          Get the context container for the solution environemnt in which this action is launched.
private static WTContainer getContextContainerFromActionURL(HTTPState aHTTPState)
          Get the context container for the solution context as passed through the query string of the action URL.
static WTContainer getContextContainerFromRequest(HTTPRequest request)
          Get the context container for the solution environemnt in which this action is launched.
static WTContainer getContextContainerFromRequest(HTTPRequest request, boolean considerActiveWorkspaceContainerContext)
          Get the context container for the solution environemnt in which this action is launched.
private static String getContextOidFromProperties(Properties props)
           
static QueryResult getDefaultCabinets(QueryResult containers)
          For the specified list of containers, return the list of default (aka cabinet for a container's "business" data) cabinets.
static WTOrganization getOrgContainerOrganization(WTContainer container)
          Get Organization for org container of the specified container.
static List getPDMLinkContainerClassNames()
          Get the list of the valid (fully qualified) class names of the containers belonging to PDMLink solution context.
static String getProEContainerType(WTContainer container)
           
static WTContainer getSelectedContainer(HTTPState aHTTPState)
          Return value of selected container as specified by user by selecting the container pull-down.
static WTContainer getSelectedContainer(HTTPState aHTTPState, String containerParam)
          Return value of selected container as specified by user by selecting the container pull-down.
static Vector getValidContainersForBusinessObjects(WTContainer wsContainer, Class containerClass, boolean filterByMembership)
          Get the containers in which business objects can be created.
static WTContainer getWTContainer(String containerOid)
          For the specified container oid, return back the WTContainer object.
static WTContainer getWTContainerByName(String containerName)
          Deprecated. Please use ContainerQueryUtilities.getWTContainerByName instead
static WTContainerRef getWTContainerRef(EPMWorkspace workspace)
          For the specified workspace object, get the container reference back.
static WTContainerRef getWTContainerRef(WTContainer container)
          For the specified container object, return back it's reference object
static boolean isClassicContainer(WTContainer container)
          Find out if the specified container is the installation's ClassicContainer
 boolean isContainerValid(String containerName)
          Deprecated. This method does not work when container with identical name are used in the inter-operable environment. Use getWTContainerByName(String containerName, WTContainer contextContainer) instead.
static boolean isExchangeContainer(WTContainer container)
           
static boolean isObjectAccessibleFromContainer(WTContained containedObj, WTContainer container)
           
static boolean isOrganizationContainer(WTContainer container)
           
static boolean isPDMLinkContainer(WTContainer container)
          Find out if the specified container is one of the PDMLink containers
private static boolean isPDMLinkContainerClass(Class containerClass)
          Find out if the specified container class is one of the PDMLink container classes
static boolean isPDMLinkLibraryContainer(WTContainer container)
           
static boolean isPDMLinkProductContainer(WTContainer container)
           
static boolean isProjectLinkContainer(WTContainer container)
          Find out if the specified container is one of the ProjectLink containers
static boolean isSelectedContainerDifferentFromWsContainer(HTTPState aHTTPState)
          Return true if selected container is other than the workspace's container
static boolean isSelectedContainerDifferentFromWsContainer(HTTPState aHTTPState, String containerParam)
          Return true if selected container is other than the workspace's container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

private static boolean VERBOSE

CONTAINER_OID_AS_CONTEXT_OBJECT

public static final String CONTAINER_OID_AS_CONTEXT_OBJECT
See Also:
Constant Field Values

CONTAINER_OID_AS_PARAMETER

public static final String CONTAINER_OID_AS_PARAMETER
See Also:
Constant Field Values

WS_AS_PARAMETER

public static final String WS_AS_PARAMETER
See Also:
Constant Field Values

PROJECLINK_TOKENS_SEPARATOR

private static final String PROJECLINK_TOKENS_SEPARATOR
See Also:
Constant Field Values

PROJECLINK_VALUE_SEPARATOR

private static final String PROJECLINK_VALUE_SEPARATOR
See Also:
Constant Field Values

DEFAULT_CONTAINER_PARAM

private static final String DEFAULT_CONTAINER_PARAM
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_UNKNOWN

public static final String PROWT_CONTEXTTYPE_UNKNOWN
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_WINDCHILL

public static final String PROWT_CONTEXTTYPE_WINDCHILL
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_PROJECTLINK

public static final String PROWT_CONTEXTTYPE_PROJECTLINK
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_PRODUCT

public static final String PROWT_CONTEXTTYPE_PRODUCT
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_LIBRARY

public static final String PROWT_CONTEXTTYPE_LIBRARY
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_SITE

public static final String PROWT_CONTEXTTYPE_SITE
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_ORGANIZATION

public static final String PROWT_CONTEXTTYPE_ORGANIZATION
See Also:
Constant Field Values

PROWT_CONTEXTTYPE_MAX_J03

public static final String PROWT_CONTEXTTYPE_MAX_J03
See Also:
Constant Field Values

PROJECT_CONTAINEROID_PREFIX

private static String PROJECT_CONTAINEROID_PREFIX
Constructor Detail

ContainerUtilities

public ContainerUtilities()
Method Detail

getContextContainerForAction

public static WTContainer getContextContainerForAction(HTTPState aHTTPState)
Get the context container for the solution environemnt in which this action is launched. The following logic is used for it: 1. Get owning container of the context object 2. Get it from context workspace 3. Get it based upon the action URL


getContextContainerForAction

public static WTContainer getContextContainerForAction(HTTPState aHTTPState,
                                                       boolean considerActiveWorkspaceContainerContext)
Get the context container for the solution environemnt in which this action is launched. The following logic is used for it: 1. Get it based upon the action URL 2. Get owning container of the context object 3. Get it from context workspace 4. If considerActiveWorkspaceContainerContext is true, then return the active workspace's container. 5. Get it based upon the action form data


getContextContainerFromRequest

public static WTContainer getContextContainerFromRequest(HTTPRequest request)
                                                  throws WTException
Get the context container for the solution environemnt in which this action is launched. The following logic is used for it: 1. Get owning container of the context object 2. Get it from context workspace 3. Get it based upon the action URL

Throws:
WTException

getContextContainerFromRequest

public static WTContainer getContextContainerFromRequest(HTTPRequest request,
                                                         boolean considerActiveWorkspaceContainerContext)
                                                  throws WTException
Get the context container for the solution environemnt in which this action is launched. The following logic is used for it: 1. Get owning container of the context object 2. Get it from context workspace 3. Get it based upon the action URL 4. If considerActiveWorkspaceContainerContext is true, then return the active workspace's container.

Throws:
WTException

getContextContainerFromActionURL

private static WTContainer getContextContainerFromActionURL(HTTPState aHTTPState)
Get the context container for the solution context as passed through the query string of the action URL. Note: This method is for limited usage only. Use getContextContainerForAction() in most cases to get container context for the solution environment.


getValidContainersForBusinessObjects

public static Vector getValidContainersForBusinessObjects(WTContainer wsContainer,
                                                          Class containerClass,
                                                          boolean filterByMembership)
                                                   throws WTException,
                                                          WTPropertyVetoException
Get the containers in which business objects can be created. The busiess objects are objects like WTPart, EPMDocument etc. Normally this list will contain only one entry for the container associated to the current workspace. However, in some cases, this list could have multiple entries. For example, in the PDMLink solution environment, user is allowed to select other products or library containers than the workspace associated produt (or library) container.

Parameters:
containerClass - deprecated
Throws:
WTException
WTPropertyVetoException

getWTContainer

public static WTContainer getWTContainer(String containerOid)
For the specified container oid, return back the WTContainer object.


getContainerNames

public static Vector getContainerNames(Vector containersVector)
For the specified query result of WTContainer objects, return back a vector of container name.


getContainerOids

public static Vector getContainerOids(Vector containersVector)
                               throws WTException
For the specified query result of WTContainer objects, return back a vector of string form of the container object id.

Throws:
WTException

getWTContainerRef

public static WTContainerRef getWTContainerRef(EPMWorkspace workspace)
                                        throws WTException
For the specified workspace object, get the container reference back.

Throws:
WTException

getWTContainerRef

public static WTContainerRef getWTContainerRef(WTContainer container)
                                        throws WTException
For the specified container object, return back it's reference object

Throws:
WTException

getContainerForBusinessObject

public static WTContainer getContainerForBusinessObject(Object businessObject,
                                                        HTTPState aHTTPState)
Get owning container for the specified business object. The business object could be either a WTContained or 'yet to be persisted' candidate WTContained. For example, 'not yet uploaded' CAD Document from the local file system are also considered here.

Parameters:
businessObject - a WTContained or 'yet to be persisted' candidate WTContained
aHTTPState - HTTPState object used primarily in case of candidate WTContained. Could be null in other cases.

getContainerForBusinessObject

public static WTContainer getContainerForBusinessObject(Object businessObject,
                                                        HTTPRequest request)
Get owning container for the specified business object. The business object could be either a WTContained or 'yet to be persisted' candidate WTContained. For example, 'not yet uploaded' CAD Document from the local file system are also considered here.


getContainerForBusinessObject

public static WTContainer getContainerForBusinessObject(Object businessObject)
Get owning container for the specified business object. This call doesn't provide for getting the container for a newly created EPMDocument - NEWEPMDocument


isContainerValid

public boolean isContainerValid(String containerName)
Deprecated. This method does not work when container with identical name are used in the inter-operable environment. Use getWTContainerByName(String containerName, WTContainer contextContainer) instead.

Check to see if the specified container name is a valid container.


getOrgContainerOrganization

public static WTOrganization getOrgContainerOrganization(WTContainer container)
Get Organization for org container of the specified container. First get the org container for the specified container. Return back organization of the org container.


areInSameSolution

public static boolean areInSameSolution(WTContainer cnt1,
                                        WTContainer cnt2)
spatanka : Added the following method : Find out if the specified container is in one of the solutions


areSame

public static boolean areSame(WTContainer cnt1,
                              WTContainer cnt2)
spatanka : Added the following method : Tests whether given conntainers are in same Organization.


getDefaultCabinets

public static QueryResult getDefaultCabinets(QueryResult containers)
For the specified list of containers, return the list of default (aka cabinet for a container's "business" data) cabinets.


getActiveWorkspaceContainer

public static WTContainer getActiveWorkspaceContainer(HTTPRequest aHTTPRequest)
Get the active workspace's container context based upon the specified request object.


getActiveWorkspaceContainer

public static WTContainer getActiveWorkspaceContainer(HTTPState aHTTPState)
Get the active workspace's container context based upon the specified state object.


isPDMLinkContainer

public static boolean isPDMLinkContainer(WTContainer container)
Find out if the specified container is one of the PDMLink containers


isPDMLinkLibraryContainer

public static boolean isPDMLinkLibraryContainer(WTContainer container)

isPDMLinkProductContainer

public static boolean isPDMLinkProductContainer(WTContainer container)

isClassicContainer

public static boolean isClassicContainer(WTContainer container)
Find out if the specified container is the installation's ClassicContainer


isOrganizationContainer

public static boolean isOrganizationContainer(WTContainer container)

isExchangeContainer

public static boolean isExchangeContainer(WTContainer container)

isProjectLinkContainer

public static boolean isProjectLinkContainer(WTContainer container)
Find out if the specified container is one of the ProjectLink containers


isPDMLinkContainerClass

private static boolean isPDMLinkContainerClass(Class containerClass)
Find out if the specified container class is one of the PDMLink container classes


getPDMLinkContainerClassNames

public static List getPDMLinkContainerClassNames()
Get the list of the valid (fully qualified) class names of the containers belonging to PDMLink solution context.


getWTContainerByName

public static WTContainer getWTContainerByName(String containerName)
                                        throws WTException
Deprecated. Please use ContainerQueryUtilities.getWTContainerByName instead

For the specified container name, return back the WTContainer object.

Parameters:
containerName -
Returns:
Throws:
WTException

getContextOidFromProperties

private static String getContextOidFromProperties(Properties props)

isObjectAccessibleFromContainer

public static boolean isObjectAccessibleFromContainer(WTContained containedObj,
                                                      WTContainer container)
                                               throws WTException
Throws:
WTException

areInSameDomain

public static boolean areInSameDomain(WTContainer container1,
                                      WTContainer container2)
Checks if passed containers are in same 'domain' If both the container are PDMLink containers, they are in same domain. Otherwise both the container should exactly match to be in same domain


getProEContainerType

public static String getProEContainerType(WTContainer container)

isSelectedContainerDifferentFromWsContainer

public static boolean isSelectedContainerDifferentFromWsContainer(HTTPState aHTTPState)
Return true if selected container is other than the workspace's container


isSelectedContainerDifferentFromWsContainer

public static boolean isSelectedContainerDifferentFromWsContainer(HTTPState aHTTPState,
                                                                  String containerParam)
Return true if selected container is other than the workspace's container


getSelectedContainer

public static WTContainer getSelectedContainer(HTTPState aHTTPState)
Return value of selected container as specified by user by selecting the container pull-down.


getSelectedContainer

public static WTContainer getSelectedContainer(HTTPState aHTTPState,
                                               String containerParam)
Return value of selected container as specified by user by selecting the container pull-down.

Parameters:
containerParam - Container parameter as passed through form data