com.ibm.portal.wcm.plr
Interface ComputedAttributeValueProvider


public interface ComputedAttributeValueProvider

This interface allows computing individual attribute values based on attribute values provided by List Rendering Profile based BeanListProviders.

The generic ComputedAttributeValueProvider interface is an optional interface that can be implemented by individual BeanListProvider implementations. If a specific BeanListProvider implementation is implementing this interface, the PLR framework will use this interface to retrieve the values for individual list rendering profile attributes that are flagged as computed attributes. For example, a specific BeanListProvider implementation could use the generic XML BeanListProvider as delegate for extracting data from remote XML documents. The BeanListProvider implementation can then add additional attributes by declaring computed attributes in the used list rendering profile and implement the value computation for those values by implementing the ComputedAttributeValueProvider interface.

It is not required to implement the ComputedAttributeValueProvider interface if the BeanListProvider implementation is not using computed attributes or not using list rendering profile based BeanListProvider delegates at all.

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

Method Summary
 java.lang.Object getComputedItemAttributeValue(BeanListRequest request, java.lang.String attributeName, int listIndex, java.util.List<? extends ResourceBean> resourceBeans, java.util.Map<java.lang.String,java.lang.Object> computationContext)
          This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as computed item attributes.
 java.lang.Object getComputedListPropertyValue(BeanListRequest request, java.lang.String propertyName, java.util.List<? extends ResourceBean> resourceBeans, java.util.Map<java.lang.String,java.lang.Object> computationContext)
          This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute list properties values flagged as computed list properties.
 java.lang.Object getLazyComputedItemAttributeValue(java.lang.String providerID, java.lang.String profileName, java.lang.String attributeName, int listIndex, java.util.List<? extends ResourceBean> resourceBeans)
          This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as lazily computed item attributes.
 java.lang.Object getLazyComputedListPropertyValue(java.lang.String providerID, java.lang.String profileName, java.lang.String propertyName, java.util.List<? extends ResourceBean> resourceBeans, java.util.Map<java.lang.String,java.lang.Object> listProperties)
          This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as lazily computed list properties.
 

Method Detail

getComputedItemAttributeValue

java.lang.Object getComputedItemAttributeValue(BeanListRequest request,
                                               java.lang.String attributeName,
                                               int listIndex,
                                               java.util.List<? extends ResourceBean> resourceBeans,
                                               java.util.Map<java.lang.String,java.lang.Object> computationContext)
                                               throws BeanListProviderException
This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as computed item attributes. Attributes flagged as computed are computed immediately after loading the non-computed attributes. The computation is performed in context of the BeanListRequest that triggered the overall BeanList computation.

Parameters:
request - the current bean list request
attributeName - the name of the attribute to compute
listIndex - the index of the current item in the list
resourceBeans - the current collection of resource beans as instantiated via the active profile
computationContext - the data that is shared by all calls to this method in the scope of the given bean list request. This context can be used to cache objects required by multiple attribute computations.
Returns:
the attribute value (of type String, String[], Date, or Calendar )
Throws:
BeanListProviderException

getLazyComputedItemAttributeValue

java.lang.Object getLazyComputedItemAttributeValue(java.lang.String providerID,
                                                   java.lang.String profileName,
                                                   java.lang.String attributeName,
                                                   int listIndex,
                                                   java.util.List<? extends ResourceBean> resourceBeans)
                                                   throws BeanListProviderException
This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as lazily computed item attributes. Attributes flagged as lazily computed are computed when the corresponding bean attribute actually gets requested via the ResourceBean interface. The computation is not performed in context of the BeanListRequest that triggered the overall BeanList computation since this context is typically no longer available when the attribute value is retrieved from a cached BeanList object.

Parameters:
providerID - the ID of the BeanListProvider extension calling this method.
profileName - the unique name of the associated list rendering profile
attributeName - the name of the attribute to compute
listIndex - the index of the current item in the list
resourceBeans - the collection of all resource beans in the current bean list
Returns:
the attribute value (of type String, String[], Date, or Calendar )
Throws:
BeanListProviderException

getComputedListPropertyValue

java.lang.Object getComputedListPropertyValue(BeanListRequest request,
                                              java.lang.String propertyName,
                                              java.util.List<? extends ResourceBean> resourceBeans,
                                              java.util.Map<java.lang.String,java.lang.Object> computationContext)
                                              throws BeanListProviderException
This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute list properties values flagged as computed list properties. List properties flagged as computed are computed immediately after loading the non-computed list properties. The computation is performed in context of the BeanListRequest that triggered the overall BeanList computation.

Parameters:
request - the current bean list request
propertyName - the name of the list property to compute
resourceBeans - the collection of all resource beans in the current bean list
computationContext - the data that is shared by all calls to this method in the scope of the given bean list request This context can be used to cache objects required by multiple attribute computations.
Returns:
the property value (of type String, String[] or java.util.Date)
Throws:
BeanListProviderException

getLazyComputedListPropertyValue

java.lang.Object getLazyComputedListPropertyValue(java.lang.String providerID,
                                                  java.lang.String profileName,
                                                  java.lang.String propertyName,
                                                  java.util.List<? extends ResourceBean> resourceBeans,
                                                  java.util.Map<java.lang.String,java.lang.Object> listProperties)
                                                  throws BeanListProviderException
This method is invoked by the PLR framework for list rendering driven BeanListProvider extension to compute attribute values flagged as lazily computed list properties. List properties flagged as lazily computed are computed when the corresponding list property actually gets requested via the BeanList interface. The computation is not performed in context of the BeanListRequest that triggered the overall BeanList computation since this context is typically no longer available when the list property is retrieved from a cached BeanList object.

Parameters:
providerID - the ID of the BeanListProvider extension calling this method.
profileName - the unique name of the associated list rendering profile
propertyName - the name of the list property to compute
resourceBeans - the collection of all resource beans in the current bean list
listProperties - the map of list properties loaded and computed so far.
Returns:
Throws:
BeanListProviderException