atg.remote.promotion.template.translators
Interface MultiElementTranslator


public interface MultiElementTranslator

Interface for components that want to act as a template translator for multiple UI elements. Allows multiple inputs to be translated into multiple outputs.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> reverseTranslateOutputValues(java.util.Map<java.lang.String,ElementState> pInputNameElementStateMap, java.util.Map<java.lang.String,java.lang.String> pOutputNameValueMap, java.lang.Object pItemPropertyInfo, java.util.Map<java.lang.String,java.lang.String> pAttributes)
          This method will provide any reverse translation necessary to obtain input values from the output values as a result of the translateInputValues method above.
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> translateInputValues(java.util.Map<java.lang.String,ElementState> pInputNameElementStateMap, java.util.Map<java.lang.String,java.lang.String> pOutputNameValueMap, java.lang.Object pItemPropertyInfo, java.util.Map<java.lang.String,java.lang.String> pAttributes)
          This is the entry method to combine and/or translate multiple input values into one or multiple outputs.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

translateInputValues

java.util.Map<java.lang.String,java.util.List<java.lang.Object>> translateInputValues(java.util.Map<java.lang.String,ElementState> pInputNameElementStateMap,
                                                                                      java.util.Map<java.lang.String,java.lang.String> pOutputNameValueMap,
                                                                                      java.lang.Object pItemPropertyInfo,
                                                                                      java.util.Map<java.lang.String,java.lang.String> pAttributes)
                                                                                      throws atg.repository.editingtemplate.TemplateException
This is the entry method to combine and/or translate multiple input values into one or multiple outputs. The outputs and inputs are defined by input and output output names unique to each user of this interface. Any mapping between these and the associated Elements from the template and resultant placeholders are handled by the framework and the mappings defined in the template for this multi-element-translator. For Example:

Parameters:
pInputNameElementStateMap - contains input names and associated ElementState. The input name is defined in the object properties file and the associated ElementState defined by its mapping in the template tag of the defining the use of this object. The value to be translated can be obtained by calling the getValue() method on each of the ElementState objects. Final as we do not wish any of the contents of this ElementState to change.
pOutputNameValueMap - this is initially an empty map into which the author must insert the outputName and value pairs where the output name is defined by the objects property file and the value is the translated output ready for substitution with a placeholder-name in the item-properties section of the template.
pItemPropertyInfo - this is the known set of property names and values for this item type.
pAttributes - optional map of attribute name value pairs if translator XML included any 'attribute' child tags.
Returns:
ErrorMap this is the Map where you should include any errors Encountered during the translation process. The errors should have the input name of the element concerned as the key and a List of the errors encountered. These errors will be displayed on the UI against the Element whose input name is specified.
Throws:
a - TemplateException if there is a problem obtaining the necessary information.
atg.repository.editingtemplate.TemplateException

reverseTranslateOutputValues

java.util.Map<java.lang.String,java.util.List<java.lang.Object>> reverseTranslateOutputValues(java.util.Map<java.lang.String,ElementState> pInputNameElementStateMap,
                                                                                              java.util.Map<java.lang.String,java.lang.String> pOutputNameValueMap,
                                                                                              java.lang.Object pItemPropertyInfo,
                                                                                              java.util.Map<java.lang.String,java.lang.String> pAttributes)
                                                                                              throws atg.repository.editingtemplate.TemplateException
This method will provide any reverse translation necessary to obtain input values from the output values as a result of the translateInputValues method above.

Parameters:
pInputNameElementStateMap - contains input names and associated ElementState. The input name is defined in the object properties file and the associated ElementState defined by its mapping in the template tag of the defining the use of this object. The reverse translated output value for each element state requiring one must be inserted into the necessary ElementState by calling the states setValue() method.
pOutputNameValueMap - contains the outputName and value pairs where the output name is defined by the objects property file and the value is the translated output which has been used for placeholder substitution in the item-properties section of the template.
pItemPropertyInfo - this is the known set of property names and values for this item type.
pAttributes - optional map of attribute name value pairs if translator XML included any 'attribute' child tags.
Returns:
ErrorMap this is the Map where you should include any errors Encountered during the reverse translation process. The errors should have the input name of the element concerned as the key and a List of the errors encountered. These errors will be displayed on the UI against the Element whose input name is specified.
Throws:
a - TemplateException if there is a problem with the reverse translation
atg.repository.editingtemplate.TemplateException