wt.inf.template.creator
Class AbstractWTContainerCreator

java.lang.Object
  extended bywt.inf.template.creator.AbstractWTContainerCreator
All Implemented Interfaces:
ContainerCreatorOrgOperations, WTContainerCreator
Direct Known Subclasses:
AbstractContainerTeamManagedCreator, ClassicCreatorHelper, ExchangeCreator, OrgContainerCreator

public abstract class AbstractWTContainerCreator
extends Object
implements WTContainerCreator, ContainerCreatorOrgOperations



Supported API: false

Extendable: false


Field Summary
private static String ACCESS_RESOURCE
           
private static String ADMIN_RESOURCE
           
private static String CLASSNAME
           
private static boolean DEBUG
           
protected static WTPrincipalReference[] EMPTY_USER_ARRAY
           
private static DebugWriter LOG
           
private static String RESOURCE
           
private static boolean SKIP_ALL_XML
           
private static boolean SKIP_ORG_XML
           
private static boolean SKIP_PROJ_XML
           
protected static String WTOBJECT_TYPE
           
 
Constructor Summary
AbstractWTContainerCreator()
           
 
Method Summary
protected  void checkCreate(WTContainerCreateRequest initData)
          Deprecated.  
 WTContainer create(WTContainerCreateRequest req)
          

Supported API: false
protected  void createAccessControlRule(WTContainerCreateRequest req, AdminDomainRef domain_ref, String type_id, String state_key, WTPrincipalReference principal_ref, boolean grant, Vector permissions)
           
protected  AdminDomainRef createRootDomain(AdminDomainRef parent, String name, String description, WTContainerRef container)
           
protected  WTContainer finalizeCreation(WTContainerCreateRequest createParams)
          This method should be over-ridden if there is a need to do any processing after loading business data.
protected  WTContainer finalizeInitialization(WTContainerCreateRequest createParams, XMLLob finalizeInitConfig)
          This method should be over-ridden to finalize any other initialization that is needed prior to Adding objects needed in the container.
 DirectoryContextProvider getAdminGroupContext(WTContainer cont)
          Initializes System access rules.
protected  WTContainer getContainer(WTContainerCreateRequest req)
           
protected  WTContainerRef getContainerRef(WTContainerCreateRequest req)
           
private  AdminDomainRef getNewDomainRefIfNeeded(WTContainer container)
           
private  AdminDomainRef getPublicParentDomainRef(WTContainer container)
           
protected  WTContainer initializeContextProvider(WTContainerCreateRequest initData)
          This method just uses a default context provider, most containers will need to add nodes so this method will have to be over-ridden.
protected  WTContainer initializeRequiredSystemUsers(WTContainerCreateRequest initData)
          This method initializes users and groups required for the container.
protected  WTContainer initializeSystemAccess(WTContainerCreateRequest createParams)
          Initializes System access rules.
protected  WTContainer initializeSystemDomains(WTContainerCreateRequest initData)
          This method initializes the domain structure for the container.
protected  WTContainer initializeSystemFolders(WTContainerCreateRequest initData)
          This method initializes the folder structure for the container.
protected  WTContainer loadBusinessTemplate(WTContainerCreateRequest createParams, XMLLob businessXML)
          This method should be over-ridden if you plan on using business XML.
 WTContainer migrate(WTContainerCreateRequest req)
          

Supported API: false
protected  WTContainer migratePrePersistAttributes(WTContainerCreateRequest initData)
          This method should provide the equivalent of setPrePersistAttributes, but with a container that has already been persisted.
protected  WTContainer runScript(WTContainerCreateRequest req)
          Runs the creation steps that are shared by both create and migrate.
protected  WTContainer setPrePersistAttributes(WTContainerCreateRequest initData)
          This method sets attributes which need to be set prior to persisting the container.
protected  boolean skipOrgXML()
           
protected  boolean skipProjectXML()
           
protected  boolean skipXML()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SKIP_ALL_XML

private static final boolean SKIP_ALL_XML

SKIP_ORG_XML

private static final boolean SKIP_ORG_XML

SKIP_PROJ_XML

private static final boolean SKIP_PROJ_XML

WTOBJECT_TYPE

protected static final String WTOBJECT_TYPE

EMPTY_USER_ARRAY

protected static final WTPrincipalReference[] EMPTY_USER_ARRAY

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG

ACCESS_RESOURCE

private static final String ACCESS_RESOURCE

ADMIN_RESOURCE

private static final String ADMIN_RESOURCE
Constructor Detail

AbstractWTContainerCreator

public AbstractWTContainerCreator()
Method Detail

create

public final WTContainer create(WTContainerCreateRequest req)
                         throws WTException


Supported API: false

Specified by:
create in interface WTContainerCreator
Parameters:
req -
Returns:
WTContainer
Throws:
WTException

migrate

public final WTContainer migrate(WTContainerCreateRequest req)
                          throws WTException


Supported API: false

Specified by:
migrate in interface WTContainerCreator
Parameters:
req -
Returns:
WTContainer
Throws:
WTException

runScript

protected final WTContainer runScript(WTContainerCreateRequest req)
                               throws WTException
Runs the creation steps that are shared by both create and migrate.

Supported API: false

Parameters:
req -
Returns:
WTContainer
Throws:
WTException

checkCreate

protected void checkCreate(WTContainerCreateRequest initData)
                    throws WTException
Deprecated.  

This method can be over-ridden by concrete delegates to perform an early check on whether an object can be created. If the container cannot be created, implementors should throw a WTException.

Supported API: false

Parameters:
initData -
Throws:
WTException

setPrePersistAttributes

protected WTContainer setPrePersistAttributes(WTContainerCreateRequest initData)
                                       throws WTException
This method sets attributes which need to be set prior to persisting the container. Default is to do nothing.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

migratePrePersistAttributes

protected WTContainer migratePrePersistAttributes(WTContainerCreateRequest initData)
                                           throws WTException
This method should provide the equivalent of setPrePersistAttributes, but with a container that has already been persisted. This is required by Windchill/PDM and PDMLink migration scenarios.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

initializeSystemDomains

protected WTContainer initializeSystemDomains(WTContainerCreateRequest initData)
                                       throws WTException
This method initializes the domain structure for the container. There are two domains and cabinets that are created no matter what you add to your over-ride. Those being the container System and Default domains and cabinets. When over-riding, the ContainerRequest contains the container, when you get done manipulating the container simply return it. The framework will make sure that the the request object has the right container reference.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

initializeSystemFolders

protected WTContainer initializeSystemFolders(WTContainerCreateRequest initData)
                                       throws WTException
This method initializes the folder structure for the container. By default no folders are created in this method. If your container requires ad-hocs to be set on folders, this is the place to set them, even the default cabinets.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

initializeContextProvider

protected WTContainer initializeContextProvider(WTContainerCreateRequest initData)
                                         throws WTException
This method just uses a default context provider, most containers will need to add nodes so this method will have to be over-ridden.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

initializeRequiredSystemUsers

protected WTContainer initializeRequiredSystemUsers(WTContainerCreateRequest initData)
                                             throws WTException
This method initializes users and groups required for the container. Whether this method is over-ridden or not, a Container Administrators group is created, and the user owning the active session is made the containers administrator. This method allows Containers to add required users and groups in addition to the required users.

Supported API: false

Parameters:
initData -
Returns:
WTContainer
Throws:
WTException

initializeSystemAccess

protected WTContainer initializeSystemAccess(WTContainerCreateRequest createParams)
                                      throws WTException
Initializes System access rules. By default, the only rules put in place are to make the Container Administrator god. If your container requires Ad-Hoc ACLs, these should be created when the object is created and not in this over-ride since at this point the container has not yet reached a state where Ad-Hoc ACLS can be created. Generally this over-ride is for policy rules.

Supported API: false

Parameters:
createParams -
Returns:
WTContainer
Throws:
WTException

finalizeInitialization

protected WTContainer finalizeInitialization(WTContainerCreateRequest createParams,
                                             XMLLob finalizeInitConfig)
                                      throws WTException
This method should be over-ridden to finalize any other initialization that is needed prior to Adding objects needed in the container. The passed in XMLLob is the one saved to finalizeInitData. This may be null.

Supported API: false

Parameters:
createParams -
finalizeInitConfig -
Returns:
WTContainer
Throws:
WTException

loadBusinessTemplate

protected WTContainer loadBusinessTemplate(WTContainerCreateRequest createParams,
                                           XMLLob businessXML)
                                    throws WTException
This method should be over-ridden if you plan on using business XML. "Business XML" corresponds to the XMLLob that was the project template.

Supported API: false

Parameters:
createParams -
businessXML -
Returns:
WTContainer
Throws:
WTException

finalizeCreation

protected WTContainer finalizeCreation(WTContainerCreateRequest createParams)
                                throws WTException
This method should be over-ridden if there is a need to do any processing after loading business data. The default is to do nothing.

Supported API: false

Parameters:
createParams -
Returns:
WTContainer
Throws:
WTException

getAdminGroupContext

public DirectoryContextProvider getAdminGroupContext(WTContainer cont)
                                              throws WTException
Initializes System access rules. By default, the only rules put in place are to make the Container Administrator god.

Supported API: false

Specified by:
getAdminGroupContext in interface ContainerCreatorOrgOperations
Parameters:
cont -
Returns:
DirectoryContextProvider
Throws:
WTException

getContainer

protected WTContainer getContainer(WTContainerCreateRequest req)

getContainerRef

protected WTContainerRef getContainerRef(WTContainerCreateRequest req)
                                  throws WTException
Throws:
WTException

skipProjectXML

protected boolean skipProjectXML()

skipOrgXML

protected boolean skipOrgXML()

skipXML

protected boolean skipXML()

getPublicParentDomainRef

private AdminDomainRef getPublicParentDomainRef(WTContainer container)
                                         throws WTException
Throws:
WTException

getNewDomainRefIfNeeded

private AdminDomainRef getNewDomainRefIfNeeded(WTContainer container)
                                        throws WTException
Throws:
WTException

createRootDomain

protected AdminDomainRef createRootDomain(AdminDomainRef parent,
                                          String name,
                                          String description,
                                          WTContainerRef container)
                                   throws WTException,
                                          WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

createAccessControlRule

protected void createAccessControlRule(WTContainerCreateRequest req,
                                       AdminDomainRef domain_ref,
                                       String type_id,
                                       String state_key,
                                       WTPrincipalReference principal_ref,
                                       boolean grant,
                                       Vector permissions)
                                throws WTException
Throws:
WTException