Home > Class Reference > ENSLIB namespace > %Studio.Extension.Base

%Studio.Extension.Base

class %Studio.Extension.Base extends %Library.RegisteredObject

Studio extensibility superclass, this does nothing but provide interface for the real extensibility classes to use. Subclass from this and implement the methods you need.

Property Inventory

Method Inventory

Properties

property IconStatus as %Integer [ InitialExpression = 0 ];
Can be set to determine if we wish to report the source control status of the document in the project window or in the open dialog. This property should be set when the source control class is initialized. As this can be a large number of callbacks the default is not to call the ItemIconState() method at all. Do not enable this unless the information needed is available directly in Cache or the performance will be too slow. Values are:
Property methods: IconStatusDisplayToLogical(), IconStatusGet(), IconStatusIsValid(), IconStatusLogicalToDisplay(), IconStatusNormalize(), IconStatusSet()
property MainJob as %String;
$Job number of the main Studio process or blank if this is the main Studio connection. This can be used to help co-ordinate between the jobs if Studio is using another server process for things like find in files or a big compile.
Property methods: MainJobDisplayToLogical(), MainJobGet(), MainJobIsValid(), MainJobLogicalToDisplay(), MainJobLogicalToOdbc(), MainJobNormalize(), MainJobSet()
property Modified as %String [ MultiDimensional ];
If the root node is set to 1 then calls to the source control hooks will keep track if the source control hook modifies the document and if it does then it will defined %SourceControl.Modified(docname)=1.
Property methods: ModifiedDisplayToLogical(), ModifiedGet(), ModifiedIsValid(), ModifiedLogicalToDisplay(), ModifiedLogicalToOdbc(), ModifiedNormalize(), ModifiedSet()
property StudioVersion as %String;
Version of Studio that is connecting to this server
Property methods: StudioVersionDisplayToLogical(), StudioVersionGet(), StudioVersionIsValid(), StudioVersionLogicalToDisplay(), StudioVersionLogicalToOdbc(), StudioVersionNormalize(), StudioVersionSet()
property Username as %String;
The username of this source control user.
Property methods: UsernameDisplayToLogical(), UsernameGet(), UsernameIsValid(), UsernameLogicalToDisplay(), UsernameLogicalToOdbc(), UsernameNormalize(), UsernameSet()

Methods

method %OnClose() as %Status
Inherited description: This callback method is invoked by the %Close() method to provide notification that the current object is being closed.

The return value of this method is ignored.

final method %OnNew(initval As %String) as %Status
This just calls the Login() to perform an initialisation. Note that this is called by Studio automatically via the %Studio.SourceControl.Interface class, do not call %New directly.
method AfterUserAction(Type As %Integer, Name As %String, InternalName As %String, Answer As %Integer, Msg As %String = "", ByRef Reload As %Boolean) as %Status
This is called after the UserAction() and after any template is run or dialog is displayed. For 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
For the dialog that contains a textbox field the text of this field is passed in 'Msg' argument. In the case of a template if the template was closed from the 'x' button then Answer=2 to indicate the user attempted to cancel the operation. Otherwise if the template closed normally by getting to the end Answer=1. For the cases where Studio did not perform any interaction this method is not called. The default implementation is to call the standard source control tags as Studio did in Cache 5.0. If the Reload argument is set to true by this method then the current document will be reloaded in Studio
method ExternalName(InternalName As %String) as %String
Convert the internal name, e.g. TEST.MAC to an external name that is used to export the routine/class/csp item. This is often a filename to write the file out to.
method GetStatus(InternalName As %String, ByRef IsInSourceControl As %Boolean, ByRef Editable As %Boolean, ByRef IsCheckedOut As %Boolean, ByRef UserCheckedOut As %String) as %Status
Return information about this entity.
classmethod IsGenerated(Name As %String) as %String
Return 1 if you wish this item to appear as if it is 'generated' when opened in Studio, return 0 to force this item not to appear as 'generated' and return "" to use normal processing
method IsInSourceControl(InternalName As %String) as %Boolean
Returns true if this item is in source control and false otherwise.
method IsReadOnly(InternalName As %String) as %Boolean
Return true if this item should be marked as read only. This is called when Studio opens a document. It is set to indicate that the user checked the 'read only' checkbox in the open dialog in Studio.
method ItemIconState(InternalName As %String) as %Integer
Used to allow Studio to display different icons in open dialog or project window etc. Return values are:
  • 0 - Not in source control
  • 1 - In source control, not checked out
  • 2 - In source control and checked out so item is editable
method Login(Name As %String, Password As %String) as %Status
Perform any login step here.
method Logout() as %Status
Perform any logout step here.
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.
method OnAfterClassCompile(List As %String, Level As %Integer, ByRef qstruct As %String, Status As %Status) as %Status