78 WEM Framework: Registering Applications Manually

Registration exposes applications in the WEM Framework, as described in Chapter 70, "WEM Framework: Understanding the Framework and Services." Registering an application manually requires using the WebCenter Sites Admin interface to create an asset for the application, create an asset for each of its views, and associate the view assets with the application asset. The registration asset types FW_Application and FW_View are enabled on AdminSite.

Create a file that specifies the layout of the application in HTML, i.e., for each view, create a placeholder element to hold the content rendered by the view. Applications and views are related as shown in Figure 72–4.

For example, layout.jsp (for the "Articles" sample application) contains the following line:

The view's content will be rendered within the placeholder element when the application is displayed (layout.app renders the application's layout; home.app renders the view).

Note:

When creating the layout file, specify a unique id for the placeholder element. You will specify the same id for the Parent Node attribute when creating the view asset. Use class="wemholder" for the placeholder elements.

Register the view and application.

Log in to the WebCenter Sites Admin interface as a general administrator, navigate to the AdminSite and click the Admin tab, where the FW_View and FW_Application asset types are enabled.

(We assume you will create the view and application assets in the same session, in which case both assets will be listed on the History tab. When creating the application asset, you will select the view asset from the History tab and associate it with the application asset. The History tab is volatile; it is cleared at the end of the user's session. Assets can be permanently placed on the Active List tab. For instructions, see the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.)

Create an instance of the FW_View asset type:

Click New, select New FW_View, and set attributes as shown below this figure. (This figure displays attribute values for the view asset of the "Articles" sample application.)

ToolTip: Enter the text that will be displayed over the application's icon when users mouse over the icon.

Icon URL: Enter the URL of the icon that represents the application. The icon will be displayed on the login page and at the top of the WEM interface. For example, the Icon URL for the "Articles" sample application takes the following value: http://localhost:9080/articles-1.0/images/articles.png

Hover Icon URL: Enter the URL of the icon that represents the application when users mouse over the icon.

Click Icon URL: Enter the URL of the icon that represents the application when users click on the icon.

Active Icon URL: Enter the URL of the icon that represents the application when it is in use.

Layout Type: LayoutRenderer (the default and only value). Layout Type is used by the UI container to render the application's views by using the application's layout page (specified below in the Layout URL attribute).

Layout URL: Enter the URL of the page that displays the application's layout. The layout page has only HTML placeholder elements (such as div) for placing the view(s).

For example, Layout URL for the "Articles" sample application takes the value: "http://localhost:9080/articles-1.0/layout.app" rather than ".../layout.jsp", given the Spring MVC framework.

78.2 Reference: Registration Asset Types

78.2.1 FW_View Asset Type

This asset type is used to register the views of an application. For each view, create an instance of FW_View. Attributes of FW_View are listed below as they appear in the WebCenter Sites Admin interface and in the Oracle Fusion Middleware WebCenter Sites REST API Bean Reference. Shading indicates a required attribute. This asset type is enabled on the site named 'AdminSite.'

Table 78-1 FW_View Asset Type Attributes

Attribute: WebCenter Sites Interface

Attribute: REST API

Description

Name

name

Short descriptive name for this view asset.

Description

description

Description of this view asset.

Parent Node

parentnode

ID of the placeholder element in the application's layout file. The placeholder element will hold the content rendered by the view. The layout file has only HTML placeholder elements (such as div) for placing the views.

View Type

viewtype

How the view should be rendered. The following view types are available:

Iframe: renders the view in an iframe into the placeholder element

IncludeHTML: renders HTML into the placeholder element

IncludeJavaScript: renders JavaScript into the placeholder element

Source URL

sourceurl

URL that provides content for the view.

JavaScript

javascriptcontent

Required if IncludeJavaScript is the view type and Source URL is not specified.

The content specified by this attribute is included in a script tag if IncludeJavaScript is specified as the view type. If IncludeJavaScript is specified, either Source URL must be specified, or code must be provided for the JavaScript attribute.

Content

includecontent

Required if IncludeHTML is the view type and Source URL is not specified. The content specified by this attribute is included in the placeholder element tag if IncludeHTML is specified as the view type. If IncludeHTML is specified, either the Source URL must be specified or code must be provided for the Content attribute.