atg.remote.promotion.template.translators
Interface ElementTranslator


public interface ElementTranslator

Interface for components that want to act as a template translator for a single UI element. Allows the element input to be translated into a placeholder output.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 java.lang.Object reverseTranslatePlaceholderValue(java.lang.String pElementID, java.lang.String pPlaceholderValue, java.util.List<ElementState> pElementStateList, java.lang.Object pItemPropertyInfo, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> pErrorMap)
          This method will provide any reverse translation necessary to obtain a UI value from the placeholder value for a given element id.
 java.lang.String translateElementValue(java.lang.String pElementID, java.lang.Object pRawValue, java.lang.String pElementType, java.util.List<ElementState> pElementStateList, java.lang.Object pItemPropertyInfo, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> pErrorMap)
          This is the entry method to translate the given ui element value into the placeholder value.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

translateElementValue

java.lang.String translateElementValue(java.lang.String pElementID,
                                       java.lang.Object pRawValue,
                                       java.lang.String pElementType,
                                       java.util.List<ElementState> pElementStateList,
                                       java.lang.Object pItemPropertyInfo,
                                       java.util.Map<java.lang.String,java.util.List<java.lang.Object>> pErrorMap)
                                       throws atg.repository.editingtemplate.TemplateException
This is the entry method to translate the given ui element value into the placeholder value.

Parameters:
pElementID - the ID of the element to translate
pRawValue - the userInput/s or selection/s in its raw form, i.e. as received from the ui client without any transformation.
pElementType - the type of the element being translated
pElementStateList - this is the complete List of ElementState objects in case we wish to base the translation of this element on the input to another element, the ID of which we must already know.
pItemPropertyInfo - this is the known set of repository property names and values for this item type.
pErrorMap - this is the Map where you should include any errors Encountered during the translation process. The errors should have the Element ID of the element as the key and a List of the errors encountered. These errors will be displayed on the UI against the Element whose ID is specified.
Returns:
the translated string which will either undergo multi element translation or directly replace a placeholder in the item-properties section of the template.
Throws:
a - TemplateException if there is a problem obtaining the necessary information.
atg.repository.editingtemplate.TemplateException

reverseTranslatePlaceholderValue

java.lang.Object reverseTranslatePlaceholderValue(java.lang.String pElementID,
                                                  java.lang.String pPlaceholderValue,
                                                  java.util.List<ElementState> pElementStateList,
                                                  java.lang.Object pItemPropertyInfo,
                                                  java.util.Map<java.lang.String,java.util.List<java.lang.Object>> pErrorMap)
                                                  throws atg.repository.editingtemplate.TemplateException
This method will provide any reverse translation necessary to obtain a UI value from the placeholder value for a given element id.

Parameters:
pElementID - the ID of the element whose value we are interested in reverse translating
pPlaceholderValue - this is the value we are interested in reverse translating
pElementStateList - this is the complete List of ElementState objects in case we wish to base the translation of this element on the information known about other elements, the ID/s of which we must already know.
pItemPropertyInfo - this is the known set of property names and values for this item type.
pErrorMap - this is the Map where you should include any errors Encountered during the Advanced Reverse Translation Process. The errors should have the Element ID of the element Concerned as the key and an ArrayList of the errors encountered. These errors will be displayed on the UI against the Element whose ID is specified.
Returns:
the rawValue object to be passed back to the client for display. This value must be in a form that can be understood by the target element for which it is intended.
Throws:
a - TemplateException if there is a problem with the reverse translation
atg.repository.editingtemplate.TemplateException