Friday, April 14, 2017

Fluid UI - Tile Wizard API - Part 2 - Dynamic Tile Images

This post is a continuation of my previous article on the Tile Wizard API, where I described how we can use the Tile Wizard API to dynamically update the Tile Content.

In this post, we will see how we can use the Tile Wizard API for another similar and more common use case to display a dynamic image based on certain conditions.

For the purposes of this post, let us assume that we want to create a Tile called 'My Team' that displays a different image and live data based on the user's security role assignment.

Demo:


Tile Wizard Setup:

NavBar > PeopleTools > Portal > Tile Wizard > Create Tile






App Package PeopleCode Implementation:



PeopleCode for Reference:

import PTGP_APPCLASS_TILE:Tiles:Tile;

class TILE_2 extends PTGP_APPCLASS_TILE:Tiles:Tile
   method TILE_2();
   method getTileLiveData();
end-class;

method TILE_2
   %Super = create PTGP_APPCLASS_TILE:Tiles:Tile();
end-method;

method getTileLiveData
   /+ Extends/implements PTGP_APPCLASS_TILE:Tiles:Tile.getTileLiveData +/
  
   If IsUserInRole("SV_CSK") Then
      rem %This.setTileImageRef("SV_CSK"); /* Method equivalent */
      %This.ImageReferenceField.Value = Image.SV_CSK;
      /* Live Data */
      %This.TileLiveData_1 = "Chennai Super Kings";
   End-If;
  
   If IsUserInRole("SV_RCB") Then
      rem %This.setTileImageRef("SV_RCB"); /* Method equivalent */
      %This.ImageReferenceField.Value = Image.SV_RCB;
      /* Live Data */
      %This.TileLiveData_1 = "Royal Challengers Bangalore";
   End-If;
  
end-method;

4 comments:

  1. how to migrate tile wizard

    ReplyDelete
    Replies
    1. Refer following document on My Oracle Support:

      E-FLUID : Migrate Fluid Tile (Doc ID 2213853.1)

      You can use Data Migration WorkBench to migrate Tile Wizard tiles. PTPPB_GROUPLET is the delivered data set definition to migrate Tile Wizard data.

      Navigation : Peopletools -> Lifecycle Tools -> Migrate Data -> Data Migration WorkBench

      Delete
  2. Where are the images - Image.SV_CSK and Image.SV_RCB placed?

    I am trying to do the example stated here; so would like to know the place where these images are placed?

    ReplyDelete
    Replies
    1. I uploaded the images (SVG format) using the Branding Objects page.
      PeopleTools > Portal > Branding > Branding Objects (Images)

      Delete