65 Registering Applications Manually in WEM Framework

When you register an application manually, you create an asset for the application, create an asset for each of its views, and associate the view assets with the application asset in the Admin interface. You can enable the registration asset types FW_Application and FW_View on AdminSite.

Topics:

65.1 Registering Applications in WEM Framework

Learn how you can register an application and its views by registering the Articles sample application and its view.

See Working with the Articles Sample Application. Articles has a single view of type iframe. The same steps apply to JavaScript and HTML views.

To manually register an application and view:

  1. Create or get an icon to represent your application. (The icon will be displayed in the applications bar.)

    The Articles sample application uses the articles.png image file located in: /sample app/articles/src/main/webapp/images/

  2. Create a file that specifies the layout of the application in HTML, that is, for each view, create a placeholder element to hold the content rendered by the view.

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

    <div id="articles" style="float:left;height:100%;width:100%"
      class="wemholder"></div>
    

    The view's contents are 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.

  3. Register the view and application.

    1. Log in to the Admin interface as a general administrator, navigate to the AdminSite and expand the Admin node, 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 after the user's session. Assets can be permanently placed on the Active List tab. See Administering Oracle WebCenter Sites.)

    2. Create an instance of the FW_View asset type:

      Click New, select New FW_View, and set attributes. (The following figure displays attribute values for the view asset of the Articles sample application.)

      Figure 65-1 Attribute Values for the View Asset

      Description of Figure 65-1 follows
      Description of "Figure 65-1 Attribute Values for the View Asset"

      Name: Enter a short descriptive name for this view asset.

      Parent Node: Enter the id of the placeholder element (defined in step 2 of Registering Applications in WEM Framework) that will hold the content rendered by the view.

      View Type: Select one of the following options to specify how the view's contents should be rendered in the placeholder:

      • 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: Enter the URL that provides contents for the view. For example, Source URL for the Articles sample application takes the following value: http://localhost:9080/articles-1.0/home.app

    3. Create an instance of the FW_Application asset type:

      Click New, select New FW_Application, and set attributes. (The following figure displays attribute values for the application asset of the Articles sample application.)

      Figure 65-2 Attribute Values for the Application Asset

      Description of Figure 65-2 follows
      Description of "Figure 65-2 Attribute Values for the Application Asset "

      Name: Enter a short descriptive name for this application asset.

      ToolTip: Enter the text that will be displayed over the application's icon when users hover 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 place mouse over the icon.

      Click Icon URL: Enter the URL of the icon that represents the application when users click 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.

      Related: Associated FW_View: views: Select the view asset created in step 3 of Registering Applications in WEM Framework (click the History tab, select the view asset, and click Add Selected Items).

65.2 Reference: Registration Asset Types

With the FW_View asset type you can register views of your application. And, you can use the FW_Application asset type to register your application.

Topics:

65.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 in the table below as they appear in the Admin interface and in the REST API Bean Reference for Oracle WebCenter Sites. This asset type is enabled on the site named AdminSite.

Table 65-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 holds 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 the view type, 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 the view type, either the Source URL must be specified or code must be provided for the Content attribute.

65.2.2 FW_Application Asset Type

This asset type is used to register the application. The asset type is enabled on AdminSite. Attributes of FW_Application are listed in the table below as they appear in the Admin interface and in the REST API Bean Reference for Oracle WebCenter Sites.

Table 65-2 FW_Application Asset Type Attributes

Attribute: WebCenter Sites Interface Attribute: REST API Description

Name

name

Short descriptive name for this application asset.

Description

description

Description of this application asset.

Tooltip

tooltip

Text that is displayed on the application's icon when users place mouse over the icon.

Icon URL

iconurl

URL of the icon that represents the application in the WEM Framework.

Hover Icon URL

iconurlhover

URL of the icon that represents the application when users place mouse over the icon.

Click Icon URL

clickiconurl

URL of the icon that represents the application when users click the icon.

Active Icon URL

iconurlactive

URL of the icon that represents the application while it is in use.

Layout Type

layouttype

Type of layout. The value is LayoutRenderer.

Layout Type is responsible for rendering the application's views by using the application's layout page (specified in the Layout URL attribute).

Layout URL

layouturl

URL of the page where the application's layout is displayed. This page has only HTML placeholder elements (such as div) for placing the views.

Related: Associated FW_Application: extends

parentnode

Parent application which the current application extends.

Related: Associated FW_View: views

views

List of view assets used in this application.