Skip to main content

Sharing pages across multiple APEX apps

D

Did you ever wanted to share some pages across multiple applications? I certainly did. I have a Dashboard page with some other pages I would like to share in several apps in the same APEX workspace. Copying these from one app to another is time consuming. Pages, supporting objects, data... And keeping all of these pages and objects synced is a nightmare.

Fortunately you can easily setup your APEX apps/workspace so it will allow you seamless transitions from one app to another without the need of re-authentication. You can even run different (or same) apps in multiple tabs in the same browser. To do that you have to run following code as administrator. There is one issue with multiple sessions - if you logoff in one app, it will sign you out from all of them.

BEGIN
    APEX_INSTANCE_ADMIN.SET_PARAMETER (
        p_parameter => 'CLONE_SESSION_ENABLED',
        p_value     => 'Y'
    );
    COMMIT;
END;
/

To setup session sharing go to Shared Components - Authentication Schemes - under your current scheme you should set Session Sharing to Workspace Sharing. You have to do this in every app. And I think you have to have the same authentication scheme is all apps you like to link.


Managing apps

I added Applications page and extended Apps table with is_visible flag/column because I don't want to show all apps to the user. But even hidden applications became visible to user when you assign him any role in that application (page User & Roles, discussed in previous article about custom authentication).


User can see all available apps as cards on his/her User Info page. Click on app card and he/she will be redirected to that app's homepage. But it is up to you how to show you links to other apps (and even specific pages).


Sharing pages

My solution utilise existing Navigation page, I just extended the Navigation table with is_shared flag/column. If I want to share some pages from my CORE app all I need to do is mark them as shared. I marked all pages from Dashboard and User groups. That's it.

Now every user can see them in any other apps in the same workspace, unless:

  • user don't pass authorization check on that page
  • page with same number exists in the current app


Screen from Application A before sharing pages from app CORE:

Screen from Application A after sharing:

Now I can sleep peacefully. If I change any of these pages in CORE app, I will see changes in all other apps without moving a finger.

The magic behind is hidden in nav_overview view which I use and described in article about custom navigation.


Sharing items

Go to Shared Components - Application Items. Create a new item you would like to share through apps, set the Scope to Global. Do this in every app.

I created G_TODAY item in CORE app and in Applications A and B. Now when I change G_TODAY value in CORE and go to APP_A I will see the value from CORE. I change it and go back (or any other app with this item), I will see the new value.

And if you are still reading, did you know that one of my favourite quotes from Peppa Pig? "Sharing is fun" by Daddy Pig.


Comments