DataDumper Documentation

By Chris Malek | Wed, Oct 13, 2010

Documentation for the DataDumper Application package

See an Overview here

Requirements

PeopleTools 8.45 or higher

Installation

Manually Create a new application package and class. It should look like this.


Add the PeopleCode

Methods

Method dataDumper

Parameters

&FileNameIn As string

The file name that you want to create. If left blank, the method will open a file name called %operatorid_debug_file.txt".

Method Description

This is the constructor method. You pass in a file name which will be created in the PS_HOME\[APPSERV]\[domainName]\LOGS\ directory. If a file name exist with that name already on the file system the file contents will be purged.

import CHG_DEBUG:dataDumper;

Local CHG_DEBUG:dataDumper &z = create CHG_DEBUG:dataDumper("myDebug.txt");

Method purgeFileContents

Parameters

No Parameters

Method Description

This method will purge the file contents of the debug file.

dump\

(&val As any);

Parameters

This method takes one parameter of type “any”.

Method Description

This method takes one parameter of type “any” and converts the object to a string and dumps it to the log file.

Method dumpString

(&stringToWrite As string);

Parameters

This method takes one parameter of type string.

Method Description

This method takes one parameter of type string and dumps it to the log file.

method dumpRecord

(&rec As Record);

Parameters

This method takes one record object as a parameters.

Method Description
This method takes one record object as a parameters. The method parses through all the record fields dynamically and dumps the values and some other information.

* Fields that have translate values. The value in additional to the human readable xlat long value is dumped.

* If the field has been marked as “changed” that record will be flagged in the dump file.

* If the record object has been changed or deleted it will be marked in the log file.

import CHG_DEBUG:dataDumper;

Local CHG_DEBUG:dataDumper &z = create CHG_DEBUG:dataDumper("myDebug.txt");

Local Record &recOpr;
&recOpr = CreateRecord(Record.PSOPRDEFN);
&recOpr.OPRID.Value = "CRMALEK";
&recOpr.SelectByKey();
&z.dumpRecord(&recOpr);

Method dumpArrayOfRecords

Parameters

This method takes one parameter of type “array of record”.

Method Description

This method takes one parameter of type “array of record”. For each array element the dumpRecord Method is called.

Method dumpRowset

Parameters

This method takes one rowset object as a parameter.

Method Description

This method takes one rowset object as a parameter. The method inspects the rowset, loops through every row. For each row found, it loops through each record object and calls the dumpRecord method.

import CHG_DEBUG:dataDumper;
Local CHG_DEBUG:dataDumper &z = create CHG_DEBUG:dataDumper("myDebug.txt");
Local rowset &rsOpr;
&rsOpr = CreateRowset(Record.PSOPRDEFN);
&rsOpr.fill("where OPRID LIKE 'P%'");
&z.dumpRowset(&rsOpr);

In the above code example, there is only one record on each row. If you were to pass in a rowset that was bound to the component buffer, it would dump all records at that level for that row dynamically.

Method dumpRow

Parameters

This method takes one row object as a parameter.

Method Description

This method takes one row object as a parameter. For each record in the row, the dumpRecord method is called.

 
import CHG_DEBUG:dataDumper;

Local CHG_DEBUG:dataDumper &z = create CHG_DEBUG:dataDumper("myDebug.txt");
Local rowset &rsOpr;
rsOpr = CreateRowset(Record.PSOPRDEFN);
&rsOpr.fill("where OPRID LIKE 'P%'");
&z.dumpRow(&rsOpr.getrow(1)); 

In the above code example, there is only one record on each row. If you were to pass in a row that was bound to the component buffer, it would dump all records at that level for that row dynamically.

method dumpArray

(&array As array);

Parameters

The method takes one parameter of type “array of any”.

Method Description

The method takes one parameter of type “array of any” and dumps all the elements out.

 import CHG_DEBUG:dataDumper;
Local CHG_DEBUG:dataDumper &z = create CHG_DEBUG:dataDumper("myDebug.txt");
local array of any &a;
&a.push("1");
&a.push(3);
&a.push("some other value");
&z.dumpArray(&a);

Method dumpArrayOfString

Parameters
The method takes one parameter of type “array of string”.

Method Description

Same as DumpArray but for Array of String data type.

method emailDumpFile

(&address As string);

Parameters
This method take one paramater which is a string and must be a valid email address.

Method Description
This method will email the debug file to the desired recipient.

method dumpLevelZero

Parameters
No Parameters

Method Description
Calls dumpRowset method for level zero. This is a shortcut for doing the following. &z.dumpRowset(getLevel0()) where &z is a reference to a dataDumper object.

h4.method dumpCurrentRow

Parameters

No Parameters.

Method Description
Calls the dumpRow method for the current row in context. This is a shortcut for &z.dumpRow(getrow()) where &z is a reference to a dataDumper object.

method whiteSpace

Parameters
This method accepts one parameter that is an integers.

Method Description
Inserts x number of blank links in the dump file. Where x is parameter passed in.

Method DumpQueryString

Parameters

None

Method Description

Dumps the URL query string in a human readable form.

method DumpHTTPHeaders

Parameters
None

Method Description
This method will dump out all the HTTP headers in a human readable format.

Properties

property string emailSubject;

Override the default email subject for the email generated in emailDumpFile

property string emailBody;

Override the default email subject for the email generated in emailDumpFile

property string output;

Not implemented;

property integer indentLevel;

This property sets the number of spaces that will be appended to later “writes” to the dump file. It persists for all remaining “dump%” calls or until you switch is back. It allows you to indent sections of the file for easier reading.

property string fileContents get;

This property will return the current state of the debug file as a string.

property string FileName get set;

This property allows you to change the file name of the debug file. This will result in a new file being created.

This has not been tested yet.

Download the HD Video

DataDumper API Introduction

Article Categories
Author Info
Chris Malek

Chris Malek is a PeopleTools® Technical Consultant with two decades of experience working on PeopleSoft enterprise software projects. He is available for consulting engagements.

About Chris Work with Chris
Looking for pain-free PeopleSoft web services? 😀
PeopleSoft Simple Web Services (SWS)

Introducing a small but powerful PeopleSoft bolt-on that makes web services very easy. If you have a SQL statement, you can turn that into a web service in PeopleSoft in a few minutes.

Book
Integration Broker - The Missing Manual

I am in the process of writing a book called "Integration Broker - The Missing Manual" that you can read online.