Wednesday, October 31, 2018

PeopleTools 8.57 | Custom Banner/Company Info Configuration - Part 4

Thus far, the blog series (Part 1, Part 2 and Part 3) on the 'Custom Banner/Company Info' configuration - available via the Branding Framework in PeopleTools 8.57, detailed an evaluation of the new functionality as delivered. As we could see from some of the demos provided previously, this delivered 'Company Info' feature can currently only display static content such as images, links, text, etc. configured via a Rich Text Editor (RTE). That is, the content will be static and the same for all users.

Wouldn't it be great if we can similarly configure and generate the content of the CompanyInfo element using an 'App Class Method' implementation for dynamic content? But this is not an option that is available in the current delivered functionality.

We know that this is possible based on the options available for other elements within the header definition. For example, pthdr2logofluid.



It would simply be a matter of extending the CompanyInfo element to also allow 'App Class Method' as an implementation option.

Idea

The following idea has been created on the My Oracle Support PeopleTools Community. Please vote for this enhancement if you think it would add value to the existing functionality.

PT 8.57 | Custom Banner/Company Info Functionality - Allow App Class Method Implementation for Dynamic Content
https://community.oracle.com/ideas/23390

Extending 'Custom Banner/Company Info' Configuration for Dynamic Content

This post will detailed how we can extend the delivered 'Custom Banner/Company Info' configuration (PT 8.57.01) to generate dynamic content such as a personalized greeting message. This type of an extension will involve minor customizations.

Environment Used

HCM 9.2 PUM Image 27 originally on PeopleTools 8.56.09 upgraded to PeopleTools 8.57.01 (inaugural Cloud-First release). The PUM image provisioning and upgrade were administered using PeopleSoft Cloud Manager 7 running on Oracle Cloud Infrastructure - Classic.

Demo


Are there any configuration options?

Initially, I pondered if we can use any configuration to extend the existing functionality. For example, PeopleTools > Portal > Branding > System Data > Define Element Types > COMPANYINFO


In theory, we could use this configuration to override the Supporting Application Class for the CompanyInfo element. But soon I found that the amount of hard-coded references to the PTBR_BRANDING application classes in several locations basically rules this out as a viable option. I don't think the juice is worth the squeeze. Here are some examples of PTBR_BRANDING app class references.




Therefore, it is much easier to simply customize the appropriate code that generates the CompanyInfo content for Classic and Fluid respectively.

Dynamic Content Implementation

Include dynamic variable substitution parameters in RTE


We can also use the 'Source' option in the RTE to wrap the substitution parameter (:1) with HTML elements and attributes. In this example, I wrapped :1 within a <span> element and also included an id attribute which will allow us to apply targeted styles to the dynamic content as per our requirements.


Generating Dynamic Content for Classic

The following PeopleCode snippet was included in PTBR_BRANDING.Elements.CompanyInfoConfigurator.OnExecute - getHTML method.



Generating Dynamic Content for Fluid

Similarly, the following PeopleCode snippet was included in PTBR_BRANDING.UTILITY.GetCompanyInfoHtml.OnExecute - GetFluidBannerHtml method.



Custom CSS for Dynamic Content

Finally, we can use the id attribute (cskWelcome) of the dynamic content to target any custom CSS as per our requirements. In this example, the following CSS was appended to Classic (CSK_BRAND_CLASSIC_TEMPLATE_857) and Fluid (CSK_BRAND_FLUID_TEMPLATE_857) theme style sheets.