16.5 Managing Application Items

Application items do not display, but are used to maintain session state.

Application items can be set using computations, processes, or by passing values on a URL. Use On New Instance computations to set the value of items once for a session. Use application items to maintain session state that is not displayed and is not specific to any one page.

16.5.1 Creating an Application Item

Create a application item on the shared Shared Components page.

To create an application item:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Application Logic, select Application Items.

    The Application Items page appears.

  3. To create an application item, click Create.

    The Create/Edit page appears.

  4. For Name:
    1. Name - Enter a name for the application item.
    2. Scope - Options include:
      • Global - Select this option if the Oracle APEX session is shared by more than one application and the item's value should be the same for all applications.

        Applications can share the same session if their authentications have the same Session Cookie Attributes. The Scope attribute of application items has to be the same across these applications.

      • Application - Select this option if the application does share session state with another application.

  5. Security, Session State Protection - Set session state protection for this item. Options include:
    • Unrestricted - The item's session state may be set by passing the item name/value in a URL or in a form. No checksum is required in the URL.

      Note:

      If you must set this item's value in session state using Ajax, then an Unrestricted protection level must be used for the item (for example in Dynamic Actions, Set Value, Page Items to Submit or Cascading LOVs, Page Items to Submit).

    • Restricted - May not be set from browser - The item may not be altered using the URL or POSTDATA. Use this option when you want to restrict the way that the item value can be set to internal processes, computations, and so on. This attribute is only applicable only to items that cannot be used as data entry items and is always observed even if Session State Protection is disabled. This attribute may be used for application items or for page items with any of these Display As types:

      • Display Only (Save State=No)

      • Display Only (Save State=No)

      • Stop and Start Grid Layout (Displays label only)

    • Checksum Required: Application Level - The item's session state may be set by passing the item name/value in a URL if a checksum specific to the schema is provided. A user-level checksum or a session-level checksum will also suffice (see next bullets). Use this option when you want to allow the item to be set only by URLs having checksums that were generated by any user running the same application in the current workspace but in a different session.

    • Checksum Required: User Level - The item's session state may be set by passing the item name/value in a URL if a checksum specific to the workspace, application, and user is provided. A session-level checksum will also suffice (see next bullet). Use this option when you want to allow the item to be set only by URLs having checksums that were generated by the same named user, running the same application in the current workspace but in a different session.

    • Checksum Required: Session Level - The item's session state may be set by passing the item name/value in a URL if a checksum specific to the current session is provided. Use this option when you want to allow this item to be set only by URLs having checksums that were generated in the current session.

  6. Security, Escape Special Characters - Controls whether the application item's value is automatically escaped in substitutions (for exmple, when referencing the item using &ITEM. syntax.
    To prevent Cross-Site Scripting (XSS) attacks, set Escape Special Characters to On. If you need to render HTML tags stored in the application item, you can set this flag to Off.
  7. Configuration, Build Option - Select a build option for this component. Build options are predefined settings that determine whether components within an application are enabled.
  8. Comments - Enter any notes regarding this item.
  9. Click Create Application Item.

16.5.2 Editing Application Item Attributes

Once you create an application item, you can edit it on the Create/Edit Application Item page.

To edit application item attributes:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Application Logic, select Application Items.

    The Application Items page appears.

  3. Select an application item.

    The Create/Edit page appears.

  4. Edit the attributes.

    To learn more about an attribute, see field-level Help

  5. Click Apply Changes.

16.5.3 Copying or Subscribing to Application Items

Copy application items from the current application or from another applications. When copying an application item from another app, you can also subscribe to it.

Note:

When copying an application item from another app, shared component dependencies are automatically resolved. To learn more, see About Automatic Dependency Resolution.

To copy or subscribe to an application item:

  1. Navigate to the Application Items page:
    1. Navigate to the Workspace home page.
    2. Click the App Builder icon.
    3. Select an application.
    4. On the Application home page, click Shared Components.
    5. Under Application Logic, click Application Items.

      The Application Items page appears.

  2. To copy an Application Item within the current application:
    1. Search for the application item and click Copy icon in the Copy column.

      The Copy Application Item Wizard appears.

      Tip:

      To copy an Application Item from another app, click Copy from another app and see Step 3.
    2. New Application Item - Enter the name of the application item. This name must be unique within the application.
    3. Click Copy Application Item.
  3. To copy an application item from another application:
    1. From the Tasks region, click Copy from another app.
      The Copy Application Item Wizard appears.
    2. Application - Select the application from which you want to copy.
    3. Copy Application Item - Select the application item to copy.
    4. Subscribe - Set this flag to On to subscribe to the application item.
    5. Click Copy Application Item.

16.5.4 Accessing Application Item Reports

View the application item Utilization and History reports by clicking the appropriate tab on the Application Items page.

To view the application item reports:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Application Logic, select Application Items.

    The Application Items page appears.

  3. Click the appropriate tab:
    • Utilization - Displays where each application item is used.
    • History - Displays recent modifications made to application items in this application.

16.5.5 About Creating an Application Item that Functions as a Global Variable

You can create a global variable by creating an application item with the same name across all applications and setting the scope to Global.

Large applications are often separated into several physical applications that reside in the same workspace. These applications often share session state by configuring the same cookie name in each application.

Another requirement of this type of architecture is the need to share a few global variables. While the number global variables should be kept small, global variables function as an effective means to facilitate communicate between the applications. For example:

  • Properties of the current user (such as email address, employee number, and so on).
  • Current company in a multitenant application.

To create an application item that functions as a global variable:

  1. Create an application item with the same name in each application to share session state.
  2. For Scope, select Global.
  3. For Security, Session State Protection, select Restricted.