Show TOC

Procedure documentationStep 3: Creating Entity Portal Components Locate this document in the navigation structure

 

Each content provider entity needs a component that can render its content in an iView. The content provider framework includes the ContentProvidersComponent class on which you can base your content provider portal components.

Procedure

  1. Add an entry in portalapp.xml that creates a portal component based on the ContentProvidersComponent class.

    Note Note

    The portal component is based on com.sap.portal.contentproviders.runtime.ContentProvidersComponent and you do not need to write any code for this component.

    End of the note.

    The following is an example of an entry in portalapp.xml for an entity portal component:

    Syntax Syntax

    1. <component name="CP_STORY">
        <component-config>
          <property name="ClassName" value="com.sap.portal.contentproviders.
      runtime.ContentProvidersComponent"/>
          <property name="SafetyLevel" value="low_safety"/>
        </component-config>
        <component-profile>
          <property name="com.sap.portal.cp.CP_SERVICE_KEY"                         value="com.sap.portal.myCP.ContentProvider"/>
          <property name="com.sap.portal.cp.ENTITY_KEY" value="CP_STORY"/>
          <property name="com.sap.portal.cp.TRANSFORMER_NAME" value="myTrans"/>
          <property name="com.sap.portal.cp.PARAMETERS_LIST" value="story_id"/>
          <property name="com.sap.portal.cp.parameter.story_id" value="">
            <property name="personalization" value="dialog"/>
            <property name="plainDescription" value="Story ID"/>
          </property>
        </component-profile>
      </component>
      
    End of the code.

    The <component> element is similar to the <component> element for any portal component. It defines the name of the service in the element's name attribute.

    In the <component> element, add a <component-config> element, as you would for any component. In this element, add the following property elements:

    • className: The name of the class that implements the component.

    • SafetyLevel: The component's security zone safety level, which should be set to low_safety.

    In the <component> element, add a <component-profile> element, and include the following property elements:

    • com.sap.portal.cp.CP_SERVICE_KEY: The provider service that the component instantiates to start the retrieval of XML content.

    • com.sap.portal.cp.ENTITY_KEY: A value representing the entity to be used for retrieving the XML content for this component. This value is passed into the provider service's getProviderEntity() method, which can use the value to determine which entity to return.

    • com.sap.portal.cp.TRANSFORMER_NAME: The name of the transformer the component uses to transform and render the XML.

    • com.sap.portal.cp.PARAMETERS_LIST: A list of parameters for the HTTP or SOAP request. The default value for each parameter is defined in another property element whose name is a concatenation of com.sap.portal.cp.parameter, a period (.) and the name of the parameter.

      For example, the default value for a parameter named ticker is defined in a property element named com.sap.portal.cp.parameter.ticker.

    • com.sap.portal.cp.parameter.<parameterName>: The default value for any parameter defined in the com.sap.portal.cp.PARAMETERS_LIST property element.