com.ptc.windchill.enterprise.doc.server
Class WTDocumentDelegate

java.lang.Object
  extended bycom.ptc.windchill.enterprise.doc.server.WTDocumentDelegate
All Implemented Interfaces:
DocumentDelegate
Direct Known Subclasses:
WTDocumentProjectDelegate

public class WTDocumentDelegate
extends Object
implements DocumentDelegate

Default implementation of the delegate. Used for Windchill PDM implementation.

Supported API: false

Extendable: false


Field Summary
private static String CHECKIN
           
private static String CLASSNAME
           
private static String CREATE
           
private static String DISPLAY
           
private static String DOC_TYPES
           
private static String RESOURCE
           
private static boolean SHOWORG
           
private static String UPDATE
           
private static boolean VERBOSE
           
 
Constructor Summary
WTDocumentDelegate()
           
 
Method Summary
 WTDocument createDocument(TypeIdentifier objType, HashMap nameValueData, Locale locale)
          Create a document from the input provided.
 HashMap getCheckinDocumentAttributes(Persistable object, HashMap hashMap, Locale locale)
          Return a list of the modeled attributes that can be updated along with their present values.
protected  HashMap getCheckinDocumentAttributes(String[] solutionList, Persistable object, HashMap hashMap, Locale locale)
          Deprecated.  
protected  HashMap getCreateDocumentAttributes(String[] solutionList, WTContainer context, TypeIdentifier objType, HashMap hashMap, boolean autoNumber, Locale locale)
          Deprecated.  
 HashMap getCreateDocumentAttributes(WTContainer context, TypeIdentifier objType, HashMap hashMap, Locale locale)
          Return a list of the modeled attributes that need to be populated for a create.
 HashMap getDetailsDocumentAttributes(Persistable object, HashMap hashMap, ClientConfiguration clientInfo, Locale locale)
          Return a list of the modeled/made up attributes that should be displayed on the details page.
protected  HashMap getDetailsDocumentAttributes(String[] solutionList, Persistable object, HashMap hashMap, ClientConfiguration clientInfo, Locale locale)
          Deprecated.  
 TypeIdentifier[] getDocumentType(Class objClass, String context)
          Return a vector of the types that are available for this context.
protected  WTDocument getNewWTDocument(TypeIdentifier objType)
           
private  String[] getPDMSpecificAttributes(String operation)
           
private  TypeInstanceIdentifier getTypeInstanceIdentifier(HashMap hashMap)
           
 HashMap getUpdateDocumentAttributes(Persistable object, HashMap hashMap, Locale locale)
          Return a list of the modeled attributes that can be updated along with their present values.
protected  HashMap getUpdateDocumentAttributes(String[] solutionList, Persistable object, HashMap hashMap, Locale locale)
          Deprecated.  
protected  WTDocument setStandardCreateAttributes(WTDocument document, HashMap nameValueData, Locale locale)
           
protected  WTDocument setStandardUpdateAttributes(WTDocument document, HashMap nameValueData, Locale locale)
           
 WTDocument updateDocument(WTDocument document, HashMap nameValueData, Locale locale)
          Update a document from the input provided.
 
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

CREATE

private static final String CREATE
See Also:
Constant Field Values

UPDATE

private static final String UPDATE
See Also:
Constant Field Values

DISPLAY

private static final String DISPLAY
See Also:
Constant Field Values

CHECKIN

private static final String CHECKIN
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

SHOWORG

private static final boolean SHOWORG

DOC_TYPES

private static final String DOC_TYPES
Constructor Detail

WTDocumentDelegate

public WTDocumentDelegate()
Method Detail

createDocument

public WTDocument createDocument(TypeIdentifier objType,
                                 HashMap nameValueData,
                                 Locale locale)
                          throws WTException
Create a document from the input provided. Override this method and add a properties entry for your new class and method to create new sub-classes of WTDocument.

Supported API: false

Specified by:
createDocument in interface DocumentDelegate
Parameters:
objType - Soft type to use for the new document.
nameValueData - Name value pairs of data from the UI.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
WTDocument
Throws:
WTException

updateDocument

public WTDocument updateDocument(WTDocument document,
                                 HashMap nameValueData,
                                 Locale locale)
                          throws WTException
Update a document from the input provided. Override this method and add a properties entry for your new class and method to create new sub-classes of WTDocument.

Supported API: false

Specified by:
updateDocument in interface DocumentDelegate
Parameters:
document - The document to be updated.
nameValueData - Name value pairs of data from the UI.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
WTDocument
Throws:
WTException

getDocumentType

public TypeIdentifier[] getDocumentType(Class objClass,
                                        String context)
                                 throws WTException
Return a vector of the types that are available for this context.

Supported API: false

Specified by:
getDocumentType in interface DocumentDelegate
Parameters:
objClass - The class of the object that the type list is requested for.
context - The product or repository that this is requested from.
Returns:
TypeIdentifier[]
Throws:
WTException

getCreateDocumentAttributes

public HashMap getCreateDocumentAttributes(WTContainer context,
                                           TypeIdentifier objType,
                                           HashMap hashMap,
                                           Locale locale)
                                    throws WTException
Return a list of the modeled attributes that need to be populated for a create.

Supported API: false

Specified by:
getCreateDocumentAttributes in interface DocumentDelegate
Parameters:
context - Container to create the document in.
objType - Soft type to use for the new document.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getUpdateDocumentAttributes

public HashMap getUpdateDocumentAttributes(Persistable object,
                                           HashMap hashMap,
                                           Locale locale)
                                    throws WTException
Return a list of the modeled attributes that can be updated along with their present values.

Supported API: false

Specified by:
getUpdateDocumentAttributes in interface DocumentDelegate
Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getDetailsDocumentAttributes

public HashMap getDetailsDocumentAttributes(Persistable object,
                                            HashMap hashMap,
                                            ClientConfiguration clientInfo,
                                            Locale locale)
                                     throws WTException
Return a list of the modeled/made up attributes that should be displayed on the details page.

Supported API: false

Specified by:
getDetailsDocumentAttributes in interface DocumentDelegate
Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
clientInfo - Information from the client application.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getCheckinDocumentAttributes

public HashMap getCheckinDocumentAttributes(Persistable object,
                                            HashMap hashMap,
                                            Locale locale)
                                     throws WTException
Return a list of the modeled attributes that can be updated along with their present values.

Supported API: false

Specified by:
getCheckinDocumentAttributes in interface DocumentDelegate
Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getCreateDocumentAttributes

protected HashMap getCreateDocumentAttributes(String[] solutionList,
                                              WTContainer context,
                                              TypeIdentifier objType,
                                              HashMap hashMap,
                                              boolean autoNumber,
                                              Locale locale)
                                       throws WTException
Deprecated.  

Return a list of the modeled attributes that need to be populated for a create.

Supported API: false

Parameters:
context - Container to create the document in.
objType - Soft type to use for the new document.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getUpdateDocumentAttributes

protected HashMap getUpdateDocumentAttributes(String[] solutionList,
                                              Persistable object,
                                              HashMap hashMap,
                                              Locale locale)
                                       throws WTException
Deprecated.  

Return a list of the modeled attributes that can be updated along with their present values.

Supported API: false

Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getCheckinDocumentAttributes

protected HashMap getCheckinDocumentAttributes(String[] solutionList,
                                               Persistable object,
                                               HashMap hashMap,
                                               Locale locale)
                                        throws WTException
Deprecated.  

Return a list of the modeled attributes that can be updated during checkin along with their present values.

Supported API: false

Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getDetailsDocumentAttributes

protected HashMap getDetailsDocumentAttributes(String[] solutionList,
                                               Persistable object,
                                               HashMap hashMap,
                                               ClientConfiguration clientInfo,
                                               Locale locale)
                                        throws WTException
Deprecated.  

Return a list of the modeled/made up attributes that should be displayed on the details page.

Supported API: false

Parameters:
object - The class of the object that the context list is requested for.
hashMap - Either a started hash map for the data or null if one is to be created inside of this method.
clientInfo - Information from the client application.
locale - The locale of the client, used to return some of the strings in the locale of the client.
Returns:
HashMap
Throws:
WTException

getTypeInstanceIdentifier

private TypeInstanceIdentifier getTypeInstanceIdentifier(HashMap hashMap)
                                                  throws IllegalFormatException,
                                                         UnableToCreateServiceException
Throws:
IllegalFormatException
UnableToCreateServiceException

getNewWTDocument

protected WTDocument getNewWTDocument(TypeIdentifier objType)
                               throws WTException
Throws:
WTException

setStandardCreateAttributes

protected WTDocument setStandardCreateAttributes(WTDocument document,
                                                 HashMap nameValueData,
                                                 Locale locale)
                                          throws WTException
Throws:
WTException

setStandardUpdateAttributes

protected WTDocument setStandardUpdateAttributes(WTDocument document,
                                                 HashMap nameValueData,
                                                 Locale locale)
                                          throws WTException
Throws:
WTException

getPDMSpecificAttributes

private String[] getPDMSpecificAttributes(String operation)