Show TOC

Using the Generic HTML Portal ComponentLocate this document in the navigation structure

Use the generic HTML portal component to simplify the development of SAPUI5 and other HTML applications that run in the portal and access data services from back-end systems.

Context

The generic HTML portal component handles the loading of application HTML in the portal request-response cycle at runtime. Using this component eliminates the need to write any Java application code. You need to add some declarations to the descriptor files and in some cases perform simple configuration tasks.

Note
  • The custom application code should not contain any <base> tags or empty <href> tags.
  • By default, the <!DOCTYPE> declaration in SAPUI5/HTML5 applications is not passed on to the browser. The following procedure also includes instructions on how to enable support for HTML5.

Procedure

To integrate your application with the generic HTML portal component, perform the following tasks:

  1. Create a portal application project.
  2. Copy all files of your custom HTML applications to the DIST subfolder of the project.
  3. Open the portalapp.xml file, and add the following properties:
    • In the <application-config> section, a sharing reference to the generic HTML portal component, supplied by the portal:
      <propertyname="SharingReference" value="com.sap.portal.html.component"/>
    • In the <component-config> section:
      <propertyname="ClassName" value="com.sap.portal.html.component.PortalHTMLComponent"/>
      <propertyname="htmlFilePath" value=[Path to application HTML file, relative to DIST folder]>
    • To enable support for HTML5, in the <component-profile> section:
      <propertyname ="com.sap.portal.prt.html5.compliant" value="true"/>
      <property name="com.sap.portal.reserved.iview.IsolationMode" value="URL"/>
    • If you use the standard SAPUI5 resource servlet in your application, you need to add an additional sharing reference in the <application-config> section of the portalapp.xml file.
      <property name="SharingReference" value="SAPJ2EE::ui~five"/>
  4. If your application uses a servlet, such as the standard SAPUI5 resource servlet, make sure that the servlet declaration is present in the web.xml file located in the WEB-INF subfolder:
    <servlet>
    	<display-name>ResourceServlet </display-name>
    	<servlet-name>ResourceServlet </servlet-name>
    	<servlet-class>com.sap.ui5.resource.ResourceServlet</servlet-class>
    </servlet>
  5. If your application performs cross-domain Ajax calls to external data services, you need to configure Destination objects for each external domain and modify the corresponding URLs in the application source code.
  6. In the portal, create an iView based on this application.
  7. For an SAPUI5/HTML5 application, configure portal support for HTML5.