com.ptc.windchill.cadx.newcaddoc
Class NewCadDocFormTaskDelegate

java.lang.Object
  extended bywt.templateutil.processor.FormTaskDelegate
      extended bycom.ptc.windchill.cadx.newcaddoc.NewCadDocFormTaskDelegate
All Implemented Interfaces:
ContextHolder

public class NewCadDocFormTaskDelegate
extends FormTaskDelegate



Supported API: true

Extendable: false


Field Summary
private  CADDocSpecs cadDocSpec
           
private  String CADModelName
           
private  String checkCADModelName
           
private  String checkNumber
           
private static String CLASSNAME
           
private  WTContainer container
           
private  String desc
           
static int DESC_MAX_LENGTH
           
private  String docFolder
           
private  String docName
           
private  String docNumber
           
private static int docNumberBlank
           
private static int docNumberTooLong
           
private static int docNumberValid
           
private  String isAutoNumber
           
private  EPMReferenceLink linkFromOtherSideObj
           
private  EPMReferenceLink linkFromSrc
           
private  Locale locale
           
private static int modelNameBlank
           
private static int modelNameExists
           
private static int modelNameHasInvalidChars
           
private static int modelNameHasInvalidExtn
           
private static int modelNameTooLong
           
static String modelNameUniqPropName
           
private static int modelNameValid
           
private  String modelType
           
private  EPMDocument newDocObj
           
private  Vector newObjVector
           
private  String organizationOID
           
private  String referredDocNumber
           
private  EPMDocument referredDocTempl
           
private  String referredModelName
           
private  String referredModelType
           
private static String RESOURCE
           
private static boolean VERBOSE
          Last used error code: NCD00015E Last used info msg code: NCD00001I Last used warning msg code: NCD00004W Last used status msg code: NCD00002S
private  EPMWorkspace wsObj
           
 
Fields inherited from class wt.templateutil.processor.FormTaskDelegate
 
Fields inherited from interface wt.templateutil.processor.ContextHolder
CONTEXT_ACTION, CONTEXT_CLASS_NAME, CONTEXT_OBJ, CONTEXT_PROPERTIES, FORM_DATA, QUERY_DATA, RESPONSE_EXCEPTIONS, RESPONSE_FOOTERS, RESPONSE_HEADERS, RESPONSE_MESSAGES, RESPONSE_STRING, STATUS
 
Constructor Summary
NewCadDocFormTaskDelegate()
           
 
Method Summary
private  boolean additionalValidation(EPMDocument tmplDoc)
          This method must be called after validateData ().
 boolean addToWorkspace()
          Adds the newly created object to workspace.
 int checkCADModelName()
          

Supported API: false
 int checkDocumentNumber()
          

Supported API: false
 boolean createDocument()
          

Supported API: false
private  String getNewNumberForReferencedDocument(String docNo, String referredModelType)
           
 EPMDocument getReferencedDocument(EPMDocument srcDoc)
           
private  EPMDocument getTemplateByConfiguredDocNumber(String modelType)
          For the specified model type, get the template EPMDocument as per the template cad doc number specified in the configuration file for this type of model.
private  EPMDocument getTemplateCadDocForContainer(String modelType)
          For the specified model type, get the template cad doc as found in the container.
private  EPMDocument getTemplateEPMDocument(String modelType)
          For the specified model type, get the template EPMDocument.
 void handleCheckCADModelNamePressed()
          

Supported API: false
 void handleCheckNumberPressed()
          

Supported API: false
private  void initializeEPMReferenceLink(EPMReferenceLink newLink, EPMReferenceLink srcLink, EPMDocument srcObj, EPMDocument refObj)
           
private  boolean isContainerValid(String containerName)
          Check to see if the specified container is a valid container.
private  boolean isFolderValid(String docFolder, WTContainer container)
          Validate if the specified doc folder is valid one.
 void processAction(ContentHTTPStream contentStream)
          Deprecated.  
private  void removeUnwantedReferencedLinks(EPMDocument srcObj)
          During copy, the EPMReferenceLink gets copied too when a EPMDocument with reference link is copied.
 boolean validateData()
          

Supported API: false
 
Methods inherited from class wt.templateutil.processor.FormTaskDelegate
addToResponseExceptions, addToResponseFooters, addToResponseHeaders, addToResponseMessages, deleteFormDataFromSession, getContextAction, getContextClassName, getContextObj, getContextProperties, getFormData, getQueryData, getResponseExceptions, getResponseFooters, getResponseHeaders, getResponseMessages, getResponseString, getState, getStatus, saveFormDataInSession, setContextAction, setContextClassName, setContextObj, setContextProperties, setFormData, setQueryData, setResponseExceptions, setResponseFooters, setResponseHeaders, setResponseMessages, setResponseString, setState, setStatus, switchPages
 
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

checkNumber

private String checkNumber

docNumber

private String docNumber

docFolder

private String docFolder

CADModelName

private String CADModelName

modelType

private String modelType

docName

private String docName

wsObj

private EPMWorkspace wsObj

cadDocSpec

private CADDocSpecs cadDocSpec

desc

private String desc

newDocObj

private EPMDocument newDocObj

checkCADModelName

private String checkCADModelName

referredDocTempl

private EPMDocument referredDocTempl

referredModelType

private String referredModelType

referredModelName

private String referredModelName

referredDocNumber

private String referredDocNumber

linkFromSrc

private EPMReferenceLink linkFromSrc

linkFromOtherSideObj

private EPMReferenceLink linkFromOtherSideObj

newObjVector

private Vector newObjVector

isAutoNumber

private String isAutoNumber

organizationOID

private String organizationOID

container

private WTContainer container

locale

private Locale locale

modelNameUniqPropName

public static final String modelNameUniqPropName
See Also:
Constant Field Values

docNumberValid

private static final int docNumberValid
See Also:
Constant Field Values

docNumberBlank

private static final int docNumberBlank
See Also:
Constant Field Values

docNumberTooLong

private static final int docNumberTooLong
See Also:
Constant Field Values

modelNameBlank

private static final int modelNameBlank
See Also:
Constant Field Values

modelNameTooLong

private static final int modelNameTooLong
See Also:
Constant Field Values

modelNameHasInvalidChars

private static final int modelNameHasInvalidChars
See Also:
Constant Field Values

modelNameHasInvalidExtn

private static final int modelNameHasInvalidExtn
See Also:
Constant Field Values

modelNameExists

private static final int modelNameExists
See Also:
Constant Field Values

modelNameValid

private static final int modelNameValid
See Also:
Constant Field Values

DESC_MAX_LENGTH

public static final int DESC_MAX_LENGTH
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE
Last used error code: NCD00015E Last used info msg code: NCD00001I Last used warning msg code: NCD00004W Last used status msg code: NCD00002S

Constructor Detail

NewCadDocFormTaskDelegate

public NewCadDocFormTaskDelegate()
Method Detail

checkDocumentNumber

public int checkDocumentNumber()
                        throws WTException


Supported API: false

Returns:
int
Throws:
WTException

validateData

public boolean validateData()


Supported API: false

Returns:
boolean

createDocument

public boolean createDocument()
                       throws WTException


Supported API: false

Returns:
boolean
Throws:
WTException

handleCheckNumberPressed

public void handleCheckNumberPressed()


Supported API: false


addToWorkspace

public boolean addToWorkspace()
                       throws WTException
Adds the newly created object to workspace.

Supported API: false

Returns:
boolean
Throws:
WTException

handleCheckCADModelNamePressed

public void handleCheckCADModelNamePressed()


Supported API: false


checkCADModelName

public int checkCADModelName()
                      throws WTException


Supported API: false

Returns:
int
Throws:
WTException

processAction

public void processAction(ContentHTTPStream contentStream)
                   throws Exception
Deprecated.  

Processed the desired action and then updates the state so that the desired response page can be generated.

Use the addToResponse methods to pass back messages on the status/results of the action.

Supported API: true

Specified by:
processAction in class FormTaskDelegate
Parameters:
contentStream -
Throws:
Exception

getTemplateEPMDocument

private EPMDocument getTemplateEPMDocument(String modelType)
                                    throws WTException
For the specified model type, get the template EPMDocument.

Throws:
WTException

getTemplateByConfiguredDocNumber

private EPMDocument getTemplateByConfiguredDocNumber(String modelType)
                                              throws WTException
For the specified model type, get the template EPMDocument as per the template cad doc number specified in the configuration file for this type of model. For example, the cad doc number could be specified in the .ini file.

Throws:
WTException

getTemplateCadDocForContainer

private EPMDocument getTemplateCadDocForContainer(String modelType)
                                           throws WTException
For the specified model type, get the template cad doc as found in the container.

Throws:
WTException

getReferencedDocument

public EPMDocument getReferencedDocument(EPMDocument srcDoc)
                                  throws WTException
Throws:
WTException

getNewNumberForReferencedDocument

private String getNewNumberForReferencedDocument(String docNo,
                                                 String referredModelType)

additionalValidation

private boolean additionalValidation(EPMDocument tmplDoc)
This method must be called after validateData (). All the basic and common validation is done in that method. Any model type specific validation is done in this method.


initializeEPMReferenceLink

private void initializeEPMReferenceLink(EPMReferenceLink newLink,
                                        EPMReferenceLink srcLink,
                                        EPMDocument srcObj,
                                        EPMDocument refObj)
                                 throws WTPropertyVetoException
Throws:
WTPropertyVetoException

removeUnwantedReferencedLinks

private void removeUnwantedReferencedLinks(EPMDocument srcObj)
                                    throws WTException
During copy, the EPMReferenceLink gets copied too when a EPMDocument with reference link is copied. However, the link will point to the original template referenced CAD Document(s). This is not expected. So, these links need to be removed manually. For example, the link "newMfg -> templateAsm" and "newAsm -> templateMfg" would need to be removed. As per Ram Bhatt and Alan Siegler, this issue will be fixed in 7.0 as structure copy will be implemented.

Throws:
WTException

isContainerValid

private boolean isContainerValid(String containerName)
Check to see if the specified container is a valid container. If it is valid, store container as instance variable for later use.


isFolderValid

private boolean isFolderValid(String docFolder,
                              WTContainer container)
                       throws WTException
Validate if the specified doc folder is valid one. As folder could have been entered manually (rather than using Browse), check that this folder is owned by the specified container.

Throws:
WTException