4 Configuring MAF Application Features

This chapter introduces application features, describes how you add one to your MAF application, and discusses how you configure an application feature to render as a sliding window.

This chapter includes the following sections:

4.1 Introduction to MAF Application Features

A MAF application must have at least one application feature. The WorkBetter sample application, for example, includes four application features (Dashboard, People, Organizations, and Springboard). Figure 4-1 shows these application features displaying in the editor.

Figure 4-1 Features Defined for Workspace Sample MAF Application

This image is described in the surrounding text

You use the MAF Features Editor to specify the application features that a MAF application includes.

You can modify these elements declaratively using the editor, shown in Figure 4-1.

4.2 Configuring the Application Features within a Mobile Application

Each mobile application must have at least one application feature.

4.2.1 How to Designate the Content for a Mobile Application

Figure 4-2 shows the Feature References page, which enables you to build the content for the mobile application. The MAF Application Editor displays these feature references in the Feature References table. Figure 4-2 shows the defined feature references for HCM and PROD that represent the Customers and Products application features, respectively.

Figure 4-2 Registered Features in the Application Page

This image is described in the surrounding text

Using Registered Features, you enter the references to the application feature and set its display within the mobile application's springboard.

In addition, the page enables you to set the order in which the application features display on the navigation bar and springboard. At runtime, the width of the device screen can limit the number of application features that display on the navigation bar. Those that cannot be accommodated on the navigation bar display under a More tab, as shown in Figure 4-3. Users can reorder the application features within the More tab by using the Edit function.

Figure 4-3 The More Tab

This image is described in the surrounding text

Note:

Because building a mobile application is an iterative process, you can add, delete or update feature references as new FARs become available (and new application features are added to the maf-feature.xml file).

Figure 4-4 Designating Application Features Using the Feature References Page

This image is described in the surrounding text

Before you begin:

You must have application features configured in the MAF Application Editor. In addition, you must open the MAF Application Editor.

To designate feature references:

  1. Select Registered Features in the outline of the MAF Application Editor.

  2. Click This image is described in the surrounding text Browse to open the Register Mobile Feature dialog, as shown in Figure 4-5.

    Figure 4-5 Registering Features for an Application

    This image is described in the surrounding text

    This dialog lists all of the application features described in the <adfmf:feature> elements of the maf-feature.xml file Using this dialog ensures that the id attributes of both the <adfmf:featureReference> and <adfmf:feature> elements match.

  3. Select the select the ID of the application feature you want to register with the application. You can use Shift and Ctrl to select more than one, and click OK.

    You can also add references to application features that are contained in an imported feature archive (FAR) file. For more information, see Section 9.1.1, "Importing a FAR as an Application Library."

  4. In the Registered Features page of the MAF Application Editor use the up- and down-arrows to arrange the display order of the feature references.

    The top-most application feature is the default application feature. Depending on the security configuration for this application, MAF can enable users to login anonymously to view unsecured content, or it can prompt users to provide their authentication credentials. For more information, see Section 30.1, "Introduction to MAF Security."

    Note:

    The top-most ID in the Feature References table is the first application feature to display within the mobile application. See, for example, the Feature 1 application feature illustrated in Figure 4-6.

    Figure 4-6 Reordering Feature References

    This image is described in the surrounding text
  5. Set the springboard and navigation bar display behavior for the application feature by selecting true or false from the dropdown lists in the rows of the Show on Navigation Bar and Show on Springboard columns. Figure 4-7 shows selecting these options to prevent an application feature from displaying in the navigation bar.

    Tip:

    Set these options to false if the application uses a custom springboard or if the application feature will display as a sliding window. For more information, see Section 4.3, "Creating a Sliding Window in Your MAF Application."

    Figure 4-7 Changing the Navigation Options

    This image is described in the surrounding text

    The springboard and the navigation bar display by default (that is, these attributes are set to true). If both the navigation bar and springboard attributes are set to false, then the application feature only displays if it is in the first position. See also Section B.2.11, "hideNavigationBar" and Section B.2.12, "showNavigationBar."

    Note:

    Because springboard features do not display on the navigation bar or within the springboard of a mobile application, Show on Navigation Bar and Show on Springboard must both be set to false for feature references used as custom springboard application features. See also Section 5.6, "What You May Need to Know About Custom Springboard Application Features with MAF AMX Content."

4.3 Creating a Sliding Window in Your MAF Application

You can render an application feature as a sliding window. This makes the application feature display concurrently with the other application features that display within the navigation bar or springboard. You might use a sliding window to display content that is always present within the application, such as a global tool bar, or for temporary (pop-up) content, such as a help window.

Figure 4-8 shows the SlidingDrawer application feature from the SlidingWindow sample application, described in Appendix G, "MAF Sample Applications."." This application feature appears on the right of an application screen while overlaying other application features.

Figure 4-8 Sliding Windows Sample Application

This image is described in the surrounding text

If you choose to render an application feature as a sliding window, you must set its Show on Navigation Bar and Show on Springboard properties to false.

You create a sliding window by invoking a combination of the oracle.adfmf.framework.api.AdfmfSlidingWindowOptions and AdfmfSlidingWindowUtilities classes, either from a managed bean or lifecycle listener within your application.

The example below demonstrates how the SlidingWindow sample application creates the sliding window from the activate method of LifeCycleListenerImpl.java. After creating the sliding window, the SlidingWindow sample application uses SlidingDrawerBean.java to manage the display of the sliding window.

...
public void activate()  {
    // The argument you pass to the create method is the refId of the
    // feature in the maf-application.xml. For example,
    // <adfmf:featureReference id="fr4" refId="SlidingDrawer" showOnNavigationBar="false" 
    // showOnSpringboard="false"/>
      String slidingWindowDrawer = AdfmfSlidingWindowUtilities.create("SlidingDrawer");  
 
    // Note also that both showOn... values must be set to false in the config 
    // file for the sliding window to appear
      
      SlidingDrawerBean.slidingDrawerWindow=slidingWindowDrawer;
      AdfmfSlidingWindowOptions options = new AdfmfSlidingWindowOptions();
      options.setDirection(AdfmfSlidingWindowOptions.DIRECTION_RIGHT);
      options.setStyle(AdfmfSlidingWindowOptions.STYLE_OVERLAID);
      options.setSize("0");
     
  }

For information about how to access the complete SlidingWindow sample application discussed here, see Appendix G, "MAF Sample Applications."

For more information about AdfmfSlidingWindowUtilities and AdfmfSlidingWindowOptions, see the Java API Reference for Oracle Mobile Application Framework. For more information about using lifecycle listeners, see Chapter 11, "Using Lifecycle Listeners in MAF Applications."