Package: appclassdoc
AppClassDocA package to create a Javadoc-like API documentation site for PeopleSoft Application Classes.AboutThis Python package will use thePeopleCode parserto analyze PeopleSoft Application Class source code and generate an HTML API documentation site similar to Java's Javadoc.PrerequisitesApplication Class Source CodeEach Application Class's source code must be exported to its own file. The files need not be organized in any particular way, but they must respect the following naming convention:<ROOT_PACKAGE>[.<INNER_PACKAGE_1>[.<INNER_PACKAGE_2>]].<CLASS_NAME>.<EXTENSION>For example, assume an Application Package namedZZ_APP_PACKAGE, with the following structure:ZZ_APP_PACKAGE
├─ GUI
│  ├─ UIController
│  └─ SomeException
├─ SERVICE
│  ├─ SOAP
│  │  └─ RequestHandler
│  └─ REST
│     └─ RequestHandler
└─ UtilitiesThe five Application Classes shown in this package would need to be extracted to files named as follows (from top to bottom):ZZ_APP_PACKAGE.GUI.UIController.pplZZ_APP_PACKAGE.GUI.SomeException.pplZZ_APP_PACKAGE.SERVICE.SOAP.RequestHandler.pplZZ_APP_PACKAGE.SERVICE.REST.RequestHandler.pplZZ_APP_PACKAGE.Utilities.pplIn essence, the file names are fully-qualified Application Class names as would be used in a PeopleCodeimportstatement, except that the colons (":") are replaced by dots ("."), and followed by an extension. These examples use.pplas the file extension. The extension itself is not important, but onemustbe present.The files can be all in the same directory, in separate directories, or in hierarchical subdirectories. Any disposition is acceptable as long as the file naming convention is respected.The source code can be extracted from Application Designer project exports by means of the PSTools package (TODO: Provide a link to it once it's on GitHub).API CommentsMuch like Javadoc, AppClassDoc parses the source code to build a model of Application Classes and present them in a navigable set of HTML pages. With no further annotation on the source code itself, this is enough to identify each constant, property, method, method argument, return type, getters, setters, and so on. However, this can be enriched by the developer by means of API comments, such as in the example below:/*** A model of a User Exit as configured for the current date.** @version 1.0* @author Leandro Baca*/classUserExit/*** Initializes the user exit by loading its context and commands.** @param &mFeature - the feature name* @param &mName - the name of the user exit* @exception MisconfigurationException - thrown if the provided feature and*            user exit names reference an inextant User Exit*/methodUserExit(&mFeatureAsstring,&mNameAsstring);/*** Executes the commands configured for this user exit in sequence. If a* CommandBreakException interrupts the sequence, the method terminates* gracefully and the IsBreak property is set to True.*/methodExecute();/** The feature name. */propertystringFeaturereadonly;/** The name of the user exit. */propertystringNamereadonly;[...]end-class;This is inspired of course fromJavadoc, but also from the"Commenting and Documenting Application Classes" sectionin the PeopleSoft Online Help (itself, no doubt, also inspired from Javadoc).Briefly:API comments start with/**and end with*/.They must immediately precede any of the following:In the class header:Theclassorinterfacedeclaration;Amethod,property,constantorinstancedeclaration.In the class body:Amethoddefinition;Agetorsetdefinition.If a method has a preceding API comment in both the header and body, the latter is used.If a property declaration in the header includes thegetand/orsetkeywords, and both the property declaration itself and theget/setdefinitions include API comments, the one in the header will be printed in the summary section, whereas the latter will be included in the respective getters/setters section.Within an API comment:The initial/**(and all subsequent asterisks) are ignored, as well as the trailing*/.An initial*in every internal line is ignored.The first sentence (i.e., all text up to the first period followed by a space) is used as the summary.The entirety of the text is used as the detailed explanation.After all the text, optional tags preceded by "at" signs ("@") can be included to provide further annotation, to wit:TagApplicabilityDescriptionOccurrence@versionClass/Interface declarationThe class/interface version.Single@authorClass/Interface declarationThe author(s) of the class/interface.Multiple@paramMethod declaration/definition,setdefinitionThe name of the parameter and a description of its purpose.Multiple for methods, single for setters@returnsor@returnMethod declaration/definition,property/instance/constantdeclaration,getdefinitionA description of what is returned.Single@exceptionor@throwsor@throwMethod declaration/definition,get/setdefinitionThe type of exception and a description of the circumstances of it being thrown.Multiple(If a tag does not specify that it can occur multiple times, only the last occurrence is used.)InstallationTo install the package, run the following:pipinstallappclassdocUsageCommand Line InterfaceThe package installs a console script calledappclassdocto serve as a CLI:appclassdoc-hThe usage information is as follows:usage: appclassdoc [-h] [-v] [-o OUTPUTDIR] [-p] [-n] file_or_dir [file_or_dir ...]

Generate API documentation for PeopleSoft Application Classes.

positional arguments:
  file_or_dir           one or more source files or directories to process recursively (wildcards accepted)

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbosity       increase output verbosity
  -o OUTPUTDIR, --outputdir OUTPUTDIR
                        the output directory for the generated documentation files (defaults to the current directory)
  -p, --private         include private class members in documentation
  -n, --nodelete        avoid deleting files already in the target directoryThe-v/--verbosityswitch can be specified up to three times, to increase the level of verbose logging.If the-p/--privateswitch is not specified, private class members are not printed to the HTML.When the API documentation site is first generated, a number ofresource filesare copied into the output directory, such as CSS files ad fonts. These can be customized, in which case subsequent executions of the script by means of the CLI will want to include the-n/--nodeleteswitch to maintain the existing versions instead of replacing them.Package InvocationThe package can also be invoked from a Python script, in which case the function to call will begenerate_appclassdoc. Its arguments map to the CLI's switches and positional arguments, with the exception that only the first level of verbosity can be specified (subsequent levels can be enabled through theloggingmechanism).ResultsThe documentation site will look like the following image:The top navigation header shows links to jump to the summary and detail sections for:The constructor;Constants;Properties;Getters;Setters;andMethods.The image below shows an example of the "Property Summary" section:Clicking on the links in the "Property and Description" column jumps to the respective details below on the page, as will thegetandsetlinks in the "Modifiers and Type" column. The type links in the left column (e.g.,ValueObjectandContextFactoryin the image) will open the page for that class.The last image shows some of the detail sections:AcknowledgementsAppClassDoc was intially written as part of the deliverables for my Master of Science dissertation at the University of Liverpool, titled "A Framework for Customizing ERP Systems to Increase Software Reuse and Reduce Rework When Challenged with Evolving Requirements." I mention this primarily in gratitude to my employer, who graciously waived their claim to intellectual property on my work as part of this academic pursuit.