What Environment Am I in?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

As I was going through some of the sessions on the QUEST NORTHEAST CONFERENCE I noticed on of the presenters mentioning customizing Test environments Main PeopleSoft CSS PSSTYLEDEF so that the users are always able to distinguish between environments.

The solution that I have employ to solve this problem is to modify the PT_BRANDING:BrandingBase class to dynamically display environment name based on the URL, like this:

captured_Image.png

PT_BRANDING Application package was meant to be used to dynamically customize the look and feel of you application and of course you can do a lot more with this but this is just a very simple example of how easy this can be done.

In order to achieve the above effect all you need is to add code to 2 methods in the class PT_BRANDING:BrandingBase

method GetUniHeaderHTML
method GetUniHeaderHTML_PIA

These methods, as the name suggests are responsible for rendering you Application Portal Header.

/*Iouri Chadour - Added to put Test Environment notification in the header&Request.ContentURI - returns your portal URL in form http://server:port/psp/PSPRC/Left(Right(&Request.ContentURI, 4), 3) - extracts the significant piece to displayon the header*/
&zEnvName = Left(Right(&Request.ContentURI, 4), 3);
&Greeting = &zEnvName | " Environment " | ", UserID:" | %UserId | ", Name: " | %UserDescription;
/* End Mod */

/* This code below is delivered checks for client browser to ensure that Header is displayed correctly */

If &navTheme.isNS4x() Then    &UniHeaderHTMLPIA = GetHTMLText(HTML.PORTAL_UNI_HEADER_NS4X, &Response.GetImageURL(Image.NEW_PS_LOGO), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBRCRV), " ", " ", &FavoritesHTML, &AddToFavoritesHTML, &HelpHTML, "", &Response.GetImageURL(Image.NEW_PORTAL_HDR_CRV), &Response.GetImageURL(Image.NEW_PORTAL_HDR_BG), &Response.GetImageURL(Image.NEW_PORTAL_HDR_BG), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBRCRV), &Response.GetImageURL(Image.NEW_PORTAL_HDR_SHD), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBR), &styleSheet, &homeURL, &startURL, &AddToFavFormHTML, &LogoutURL, MsgGetText(95, 400, "Return Home"), /*20*/MsgGetText(95, 401, "Home"), MsgGetText(95, 402, "Return to Menu"), MsgGetText(95, 403, "Menu"), MsgGetText(95, 408, "Sign out"), &Greeting, &SearchHTML, &ColSpanHTML, &PersonalizeHTML, "", "", &HelpJSHTML, &homepageJS, "", &TabHTML, &WLHTML, &domainScript, &Response.GetJavaScriptURL(HTML.PT_SAVEWARNINGSCRIPT), "", &SaveWarnCrossDomainScript, &Response.GetImageURL(Image.PT_HOME_TAB_ACTIVE_CENTER), &Response.GetImageURL(Image.PT_HOME_TAB_INACTIVE_CENTER), /*40*/&Response.GetImageURL(Image.PT_HOME_TAB_LINE), %Request.ExpireMeta, &CTIHTML, &MCFHTML, &PPMHTML, &Charset);ElseElse    &UniHeaderHTMLPIA = GetHTMLText(HTML.PORTAL_UNI_HEADER_NNS, &Response.GetImageURL(Image.NEW_PS_LOGO), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBRCRV), "", "", &FavoritesHTML, &AddToFavoritesHTML, &HelpHTML, "", &Response.GetImageURL(Image.NEW_PORTAL_HDR_CRV), &Response.GetImageURL(Image.NEW_PORTAL_HDR_BG), &Response.GetImageURL(Image.NEW_PORTAL_HDR_BG), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBRCRV), &Response.GetImageURL(Image.NEW_PORTAL_HDR_SHD), &Response.GetImageURL(Image.NEW_PORTAL_HDR_TBR), &styleSheet, &homeURL, &startURL, &AddToFavFormHTML, &LogoutURL, MsgGetText(95, 400, "Return Home"), /*20*/MsgGetText(95, 401, "Home"), MsgGetText(95, 402, "Return to Menu"), MsgGetText(95, 403, "Menu"), MsgGetText(95, 408, "Sign out"), &Greeting, &SearchHTML, &ColSpanHTML, &PersonalizeHTML, "", "", &HelpJSHTML, &homepageJS, MsgGetText(95, 138, "Tool Bar Header"), &TabHTML, &WLHTML, &domainScript, &Response.GetJavaScriptURL(HTML.PT_SAVEWARNINGSCRIPT), "", &SaveWarnCrossDomainScript, &Response.GetImageURL(Image.PT_HOME_TAB_ACTIVE_CENTER), &Response.GetImageURL(Image.PT_HOME_TAB_INACTIVE_CENTER), /*40*/&Response.GetImageURL(Image.PT_HOME_TAB_LINE), %Request.ExpireMeta, &CTIHTML, &MCFHTML, &PPMHTML, &Charset); End-If;
Comments
  1. Srinivas |
  2. Iouri Chadour |
  3. psdb |
  4. Iouri Chadour |
  5. psdb |
  6. Iouri Chadour |
  7. Iouri Chadour |
  8. PSDB |
  9. Iouri Chadour |
  10. Dennis Lovelady |
  11. Iouri "Yury" Chadour |
  12. Aravind |
  13. Iouri "Yury" Chadour |

I really want to know what you think