Friday, September 21, 2018

Tile Wizard API - Part 4 - Dynamic Target Page

I previously wrote a series of posts on Tile Wizard API which allows us to control the display of the Tile Content using PeopleCode.

Part 1: Dynamic Tile Content
Part 2: Dynamic Tile Images
Part 3: Dynamic Tile Styling

These posts mainly focused on the content of the Tile as expected because the Application Class delivered by Oracle was mainly for the purpose of manipulating 'Tile Content'.

Marcin Tomczak asked the question:
"Can we make the tile point to a different external page than the tile itself?"

This made me wonder if we can dynamically change the target/destination page (internal/external) of a tile using PeopleCode? It is technically not a feature as per the design/implementation of the Tile Class. But there is an error/exception processing option that is available which might enable us to "hack" the Tile Class to do something it was not originally intended for.

Tile Class Properties - hasContent
Tile Class Properties - PreferencesURLLabel
Tile Class Properties - PreferencesURL

The hasContent property allows us to enable the error/exception mode where we can set a different image, destination URL and URL label. While it is technically not an error scenario in this case, we can still set it in error/exception mode to dynamically modify the Tile destination/target page!

Demo

- As you can see in the demo, the Tile 'Dynamic Target' is created using Tile Wizard with a destination page as 'My System Profile'. This destination has no significance because the 'Disable Main Hotspot' is set to 'Yes'.
- Once the role 'SV_ROLE_1' is added to PS user, we can see the new image and 'My Preferences' URL is enabled for the 'Dynamic Target' tile via the Tile App Class.
- When the role is switched to 'SV_ROLE_2', we can see the 'Change My Password' URL is enabled for the 'Dynamic Target' tile via the Tile App Class.
- When the role is switched to 'SV_ROLE_3', we can see the 'Google Search' external URL is enabled for the 'Dynamic Target' tile via the Tile App Class.


 Tile Wizard Settings








App Package PeopleCode


Environment Details
- CS 9.2 PUM Image 4
- PeopleTools 8.55.12

Tuesday, September 18, 2018

Decoupling the 'Add to' Homepages, Favorites and NavBar Functionality

As delivered, the 'Add to' functionality - Add to Homepage, Add to NavBar, Add to Favorites, which is available in the New User Interface (NUI) is all or nothing. That is how it works as designed in PeopleTools.


What this means is that, we cannot simply remove access to 'Add to Homepage...' while allowing access to 'Add to NavBar' and/or 'Add to Favorites'. Basically there is no granularity in the security access. The access to the 'Add to' functionality is mainly controlled via the following weblib from a security point of view:
WEBLIB_PTNUI.PT_BUTTON_PIN.FieldFormula.IScript_SavePin

Note: There are some other configurations that may impact the display of the 'Add to' options. Refer MOS Doc ID 1983068.1 for more details.

My Oracle Support Reference Documents
E-FLUID: How To Restrict Users From Adding Homepages or Tiles in Fluid Homepages (Doc ID 1983068.1)
Bug 26290030: THE ADD TO FUNCTIONALITY NEEDS ENHANCEMENT

Clearly, this is not ideal. I worked on a requirement recently to decouple the security for the 'Add to' functionality. This also seems to be a common request among other PeopleSoft customers as well. For example: https://community.oracle.com/message/14937074#14937074

Here are the steps to decouple the 'Add to' functionality.

Step 1: Create a custom weblib

The IScripts in this custom weblib are primarily for dummy purposes. We can see that there is no code in the IScript.


PeopleCode Snippet for Reference:

Step 2: Update IScript_ShowPinMenu

This customization will take care of the 'Add to' functionality in Classic.


PeopleCode Snippet for Reference

Step 3: Update PT_HEADERPAGE.Activate (Page PeopleCode)

This customization will take care of the 'Add to' functionality in Fluid.


PeopleCode Snippet for Reference

Step 4: Security Configuration

Provide Full Access to the following delivered IScripts:
WEBLIB_PTNUI.PT_BUTTON_PIN.FieldFormula.IScript_ShowPinMenu
WEBLIB_PTNUI.PT_BUTTON_PIN.FieldFormula.IScript_SavePin

 This is to provide the delivered 'all or nothing' access to the delivered 'Add to' functionality.


Now we are ready to control the decoupled 'Add to' functionality using the custom weblibs. We can selectively provide granular access to the following custom weblibs based on our requirements.
Add to Homepage: WEBLIB_CSK_PIN.ISCRIPT1.FieldFormula.IScript_AddToHomepage
Add to NavBar: WEBLIB_CSK_PIN.ISCRIPT1.FieldFormula.IScript_AddToNavBar
Add to Favorites: WEBLIB_CSK_PIN.ISCRIPT1.FieldFormula.IScript_AddToFavorites

In the example below, I am choosing to provide access to 'Add to NavBar' and 'Add to Favorites' but not to 'Add to Homepage'.


Results

Fluid Page:


Classic Page:


Environment Details
- HCM 9.2 PUM Image 25
- PeopleTools 8.56.05