com.ptc.windchill.enterprise.change2.forms.delegates
Class ChangeItemFormDelegate

java.lang.Object
  extended by com.ptc.core.components.forms.DefaultObjectFormProcessorDelegate
      extended by com.ptc.windchill.enterprise.change2.forms.delegates.ChangeItemFormDelegate
All Implemented Interfaces:
ObjectFormProcessorDelegate
Direct Known Subclasses:
RelatedProductDataFormDelegate

public abstract class ChangeItemFormDelegate
extends DefaultObjectFormProcessorDelegate

A class for subprocessors that perform a database operation on one or more objects. Typically used for the processing of a wizard.

Supported API: true

Extendable: false


Method Summary
protected abstract  Class getAssociationClass(ChangeItemIfc item)
          Method to retrieve the associated class such as ReportedAgainst.class for saving affected data for a Problem Report.
protected  com.ptc.core.ui.resources.ComponentMode getComponentMode()
          Helper method to retrieve the component mode for the given processing session.
protected abstract  String getDefaultTableId()
          Method to retrieve the default table ID used for table ID parameter lookups.
protected abstract  String getDelegateName()
          Method to retrieve the delegate name used for table ID parameter lookups.
protected abstract  Vector getItemsToStoreForAssociation(List items)
          Retrieval method for RelatedProductData links to get the list of items to store.
protected static Object getReferenceValueFromMap(Map map, Persistable persistable, String post_fix)
          Utility method to retrieve a value from a map using either the object or version reference of the object.
protected static Object getReferenceValueFromMap(Map map, Persistable persistable, String pre_fix, String post_fix)
          Utility method to retrieve a value from a map using either the object or version reference of the object.
protected  String getTableId()
          This method will return the valid table ID for the given table.
 FormResult postProcess(NmCommandBean clientData, List<ObjectBean> objectBeans)
          Method to process the data posted for the associated objects to the change item.
protected abstract  WTCollection processLinkAttributes(ChangeItemIfc item, WTCollection binaryLinks)
          Abstract method to process any link attributes associated with the table.
 
Methods inherited from class com.ptc.core.components.forms.DefaultObjectFormProcessorDelegate
doOperation, postTransactionProcess, preProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getComponentMode

protected com.ptc.core.ui.resources.ComponentMode getComponentMode()
Helper method to retrieve the component mode for the given processing session. Requires the init( ) method to have been executed.

Supported API: true

Returns:
the ComponentMode.

getTableId

protected String getTableId()
This method will return the valid table ID for the given table. The implementing subclasses are required to implement the methods getDelegateName() and getDefaultTableId() used by this method.

Supported API: true

Returns:
The table ID.
See Also:
com.ptc.windchill.enterprise.change2.forms.ChangeItemFormDelegate.getDelegateName(), com.ptc.windchill.enterprise.change2.forms.ChangeItemFormDelegate.getDefaultTableId()

getDelegateName

protected abstract String getDelegateName()
Method to retrieve the delegate name used for table ID parameter lookups.

Supported API: true

Returns:
the delegate name.

getDefaultTableId

protected abstract String getDefaultTableId()
Method to retrieve the default table ID used for table ID parameter lookups.

Supported API: true

Returns:
the table id for the default processing.

getAssociationClass

protected abstract Class getAssociationClass(ChangeItemIfc item)
Method to retrieve the associated class such as ReportedAgainst.class for saving affected data for a Problem Report.

Supported API: true

Parameters:
item - The Change object that the changeables getting associated to.
Returns:
The associated class for the given Change Object.

getItemsToStoreForAssociation

protected abstract Vector getItemsToStoreForAssociation(List items)
                                                 throws WTException
Retrieval method for RelatedProductData links to get the list of items to store.

Supported API: true

Parameters:
items - The current list of items that are displayed or hidden in the change table.
Returns:
The list of items to be associated.
Throws:
WTException

postProcess

public FormResult postProcess(NmCommandBean clientData,
                              List<ObjectBean> objectBeans)
                       throws WTException
Method to process the data posted for the associated objects to the change item. The objectList must contain a persisted changeItem in order for this processing to occur.

Supported API: true

Specified by:
postProcess in interface ObjectFormProcessorDelegate
Overrides:
postProcess in class DefaultObjectFormProcessorDelegate
Parameters:
clientData - The command bean
objectList - The list of current objects (must contain at least a change item)
Returns:
The form result. Will be SUCCESS if all processing was valid or FAILURE if there is an error.
Throws:
WTException

processLinkAttributes

protected abstract WTCollection processLinkAttributes(ChangeItemIfc item,
                                                      WTCollection binaryLinks)
                                               throws WTException
Abstract method to process any link attributes associated with the table. This method is called automatically by the postProcess( ) method. Any implementing classes should overload this method to process any specific link attributes which are present.

Supported API: true

Parameters:
item - The change item
binaryLinks - The collection of current binary links.
Returns:
A collection of just the "changed" binary links that are processed.
Throws:
WTException

getReferenceValueFromMap

protected static Object getReferenceValueFromMap(Map map,
                                                 Persistable persistable,
                                                 String pre_fix,
                                                 String post_fix)
                                          throws WTException
Utility method to retrieve a value from a map using either the object or version reference of the object. Depending on which layer generated the id, the id may be a Version or Object reference. This method will attempt to extract the change value from the appropriate reference string.
This is used for the attributes generated by the ChangeLinkAttributeDataUtility which will generate a link in the fashion OR:wt.part.WTPart:22233_ApprovedQuantity

Supported API: true

Parameters:
map - The map of changed values
persistable - The persistable which to generate the references from.
pre_fix - The string in from of the map key.
post_fix - The terminating string from the map key (example "ApprovedQuantity")
Returns:
the value referenced in the map or null.
Throws:
WTException

getReferenceValueFromMap

protected static Object getReferenceValueFromMap(Map map,
                                                 Persistable persistable,
                                                 String post_fix)
                                          throws WTException
Utility method to retrieve a value from a map using either the object or version reference of the object. Depending on which layer generated the id, the id may be a Version or Object reference. This method will attempt to extract the change value from the appropriate reference string.
This is used for the attributes generated by the ChangeLinkAttributeDataUtility which will generate a link in the fashion OR:wt.part.WTPart:22233_ApprovedQuantity

Supported API: true

Parameters:
map - The map of changed values
persistable - The persistable which to generate the references from.
post_fix - The terminating string from the map key (example "ApprovedQuantity")
Returns:
the value referenced in the map or null.
Throws:
WTException