class %Studio.SourceControl.Base extends %Studio.Extension.BaseThis class is kept to provide an interface to the %Studio.Extension.Base class which provides the general Studio extension interface.
Subclass from this and implement the methods you need for your source control system.
parameter Flags = 1111;
Used to control which dialogs appear in Studio. If the position is '1' then this dialog will appear and if it is '0' the UserAction() will be called to determine what to do. This is included for backward compatibilty. The flags are:
- 1 : Present dialog on check in
- 2 : Present dialog on check out
- 3 : Ask to add new item to source control
- 4 : Ask to remove deleted item from source control
Called to add this item to source control.
method AfterUserAction(Type As %Integer, Name As %String, InternalName As %String, Answer As %Integer, Msg As %String = "", ByRef Reload As %Boolean) as %Status
Inherited description: This is called after the UserAction() and after any template is run or dialog is displayed. For a list of input arguments see UserAction(). In the case of the dialog the button pushed by the user is passed in Answer:
- 0 - No
- 1 - Yes
- 2 - Cancel
Check this routine/class/csp file into source control.
Check this routine/class/csp file out of source control.
Get the latest version of this file from source control.
API to give developers control over the HTML environment. Used when viewing a source control popup for the URL in pPageURL from the portal. Developers can specify the following keys in pOptions:
- IECompatibility - set
pOptions("IECompatibility")to 1 to permit IE compatibility mode when rendering the URL. The default behaviour is to force IE to use its most recent rendering engine.
- CSSLevel - set
pOptions("CSSLevel")to 2 to force HTML 4 output, or 3 to force HTML 5 output. The default behaviour is to use HTML5 output when the browser can support it. Note that the values follow the semantics for the %OnDetermineCSSLevel() callback implemented in %ZEN.Component.abstractPage.
method OnMenuItem(MenuName As %String, InternalName As %String, SelectedText As %String, ByRef Enabled As %Boolean, ByRef DisplayName As %String) as %Status
Inherited description: This is called for every menu item returned to Studio to allow the menu to be enabled/disabled without having to write a custom query for MenuItems. The DisplayName of this menu is also passed by reference and this may be modified to change the appearance of this menu item. The MenuName is the main menu name then the submenu name separated by a ','. If Enabled is set to -1 then it will remove this menu item from the list totally, 0 will gray the menu item out, and the default 1 will display the menu item as normal.
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.
Called to delete this item from source control.
Undo the checkout of this item.
method UserAction(Type As %Integer, Name As %String, InternalName As %String, SelectedText As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String, ByRef Reload As %Boolean) as %Status
Inherited description: This is called when the user performs an action that may need to interact with the server, such as selecting a menu or adding a new document. This encompases what the deprecated Flags parameter did and allows additional flexibility.
The Type argument values are:
- 0 : Server defined menu item selected
- 1 : Other Studio action
- 0 : User has tried to change a document that is locked in source control
- 1 : User has created a new document
- 2 : User has deleted a document
- 3 : User has opened a document
- 4 : User has closed a document
- 5 : User has connected to a new namespace
- 6 : User has selected to import comma delimetered list of documents
- 7 : User has saved a new document for the first time
- 0 : Do nothing, note that this method can still perform some action such as check an item out of source control, but Studio will not ask for user input.
- 1 : Display the default Studio dialog with a yes/no/cancel button. The text for this dialog is provided in the 'Target' return argument.
- 2 - Run a CSP page/Template. The Target is the full url to the CSP page/Template, as usual the page will be passed the current document name, any selected text, the project name, the namespace.
- 3 - Run an EXE on the client. The Target is the name of an executable file on the client machine. It is the responsibility of the customer to ensure this EXE is installed in a suitable location.
- 4 - Insert the text in Target in the current document at the current selection point.
- 5 - Studio will open the documents listed in Target. If there are multiple documents to open they will be separated with commas. If the document name is 'test.mac:label+10' it will open the document 'test.mac' and goto 'label+10'.
- 6 - Display an alert dialog in Studio with the text from the Target variable.
- 7 - Display a dialog with a textbox and Yes/No/Cancel buttons. The text for this dialog is provided by the 'Target' return argument. The initial text for the textbox is provided by the 'Msg' return argument.