Author Archive

May 1st, 2009

Older PeopleSoft and Web 2.0 Step 2

In this blog we’ll continue where we left some time ago. The aim is to create a page containing the blocks which can be ordered by the user. First we create a new page containing some groupboxes with content. Every groupbox must be placed in a container, for we will switch groupboxes within these containers. To create a container, draw a frame around each individual groupbox and disable the frame border. To be able to address the groupboxes later, add a custom style class (added to the stylesheet), lets say ‘DRAGGABLE’ to each groupbox. Put a static html object at the bottom of your page in which we’ll put our javascript. So far for the server side.

December 18th, 2008

PeopleSoft export to formatted MS Word file using XML templates

You don’t need a program like Oracle XML Publisher to present a PeopleSoft user a formatted MS Word file, filled with PeopleSoft data. If you want to export PeopleSoft data to a formatted MS Word file, just follow these few simple steps:

  1. create a formatted xml file in MS Word containing placeholders for the PeopleSoft data. Store this xml in the database.
  2. Create a page containing an export button, which calls an IScript
  3. Create an IScript which retrieves the template from the database, fetches the data to be inserted from the database and substitutes the placeholders for the data.

In detail:

  1. Open MS Word and create and format a page normally. Create placeholders that will contain the data from the database or PeopleCode. For example {NAME}. Be sure to save the file as an XML document. We want to store the plain text “source” of the formatted XML document in the database. For this reason open the file in a plain text editor like Notepad. You can check your placeholder(s) here. Copy the contents and save them in the database. This can be in a custom table or perhaps in the message catalog. In this example we’ll use the message catalog 20.000 and item 1.
  2. Create a page in Application Designer and insert a button or hyperlink. The destination of the button is a PeopleCode command of a field in a derived record. For example DERIVED_REC.CALL_ISCRIPT. In the FieldChange event of the above mentioned field, call the ViewURL(URL_str) function. The parameter of this function is an IScript which we’ll create in the next step.
  3. Example:

    &sUrl = %Request.RequestURI | “?ICType=Script&ICScriptProgramName=DERIVED_REC.CALL_ISCRIPT.FieldFormula.ISCRIPT_XML_RESPONSE”;

    ViewURL(&sUrl);

    In newer versions you can use functions like GenerateScriptContentURL to compose the IScript URL.

  4. Create an IScript with the following content:

Function ISCRIPT_XML_RESPONSE

/* set filename */

&XMLFileName = “xml_export”;

/* set headers so the browser sends a save dialog box */

&contDisposition = “attachment; filename=” | &XMLFileName | “.doc”;

%Response.SetHeader(“content-disposition”, &contDisposition);

/* set content type to word, so MS Word can be opened */

%Response.SetContentType(“application/msword”);

/* get the template xml file */

&sXMLTpl = MsgGetExplainText(20000, 1, “XML not found”);

/* get the data */

&sName = “John Doe”;

/* substitute placeholder for the data */

&sXMLTpl = Substitute(&sXMLTpl, “{NAME}”, &sName);

/* send to browser */

%Response.Write(&sXMLTpl);

End-Function;

A couple of notes:

  • Because we are using an IScript we can’t access the component buffer data. So if you want to use content specific variables in your IScript, create some global variables in step 2 which can be addressed in the IScript.
  • Don’t forget to add the IScript to the weblibrary of your permission list.
  • When creating the xml template, turn off any spelling or grammar checks for this can disturb the xml placeholders.
  • When you’ve made an error in a placeholder, completely retype the placeholder. A partial correction can disturb the xml.

 

November 13th, 2008

Older PeopleSoft and Web 2.0 Step 1

Every PeopleSoft developer has read something about the new Oracle products incorporating web 2.0 functionality like personalized pages. But what if you’re not among the lucky developers that use those new, modern, up2date products? In this post I’d like to show how we can create web 2.0 functionality in older PeopleSoft versions step by step.

First a small introduction. At the moment I am a member of a team which is busy building Selfservice functionality for a very large oranisation. Development is done in PS HRMS 8.22. I was asked to think about a selfservice page with dynamicaly ordered content blocks. Still there? I mean that the page has several blocks containing content and the employee  must be able to organize these blocks himself.

So, what’s the plan? Let’s start by describing the big picture. We must create a page in app designer containing the blocks that shall contain the content. After that we’ll add some Javascript (client side script)  to make the blocks draggable. The order of the blocks must then be stored in the database. For this we’ll use Ajax and IScript. Almost there, hang on. The last thing to do is to make sure that if the page is reloaded / revisited we get the order of the blocks from the database with Ajax and IScript again and order the blocks.

The philosophy is that  the page is designed in app designer as always and will work without all the fancy web 2.0 stuff. We will only use the web 2.0 stuff to enhance the user experience.

In the next post we will set up a simple page with content blocks, and make these blocks draggable.

Hopefully see you then!