com.ibm.portal.wcm.plr
Interface AttributeValueProcessorFactory


public interface AttributeValueProcessorFactory

This interface can be implemented to realize a factory that creates AttributeValueProcessor objects. The newProcessor(String) method is called once per BeanList processing.

Implementations of AttributeValueProcessorFactory need to globally register using a plugin.xml. Here is an example fragment of a plugin.xml that registers a custom AttributeValueProcessorFactory implementation.

<plugin id="com.acme.plr">
    <extension 
         point="com.ibm.portal.wcm.plr.AttributeValueProcessor"
         id="MyAttributeValueProcessorFactoryImpl">    
       <factory class="com.acme.MyAttributeValueOnRequestProcessorFactory"/>
    </extension>
 </plugin>
 
After registration of the factory you need to enable the attribute processing for a certain attribute in the list rendering profile. To enable attribute processing for a certain attribute set the meta data key "processors". The value of the meta data key must be the unique identifier of the extension. If available, this identifier is unique within the plug-in registry, and is composed of the namespace where this extension was declared and this extension's simple identifier.
This is an example of a fragment of attribute definition in a list rendering profile that enables the factory from the sample above for the attribute with the name "body"
 myprofile.ItemAttribute.body.processors=com.acme.plr.MyAttributeValueOnRequestProcessorFactory
 

Implementations must be thread-safe as the same instance might be used by multiple threads concurrently.

Since:
8.5.0.0 CF03
Note:
This interface is designed to be implemented by clients.

Method Summary
 AttributeValueProcessor newProcessor(java.lang.String profileName)
          Create a new a instance of a AttributeValueProcessor.
 

Method Detail

newProcessor

AttributeValueProcessor newProcessor(java.lang.String profileName)
                                     throws AttributeValueProcessorInstantiationException
Create a new a instance of a AttributeValueProcessor. This method is called once per BeanList processing.

Processing results from the returned processor instance are cached in the scope of the BeanList that was used to retrieve the ResourceBean from a BeanListResponse. See BeanListResponse.getCacheSpec() for more information on how the resource beans provided with by the BeanList from the BeanListResponse are cached.

Parameters:
profileName - The unique name of the list rendering profile that was used to transform external data into a ResourceBean. This value may be null in case no list rendering profile was applied.
Returns:
A valid non-null instance of a AttributeValueProcessor
Throws:
AttributeValueProcessorInstantiationException - If a AttributeValueProcessor could not be instantiated