Click HERE to view the API documentation for this class template. The complete documentation for all of the classes can be found in the API Reference.
Click HERE to view the source code for this class.
This class actually performs two distinct functions. It will register itself as a post-process observer. It will also register itself as a contributed tool. This section will discuss only the event observer portion of the class.
The update() method has been modified to perform specific actions for the post process of the build process for specific minor IDs.
update:
enter aPvxState
/*
* This observer is triggered when an incremental build is initiated on a
* data file.
*
* If the source file ends with the XML extension, it will be converted to
* a PVX keyed file. Otherwise, the file header is read to verify that this
* is in fact a PVX keyed file and then it is converted to XML.
*/
/* Get the major/minor codes for this event. */
psMajor$ = aPvxState'getMajor$(), \
psMinor$ = aPvxState'getMinor$()
/* Get the parameters that were passed into this event. */
source$ = aPvxState'getArgumentValue$(_pvxConstants'SrcFile$), \
dest$ = aPvxState'getArgumentValue$(_pvxConstants'Dest$), \
domFile$ = aPvxState'getArgumentValue$(_pvxConstants'DomFile$), \
passwd$ = aPvxState'getArgumentValue$(_pvxConstants'pkf_Password$), \
passwd_type$ = aPvxState'getArgumentValue$(_pvxConstants'_iPasswordType$)
/* Create a local reference to the EventLog */
_eventLog = new("ErrorLogBuilder",_pvxConstants,ViewManager)
_eventLog'bufferInit()
_eventLog'bufferAddText("["+psMajor$+"]"+$0A$+"==:"+psMinor$+":=="+$0A$)
switch psMajor$
case _pvxConstants'Incremental_Build$
switch psMinor$
/* Convert a ProvideX data file to XML */
case _pvxConstants'BuildType_DataFile$
_obj'data2xml(source$)
break
/* Convert a XML to ProvideX data file */
case _pvxConstants'BuildType_OtherFile$
_obj'xml2data(source$,dest$)
break
end switch
break
end switch
_eventLog'bufferWriteText()
drop object _eventLog
return 0