Monday, August 31, 2020

How to automatically expand the Navigator in the Fluid NavBar

Whilst looking for a solution to do this I came across Sasank's page documenting how he achieved this, via injecting JavaScript and using JQuery. 

The downside, at least for me, was implementing all of the other JavaScript to actually trigger the click event. What I really wanted was a native JavaScript solution, i.e. without any frameworks.

With Fluid pages it is now possible to inject JavaScript (and CSS) through Fluid specific PeopleCode events. There are quite a few different functions, which are documented here.

So we know that we can inject JavaScript into a Fluid component, and we also know that the NavBar is a Fluid component. So, can we use Event Mapping to inject the PeopleCode? The answer is yes we can.

Like any Related Content Framework PeopleCode, you need to:

  • Create an Application Package PeopleCode class.
  • Create a Service Definition with a URL Type of Application Class, and reference the class created above.
  • And then map the PeopleCode to the Content Reference (Event Mapping).

import PT_RCF:ServiceInterface;

class OpenNavigator implements PT_RCF:ServiceInterface;
   method execute();
end-class;


method execute
   /+ Extends/implements PT_RCF:ServiceInterface.execute +/
   AddJavaScript(HTML.OPEN_NAV_MENU);
end-method;

The HTML referenced is as follows:

var callback = function () {
    // Handler when the DOM is fully loaded
    if (document.querySelector("[page='PTNUI_NAVBAR']") !== null) {
        let navButton = document.getElementById('PTNB$PTNUI_NB_MENU');
        navButton.click();
    }
};


document.addEventListener("DOMContentLoaded"callback);

The component you map this your Service Definition to is found here (hidden by default so remember to check the 'Include Hidden CREFs' checkbox):

Root > Fluid Structure Content > Fluid PeopleTools > Fluid PeopleTools Framework > NavBar

Given that this solution does the same thing as Sasank's solution, I did not add any extra screenshots showing the before and after. And whilst there probably are better ways of doing this, this is what I found working for me.

Credit for the JavaScript idea belongs to the post here


    Saturday, June 27, 2020

    Using the CompanyInfo element


    Note that I worked on this in the FSCM Image 35, which is PeopleTools 8.58.02.
    • I think it looks quite promising though, considering this is all just done through configuration.

    You need to have the following two roles:
    1. Secure Branding Administrator: Otherwise you cannot access the Define Headers and Footers page.
    2. Company Info Administrator: Otherwise the CompanyInfo element will not appear in the Tree.














    Navigate to the Define Headers and Footers page and select DEFAULT_HEADER_FLUID:
    Home > PeopleTools > Portal > Branding > Define Headers and Footers

    • From inside of the tree, click on the CompanyInfo element.
    • Click on the Additional Options hyperlink within the Element Properties group box to the right.
    • Check the 'Enable Company Banner Area' checkbox and, optionally, the 'Use Different Content for Classic and Fluid' checkbox.
    • Enter what you like into the Rich Text.

    You can use Meta-HTML in the Rich Text Editor. I noticed there are two HTML objects which contain examples of them being used in HTML (as this is ultimately rendered):
    • PT_INFOPAGECONNECT_FLUID
    • PT_INFOPAGECONNECT
    In my testing it seemed as though several of the Meta-HTML variables did not work in the header for Classic/Classic Plus pages, even though they did work in the 'Info Page' (Ctrl + Shift + J):
    • %Browser
    • %BrowserVersion
    • %BrowserPlatform
    • %Menu
    • %Component
    • %Page
    • %AppServer
    • %CompBufferSize
    I also noticed that in the Classic [Plus] components, the styling of the header looked more like it comes from the 8.57 theme, i.e. that blue look rather than the 8.58 look. I do not know if this is a bug or not, but this could be fixed via modifying the DEFAULT_THEME_FLUID Style Sheet.
    • Just search for .ps_box-headerbranding

    I was able to successfully use the following Meta-HTML variables in both Fluid and Classic:
    • %UserId
    • %DBName
    • %Message(n,n)
    • %ToolsRel
    • %AppsRel
    • %ServicePack
    • %Image
    Two notes on using the Meta-HTML variables:
    1. I used the %Message variable to reference a Message Catalog object which could be used to show the date when the system was refreshed, including the timestamp of the restore point.
      • The Message Catalog value was just hardcoded to prototype the idea.
      • It could be updated as part of a refresh process.
    2. The %Image variable needs to be used with the Source button on the Rich Text Editor, so that you can embed an <img> tag directly.

    Some final thoughts on the process:
    1. As recommended it is probably better to clone the objects rather than customize the DEFAULT_HEADER_FLUID.
    2. Be careful with how much you put into the header is it makes the header/banner grow taller.
    3. My little foray into this probably needs more effort in terms of styling.
    4. I should look into Macro Sets for Branding.
    Some examples:







    Saturday, May 23, 2020

    Cloud Manager Image 10


    Resource Stack: Choosing "PeopleSoft Cloud Manager for OCI" from the Marketplace.

    In the end, this seemed to work reasonably well. Although I think I had some issues with this, and I ended up with three different VCNs with the same name.

    Issues with Self Update
    Issues with installing the second IH (for self update) in a different VCN. See above.
    • I ended up terminating the instances and doing the stack resource update again with a different VCN to avoid confusion.
    The Windows client password wasn't complex enough.
    • I should have really paid more attention.
    The Linux server wouldn't create.
    • After help from Oracle and trial and error (experimenting with creating instances manually) the issue seemed to be the that my account/tenancy didn't have the authority to create the instance using the Linux 7.7 template from the drop down in Cloud Manager.
    • I had to find the 7.8 image from https://docs.cloud.oracle.com/en-us/iaas/images. This failed again due to selecting the Gen 2 image, so had to use the regular image.
    The Windows provisioning failed (although the instance was created) as the 8.57 tools didn't exist on f:/somewhere.
    • I had to subscribe to the Windows 8.57 Linux channel. Then redo the step in Cloud Manager.
    The change package failed (Change Assistant), but you don't get much from the Terraform logs.
    • I had to RDP to the server and look at the Change Package logs. 
    • An App Engine was trying to insert into a table where the unique key already existed.
    • I marked the step as complete and resubmitted the job and it completed.
    • I restarted the steps in Cloud Manager

    To be honest I had to mark several steps as complete, and I don't really think the self-update even worked.
    • I checked some of the update/bug ids from the download pages against the PS_MAINTENANCE_LOG and I couldn't see any of them.

    Final thoughts on the self update
    This was a very painful process. I think there is a lot of work that could be done to make this a more 'polished' process, and less prone to (user) errors. I found the terminology sometimes also confusing.

    I find the Virtual Box based PI a lot easier to install! But this is probably due to more practice.


    Installing FSCM Image #35
    After subscribing to the channel, and creating an Environment Template I was able to create the environment. Once you click done (or start) the process starts.

    This Cloud Manager process actually provisioned the Linux and Windows Server compute instances, but the DPK failed.

    After looking at the logs on the server (the terraform logs were not terribly helpful), it turned out the Oracle database wasn't able to be created due to some missing prerequisites. 
    • Perhaps due to the different Linux build and 8.58 or 19c?!

    Eventually I found MOS doc 2651114.1 which seemed to be a pretty close fit with the issue I had and recommended checking some other logs, which once I did, confirmed the same issue. The solution was to contact your IT department and installing the missing package.
    • E-PUM: When Installing an 8.58 Based PUM the Following Error is Seen: Inventory.xml NOT Found (Doc ID 2651114.1)

    Obviously I can install the package, and probably even start the puppet apply again. But I assume this won't feed back into Cloud Manager.

    So ideally it needs to be done before the automated puppet build starts, i.e. as part of the DPK build. You can't do it earlier, as the creating the environment in Cloud Manager also provisions the Server.

    Luckily, you can configure a script to be run before (and after I think) the DPK builds. This can be configured in the Environment Template or during the Environment build itself.
    • I chose to do it in the template.

    I then had to delete the environment again, which thankfully also terminates the instances in OCI as well.

    After added the environment again, it (eventually) completed. This must have taken around 2 hours.
    But in the end happy to have the new EP92U035 system up and running.

    References
    • For setting up Cloud Manager and provisioning an environment:

    • For the self update: