Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Friday, November 30, 2018

Query Transformations

I rarely do much work in PS Query, but while doing some other troubleshooting for PS Query related issues, I noticed the "Transformations" tab in Query Manager. I am running PT 8.56.x in HCM 9.2, but looks like this has been around since 8.53 or 8.54. 

So decided to do a quick test to see what this does and how it works. So the benefit here is that the output can be transformed to create reports right out off the output delivered by PS Query.

So as part of this POC used any existing query. Transforming the output to HTML and using a XSL transformation to highlight the row when a certain condition is matched.

On the Transformation tab within Query Manager, click on Add XSLT which opens a window to key in free-form XSLT text. It would have been nice if there is a wizard of some sort to build the XSLT. 

Gave it a Name and in the "Output File Type" lookup selected HTML. Following are the available choices - 001, A01, ABA, AET, APC, CSS, CSV, D01, DAT, DTD, DTL, ERR, GIF, GIR, HTM, HTML, IDX, JCD, JS, LIS, LOG, MDL, MT9, N01, NVT, NXT, OUT, PS, SQL, STDOUT, SYS, TMP, TRC, TRN, TXT, XLSM, XLSX, XML, XSD, ZIP

Not sure what is the difference between HTM and HTML, but I selected HTML. My sample XSLT is designed as follows.

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html>
<!-- defined a style for the row that is going to be highlighted -->
<style type="text/css">
tr.redRow td {
font-size: 100%;
font-family: calibri;
font-weight:bold;
background-color: #FF2626;
padding-right: 10px;
color:#000;
}
</style>
<body>
<!-- in the html body defined a html table --> <table border="1">
<!-- Added a heading --> <font color="blue"> <h2>Sample Transformation test</h2> </font>
<!-- defined column headers --> <tr> <th>Employee ID</th> <th>Last Name</th> <th>First Name</th>
<th>Location</th> </tr>
<!-- Here I am selecting the data from PS Query --> <xsl:for-each select="query/row"> <tr>
<!-- defined a if condition to check if -->
<!-- value is McLean then highlight the row --> <xsl:if test="L.DESCR='McLean'"> <xsl:attribute name="class">redRow</xsl:attribute> </xsl:if>
<!-- Output the PS Query results --> <td> <xsl:value-of select="A.EMPLID" /> </td> <td> <xsl:value-of select="C.LAST_NAME" /> </td> <td> <xsl:value-of select="C.FIRST_NAME" /> </td> <td> <xsl:value-of select="L.DESCR" /> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>

So saved this and hit the preview button to preview the results. My query uses runtime prompts so those pop'ed up first, provided values for them and results are displayed in a new window (disable pop-up blocker or allow pop-up for this site).


Sample Transformation test


Employee IDLast NameFirst NameLocation
12345DoeJohnMadrid
13244DoeJaneEgypt
43423HuftonAbcdeLondon
42343FlemingJillMcLean
34423TiboldJozsefLondon
67554FarrellWilliamJohannesburg
43556MyersTonyIreland
75757KramerNicoleMcLean
27341WadaMarkNew York
27045RogerWaiMcLean
27098WayneJessicaNew York
27125GarciaGuillermoNew York
75688Deepak ShirguppiMaryland

If this query is scheduled using Query Scheduler option then a new format of XFORM is available and then I can pick any transformations (can define n number of transformations) that I have defined on the query.









Wednesday, August 19, 2015

Configuring Microsoft IIS 7.0 as a RPS

This post describes how to proxy content to a single server configuration of PIA. In a production environment, a multi server configuration would be used to perform these steps to proxy content to your managed server instance of PIA, PIA1, PIA2, and so on.

Microsoft Internet Information Server (IIS) can be configured as a reverse proxy server (RPS) for one or more WebLogic Server instances. Multiple instances can either be independent instances, or grouped into a cluster. When using a reverse proxy, all URLs that are used to access your PeopleSoft application (even URLs that are stored in the database), need to point to the reverse proxy, and not to the WebLogic server.

Oracle only supports IIS 7.0 as an RPS on Windows Server 2008 x64 Standard Edition, or Enterprise Edition environments. These instructions are based on a physical separation of WebLogic Server and Microsoft IIS 7.0, where both web servers are installed on different VMs.

First verify/enable CGI or ISAPI Extensions on IIS.

WINDOWS SERVER 2008 OR WINDOWS SERVER 2008 R2

1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.

2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).

3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.

4. On the Select Role Services page of the Add Role Services Wizard, select CGI or ISAPI Extensions.





























5. If the Add role services dialog appears, click Add Required Role Services. (This page appears only if you have not already installed any prerequisite role services on your server.)

6. On the Select Role Services page, click Next.

7. On the Confirm Installation Selections page, click Install.

8. On the Results page, click Close.





































Create RPS site in IIS

1. Create a web application in IIS Manager:
    a. Right click Web Sites and select Add Web Site.
    b. Enter the web site name of your web application.
    c. Select the path of your web application port that can be any valid port number not currently in use.
   d. Click OK button to create the web application.
If you can see the name of your application under Web Sites it means that your application has been created and started running.












From the WebLogic server, copy WL_HOME\server\plugin\win\x64\iisproxy.dll to c:\inetpub\psrps
From the WebLogic server, copy WL_HOME\server\plugin\win\x64\iisforward.dll to c:\inetpub\psrps

2. Click the web application node under Web Sites to see all the settings related to the application.

3. Click Handler Mappings link to set the mappings to the handler for a particular MIME type.

4. Click StaticFile link and change the Request path field from * to *.*. Click OK.
















5. In Features View, on the server, site, or applicationHome page, double-click Handler Mappings. On the Handler Mappings page, in the Actions pane, click Add Script Map… under the Actions panel on right-hand side.

6. The Edit Script Map dialog box appears. Enter * for the Request path.

7. Browse to the iisproxy.dll file in Executable field. Name it proxy.

8. Click Request Restrictions… button and deselect the Invoke handler only if the request is mapped to check box.

9. Click OK to add this Handler mapping. Click Yes on the Add Script Map dialog box.













10. Close IIS Manger and restart it. Click Root node of the IIS Manager tree and click ISAPI and CGI Restrictions. Select Allow unspecified ISAPI modules check box.














11. Create a file called iisproxy.ini with the following contents and place it in the directory with the plug-in:

WebLogicCluster=server1:80,server2:80
DynamicServerList=ON
ConnectRetrySecs=5
ConnectTimeoutSecs=25
Debug=ALL
DebugConfigInfo=ON
KeepAliveEnabled=true
WlForwardPath=/psp,/psc
WLCookieName=SERVER-80-PORTAL-PSJSESSIONID
WLLogFile=C:/inetpub/psrps/logs/psprs.log
SecureProxy=OFF




































Add user IUSR to the psrps folder and also to the psrps\logs folder too.


PeopleSoft Setup

cookie-name tag in the weblogic.xml file of PIA1, PIA2 etc should have the same value. e.g. SERVER-80-PORTAL-PSJSESSIONID

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">

<description>PeopleSoft Internet Architecture</description>

<!-- Coherence*Web Library - Resolution 863761
  <library-ref>
      <library-name>coherence-web-spi</library-name>
  </library-ref>
-->

  <session-descriptor>
  <id-length>32</id-length>
  <cookie-name>SERVER-80-PORTAL-PSJSESSIONID</cookie-name>
  <cookie-domain>.company.com</cookie-domain>
  <monitoring-attribute-name>USERID</monitoring-attribute-name>
  <persistent-store-table>wl_servlet_sessions</persistent-store-table>
  <http-proxy-caching-of-cookies>true</http-proxy-caching-of-cookies>
  </session-descriptor>
    <container-descriptor>
      <servlet-reload-check-secs>-1</servlet-reload-check-secs>
      <session-monitoring-enabled>true</session-monitoring-enabled>
  </container-descriptor>
  <context-root>/</context-root>
</weblogic-web-app>

In web profile - update the General and Virtual Addressing tab as shown below.










Monday, December 19, 2011

HTML based notifications

PeopleSoft provides functions and procedures to send email notifications. Most of the times we send simple text messages and attach reports, generally in PDF format to these notifications. The following post, explores the possibility of generating a report via XMLP and then sending a notification to an email client like MS Outlook in HTML format. The distribution type of "email" that is natively available via XMLP just doesn't cut it. Its very tedious to change the subject/body of the notification and then the report is sent as an attachment and not the body the notification.

For this POC, I am using a HR 9.1 PeopleSoft system running on PT 8.51.10 and my email client is MS Outlook 2007. The exchange server is running MS Exchange 2003. I am executing the following code via an AE program. Some changes needed if using it via an online trigger like FieldChange.
I will be using the SendMail function instead of PeopleSoft MultiChannel Framework mail classes. To do the same via MCF mail classes is another post, some other day.

/* this section details the steps to create the report in HTM format and store it in a folder location */
SQLExec("select PRCSOUTPUTDIR from PSPRCSPARMS where PRCSINSTANCE = :1", N_RECORD_AET.PROCESS_INSTANCE, &dir);
&REPORTDEFN.OutDestination = &dir | "\"; /* This will create the output under the temp directory used by the process scheduler */
&REPORTDEFN.ProcessReport(&template, "", %Date, "HTM"); /* generating the report in HTM format */
&REPORTDEFN.Publish("", "", "", N_RECORD_AET.PROCESS_INSTANCE);

/* the following section, sets up the parameters of the SendMail function and sends the notification */
&EmailSQL = CreateSQL("select EMAIL_ADDR from PS_EMAIL_ADDRESSES where EMPLID = :1 and PREF_EMAIL_FLAG = 'Y'", &EmplID);
&EmailSQL.Fetch(&email_addr);
If All(&email_addr) Then
      &MAIL_FLAGS = 0;
      &MAIL_TO = &email_addr;
      &MAIL_CC = "";
      &MAIL_BCC = "";
      &MAIL_SUBJECT = "PeopleSoft Report";
/* here I am reading the htm report file in UTF-8 mode and then use that to populate the "body" variable */
      &fullfile = "";
      &reportfilepath = &dir | "\N_REPORT.htm";
      &html_file = GetFile(&reportfilepath, "R", "UTF-8", %FilePath_Absolute);
      While &html_file.ReadLine(&Text)
         &fullfile = &fullfile | &Text;
      End-While;
      &html_file.close();
      &MAIL_TEXT = &fullfile;

      /* this will takre care of only one image */
      &imgpath = &dir | "\*.png";
      &FileList = FindFiles(&imgpath, %FilePath_Absolute);
      &filepath = &FileList.Shift();
      &MAIL_FILES = &filepath;
     
      &pos = Find("xdo", &filepath);
      &MAIL_TITLES = Substring(&filepath, &pos, Len(&filepath) - &pos + 1);
     
      &CONTTYPE = "Content-type: text/html; charset=utf8";
      &MAIL_SENDER = "PeopleSoft@test.com";
     
      &RET = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_TEXT, &MAIL_FILES, &MAIL_TITLES, &MAIL_SENDER, ";", &CONTTYPE);
      If Not (&RET = 0) Then
         Warning ("Return status from mail = " | &RET);
      End-If;
Else
      Warning ("No Email Addresses found for " | &EmplID);
End-If;

Thats it. It produces a nice and chic looking HTML notification.