Friday, April 24, 2015

PeopleTools 8.54 - Branding Objects - Migration Issue and Workaround

I realized recently that there is an issue with the steps I detailed under "Migrating Branding to other environments" in my previous post (PeopleTools 8.54 - Branding - Part 3).

If we migrate all Branding Objects (HTML, Javascript, Style Sheet, Image) that were created using an App Designer Project then the objects end up in the target environment but they are no longer available for update online under Main Menu > PeopleTools > Portal > Branding > Branding Objects.

While I understand that this is working as per PeopleTools design, I believe that there should be an option for branding objects that are created and/or migrated using App Designer to be made available for online updates (probably using a setting/flag in App Designer?). Otherwise, we would need to go through a lot of manual object creation/update steps via the PIA for migrating html, JS, style sheets and images just to keep them available for online updates in the target which is very important if we want to maintain them as a configuration as opposed to a managed object (that requires migration any update).

I have raised a service request with Oracle to pursue this as an enhancement. If you feel that you could also benefit from such a feature then please raise a service request with Oracle. The chances of this being accepted as an enhancement would be more if there are several organizations requesting the same!

Nevertheless, I found a way to temporarily workaround this issue using a script. So far I only have this working for HTML, Javascript and Style Sheet objects (basically inserting appropriate data into PS_PTBR_OBJECT_TBL). Here are the scripts:

Note: Please DO NOT execute these scripts directly in your production environment. As always, TEST, TEST and TEST before doing anything in production.

/* HTML Objects */
insert into PS_PTBR_OBJECT_TBL (
                                  SELECT
                                    'H',
                                    CONTNAME,                                   
                                    VERSION,
                                    LASTUPDDTTM,
                                    LASTUPDOPRID,
                                    NULL
                                  FROM PSCONTDEFN
                                  WHERE conttype = 4 and contname in ('<HTML_NAME>')
                                );


/* Javascript Objects */
insert into PS_PTBR_OBJECT_TBL (
                                  SELECT
                                    'J',
                                    CONTNAME,                                   
                                    VERSION,
                                    LASTUPDDTTM,
                                    LASTUPDOPRID,
                                    NULL
                                  FROM PSCONTDEFN
                                  WHERE conttype = 4 and contname in ('<JAVASCRIPT_NAME>')
                                );

/* Style Sheet Objects */
insert into PS_PTBR_OBJECT_TBL (
                                  SELECT
                                    'S',
                                    CONTNAME,                                   
                                    VERSION,
                                    LASTUPDDTTM,
                                    LASTUPDOPRID,
                                    NULL
                                  FROM PSCONTDEFN
                                  WHERE conttype = 9 and contname in ('<STYLESHEET_NAME>')
                                );

Scripting for images seem to be a bit complicated because PSCONTDEFN is not storing the appropriate version numbers for images and the version is always defaulted to 1. I don't see an option of trying to script the insert into PS_PTBR_IMAGE_TBL (note: this table is different compared to what we used above for HTML, Javascript and Style Sheet) without having to update PSVERSION which will get very messy.

Although, the chances of image changes in a production environment are much lesser than HTML, Javascript and Style Sheet objects so this seems to be a decent workaround for now!

Wednesday, April 1, 2015

Conditional Redirect in SignOn PeopleCode

There are several scenarios where we might want to conditionally redirect users in SignOn PeopleCode. We cannot use the %Response.RedirectURL(location) method to achieve this because it does not work in SignOn PeopleCode.

There is a delivered function called SetAuthenticationResult which can be used for redirecting users in SignOn PeopleCode. Here is how we can use this feature (not very well documented in PeopleBooks):

E.g.: SetAuthenticationResult( False, &userid, &redirectURL, False);

Note: For this redirect to work, we need to change your Web Profile Configuration > Look and Feel (Tab):
Set Signon Result Doc Page to signonresultdocredirect.html


Information from Help:


Note: The web server(s) needs to be restarted for any changes in the web profile to take effect.

P.S.: This post is based on my response to a question in OTN.