wt.inf.container
Interface WTContainerService

All Known Implementing Classes:
StandardWTContainerService, WTContainerServiceFwd

public interface WTContainerService



Supported API: true

Extendable: false


Method Summary
 boolean canCreate(Class container_class, WTUser user)
          Uses a CanCreateDelegate to determine if the user can create a container of type container_class in their organization's OrgContainer.
 boolean canCreate(Class container_class, WTUser user, WTContainerRef parent_ref)
          Uses a CanCreateDelegate to determine if the given user can create an instance of the given container class in the given container.
 WTContainer changePublicParentDomain(WTContainer container, AdminDomainRef new_parent)
          Changes a WTContainer's publicParentDomain property.
 OrgContainer changeRestrictedDirectorySearchScope(OrgContainer container, boolean restrict)
          Changes a persistent OrgContainer's restrictedDirectorySearchScope property.
 void checkCreate(Class container_class, WTUser user, WTContainerRef parent_ref)
          Throws an exception if the given user cannot create a container in the given parent container.
 WTContainer create(WTContainer container)
          Finds an appropriate WTContainerCreator for the given container and calls create().
 WTContainer create(WTContainer container, String selector)
          Finds an appropriate WTContainerCreator for the given container and calls create().
 AdminDomainRef getBasePublicDomain(OrgContainer container, Class container_class)
          Returns the root public domain for containers of the given class.
 WTContainerRef getByInternetDomain(String domain_name)
          

Supported API: false
 WTContainerRef getByPath(String path)
          Finds a container based on a path.
 WTLibrary getClassicContainer()
          Returns a cached, read-only instance of the installation's classic container.
 WTContainerRef getClassicRef()
          Returns a cached, inflated, read-only reference to the installation's classic container.
 QueryResult getContainers(ContainerSpec spec)
          Gets the containers specified in the ContainerSpec.
 DirectoryContextProvider getContextProvider(WTContainer container)
          Returns the DirectoryContextProvider associated with the given container.
 DirectoryContextProvider getContextProvider(WTContainerRef container_ref)
          Returns the DirectoryContextProvider associated with the given container.
 CreatorsMap getCreatorsMap(OrgContainer container)
          

Supported API: false
 ExchangeContainer getExchangeContainer()
          Returns a cached, read-only instance of the installation's exchange (site) container.
 WTContainerRef getExchangeRef()
          Returns a cached, inflated, read-only reference to the installation's exchange (site) container.
 String getInternetDomain(WTContainer container)
          Returns the name of the internet domain associated with the given container, for example "com.ptc".
 String getInternetDomain(WTContainerRef container_ref)
          Returns the name of the internet domain associated with the given container, for example "com.ptc".
 WTContainer getNamespace(Class contained_class, WTContainer new_container)
          Get the namespace for objects of the given class in the given container.
 WTContainer getNamespace(WTContained contained)
          Deprecated. Replaced by getNamespace(Class)
 WTContainer getNamespace(WTContained contained, WTContainer new_container)
          Deprecated. Replaced by getNamespace(Class, WTContainer)
 OrgContainer getOrgContainer(WTContained contained)
          Finds the first parent of the given container that is an OrgContainer.
 OrgContainer getOrgContainer(WTOrganization wt_org)
          Find the OrgContainer for a WTOrganization

Supported API: true
 WTContainerRef getOrgContainerRef(WTContained contained)
          Finds the first parent of the given container that is an OrgContainer.
 WTContainerRef getOrgContainerRef(WTOrganization wt_org)
          Find the OrgContainer for a WTOrganization

Supported API: false
 PrincipalQueryResult getPrincipals(PrincipalSpec spec)
          Deprecated. Replaced by DirectoryHelperSvr.queryPrincipals

Finds principals in the public context of the given container, as defined in the PrincipalSpec parameter object.

 DirectoryContextProvider getPublicContextProvider(WTContainer container, Class principal_class)
          Deprecated. Replaced by getPublicContextProviders

Creates DirectoryContextProviders according to the following specification:

OrganizationsGroupsUsers
Site ContainerSelects all principals in all adapters
Windchll PDM ContainerSelects all principals in all adapters
Restricted OrgContainers Selects only the given OrgContainer's organization. Only selects groups in the bundled adapter, underneath the organization's "Public" node Selects users that are members of the organization in all adpaters
Unrestricted OrgContainers Selects only the given OrgContainer's organization. In the bundled adapter, selects groups underneath the organization's "Public" node. In all other adapters, selects all groups. Selects all users in all adapters
ContainerTeamManaged containers in restricted OrgContainers Only selects organizations and groups in the default adapter, underneath the containers "accessGroups" node. This node is the root for all of the container's role groups. Selects users that are members of the container's organization in all adapters
ContainerTeamManaged containers in unrestricted OrgContainers In the bundled adapter, selects groups and organizations underneath the container's "accessGroups" node. This node is the root for all of the container's role groups. In all other adapters, selects all groups. Selects all users in all adpaters
 DirectoryContextProvider[] getPublicContextProviders(PrincipalSpec spec)
          Returns an array of DirectoryContextProviders that select a set of principals appropriate for display in clients.
 AdminDomainRef getPublicDomainRef(OrgContainer container, Class container_class, String domain_path)
          Gets the public domain for the given container class.
 PublicDomainSet getPublicDomains(OrgContainer container, Class container_class)
          Finds all domains that can be used for a child container's publicParentDomain property.
 DirectorySubtree getSubtree(WTContainer container)
          Get a DirectorySubtree representing the path to the root directory node corresponding to the given container.
 boolean isAdministrator(WTContainerRef container_ref, WTPrincipal user)
          Determines if a user is an administrator of a container.
 boolean isAdministrator(WTContainerRef container_ref, WTPrincipal user, boolean lookup)
          Determines if a user is an administrator of a container.
 boolean isDescendedFrom(WTContainerRef parent_ref, WTContainerRef child_ref)
          Determines if child_ref is a descendent of parent_ref.
 boolean isRootDomain(AdminDomainRef domain_ref)
          Determines whether the given domain should be considered a root domain for the given container.
 QueryResult lookup(LookupSpec spec)
          Perform the lookup specified in the LookupSpec

Supported API: false
 WTContainer makePrivate(WTContainer container)
          Sets the container's privateAccess property to true.
 WTContainer makePublic(WTContainer container)
          Sets the container's privateAccess property to false.
 

Method Detail

canCreate

public boolean canCreate(Class container_class,
                         WTUser user)
                  throws WTException
Uses a CanCreateDelegate to determine if the user can create a container of type container_class in their organization's OrgContainer.

Supported API: false

Parameters:
container_class -
user -
Returns:
boolean
Throws:
WTException
See Also:
CanCreateDelegate

canCreate

public boolean canCreate(Class container_class,
                         WTUser user,
                         WTContainerRef parent_ref)
                  throws WTException
Uses a CanCreateDelegate to determine if the given user can create an instance of the given container class in the given container.

Supported API: false

Parameters:
container_class -
user -
parent_ref -
Returns:
boolean
Throws:
WTException
See Also:
CanCreateDelegate

changePublicParentDomain

public WTContainer changePublicParentDomain(WTContainer container,
                                            AdminDomainRef new_parent)
                                     throws WTException
Changes a WTContainer's publicParentDomain property. The new domain must be included in those returned by getPublicDomains for the container's OrgContainer

Supported API: true

Parameters:
container -
new_parent -
Returns:
WTContainer
Throws:
WTException

changeRestrictedDirectorySearchScope

public OrgContainer changeRestrictedDirectorySearchScope(OrgContainer container,
                                                         boolean restrict)
                                                  throws WTException
Changes a persistent OrgContainer's restrictedDirectorySearchScope property. If the new value is true, then the container's associated WTOrganization is removed from the site-level All Unrestricted Organizations group. If the new value is false, then the organization is added to the group.

By default, members of the All Unrestricted Organizations group are granted read access to all principals in the User domain or any of its child domains.

Use WTContainerHelper.setRestrictedDirectorySearchScope(OrgContainer,boolean) to assign this value to an unpersisted container.

Supported API: false

Parameters:
container -
restrict -
Returns:
OrgContainer
Throws:
WTException
See Also:
OrgContainer.restrictedDirectorySearchScope

checkCreate

public void checkCreate(Class container_class,
                        WTUser user,
                        WTContainerRef parent_ref)
                 throws WTException
Throws an exception if the given user cannot create a container in the given parent container.

Supported API: false

Parameters:
container_class -
user -
parent_ref -
Throws:
WTException
See Also:
CanCreateDelegate

create

public WTContainer create(WTContainer container)
                   throws WTException
Finds an appropriate WTContainerCreator for the given container and calls create().

Supported API: true

Parameters:
container -
Returns:
WTContainer
Throws:
WTException
See Also:
WTContainerCreator

create

public WTContainer create(WTContainer container,
                          String selector)
                   throws WTException
Finds an appropriate WTContainerCreator for the given container and calls create().

Supported API: false

Parameters:
container -
selector - An optional selector to help pick the appropriate WTContainerCreator.
Returns:
WTContainer
Throws:
WTException
See Also:
WTContainerCreator

getBasePublicDomain

public AdminDomainRef getBasePublicDomain(OrgContainer container,
                                          Class container_class)
                                   throws WTException
Returns the root public domain for containers of the given class. In the OOTB configuration, for products and repositories this will be a domain named "PDM" stored under the container's default domain, and for projects this will be a domain named "Project" stored under the container's default domain.

Supported API: true

Parameters:
container -
container_class -
Returns:
AdminDomainRef
Throws:
WTException

getByInternetDomain

public WTContainerRef getByInternetDomain(String domain_name)
                                   throws WTException


Supported API: false

Parameters:
domain_name -
Returns:
The container that has the given internet domain name.
Throws:
WTException
See Also:
WTContainer.getInternetDomain()

getByPath

public WTContainerRef getByPath(String path)
                         throws WTException
Finds a container based on a path. The path is of the form:
 path                    ::= path_element (path_element)*
 path_element     ::= '/' class_name '=' container_name
 class_name        ::= the fully qualified name of a container class
 container_name :: = the name of a container instance
 


Supported API: false

Parameters:
path -
Returns:
WTContainerRef
Throws:
WTException

getClassicContainer

public WTLibrary getClassicContainer()
                              throws WTException
Returns a cached, read-only instance of the installation's classic container.

Supported API: false

Returns:
The installation's ClassicContainer.
Throws:
WTException

getClassicRef

public WTContainerRef getClassicRef()
                             throws WTException
Returns a cached, inflated, read-only reference to the installation's classic container.

Supported API: false

Returns:
A reference to the installation's ClassicContainer.
Throws:
WTException

getContainers

public QueryResult getContainers(ContainerSpec spec)
                          throws WTException
Gets the containers specified in the ContainerSpec.

Supported API: false

Parameters:
spec -
Returns:
QueryResult
Throws:
WTException

getContextProvider

public DirectoryContextProvider getContextProvider(WTContainer container)
                                            throws WTException
Returns the DirectoryContextProvider associated with the given container.

Supported API: false

Parameters:
container -
Returns:
DirectoryContextProvider
Throws:
WTException
See Also:
WTContainer.getContextProvider()

getContextProvider

public DirectoryContextProvider getContextProvider(WTContainerRef container_ref)
                                            throws WTException
Returns the DirectoryContextProvider associated with the given container.

Supported API: false

Parameters:
container_ref -
Returns:
DirectoryContextProvider
Throws:
WTException
See Also:
WTContainer.getContextProvider()

getCreatorsMap

public CreatorsMap getCreatorsMap(OrgContainer container)
                           throws WTException


Supported API: false

Parameters:
container -
Returns:
A CreatorsMap for the given container.
Throws:
WTException
See Also:
CreatorsMap

getExchangeContainer

public ExchangeContainer getExchangeContainer()
                                       throws WTException
Returns a cached, read-only instance of the installation's exchange (site) container.

Supported API: false

Returns:
The installation's ExchangeContainer.
Throws:
WTException

getExchangeRef

public WTContainerRef getExchangeRef()
                              throws WTException
Returns a cached, inflated, read-only reference to the installation's exchange (site) container.

Supported API: false

Returns:
A reference to the installation's ExchangeContainer.
Throws:
WTException

getInternetDomain

public String getInternetDomain(WTContainerRef container_ref)
                         throws WTException
Returns the name of the internet domain associated with the given container, for example "com.ptc".

This property may be derived from WTOrganization.internetDomain



Supported API: false

Parameters:
container_ref -
Returns:
String
Throws:
WTException
See Also:
WTContainer.getInternetDomain(), WTOrganization.getInternetDomain()

getInternetDomain

public String getInternetDomain(WTContainer container)
                         throws WTException
Returns the name of the internet domain associated with the given container, for example "com.ptc".

This property may be derived from WTOrganization.internetDomain



Supported API: false

Parameters:
container -
Returns:
String
Throws:
WTException
See Also:
WTContainer.getInternetDomain(), WTOrganization.getInternetDomain()

getNamespace

public WTContainer getNamespace(WTContained contained)
                         throws WTException
Deprecated. Replaced by getNamespace(Class)



Supported API: false

Parameters:
contained -
Returns:
WTContainer
Throws:
WTException

getNamespace

public WTContainer getNamespace(WTContained contained,
                                WTContainer new_container)
                         throws WTException
Deprecated. Replaced by getNamespace(Class, WTContainer)



Supported API: false

Parameters:
contained -
new_container -
Returns:
WTContainer
Throws:
WTException

getNamespace

public WTContainer getNamespace(Class contained_class,
                                WTContainer new_container)
                         throws WTException
Get the namespace for objects of the given class in the given container. WTContained must be assignable from the class.

Supported API: false

Parameters:
contained_class -
new_container -
Returns:
WTContainer
Throws:
WTException

getOrgContainer

public OrgContainer getOrgContainer(WTContained contained)
                             throws WTException
Finds the first parent of the given container that is an OrgContainer.

Supported API: false

Parameters:
contained - The contained object to find an OrgContainer for.
Returns:
OrgContainer
Throws:
WTException

getOrgContainer

public OrgContainer getOrgContainer(WTOrganization wt_org)
                             throws WTException
Find the OrgContainer for a WTOrganization

Supported API: true

Parameters:
wt_org -
Returns:
The associated OrgContainer, or null if one can't be found
Throws:
WTException

getOrgContainerRef

public WTContainerRef getOrgContainerRef(WTContained contained)
                                  throws WTException
Finds the first parent of the given container that is an OrgContainer.

Supported API: false

Parameters:
contained -
Returns:
A reference to the OrgContainer
Throws:
WTException

getOrgContainerRef

public WTContainerRef getOrgContainerRef(WTOrganization wt_org)
                                  throws WTException
Find the OrgContainer for a WTOrganization

Supported API: false

Parameters:
wt_org -
Returns:
A reference to the associated OrgContainer, or null if one can't be found
Throws:
WTException

getPrincipals

public PrincipalQueryResult getPrincipals(PrincipalSpec spec)
                                   throws WTException
Deprecated. Replaced by DirectoryHelperSvr.queryPrincipals

Finds principals in the public context of the given container, as defined in the PrincipalSpec parameter object.



Supported API: false

Parameters:
spec -
Returns:
A PrincipalQueryResult containing the resulting principals.
Throws:
WTException

getPublicContextProvider

public DirectoryContextProvider getPublicContextProvider(WTContainer container,
                                                         Class principal_class)
                                                  throws WTException
Deprecated. Replaced by getPublicContextProviders

Creates DirectoryContextProviders according to the following specification:

OrganizationsGroupsUsers
Site ContainerSelects all principals in all adapters
Windchll PDM ContainerSelects all principals in all adapters
Restricted OrgContainers Selects only the given OrgContainer's organization. Only selects groups in the bundled adapter, underneath the organization's "Public" node Selects users that are members of the organization in all adpaters
Unrestricted OrgContainers Selects only the given OrgContainer's organization. In the bundled adapter, selects groups underneath the organization's "Public" node. In all other adapters, selects all groups. Selects all users in all adapters
ContainerTeamManaged containers in restricted OrgContainers Only selects organizations and groups in the default adapter, underneath the containers "accessGroups" node. This node is the root for all of the container's role groups. Selects users that are members of the container's organization in all adapters
ContainerTeamManaged containers in unrestricted OrgContainers In the bundled adapter, selects groups and organizations underneath the container's "accessGroups" node. This node is the root for all of the container's role groups. In all other adapters, selects all groups. Selects all users in all adpaters



Supported API: false

Parameters:
container -
principal_class -
Returns:
DirectoryContextProvider
Throws:
WTException

getPublicContextProviders

public DirectoryContextProvider[] getPublicContextProviders(PrincipalSpec spec)
                                                     throws WTException
Returns an array of DirectoryContextProviders that select a set of principals appropriate for display in clients. The following table presents the results of getPublicContextProviders given an input container reference and principal class.

Notes on the table:

Organizations Groups Users
Site Container A single context provider with no search filter in any service. A single context provider that searches with one level scope beneath the base DN of the bundled adapter. No search filter for other services. A single context provider with no search filter in any service.

If filterByOrganization is true, then only users with a matching "o" attribute or from a supporting service are selected.

Organization Container
  1. A context that selects groups with one level scope beneath the organization's "Public" node in the bundled adapter. No search filter in other services.
  2. The site-level context for groups.
Application Container
  1. A context that selects groups with subtree scope beneath the container's "accessGroups" node in the bundled adapter. No search filter in other services.
  2. The org-level context for groups.
  3. The site-level context for groups.
Classic Container
  1. A context that selects groups with subtree scope beneath the container's root node in the bundled adapter. No search filter in other services.
  2. The org-level context for groups.
  3. The site-level context for groups.



Supported API: false

Parameters:
spec -
Returns:
DirectoryContextProvider[]
Throws:
WTException
See Also:
PrincipalSpec, wt#org#DirectoryContextProvider

getPublicDomainRef

public AdminDomainRef getPublicDomainRef(OrgContainer container,
                                         Class container_class,
                                         String domain_path)
                                  throws WTException
Gets the public domain for the given container class. The domain path should be relative to the base public domain. For example, if the domain structure in an org is
 /Root/Default/Project/HR/Arden
 Hills
, then the way to get the "Arden Hills" domain would be:
getPublicDomain(org, Project2.class, "/HR/Arden Hills")
.

 

Supported API: false

Parameters:
container -
container_class -
domain_path -
Returns:
AdminDomainRef
Throws:
WTException

getPublicDomains

public PublicDomainSet getPublicDomains(OrgContainer container,
                                        Class container_class)
                                 throws WTException
Finds all domains that can be used for a child container's publicParentDomain property. This includes the container's base domain for the given container class, as well as all children of the base domain that are also in the container.

Supported API: true

Parameters:
container -
container_class -
Returns:
PublicDomainSet
Throws:
WTException

getSubtree

public DirectorySubtree getSubtree(WTContainer container)
                            throws WTException
Get a DirectorySubtree representing the path to the root directory node corresponding to the given container.

Supported API: false

Parameters:
container -
Returns:
DirectorySubtree
Throws:
WTException
See Also:
DirectorySubtree, getContextProvider(wt.inf.container.WTContainer)

isAdministrator

public boolean isAdministrator(WTContainerRef container_ref,
                               WTPrincipal user)
                        throws WTException
Determines if a user is an administrator of a container. Calls isAdministrator(WTContainerRef,WTPrincipal,boolean) with lookup set to true.

Supported API: false

Parameters:
container_ref -
user -
Returns:
boolean
Throws:
WTException

isAdministrator

public boolean isAdministrator(WTContainerRef container_ref,
                               WTPrincipal user,
                               boolean lookup)
                        throws WTException
Determines if a user is an administrator of a container. Returns true if the user is a member of the container's administrators group. If lookup is true, will also return true if the user is in the administrators group of any of the container's ancestors.

Supported API: false

Parameters:
container_ref -
user -
lookup -
Returns:
boolean
Throws:
WTException
See Also:
WTContainer.getAdministrators()

isDescendedFrom

public boolean isDescendedFrom(WTContainerRef parent_ref,
                               WTContainerRef child_ref)
                        throws WTException
Determines if child_ref is a descendent of parent_ref.

Supported API: false

Parameters:
parent_ref -
child_ref -
Returns:
boolean
Throws:
WTException

isRootDomain

public boolean isRootDomain(AdminDomainRef domain_ref)
                     throws WTException
Determines whether the given domain should be considered a root domain for the given container. The domain is a root domain if the domain's parent is stored in a different container than the domain itself. This API is used to determine whether access control rules need to be programmatically added to the domain.

Supported API: false

Parameters:
domain_ref -
Returns:
boolean
Throws:
WTException

lookup

public QueryResult lookup(LookupSpec spec)
                   throws WTException
Perform the lookup specified in the LookupSpec

Supported API: false

Parameters:
spec -
Returns:
QueryResult
Throws:
WTException
See Also:
LookupSpec

makePrivate

public WTContainer makePrivate(WTContainer container)
                        throws WTException
Sets the container's privateAccess property to true. In addition, reparents the container's defaultDomain to point to the org container's privateDomain.

Supported API: true

Parameters:
container -
Returns:
WTContainer
Throws:
WTException

makePublic

public WTContainer makePublic(WTContainer container)
                       throws WTException
Sets the container's privateAccess property to false. In addition, reparents the container's defaultDomain to point to the domain stored in the container's publicParentDomain property.

Supported API: true

Parameters:
container -
Returns:
WTContainer
Throws:
WTException