1 Reply Latest reply: Feb 13, 2013 4:03 AM by Daniel Merchán RSS

    how to load and get attributes from recommendation asset

      Hi all,

      I have made a recommendation asset where i dropped two different assets in a static list.
      My problem is that how to load and get the attributes of the asset which is dropped in it.
      Kindly Help.

      Thanks in advance

      Ankur Bhatia

      Edited by: 986921 on Feb 13, 2013 1:12 AM
        • 1. Re: how to load and get attributes from recommendation asset
          Daniel Merchán

          If I understood you have a Site Studio Region Definition with static lists element definition storing dDocName of other assets.

          I'll share to you some EL Expression that you can use to achieve your purpose:

          - First add "cmfn" (Content Management Function Tag) schema to your page schemas:
          - Create a manage bean of scope request (in adfc-config.xml) to facilitate using cmfn:getNodeById function
          public final class CPTUtil implements Serializable {
               * Primary WebCenter Content Connection configured
              private static final String CONEXION_UCM =
              private static final long serialVersionUID = -2874242088031295906L;
              Map<String, String> repository = null;
              public CPTUtil() {
                  repository = new HashMap<String, String>() {
                          public String get(Object key) {
                              if (key != null && !key.equals(""))
                                  return CONEXION_UCM + key;
                                  return super.get(key);
              public Map<String, String> getRepository() {
                  return repository;
          - Now we can use next EL Expression to iterate over the items of our static list:
          <af:iterator value="#{node.propertyMap['YourRegionDefinitionName:NameOfStaticList'].values}" var="item" id="i2">
          <af:outputText id="ot1" value="#{cmfn:getNodeById(cpUtilBean.repository[item.nestedValue[0].value]).propertyMap['dDocTitle'].value.stringValue}"/>
          <af:outputText id="ot2" value="#{cmfn:getNodeById(cpUtilBean.repository[item.nestedValue[0].value]).propertyMap['YourOtherRegionDefName:FieldOfRd'].value.stringValue}"/>          
          Explaining the code see next items:
          #{cmfn:getNodeById(cpUtilBean.repository[item.nestedValue[0].value])} is translated to cmfn:getNodeById('/MyRepositoryName/dDocName')
          cpUtilBean is a requestScope manage bean of previous Java code. Is a util bean to get clean and easy your repository name.

          With getNodeById you have accesibilty to all attributes of that item including Region Definition attributes an then you can use propertyMap['whateveryouwant']

          I hope this help you.