Thursday, July 22, 2010

The Code is now Available!

The code for my new book PeopleSoft PeopleTools Tips & Techniques is now available. There is a download link on the book's McGraw Hill page. Look for the Downloads section. Enjoy!


Ciphersbak said...



Neeraj Kholiya said...

Hi Sir

On chapter 5 on Iscript , I have a question . In some organization , Employee doesn't have access for direct access for URL server and it is routed through proxy server . Just wondering , how can we handle this situation ?

Neeraj Kholiya said...

Hi Sir

I have a question chapter 5 iscript , some org doesn't allow to access direct webservr and alll request are routed through a proxy server . I am just wondering , how can we generate ISCRIPT URL than ?

Jim Marion said...

@Neeraj, the GenerateScriptContent and GenerateScriptPortal URL will generate an iScript URL according to your web profile and/or node configuration or even the incoming request information (if the other information isn't configured). Generally speaking, with a reverse proxy, you will set the reverse proxy server information in your web profile.

Essentially, iScript access through a proxy is no different from regular page/component access. If your users can access PeopleSoft pages, then they will be able to access iScripts.

bp2009 said...

Hi Jim, I was able to store the uncompressed jQuery in our PeopleTools 8.50 HTML object. Could you please elaborate the use of %JavaScript meta-HTML and Response.GetJavaScriptURL method in Tools 8.50 to server JavaScript libraries. How do I replace the Fuction IScript_jQuery in page 243 to reference the libraries I stored in HTML.
Thanks so much.
B. Pham

Jim Marion said...

@bp2009, you are correct. There is no size limit in PT 8.50, where there was a size limit in prior releases (I mention this on page 241).

%JavaScript generates a URL. As delivered, there are certain types of HTML definitions that allow you to use %JavaScript to acquire a URL to the HTML definition. PeopleSoft will copy the HTML definition to a cache file on your web server. If the file already exists in the cache, then %JavaScript returns the URL for the existing file. The %Response.GetJavaScriptURL does the same thing. The difference between the two is that you can use %Response.GetJavaScriptURL all the time. It always works. The delivered %JavaScript Meta-HTML only works for certain conditions.

Page 243 uses an iScript to serve JavaScript. To use the same iScript, you would replace MsgGetExplainText with GetHtmlText. If you want to use %Response.GetJavaScriptUrl, then you can completely ignore the iScript on page 243. What you would do is update the location that uses the jQuery iScript. In the place where you use the iScript, you would replace GenerateScriptContentURL with %Response.GetJavaScriptURL. The iScript and %Response.GetJavaScriptURL approaches have different merits. Generally speaking %Response.GetJavaScriptURL is better (although you can implement browser and proxy caching for the iScript). If you have a JavaScript that you want to secure, then the iScript approach is appropriate. %Response.GetJavaScriptURL and %JavaScript have no security mechanism whereas iScripts are secured through the WEBLIB security on permission lists. Of course, if you have a JavaScript that should be public, then using %Response.GetJavaScriptURL would be much easier because you don't have to configure security.

In this comment, I specifically referred to the delivered %JavaScript Meta-HTML. In chapters 9 and 15, I provide code for creating your own Meta-HTML processor (which uses %Response.GetJavaScriptURL). Chapter 9 introduces the idea and Chapter 15 creates a production ready version of a Meta-HTML processor.

PE said...

This is an LDAP question.

I am trying to connect to ldap to retrieve the groups a dn is associated with.

In an LDAP explorer tool, for a specific user, I I see multiple entries of 'memberof' attribute.

However, when I loop thru the attributes of the user , ( for some reason, the code is retrieving only one memberof attributes ) for the user.

It almost seems that the current implementation supports only one attribute name per user.

Consequently, I have to fire another query to get all the groups for the dn. ( An extra ldap call, which I would like to avoid )

Is this the expected behaviour or can something be done to avoid the extra LDAP call ?


Unknown said...

Hi Jim,
I have a question with regards to the mobile application.
We have a component that is based on the approval component. I created a CI out of this component and then a webservice (that's the easy bit).
The component has quite a bit of peoplecode especially with buttons like approve, deny and pushback. Those 3 buttons plus some fields need to be displayed on the BB so managers can approve etc. on their BB if need be.
I was hoping I'd find a solution in your book but unfortunately, I couldn't.
I have followed your walkthrough with the mobile application successfully but this CI/Webservice is slightly different as we don't really need a search page. Could you give me just a bit of a hint as to how to go about it without having to code everything within the JDeveloper? Or have I missed it in the book?
Will I have to create a service, message and service operation? And then a webservice? Your help is appreciated. Oh, I know Java and am quite good with Integration Broker.

Jim Marion said...

@Jane, for the sake of brevity and simplicity, I went with a very simple search page. I'm sure you already figured out how to expand that example to a data entry page. It is the same as the search page, in that you drag the parameter section onto the page and drop it as a trinidad parameter form.

It sounds like the question now is how to execute the FieldChange PeopleCode for the buttons in the CI. I have done that with PeopleCode and CI's, but not through web services. I would imagine it would be the same. In a CI, the field behind the button is usually represented as a single character field. All you have to do is set the value of that field, for example, setting it to "Y". Next question... how do you represent a web service character field as a button and bind it to a button? I'm actually not sure. I haven't tried it yet. But if you are interested in trying, as I'm sure you are, I can think of a couple of ideas:

1. The web service data control object model is available to your server side Java. You may be able to create a bean with a method that updates the CI button field value and bind that bean's method to a Trinidad button using expression language. The code in your bean will access the data control's object model in a manner similar to the code in the MobileDCLogin sample in chapter 14. See \0071664939_code\chapter14\MobileDCLogin\MobileView\src\apt\peoplesoft\mobile\view\ for how to get a reference to the web service data control using Expression Language.

2. Make it so the CI button character field ends up on the page as an invisible field. Add another button to the page and update the value of the invisible field using either JavaScript or EL.


Option 2 sounds easier, but I think option 1 is the recommended method, considering that not all devices support JavaScript.

One other thing to check... Make sure your CI button fields are enabled in the CI itself. Sometimes they are marked as exclude or marked read only.

I need to write another manual on Mobile. A 40 page tutorial is just enough to spark some ideas.

Manoj said...

Hi Jim, a wonderful book indeed.

In Chapter 06, where you explain making the bookmarklet using the regexp match, I feel it is better to use "window.location.pathname.match" instead of window.frames.

I understand that the intention of starting the trace is when you are on a page. But yeah, the first statement would enable you to trigger the trace from anywhere

Jim Marion said...

@Manoj, this is a difficult issue. Neither the window.frames["TargetContent"] approach or the window.location approach capture all possible situations. Here are the possibilities:

1) window.location and window.frames["TargetContent"] point to the same PeopleSoft system (stand alone install)
2) window.location and window.frames["TargetContent"] point to separate systems (Enterprise Portal install)
3) window.location does not have frames and content comes from the same PeopleSoft system (no frames CREF template)
4) window.location does not have frames and content comes from a separate PeopleSoft system (no frames CREF template)
5) window.location has frames, but the TargetContent is an iScript or other content that doesn't have the PeopleSoft strCurrUrl variable

The purpose is to turn on tracing at the transaction app server, not necessarily the portal app server. strCurrUrl works for PeopleSoft pages/components shown in a PeopleSoft frameset. It won't work for pages/components shown in a non frames template or non-component content shown regardless of the template. The window.location concept will work with all URL's as long as the content is served by the same app server as the portal. Another solution to this would be to use Ajax to send window.location.href back to an iScript, use the Portal API to determine the source app server URL, and then send an Ajax request to that server to turn on tracing. This approach assumes that the URL for the top level displayed content is registered in your portal (app or enterprise), and I think that is a reasonable assumption. Unfortunately, though, I'm not sure if the Ajax for this would fit in a bookmarklet.

You bring up a good point, though, and that is that window.location is a better alternative for stand-alone installations. Unfortunately, it won't work for transactions shown through Enterprise Portal, though because the web server at window.location for Enterprise Portal is usually not the web server for the transaction.

truffing said...


I'm working my way through the jquery section in your book. I'm on page 241. I have saved the jquery library to an HTML, and called it using the %response. I noticed in the lower left hand corner of the browser an error message. I was wondering if you had any ideas on how to resolve the following:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; MS-RTC LM 8; Oakwood Healthcare; .NET4.0C; .NET4.0E; InfoPath.3; Oakwood Healthcare)
Timestamp: Fri, 5 Apr 2013 17:06:02 UTC

Message: Expected ';'
Line: 5
Char: 6
Code: 0

I have named my html HK9_JQUERY_LIBRARY, the cached version is given the 302 number. I'm wondering if a direct copy and paste of the library is causing the issue. Formatting maybe? It's driving me nuts at the moment.

Jim Marion said...

@truffing, Unfortunately, that isn't enough to go off. Do you have Firefox and Firebug? You can also try IE developer tools, but having the JavaScript console on Firebug is really helpful.