%Studio.Extension.Base
class %Studio.Extension.Base extends %Library.RegisteredObjectStudio 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
- %OnClose()
- %OnNew()
- AfterUserAction()
-()
- OnMenuItem()
- UserAction()
Properties
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 InterSystems IRIS or the performance will be too slow. Values are:
- 0 - Disabled
- 1 - Use ItemIconState() callback in project window
- 2 - Use ItemIconState() callback in open dialog window (and namespace window)
- 3 - Use ItemIconState() callback everywhere
Property methods: IconStatusDisplayToLogical(), IconStatusGet(), IconStatusIsValid(), IconStatusLogicalToDisplay(), IconStatusNormalize(), IconStatusSet()
$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()
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 set %SourceControl.Modified(docname)=1.
Property methods: ModifiedDisplayToLogical(), ModifiedGet(), ModifiedIsValid(), ModifiedLogicalToDisplay(), ModifiedLogicalToOdbc(), ModifiedNormalize(), ModifiedSet()
Version of Studio that is connecting to this server.
Property methods: StudioVersionDisplayToLogical(), StudioVersionGet(), StudioVersionIsValid(), StudioVersionLogicalToDisplay(), StudioVersionLogicalToOdbc(), StudioVersionNormalize(), StudioVersionSet()
property Username as %Library.Username;
The username of this source control user.
Property methods: UsernameDisplayToLogical(), UsernameGet(), UsernameIsValid(), UsernameLogicalToDisplay(), UsernameLogicalToOdbc(), UsernameNormalize(), UsernameSet()
Methods
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.
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
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.
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.
Returns true if this item is in source control and false otherwise.
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.
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
Perform any login step here.
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 instantiated in order for it to be called. By default it will call the OnAfterClassCompile() if there is a source control class instantiated, 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
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.
Called after the compile of the item is done.
Called after an item is deleted.
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.
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.
This is called if you compile a class and the compilation updates the class 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.
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 instantiated in order for it to be called. By default it will call the OnBeforeClassCompile() if there is a source control class instantiated, 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.
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.
Called before the compile of the item is done. It is passed a qstruct which can be inspected and modified.
Called before an item is deleted. Returning an error code prevents the delete from occurring.
This is called before the actual load of data to give the chance to load the item from an external format.
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.
Called before Studio checks for the timestamp of an item.
method OnMenuItem(MenuName As %String, InternalName As %String, SelectedText As %String, ByRef Enabled As %Boolean, ByRef DisplayName As %String) as %Status 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.
Queries
SQL Query:
SELECT Name, Type FROM %Studio_Extension.Menu WHERE MenuBase = :Classname
SELECT Name, Type FROM %Studio_Extension.Menu WHERE MenuBase = :Classname
Provide a list of the top level menu items that Studio will add when connecting to this namespace. For each of these top level menus Studio will call the MenuItems query to obtain the items in this menu when the top level menu is selected. Each top level menu has a 'Name' and a 'Type'. The type is 0 for regular top level menus and 1 to specify the name of the context submenu that will be added to all the context menus.
Note that you can change the SQL statement or implement this query yourself. This is just an example of where you can start.
query MenuItems(Classname As %String, MenuName As %String, InternalName As %String, SelectedText As %String)
SQL Query:
SELECT MenuItem_Name, MenuItem_Enabled, MenuItem_Save, MenuItem_Separator FROM %Studio_Extension.Menu_MenuItem WHERE Menu->MenuBase = :Classname AND Menu->Name = :MenuName
SELECT MenuItem_Name, MenuItem_Enabled, MenuItem_Save, MenuItem_Separator FROM %Studio_Extension.Menu_MenuItem WHERE Menu->MenuBase = :Classname AND Menu->Name = :MenuName
This query is called by Studio when the top level menu is selected and it returns the list of items that will appear on this menu. It is passed the name of the menu and the name of the current document that has focus or "" if there are no documents open. The fields returned are:
Note that you can change the SQL statement or implement this query yourself. This is just an example
of where you can start.
- Name - Name of this menu item
- Enabled - True if this menu item is enabled, false to disable this menu item
- Save - Flag to see if the current document or all documents should be saved before running this item
- Separator - True if this is a menu separ()