Extending PeopleSoft FTPClient App Package Class

This post will be covering a few items under the same topic.

We ran into problems with the built in FTP PeopleCode functions with 8.51.  So for example, to use GetAttachment, one of the parameters you are to supply is URLDestination, which would resolve to something like:

ftp://anonymous:hobbit1@ftp.ps.com

Where anonymous is the user name, and hobbit1 the password.

If you are in an Active Directory situation, and the domain needs to be a part of the username:

<domain name>/<user name>

With tools 8.51 that slash throws an error.  So to resolve this we stopped using the built-in functions, replaced them with calls to the supplied HCSC:FTP:CLIENT:FTPClient Application Package/Class.

The class FTPClient calls an open source netcomponents.jar file, provided by www.savarese.org.

There is a problem with the delivered app package however, the developers never allowed for the FTP return codes.  I’m providing a simple fix. While I was at it, I added FTP rename and delete functionality.

I created an App Package, then added a new class with the methods I wanted:

class FTPClientExtended extends HCSC:FTP:CLIENT:FTPClient
/** Constructor*/
method FTPClientExtended();
/*
Returns the integer value of the reply code of the last FTP reply.
You will usually only use this method after you connect to the FTP
server to check that the connection was successful since connect is of type void.
*/
method getReplyCode() Returns integer;

/*
Returns the entire text of the last FTP server response exactly as it was received,
including all end of line markers in NETASCII format.
*/
method getReplyString() Returns string;

/*
Renames a remote file.
Parameters:from – the name of the remote file to rename.
to   – the new name of the remote file.
Returns:True if successfully completed, false if not.
*/
method rename(&from As string, &to As string) Returns boolean;

/* Deletes a file on the FTP server.
Parameters:pathname – The pathname of the file to be deleted.
Returns:True if successfully completed, false if not. */
method deleteFile(&pathName As string) Returns boolean;

protected

/** holds reference to Java ftp object */
property JavaObject _ftp;

end-class;

Note the extended keyword.  This class is now a subclass of the delivered FTPClient.

The constructor does the heavy lifting for us:

/**
Constructor
*/
method FTPClientExtended

/* Create the base class constructor */
%Super = create HCSC:FTP:CLIENT:FTPClient();

/* create pointer to Base class Java object */
&_ftp = %Super._ftp;

end-method;

We create Superclass references to the class and the base class Java object.   Take a look at the delivered FTPClient Application Class constructor:

method FTPClient

/* Create the base class constructor */
%Super = create HCSC:COMMON:BASE:JavaBase(“com.peoplesoft.hr.hr.ftpclient.ExFTPClient”);

/* create Java object for splitter */
&_ftp = %Super.getJavaObject();

end-method;

The base class FTPClient is iteslf using Superclass references.

The rest gets very straight foward:

method getReplyCode

/+ Returns Integer +/

/* Return the FTP code – use to determine if failed or successful */

Return &_ftp.getReplyCode();

end-method;

method getReplyString

/+ Returns String +/

/* Returns the entire text of the last FTP server response exactly as it  was received, including all end of line markers in NETASCII format.  */

Return &_ftp.getReplyString();

end-method;

method rename

/+ &from as String, +/

/+ &to as String +/

/+ Returns Boolean +/

Return &_ftp.rename(&from, &to);

end-method;

method deleteFile

/+ &pathName as String +/

/+ Returns Boolean +/

Return &_ftp.deleteFile(&pathName);

end-method;

By creating a new Package and class, I’ve added functionality but without having to customize the delivered code.  Come upgrade time this is (hopefully!) going to be a lot easier to deal with.

Advertisements

IE 9 and more PeopleSoft issues – white space???

How about another PeopleSoft and IE 9 story?  Gather round!

We (my company – for the rest of the story will be known as we) recently upgraded to PeopleTools 8.51.10 – our application level is 9.0.  We are a PeopleSoft HRMS shop, and use PeopleSoft Portal for our self-service customers.

So, shortly after our tools upgrade a corporate decision was made to upgrade our browser to IE 9.  Our usual in-house computer has MS Windows 7 (soon to be upgraded to SP1) with the browser standardized as Internet Explorer – currently version 8.

While we had been using PS Portal for a while the presentation was getting – well – dated is a nice way of putting it.  Our portal got amped up – a lot.  So when we took a look at our freshly delivered portal in IE 9 we noticed white space in areas that decidedly should not be white.

In essence bands of white space were being rendered in the header.  Not always tho, only when a user was clicking thru to a lower level of navigation.

Oracle admits there is a bug # 13087401: IN IE9- WHITE SPACE IS APPEARING ABOVE THE PEOPLESOFT HEADER ON EACH PAGE.

White spaces appear in IE9 only – which seems to be caused by the tags (or dir=”ltr” in general) within the HTML. These are found throughout PeopleTools.

Unfortunately – Oracle plans a final fix in Tools 8.53 – and there is no plan on back porting to earlier versions.

So, noticing that the white spaces only appeared some of the time I started looking into the code.  I found that we had an HTML template that was not used at the top most page level – but was fired once a user started drilling down.  The template started with a boilerplate declaration:

DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”&gt;

<html dir=”%Direction” lang=”%LanguageISO”>

The html root level element in the template had a dir attribute.  It seems that when PeopleTools renders a page using a template, and the template has a dir attribute in the html root level element – that gets used when span tags are generated.  So in our case span tags were getting generated as ….  In an IE 9 browser that line would get rendered as a white space.

My solution was simple – since this was only happening in the page header, I removed the dir attribute.  The second line now reads: <html lang=”%LanguageISO”>.  When the page gets rendered by PeopleTools the span tags no longer had a dir attribute; and white space was no longer being created in IE 9.

I would guess that in those situations where you needed the dir attribute then the next step would be to try inline formatting – but for now I’m not in that situation.

PeopleTools 8.51 nVision – Excel forumulas throw UnrecoverableExceptionFilter

How about an upgrade story?  We are upgrading PeopleTools from 8.48 to 8.51 – as well as upgrading from Windows 2003 32 bit server to Windows 2008 R2 64 bit server – and for a trifecta from Office 2003 to Office 2007.

Okay – so we have nVision reports that worked fine in PTools 8.48 and Excel 2003.  One of my tasks was to upgrade the nVision reports to Office 2007 and then test them in the new PTools environment.  Found this problem – which has been reported to Oracle.

Report would error out with the following as part of the log file entry:

PSPAL::Abort: Unrecoverable exception received
PSPAL::Abort: Location: E:\pt85110b-retail\peopletools\src\pspal\exception_winunhandled.cpp:594: PSPAL::UnhandledExceptionFilter::UnrecoverableExceptionFilter

Couldn’t find anything on the Oracle site, went back and forth several times with Oracle on the service call.  This nVision had several pages and a macro associated with it – the macro was run from a call by NvsInstanceHook.  I took out the call to the macro, and started removing pages – finally got it to run by removing two specific pages in the layout.

I’m not going to go thru all the steps I took to find the bug – and it is a bug – what I found was the 8.51 version of nVision does not properly handle IF formulas in cells.

There was a nested IF statement having 5 truth checks.  There was also both an AND and an OR condition in the statement.  If I whittled the formula down to three checks maximum then the layout would run to success.

Some examples are in order here.  This formula is an edited version of the original – which failed:

=IF(AND(O5<>”Condition One”, O5<>”Condition Two”, O5<>”Condition Three”), IF(OR(O5=”Condition Four”, O5=”Condition Five”), , “”), <Add a bunch of cells>)

So – if I got rid of the OR condition – in essence only going with the AND operator:

=IF(AND(O5<>”Condition One”, O5<>”Condition Two”, O5<>”Condition Three”), “”, <Add a bunch of cells>)

The layout would work fine.  Same if I only used the OR conditional portion of the formula:

=IF(OR(O5=”Condition Four”, O5=”Condition Five”), <Add a bunch of cells>, “”)

Clearly nVison can handle having formulas in cells, plus it can handle the AND and OR conditional operators – it’s the number of truth table checks in the formula nVision is having an issue with.  Which is a shame as per Microsoft you can have up to 64 nested inline IF statements in a formula.

What I finally did was break the formula down – do the AND truth table test in one cell, the OR test in another.  Those cells would be hidden in the report – what was shown was an IF statement where if the value of the AND cell was blank use the value from the OR test.

PeopleTools 8.51 nVision configuration in Windows 2008 R2 64 Bit and Office 2007

We have been upgrading to PeopleTools 8.51 recently.  The company I work for uses both PeopleSoft Financials and PeopleSoft HRMS – and I work on the HRMS side.

Currently client machines use Windows 7 with Office 2007.  Our new Windows server environment will be virtualized instances of Windows 2008 R2 in 64 bit – which does pose some problems with installing and running nVision.

After a number of conference calls with Oracle Support and a lot of trial and error here seems to be the right configuration (at least in my corporate environment – ‘your mileage may differ’) :

  1. For each database instance on the server, either using PSADMIN or directly in the psprcs.cfg configuration file, go to the [nVision] section and set the following and then restart:
    • EnableDrillDownForFile=1
    • EnablePollDialogs=1
    • UseExcelAutomation=1  NOTE – if you are going to be using any macro code at all you must have MS Office installed and this switch must also be set.
  2. In your server PSOFT installation directory appserv\prcs\ create nvision\instance folders inside each and every PSOFT database instance that will be using nVision.  So as an example, in my machine I have <Drive>:\psoft\ hrms90\appserv\prcs\<Instance Name>\NVISION\INSTANCE.
  3. In your W2008 R2  server create a C:\Windows\SysWOW64\config\systemprofile\Desktop directory.
  4. We set the psoft directory in our Windows servers as a share and grant change access in our DEV and QA environments to our dev team.
  5. We set the following Windows Services up to use a service account that is created in Active Directory, and that service account is then set up as a local admin on the server.  For some reason both of these services in installation default to the Local System Account – and the PeopleSoft PSADMIN service sets Allow service to interact with desktop. They both need to be changed to use the This Account – interaction with local desktop needs to be turned off – and the account MUST HAVE LOCAL ADMIN RIGHTS:
    • Oracle Process Manager: ORACLE ProcMGR V10gR3 with VS2008
    • Process Scheduler: PeopleSoft <path to installed instance>
  6. Log into the server with whatever account the two services are using.  My suggestion – use the same account for both services but keep it unique for your PeopleTools installation.  After logging in start Excel.  Answer all the pop-up questions that come up.  Click the Office button – the new large button on the upper left of the opened Excel workbook.  At the bottom of the opened menu you will see a button labeled Excel Options – click on that.  On the left navigation bar click on Trust Center – when the Trust Center page loads click on the Trust Center Settings button you should see on the page to the right.  Again there is a left hand navigation bar – you want Macro Settings – it’s just about in the middle of the options.  Click on Enable all macros (not recommended but if you are going to be using macro code fired by NvsInstanceHook you need to do this).  Then click in the Trust access to the VBA project object model.  Click OK on the bottom of the page but don’t leave the menu just yet.
  7. With Excel still open and the Excel Options menu open – navigate to the top of the left hand navigation.  Select Popular – when the page loads put a check mark in Show Developer tab in the Ribbon.  You may need this to work on macros.

That should do it.  Exit out of Excel, make sure the services are up and running and you should have nVision working.  However!  I have been finding a few gotchas along the way – I’ll try to detail some of those in later posts.

%d bloggers like this: