com.ptc.windchill.uwgm.common.container
Class ContainerUtilities

java.lang.Object
  extended bycom.ptc.windchill.uwgm.common.container.ContainerUtilities

public class ContainerUtilities
extends Object

Windchill container relater utilities and container types


Field Summary
private static Log log
          logging
 
Constructor Summary
private ContainerUtilities()
          private default construct to prevent accidental instantiation
 
Method Summary
static WTContainer[] getAllProjectLinkContainers()
          private query for getting all project link containers
static WTContainer getContainerByName(WTPrincipal principal, String containerName, ContainerType containerType)
          gets container by container name and type where principal is a member
static WTContainer getContainerByOrganizationAndName(WTPrincipal principal, WTPrincipalReference organizationReference, String containerName, ContainerType containerType)
          gets container by organization, container name and type where principal is a member Use OrganizationHelper.getUserOrganizationReference(principal) to get Organization reference
static WTContainer getContainerForPersistable(Persistable businessObject)
          Get owning container for the specified Persistable business object.
static WTContainer[] getContainers(WTPrincipal principal)
          gets all containers where user is invited to
static WTContainer[] getContainers(WTPrincipal principal, ContainerType containerType)
          gets all containers of given type where user is invited to
static WTContainer[] getContainersByName(WTPrincipal principal, String containerName)
          gets container(s) by container name where principal is a member this method may return more than one container (currently up to 3) since a project, product and library may have the same name
static WTContainer[] getContainersByName(WTPrincipal principal, String containerName, ContainerType containerType)
          gets containers by container name and type where principal is a member
static WTContainer[] getPDMLinkContainers(WTPrincipal principal)
          gets all PDMLink containers (prodicts and libraries) where user is invited to
static WTContainer[] getRegisteredContainers(WTPrincipal principal, ContainerType containerType)
          gets "registered" user containers of given container type container is registered by the user, when at least one user workspace is associated with this container
private static WTContainer[] getUserContainers(WTPrincipal principal, ContainerType containerType, String containerName)
          private query for getting user containers Site and Organization only available for their administators
static WTContainer getWTContainer(String containerOid)
          For the specified container oid, return back the WTContainer object.
static boolean isActive(WTContainer container)
          returns "true" if container is active container is active if the user has at least "read" permissions and for PL containers project is active
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Log log
logging

Constructor Detail

ContainerUtilities

private ContainerUtilities()
private default construct to prevent accidental instantiation

Method Detail

getContainersByName

public static WTContainer[] getContainersByName(WTPrincipal principal,
                                                String containerName)
                                         throws WTException
gets container(s) by container name where principal is a member this method may return more than one container (currently up to 3) since a project, product and library may have the same name

Throws:
WTException

getContainerByOrganizationAndName

public static WTContainer getContainerByOrganizationAndName(WTPrincipal principal,
                                                            WTPrincipalReference organizationReference,
                                                            String containerName,
                                                            ContainerType containerType)
                                                     throws WTException
gets container by organization, container name and type where principal is a member Use OrganizationHelper.getUserOrganizationReference(principal) to get Organization reference

Returns:
WTContainer or null if none available
Throws:
WTException

getContainerByName

public static WTContainer getContainerByName(WTPrincipal principal,
                                             String containerName,
                                             ContainerType containerType)
                                      throws WTException
gets container by container name and type where principal is a member

Returns:
WTContainer or null if none available
Throws:
WTException

getContainersByName

public static WTContainer[] getContainersByName(WTPrincipal principal,
                                                String containerName,
                                                ContainerType containerType)
                                         throws WTException
gets containers by container name and type where principal is a member

Returns:
an array of WTContainers. Empty array if none available
Throws:
WTException

getContainers

public static WTContainer[] getContainers(WTPrincipal principal,
                                          ContainerType containerType)
                                   throws WTException
gets all containers of given type where user is invited to

Parameters:
principal - WTPrincipal
containerType - ContainerType
Returns:
WTContainer[] maybe empty but NEVER null
Throws:
WTException

getPDMLinkContainers

public static WTContainer[] getPDMLinkContainers(WTPrincipal principal)
                                          throws WTException
gets all PDMLink containers (prodicts and libraries) where user is invited to

Parameters:
principal - WTPrincipal
Returns:
WTContainer[] maybe empty but NEVER null
Throws:
WTException

getContainers

public static WTContainer[] getContainers(WTPrincipal principal)
                                   throws WTException
gets all containers where user is invited to

Parameters:
principal - WTPrincipal
Returns:
WTContainer[] maybe empty but NEVER null
Throws:
WTException

getRegisteredContainers

public static WTContainer[] getRegisteredContainers(WTPrincipal principal,
                                                    ContainerType containerType)
                                             throws WTException
gets "registered" user containers of given container type container is registered by the user, when at least one user workspace is associated with this container

Throws:
WTException

getContainerForPersistable

public static WTContainer getContainerForPersistable(Persistable businessObject)
                                              throws WTException
Get owning container for the specified Persistable business object. This method supports EPMDocument, WTPart, WTContainer (any type), EPMWorkspace and so on for EPMWorkspace returns associated container This call doesn't provide for getting the container for a newly created EPMDocument - NEWEPMDocument

Returns:
WTContainer or null if none available
Throws:
WTException

getWTContainer

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

Throws:
WTException

isActive

public static boolean isActive(WTContainer container)
                        throws WTException
returns "true" if container is active container is active if the user has at least "read" permissions and for PL containers project is active

Parameters:
container - WTContainer
Returns:
boolean
Throws:
WTException

getUserContainers

private static WTContainer[] getUserContainers(WTPrincipal principal,
                                               ContainerType containerType,
                                               String containerName)
                                        throws WTException
private query for getting user containers Site and Organization only available for their administators

Parameters:
principal - WTPrincipal user
containerType - ContainerType any ContainerType.XXX. use ANY to get ALL avalable and PDMLINK for both product and libraries
containerName - String optional name. If null, all container will be returned
Returns:
WTContainer[] array of available containers. Might be an empty, but NEVER null
Throws:
WTException

getAllProjectLinkContainers

public static WTContainer[] getAllProjectLinkContainers()
                                                 throws WTException
private query for getting all project link containers

Returns:
WTContainer[] array of all project link containers
Throws:
WTException