DataDumper Documentation

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.

DataDumper Related Content


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值