com.ptc.windchill.enterprise.templates
Class TemplatesFactory

java.lang.Object
  extended bycom.ptc.windchill.enterprise.templates.TemplatesFactory
All Implemented Interfaces:
ApplicationContextChild, Externalizable, Serializable

public class TemplatesFactory
extends Object
implements ApplicationContextChild, Externalizable

Gets the correct delegate that implements the requested function. Will pick the delegate based on object type OR solution and object type.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  ApplicationContext applicationContext
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
TemplatesFactory()
           
 
Method Summary
static RevisionControlled doCreateFromTemplateContextTasks(String selector, Object branchingObj, RevisionControlled object, Templateable template, HashMap inputHash)
          Perform context specific tasks during Create from Template operation.
static Templateable doCreateTemplateContextTasks(String selector, Object branchingObj, Templateable object, HashMap inputHash)
          Perform context specific tasks during Create Template operation.
static RevisionControlled doPostCreateFromTemplateContextTasks(String selector, Object branchingObj, RevisionControlled object, Templateable template, HashMap inputHash)
          Perform context specific tasks after persisting the object created from template during a Create from Template operation.
static Templateable doPostCreateTemplateContextTasks(String selector, Object branchingObj, Templateable object, HashMap inputHash)
          Perform context specific tasks after persisting the template during a Create Template operation.
 ApplicationContext getApplicationContext()
          Gets the object for the association that plays role: applicationContext.
 ApplicationContextServices getApplicationContextServices()
           
static RevisionControlled newObjFromTemplate(Templateable objTemplate, String context)
          Create an object from template and set its context, defaults and mandatory values etc.
static Templateable newTemplate(String objType, String context)
          Create an object that will be used as a template object and set its context, defaults and mandatory values etc.
static Templateable newTemplate(TypeIdentifier objType, WTContainer context)
          Create an object that will be used as a template object and set its context, defaults and mandatory values etc.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(TemplatesFactory thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setApplicationContext(ApplicationContext a_ApplicationContext)
          Sets the object for the association that plays role: applicationContext.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
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

applicationContext

private ApplicationContext applicationContext

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

TemplatesFactory

public TemplatesFactory()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(TemplatesFactory thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

newTemplate

public static Templateable newTemplate(String objType,
                                       String context)
                                throws WTException
Create an object that will be used as a template object and set its context, defaults and mandatory values etc. This new object will be stored in the context that this operation is started in.

Supported API: true

Parameters:
objType - Type to use for the new template.
context - Context used to store this new template
Returns:
Templateable
Throws:
WTException

newTemplate

public static Templateable newTemplate(TypeIdentifier objType,
                                       WTContainer context)
                                throws WTException
Create an object that will be used as a template object and set its context, defaults and mandatory values etc. This new object will be stored in the context that this operation is started in.

Supported API: true

Parameters:
objType - Type to use for the new template.
context - Context used to store this new template
Returns:
Templateable
Throws:
WTException

doCreateTemplateContextTasks

public static Templateable doCreateTemplateContextTasks(String selector,
                                                        Object branchingObj,
                                                        Templateable object,
                                                        HashMap inputHash)
                                                 throws WTException
Perform context specific tasks during Create Template operation. The context could be just the solution irrespective of the object or it could be for a particular object type within a solution. In the common server implemention for templates, there are certain tasks that are solution specific or object specific within a solution. For ex:- Setting the repository on an object such as Part or Document using PDMLink apis is a PDMLink specific-any object task.

Supported API: true

Parameters:
selector - This is the solution name used to branch to a specific delegate.
branchingObj - This is the branching object used to branch to a specific delegate.
object - Template object to perform context based createtemplate tasks on.
inputHash - A hashmap of custom values that need to be passed into the method.
Returns:
Templateable
Throws:
WTException

newObjFromTemplate

public static RevisionControlled newObjFromTemplate(Templateable objTemplate,
                                                    String context)
                                             throws WTException
Create an object from template and set its context, defaults and mandatory values etc. This new object will be stored in the context that this operation is started in.

Supported API: true

Parameters:
objTemplate - Template to use for the new object.
context - Context used to store this new object created from template
Returns:
RevisionControlled
Throws:
WTException

doCreateFromTemplateContextTasks

public static RevisionControlled doCreateFromTemplateContextTasks(String selector,
                                                                  Object branchingObj,
                                                                  RevisionControlled object,
                                                                  Templateable template,
                                                                  HashMap inputHash)
                                                           throws WTException
Perform context specific tasks during Create from Template operation. The context could be just the solution irrespective of the object or it could be for a particular object type within a solution.

Supported API: true

Parameters:
selector - This is the solution name used to branch to a specific delegate.
branchingObj - This is the branching object used to branch to a specific delegate.
object - Object created from template to perform context based createfromtemplate tasks on.
template - template that the object was create from during createfromtemplate
inputHash - A hashmap of custom values that need to be passed into the method.
Returns:
RevisionControlled
Throws:
WTException

doPostCreateTemplateContextTasks

public static Templateable doPostCreateTemplateContextTasks(String selector,
                                                            Object branchingObj,
                                                            Templateable object,
                                                            HashMap inputHash)
                                                     throws WTException
Perform context specific tasks after persisting the template during a Create Template operation. The context could be just the solution irrespective of the object or it could be for a particular object type within a solution. In the common server implemention for templates, there are certain tasks that are solution specific or object specific within a solution. For ex:- Setting Access Control and Ownership could be specific to create template operation within the ProjectLink solution but these functions are common for all objects across projectlink. Whereas Uploading the document using projectlink specific upload could be specific to document functions for ProjectLink.

Supported API: true

Parameters:
selector - This is the solution name used to branch to a specific delegate.
branchingObj - This is the branching object used to branch to a specific delegate.
object - Template object to perform context based post createtemplate tasks on.
inputHash - A hashmap of custom values that need to be passed into the method.
Returns:
Templateable
Throws:
WTException

doPostCreateFromTemplateContextTasks

public static RevisionControlled doPostCreateFromTemplateContextTasks(String selector,
                                                                      Object branchingObj,
                                                                      RevisionControlled object,
                                                                      Templateable template,
                                                                      HashMap inputHash)
                                                               throws WTException
Perform context specific tasks after persisting the object created from template during a Create from Template operation. The context could be just the solution irrespective of the object or it could be for a particular object type within a solution. In the common server implemention for templates, there are certain tasks that are solution specific or object specific within a solution. For ex:- Downloading the document and checking it out based on the keepcheckedout flag using projectlink's download could be specific to document functions for ProjectLink.

Supported API: true

Parameters:
selector - This is the solution name used to branch to a specific delegate.
branchingObj - This is the branching object used to branch to a specific delegate.
object - Object created from template to perform context post based createfromtemplate tasks on.
template - template that the object was create from during createfromtemplate
inputHash - A hashmap of custom values that need to be passed into the method.
Returns:
RevisionControlled
Throws:
WTException

getApplicationContext

public ApplicationContext getApplicationContext()
Gets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
getApplicationContext in interface ApplicationContextChild
Returns:
ApplicationContext

setApplicationContext

public void setApplicationContext(ApplicationContext a_ApplicationContext)
                           throws WTPropertyVetoException
Sets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
setApplicationContext in interface ApplicationContextChild
Parameters:
a_ApplicationContext -
Throws:
WTPropertyVetoException

getApplicationContextServices

public ApplicationContextServices getApplicationContextServices()