16.10 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.10.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.10.2 Viewing Application Item Usage

You can view a list of where application items are used by clicking the Utilization tab at the top of the Application Items page.

To view the Utilization report:

  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 Utilization tab at the top of the page.

16.10.3 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.10.4 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.