Class ChangeLinkAttributeDataUtility

java.lang.Object
com.ptc.core.components.factory.AbstractDataUtility
com.ptc.windchill.enterprise.change2.dataUtilities.ChangeLinkAttributeDataUtility
All Implemented Interfaces:
DataUtility
Direct Known Subclasses:
ChangeTransitionDataUtility, DispositionDataUtility, ImpactIntentDataUtility

public class ChangeLinkAttributeDataUtility extends AbstractDataUtility
This class is used to process the change binary link attributes used by the various change clients. This includes the Inventory Disposition attributes. and the description attributes. The ReportedAgainst Quantity is also handled by this class.

Supported API: true

Extendable: true
  • Constructor Details

    • ChangeLinkAttributeDataUtility

      public ChangeLinkAttributeDataUtility()
      Default constructor for ChangeLinkAttributeDataUtility.

      Supported API: true
  • Method Details

    • getDataValue

      public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException
      Will retrieve a value from a binary link using the reference object as the source. This method assumes the setModelData() method has been called to initialize the data.

      Supported API: true
      Parameters:
      component_id - One of the supported component_ids
      datum - The object to use as the reference
      mc - The current model context
      Returns:
      An object that can be sent to a view for rendering
      Throws:
      WTException - If a problem occurs while extracting the data
    • createGuiComponent

      protected AbstractGuiComponent createGuiComponent(String component_id, Object datum, ChangeLinkAttributeBean linkBean) throws WTException
      Creates the GUI component for the component id. When overriding createGuiComponent(String, Object, ChangeLinkAttributeBean) the GUI component id should be set on the gui component. See getGUIComponentId(String, WTReference).

      Supported API: true
      Parameters:
      component_id -
      datum -
      linkBean -
      Returns:
      GUI component
      Throws:
      WTException
    • setNumericEventListener

      public void setNumericEventListener(TextBox component, ChangeLinkAttributeBean linkBean) throws WTException
      Adds the onChange event and the onFocus event to assist with some form validation for numeric input

      Supported API: true
      Parameters:
      component -
      linkBean -
      Throws:
      WTException
    • getGUIComponentId

      protected String getGUIComponentId(String component_id, WTReference ref) throws WTException
      Generates the GUI component id using the reference of an object and the component id. The GUI component id needs to be unique in order to properly update text or values of the component. For example the GUI component id for a "WTPart" with the component id "aaDescription" would be: "VR:wt.part.WTPart:1234#aaDescription".

      Supported API: true
      Parameters:
      component_id -
      ref -
      Returns:
      GUI component id
      Throws:
      WTException
    • getLabel

      public String getLabel(String component_id, ModelContext mc) throws WTException
      Will retrieve the localized label of the attribute. If the attribute is one of the known attributes, the text will be obtained from the resource bundle.

      Supported API: true
      Specified by:
      getLabel in interface DataUtility
      Overrides:
      getLabel in class AbstractDataUtility
      Parameters:
      component_id - The component ID to search the resource bundle for.
      mc - The current model context.
      Returns:
      the label for the column.
      Throws:
      WTException
    • setModelData

      public void setModelData(String component_id, List<?> objects, ModelContext mc) throws WTException
      Method to set the Model Data. This method will try and deterministically Build up a map of the attribute values such that they can be reused for additional attributes off the binary link.

      Supported API: true
      Specified by:
      setModelData in interface DataUtility
      Overrides:
      setModelData in class AbstractDataUtility
      Parameters:
      component_id - The component id of the column/attribute
      objects - The objects to retrieve the data for.
      mc - The model context.
      Throws:
      WTException - If a problem happens while batch processing the data objects.
    • processExistingLinks

      protected Map<WTReference,BinaryLink> processExistingLinks(NmOid oid, String component_id) throws WTException
      Deprecated.
      use ChangeableObjectBean
      Method to retrieve the binary link for the given NmOid and the component id returns a map of persisted binary links and the role A references.

      Supported API: true
      Parameters:
      oid - Context object
      component_id - The id of the column/attribute.
      Returns:
      a map of reference and corresponding binary links
      Throws:
      WTException
    • processExistingLinks

      protected Map<WTReference,BinaryLink> processExistingLinks(NmOid oid, String component_id, ChangeLinkAttributeDataUtility.LinkType dataLinkType) throws WTException
      Deprecated.
      use ChangeableObjectBean
      Method to retrieve the binary link for the given NmOid and the component id returns a map of persisted binary links and the role A references.

      Supported API: true
      Parameters:
      oid - Context object
      component_id - The id of the column/attribute.
      dataLinkType - used to override and retrieve the specific type of data link.
      Returns:
      a map of reference and corresponding binary links
      Throws:
      WTException
      See Also: