Skip to main content

%Atelier.SourceControl

Class %Atelier.SourceControl Extends %Studio.SourceControl.Base

This class is intended to demonstrate that source control hooks are called on the server when corresponding actions are peformed in Atelier. Enabling this class in the managment portal will write diagnostic information to the Atelier console during events, such as save, compile, etc. Note that the methods in section 'Menu Items' here are included for completeness, in reality only those methods in the section marked 'Events' will be called.

Users wishing to take advantage of server side source control hooks with Atelier should subclass %Studio.SourceControl.Base directly.

Parameters

PREFIX

Parameter PREFIX = "*** Atelier Source Control Hook *** ";

This aids in identifying the hook output amongst other console output

Methods

CheckIn

Method CheckIn(InternalName As %String, Description As %String = "") As %Status

Check this routine/class/csp file into source control.

CheckOut

Method CheckOut(InternalName As %String, Description As %String = "") As %Status

Check this routine/class/csp file out of source control.

UndoCheckout

Method UndoCheckout(InternalName As %String) As %Status

Undo the checkout of this item.

AddToSourceControl

Method AddToSourceControl(InternalName As %String, Description As %String = "") As %Status

Called to add this item to source control

RemoveFromSourceControl

Method RemoveFromSourceControl(InternalName As %String, Description As %String = "") As %Status

Called to delete this item from source control

GetLatest

Method GetLatest(InternalName As %String) As %Status

Get the latest version of this file from source control.

OnBeforeSave

Method OnBeforeSave(InternalName As %String, Location As %String = "", Object As %RegisteredObject = {$$$NULLOREF}) As %Status

Called before the item is saved to the database it is passed a reference to the current temporary storage of this item so that it can be modified before the save completes. If you quit with an error value then it will abort the save.

OnAfterAllClassCompile

ClassMethod OnAfterAllClassCompile(List As %String, Level As %Integer, ByRef qstruct As %String, Status As %Status) As %Status

Called in the activated source control class after we have compiled all the classes but before we exit. Note that this is a class method and it does not require the source control class to be instanciated in order for it to be called. By default it will call the OnAfterClassCompile if there is a source control class instanciated, but you can override this to do whatever you require. List is a subscripted array of items that were compiled. Status is the current compile return error %Status, so the callback can check if there was any error in compiling the list of classes.

OnAfterClassCompile

Method OnAfterClassCompile(List As %String, Level As %Integer, ByRef qstruct As %String, Status As %Status) As %Status

Called in the class compiler after we have compiled all the classes before we exit List is a subscripted array of items that were compiled. Status is the current compile return error %Status, so the callback can check if there was any error in compiling the list of classes.

OnAfterCompile

Method OnAfterCompile(InternalName As %String) As %Status

Called after the compile of the item is done.

OnAfterDelete

Method OnAfterDelete(InternalName As %String) As %Status

Called after an item is deleted.

OnAfterLoad

Method OnAfterLoad(InternalName As %String, Object As %RegisteredObject = {$$$NULLOREF}) As %Status

This is called after the item is loaded but before it is sent to Studio so you have a chance to modify this copy before it appears in the editor. It is passed a reference to the object that represents this item so it can be modified before Studio reads this information.

OnAfterSave

Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NULLOREF}) As %Status

This is called after the item has been saved to the database. It may be passed a reference to the object representing the item just saved. It can be use to export this documement to an external form for example.

OnAfterStorage

Method OnAfterStorage(InternalName As %String, Location As %String = "") As %Status

This is called if you compile a class and the compilation updates the classes storage. It is called after the storage has been updated so you can determine how to deal with this change in the class. The Location is the global reference to the class definition that was changed.

OnBeforeAllClassCompile

ClassMethod OnBeforeAllClassCompile(List As %String, Level As %Integer, ByRef qstruct As %String) As %Status

Called in the activated source control class before starting a compile after we have resolved the list of classes but before we have started the compile itself. Note that this is a class method and it does not require the source control class to be instanciated in order for it to be called. By default it will call the OnBeforeClassCompile if there is a source control class instanciated, but you can override this to do whatever you require. Returning an error here will abort the compile. List is a subscripted array of items that will be compiled.

OnBeforeClassCompile

Method OnBeforeClassCompile(List As %String, Level As %Integer, ByRef qstruct As %String) As %Status

Called in the class compiler after we have resolved the list of classes to be compiled but before we have started the compile itself. List is a subscripted array of items that will be compiled.

OnBeforeCompile

Method OnBeforeCompile(InternalName As %String, ByRef qstruct As %String) As %Status

Called before the compile of the item is done. It is passed a qstruct which can be inspected and modified.

OnBeforeDelete

Method OnBeforeDelete(InternalName As %String) As %Status

Called before an item is deleted. Returning an error code prevents the delete from occurring.

OnBeforeLoad

Method OnBeforeLoad(InternalName As %String) As %Status

This is called before the actual load of data to give the chance to load the item from an external format.

OnBeforeTimestamp

Method OnBeforeTimestamp(InternalName As %String)

Called before Studio checks for the timestamp of an item.

OnMenuItem

Method OnMenuItem(MenuName As %String, InternalName As %String, SelectedText As %String, ByRef Enabled As %Boolean, ByRef DisplayName As %String) As %Status

OnPortalCreate

Method OnPortalCreate(pUserData As %ZEN.proxyObject = "") As %Status [ CodeMode = objectgenerator ]

Callback invoked when the portal-based Source Control hooks instantiate the source control class. Operations that occur in this callback should be lightweight as the source control class needs to be instantiated afresh every time a source control action is performed.