Show TOC

Procedure documentationCreating HTTP Entities Locate this document in the navigation structure

 

The portal includes an AbstractHTTPProviderEntity class that implements all required methods of IProviderEntity and ITransformationProviderEntity interfaces in order to make a HTTP request.

You need, however, to implement the getSourceURL() method (from the IHTTPProviderEntity interface, which AbstractHTTPProviderEntity also implements). getSourceURL() returns the URL string for the HTTP request for the XML source.

Procedure

  1. Create a class that extends AbstractHTTPProviderEntity.

  2. Implement the getSourceURL() method, which should return the URL for the HTTP request to the XML source. The following is an example:

    Syntax Syntax

    1. public String getSourceURL() throws ContentProviderException
      {
          List params =
              m_sourcePropertiesHandler.getParametersValues(m_request);
      
          String staticUrlPart = (String) m_dataHandler.getProperty("Static");
      
          return m_baseUrl + staticUrlPart + "&" +
              this.convertParametersToUrl(params);
      }
      
    End of the code.
    • Base URL: The base URL is taken from the entity's m_baseUrl field, which the default implementation loads with the value set in the service's com.sap.portal.cp.BASE_URL property, which is defined in portalapp.xml.

    • Static URL: The static part of the URL is taken from the value set in the entity's Static property, which is defined in portalapp.xml. This property is not part of the default implementation.

    • Parameters: The URL parameters are stored in the entity's source properties handler (which was defined when the entity was retrieved by the provider service in its getProviderEntity() method).

    These URL parameters are listed in the com.sap.portal.cp.PARAMETERS_LIST property in the <component> element for the entity in portalapp.xml. The default values are defined in separate <property> elements for each parameter. For more information on these properties, see Parameters and Constants.

  3. If necessary, override the doInit() method.

  4. If necessary, override the getGeneralParameters() method. This method defines parameters that are passed to all the transformers associated with this entity.

  5. If necessary, override the getEntityTransformerParams() method. This method can be used to pass different key-value pairs to different transformers associated with this entity. You can determine the current transformer by examining the ITransformerInformation object passed into the method.