The current version contains a few scripts, to be used from a
command line, to extract PeopleCode and SQL text from either
a PeopleTools project file or directly from PeopleTools
tables (using direct, read-only database access).
If a PTools project file is read, .pcode files are produced exactly
as they appear in Application Designer.
If you have ptools >= 8.52, the PeopleCode is read from table PSPCMTXT.
Otherwise, the bytecode in the PSPCMPROG table is decoded and while this
works quite well, the .pcode files it produces are not always formatted
precisely as in AppDesigner.
The produced files can either be saved to the local file system, or
submitted to a version control system (currently, Subversion
(SVN) and Git are supported).
The app can also process several environments (e.g. DEV and TEST)
in one go, saving each environment's version of a PeopleCode object
to a separate directory or to a separate SVN/Git folder. Alternatively,
the tool can save the various versions of newly added objects
(e.g. DEMO, PROD, DEV) to the same branch, so that the objects'
history shows the customizations.
There is also a script to attempt three-way merging of PeopleCode,
especially useful for functional upgrades.
Connects to a database, reads PeopleCode bytecode and SQL definitions
from the PeopleTools tables, and writes the decoded PeopleCode and
the SQL text to the file system (below a top directory that you
specify in the .properties file)
(Connects to the database and uses this project definition to determine
what PeopleCode segments and SQL definitions to extract)
(all PeopleCode/SQL with LASTUPDOPRID <> 'PPLSOFT')
DecodePCODE.bat since 2011/01/01
(LASTUPDDTTM on or after the specified day)
DecodePCODE.bat since-days 7
(same, but relative to current date)
(this reads a file 'last-time.txt' , which is created by this program
every time it runs with one of the 'since' parameters. You may want
to use this command in a recurrent job).
DecodePCODE.bat since 2012/01/01 oprid JOHNNY
(parameter 'OPRID' can be combined with 'custom' or any of the 'since'
parameters; it adds a 'LASTUPDOPRID = ...' clause to the selects)
(Reads a PeopleTools project file, and extracts all PeopleCode segments
it contains, as well as the SQL definitions.
This script accepts the same parameters as DecodePCODE.bat, but instead
of writing the extracted text to files, it submits it to a
Subversion (SVN) version control system. Connection parameters for
SVN should be entered in DecodePC.properties. You can specify more
than one SVN user in the properties; the program will try to map
each PeopleSoft user (LASTUPDOPRID) to an SVN user.
To submit the extracted text to a local Git repository (which will be
created if it does not already exist).
Extracts PeopleCode from a compare report and from a PeopleTools .xml
project,and attempts to merge the three versions of each PeopleCode
segment. Modifies the (browser) compare report that was used for input,
adding links to various version of the PeopleCode as well as to diffs.
See 'Using DecodePCODE_Merge.pdf'.
Extract the .zip file, and ensure a suitable JDBC library is
available in the working directory: sqljdbc4.jar for MS SQL
Server, ojdbc5.jar for Oracle (retrieve from the vendor
sites; the Oracle driver may also be found in jdbc/lib under
the Oracle home). Other database types should work as well
(adjust the url and driverclass entries, and specify the .jar
file in the scripts).
If you want to commit files to Subversion, you need svnkit.jar
(from svnkit.com; this program has been tested with the
version included in org.tmatesoft.svn_1.3.5.standalone.zip).
If you want to commit files to a Git repository, you will need
jgit.jar (from http://www.eclipse.org/jgit/download, pick the
'Raw API library' and rename the file).
See 'Setting up version control.pdf' for more details on using
Subversion or Git with this application.
Specify the connection parameters in DecodePC.properties. For
Oracle, you can use tnsping to determine server
and port number.
For all three .bat files, you may have to specify the path for java
(JRE 1.5+ required). You may be able to use $PS_HOME/jre/bin/java.
Installation on Unix: same, but use the .sh scripts instead of
the batch files. You will have to do something like
chmod 700 *.sh
Minimum persissions for the SQL user that you specify in
the .properties file:
select rights on PSPCMPROG PSPCMNAME PSSQLDEFN PSSQLTEXTDEFN
PSPROJECTITEM PSPACKAGEDEFN and (ptools >= 8.52) PSPCMTXT;
no insert/delete/alter permissions required.
To retrieve or browse the source code, please use the
Code link on the SourceForge project
If you run into a bug, please submit a bug report via the Tracker
feature on the SourceForge pages.