Jim J Marion
Wenatchee, WA


 
WRITTEN WORKS:

PeopleSoft PeopleTools Tips & Techniques
Published on: 2010-06-22
Copyright: 2010
More Info



BLOG:

OpenWorld 2014
2014-09-05T09:24:00.001-07:00

OpenWorld is only a couple of weeks away. As always, this promises to be an outstanding conference. Whether your focus is functional or technical, OpenWorld has a lot of PeopleSoft sessions. The Focus on PeopleSoft OpenWorld document contains a good list of PeopleSoft focused sessions and events. I look forward to seeing you at OpenWorld this year. Here are some of the places and times where you can find me:

Monday

Demo Grounds: PeopleSoft User Experience from 12:00 PM to 2:00 PM

Tuesday

Demo Grounds: PeopleSoft User Experience from 9:45 AM to 11:00 AM


Session ID: CON7568
Session Title: PeopleSoft PeopleTools Developer: Tips and Techniques
Venue / Room: Moscone West - 3004/3006
Date and Time: 9/30/14, 17:00 - 17:45

Wednesday

Demo Grounds: PeopleSoft User Experience from 9:45 AM to 12:00 PM

Thursday


Session ID: CON7537
Session Title: Connecting PeopleSoft HCM, Oracle Taleo, Oracle HCM Cloud, and More
Venue / Room: Palace - Twin Peaks South
Date and Time: 10/2/14, 9:30 - 10:15

Meet the Authors Book Signing at the OpenWorld Bookstore in Moscone South Upper Hall Lobby from 1:00 PM to 1:30 PM.

See you there!!


Up and Running with HCM 9.2 on PT 8.54 via PUM "Demo Image"
2014-08-21T10:57:00.000-07:00

Yes, you read that correctly. PUM is the new demo image. According to MOS Doc ID 1464619.1 "As of HCM 9.2.006, the PeopleSoft Image and PeopleSoft Demo Image have been combined into one PeopleSoft Update Image. You can use the PeopleSoft Update Image for both your patching and demonstration purposes." If you are current on your PUM images, you probably already knew that. If you are like me, however, and haven't downloaded a demo image for a while, then you may have been looking for demo images on the old MOS demo image page.

Since I use the image for prototyping and demonstrations, I turned off SES and reduced the memory requirements to 2048 MB. It is working great at this lower memory setting.

There are a lot of new and great features in the PT 8.54 PUM:

  • Attribute based branding,
  • Component Branding (add your own CSS and JavaScript to components without hacking a delivered HTML definition)
  • REST Query Access Service,
  • Mobile Application Platform (MAP), and
  • Fluid homepages

Tip: Access the fluid homepages by visiting the URL http://<yourserver>:8000/psc/ps/EMPLOYEE/HRMS/c/NUI_FRAMEWORK.PT_LANDINGPAGE.GBL. For example, if you have a hosts entry mapping your PUM image to the hostname hcmdb.example.com, then use the URL http://hcmdb.example.com:8000/psc/ps/EMPLOYEE/HRMS/c/NUI_FRAMEWORK.PT_LANDINGPAGE.GBL.


Accessing Database Photos from Query Access Service
2014-08-18T22:47:00.000-07:00

I have been working with the PeopleTools 8.54 REST Query Access Services. I would absolutely LOVE them if they returned JSON instead of XML. With a little help from x2js I am able to work around this "shortcoming." One specific challenge I faced was accessing image data. For example, with PeopleSoft query I can see who has photos in PS_EMPL_PHOTO, but I can't see the actual uploaded photo. With a little help from Oracle and a query expression, however, I can convert the photo blob into base64:

SELECT UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(EMPLOYEE_PHOTO))
FROM PS_EMPL_PHOTO
WHERE EMPLID = 'KU0003'

The only problem with this approach is that Oracle database has a maximum size limit on data that can be encoded and most of the photos I have seen exceed that maximum. The way I chose to work around this limitation is to substring the blob and encode it in fragments. I create a separate column for each fragment, and then concatenate them together in the REST client. Here is some sample SQL from a PeopleSoft query. Each of the CASE statements is a query expression.

SELECT
CASE
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 1455 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, 1455, 1)))
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) <= 1455 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(EMPLOYEE_PHOTO))
END AS C1,
CASE
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 2910 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, 1455, 1456)))
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) <= 2910 AND DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 1455 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) - 1455, 1456)))
END AS C2,
CASE
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 4365 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, 1455, 2911)))
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) <= 4365 AND DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 2910 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) - 2910, 2911)))
END AS C3,
CASE
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 5820 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, 1455, 4366)))
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) <= 5820 AND DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 4365 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) - 4365, 4366)))
END AS C4,
CASE
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 7275 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, 1455, 5821)))
WHEN DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) <= 7275 AND DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) > 5820 THEN UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(DBMS_LOB.SUBSTR(EMPLOYEE_PHOTO, DBMS_LOB.GETLENGTH(EMPLOYEE_PHOTO) - 5820, 5821)))
END AS C5
FROM PS_EMPL_PHOTO
WHERE EMPLID = 'KUL704'

On the client I use something like this:

var data = data:image/jpeg;base64," + columns.join("");

The end result is something like this (right-click to see base64 data):

Mikko,Jill's Photo


PeopleTools 8.54 Upgrade now Available
2014-08-15T22:38:00.001-07:00

Today Matthew Haavisto of the PeopleTools strategy team announced that the PeopleTools 8.54 upgrade is now available. Visit the PeopleSoft Technology Blog to learn more.


"Private" App Class Members
2014-07-30T23:23:00.001-07:00

I was reading Lee Greffin's post More Fun with Application Packages -- Instances and stumbled across this quote from PeopleBooks:

A private instance variable is private to the class, not just to the object instance. For example, consider a linked-list class where one instance needs to update the pointer in another instance.

What exactly does that mean? I did some testing to try and figure it out. Here is what I came up with:

  1. It is still an instance variable which means each in-memory object created from the App Class blue print has its own memory placeholder for each instance member.
  2. Instances of other classes can't interact with private instance members.
  3. Instances of the exact same class CAN interact with private members of a different instance.
  4. Private instance members differ from static members in other languages because they don't all share the same pointer (pointer, reference, whatever).

I thought it was worth proving so here is my sample. It is based on the example suggested in PeopleBooks:

For example, consider a linked-list class where one instance needs to update the pointer in another instance.

The linked list is just an item with a pointer to the next item (forward only). A program using it keeps a pointer to the "head" and then calls next() to iterate over the list. It is a very common pattern so I will forgo further explanation. Here is a quick implementation (in the App Package JJM_COLLECTIONS):

class ListItem
method ListItem(&data As any);
method linkTo(&item As JJM_COLLECTIONS:ListItem);
method next() Returns JJM_COLLECTIONS:ListItem;
method getData() Returns any;
private
instance JJM_COLLECTIONS:ListItem &nextItem_;
instance any &data_;
end-class;

method ListItem
/+ &data as Any +/
%This.data_ = &data;
end-method;

method linkTo
/+ &item as JJM_COLLECTIONS:ListItem +/
&item.nextItem_ = %This;
end-method;

method next
/+ Returns JJM_COLLECTIONS:ListItem +/
Return %This.nextItem_;
end-method;

method getData
/+ Returns Any +/
Return %This.data_;
end-method;

Notice the linkTo method sets the value of the private instance member of a remote instance (its parameter), NOT the local instance. This is what is meant by private to the class, not private to the instance. Each instance has its own &nextItem_ instance member and other instances of the exact same class can manipulate it. Here is the test case I used to test the remote manipulation implementation:

import TTS_UNITTEST:TestBase;
import JJM_COLLECTIONS:ListItem;

class TestListItem extends TTS_UNITTEST:TestBase
method TestListItem();
method Run();
end-class;

method TestListItem
%Super = create TTS_UNITTEST:TestBase("TestListItem");
end-method;

method Run
/+ Extends/implements TTS_UNITTEST:TestBase.Run +/
Local JJM_COLLECTIONS:ListItem &item1 =
create JJM_COLLECTIONS:ListItem("Item 1");
Local JJM_COLLECTIONS:ListItem &item2 =
create JJM_COLLECTIONS:ListItem("Item 2");

&item2.linkTo(&item1);

%This.AssertStringsEqual(&item1.next().getData(), "Item 2",
"The next item is not Item 2");
%This.Msg(&item1.next().getData());
end-method;

The way it is written requires you to create the second item and then call the second item's linkTo method to associate it with the head (or previous) element.

Now, just because you CAN manipulate a private instance member from a remote instance doesn't mean you SHOULD. Doing so seems to violate encapsulation. You could accomplish the same thing by reversing the linkTo method. What if we flipped this around so you created the second item, but called the first item's linkTo? It is really the first item we want to manipulate in a forward only list (now, if it were a multi-direction list perhaps we would want to manipulate the &prevItem_ member?). Here is what the linkTo method would look like:

method linkTo
/+ &item as JJM_COLLECTIONS:ListItem +/
%This.nextItem_ = &item;
end-method;

Now what if we wanted a forward AND reverse linked list? Here is where maybe the ability to manipulate siblings starts to seem a little more reasonable (I still think there is a better way, but humor me):

class ListItem
method ListItem(&data As any);
method linkTo(&item As JJM_COLLECTIONS:ListItem);
method next() Returns JJM_COLLECTIONS:ListItem;
method prev() Returns JJM_COLLECTIONS:ListItem;
method remove() Returns JJM_COLLECTIONS:ListItem;
method getData() Returns any;
private
instance JJM_COLLECTIONS:ListItem &nextItem_;
instance JJM_COLLECTIONS:ListItem &prevItem_;
instance any &data_;
end-class;

method ListItem
/+ &data as Any +/
%This.data_ = &data;
end-method;

method linkTo
/+ &item as JJM_COLLECTIONS:ListItem +/
REM ** manipulate previous sibling;
&item.nextItem_ = %This;
%This.prevItem_ = &item;
end-method;

method next
/+ Returns JJM_COLLECTIONS:ListItem +/
Return %This.nextItem_;
end-method;

method prev
/+ Returns JJM_COLLECTIONS:ListItem +/
Return %This.prevItem_;
end-method;

method remove
/+ Returns JJM_COLLECTIONS:ListItem +/
%This.nextItem_.linkTo(%This.prevItem_);
REM ** Or manipulate both siblings;
REM %This.prevItem_.nextItem_ = %This.nextItem_;
REM %This.nextItem_.prevItem_ = %This.prevItem_;
Return %This.prevItem_;
end-method;

method getData
/+ Returns Any +/
Return %This.data_;
end-method;

And here is the final test case

import TTS_UNITTEST:TestBase;
import JJM_COLLECTIONS:ListItem;

class TestListItem extends TTS_UNITTEST:TestBase
method TestListItem();
method Run();
end-class;

method TestListItem
%Super = create TTS_UNITTEST:TestBase("TestListItem");
end-method;

method Run
/+ Extends/implements TTS_UNITTEST:TestBase.Run +/
Local JJM_COLLECTIONS:ListItem &item1 =
create JJM_COLLECTIONS:ListItem("Item 1");
Local JJM_COLLECTIONS:ListItem &item2 =
create JJM_COLLECTIONS:ListItem("Item 2");
Local JJM_COLLECTIONS:ListItem &item3 =
create JJM_COLLECTIONS:ListItem("Item 3");

&item2.linkTo(&item1);

%This.AssertStringsEqual(&item1.next().getData(), "Item 2",
"Test 1 failed. The next item is not Item 2");
%This.AssertStringsEqual(&item2.prev().getData(), "Item 1",
"Test 2 failed. The prev item is not Item 1");

&item3.linkTo(&item2);
%This.AssertStringsEqual(&item1.next().next().getData(), "Item 3",
"Test 3 failed. The next.next item is not Item 3");
%This.AssertStringsEqual(&item1.next().next().prev().getData(), "Item 2",
"Test 4 failed. The prev item is not Item 2");

Local JJM_COLLECTIONS:ListItem &temp = &item2.remove();
%This.AssertStringsEqual(&item1.next().getData(), "Item 3",
"Test 5 failed. The next item is not Item 3");
%This.AssertStringsEqual(&item1.next().prev().getData(), "Item 1",
"Test 6 failed. The prev item is not Item 1");

end-method;

I hope that helps clear up some of the confusion around the term "private" as it relates to Application Classes.


List of PeopleSoft Blogs
2014-07-29T22:49:00.000-07:00
It has been amazing to watch the exponential growth in the number of PeopleSoft community bloggers. It seems that most of them have links to other PeopleSoft blogs, but where is the master list of PeopleSoft blogs? Here is my attempt to create one. Don't see your blog on the list? Add a comment and I'll review your blog. If your blog is education oriented, then I will put it in the list... and probably delete your comment (that way you don't have to feel awkward about self promotion). There are some PeopleSoft related blogs that I really wanted to include, but they just weren't educational (more marketing than education). I suppose some could say that the Oracle blogs I included were primarily marketing focused. That is true. I included them, however, because those product release announcements are so valuable.

I have not read all of these blogs. I can't, don't, and won't attest to the quality of the content in those blogs. Each reader should evaluate the content of these blog posts before implementing suggestions identified in these blogs and their corresponding comments.


     
    Author Profile
    Name: Jim J Marion
    Location: Wenatchee, WA
    Subjects: Applications;
    Regions: Europe; US/East Coast; US/Midwest; US/South; US/West Coast;


    Website: Jim's PeopleSoft Journal

    Copyright © 2013 McGraw-Hill Global Education Holdings, LLC Any use is subject to the Terms of Use and Privacy Notice