%Studio.Project
Class %Studio.Project Extends (%Persistent, %XML.Adaptor) [ System = 3 ]
Represents a Studio Project.
Many methods in this class use the qspec argument, which is a list of flags or qualifiers. See System Flags and Qualifiers.
Parameters
SQLPUBLICSECURITY
Parameter SQLPUBLICSECURITY = "{""Project_ProjectItemsList"":""Requires:%Development:USE"",""Project_WatchVariablesList"":""Requires:%Development:USE"",""Project_BreakPointsList"":""Requires:%Development:USE"",""Project_WatchPointsList"":""Requires:%Development:USE""}";
Properties
Name
Property Name As %String(MAXLEN = 64, XMLNAME = "name", XMLPROJECTION = "attribute");
LastModified
Property LastModified As %Studio.TimeStamp(XMLPROJECTION = "attribute");
Description
Property Description As %String(MAXLEN = 4000, XMLNAME = "ProjectDescription", XMLPROJECTION = "element");
Target
Property Target As %String(MAXLEN = 256, XMLPROJECTION = "attribute");
TargetType
Property TargetType As %Integer(XMLPROJECTION = "attribute");
RunInTerminal
Property RunInTerminal As %Boolean(XMLPROJECTION = "attribute");
HttpServer
Property HttpServer As %String(MAXLEN = 256, XMLPROJECTION = "attribute");
Locked
Property Locked As %Integer(XMLPROJECTION = "none") [ Transient ];
TerminalUsername
Property TerminalUsername As %String(MAXLEN = 64, XMLPROJECTION = "attribute");
TerminalPassword
Property TerminalPassword As %String(MAXLEN = 64, XMLPROJECTION = "attribute");
TerminalPort
Property TerminalPort As %Integer(XMLPROJECTION = "attribute");
Projections
Property Projections As list Of %String(MAXLEN = 128, XMLPROJECTION = "none");
Defines
Property Defines As %String(MAXLEN = 4000, XMLPROJECTION = "attribute");
DebugStepping
Property DebugStepping As %String(MAXLEN = 64, XMLPROJECTION = "none");
Stream
Property Stream As %FileBinaryStream(XMLPROJECTION = "none") [ Transient ];
Temporary stream for passing information between InterSystems IRIS and client system.
StreamName
Property StreamName As %String(MAXLEN = 256, XMLPROJECTION = "none") [ Transient ];
Temporary name of the stream
Items
Relationship Items As ProjectItem(XMLITEMNAME = "ProjectItem", XMLPROJECTION = "wrapped") [ Cardinality = children, Inverse = Project ];
BreakPoints
Relationship BreakPoints As BreakPoint(XMLITEMNAME = "BreakPoint", XMLPROJECTION = "wrapped") [ Cardinality = children, Inverse = Project ];
WatchVariables
Relationship WatchVariables As WatchVariable(XMLITEMNAME = "WatchVariable", XMLPROJECTION = "wrapped") [ Cardinality = children, Inverse = Project ];
WatchPoints
Relationship WatchPoints As WatchPoint(XMLITEMNAME = "WatchPoint", XMLPROJECTION = "wrapped") [ Cardinality = children, Inverse = Project ];
Methods
TargetNormalize
ClassMethod TargetNormalize(val As %String) As %String
%OnNew
Method %OnNew(initvalue) As %Status
%OnOpen
Method %OnOpen() As %Status [ Private ]
%OnBeforeSave
Method %OnBeforeSave(insert As %Boolean) As %Status [ Private ]
%OnAfterSave
Method %OnAfterSave(insert As %Boolean) As %Status [ Private ]
%OnClose
Method %OnClose() As %Status [ Private ]
%IsModified
Method %IsModified() As %Integer
%ObjectModified
Method %ObjectModified() As %Integer
%OnDelete
ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private ]
This callback method is invoked by the %Delete method to provide notification that the object specified by oid is being deleted.
If this method returns an error then the object will not be deleted.
GetDate
ClassMethod GetDate(name As %String) As %TimeStamp
Return the timestamp the project with name was last updated.
NameSet
Method NameSet(val As %String) As %Status
NameIsValid
ClassMethod NameIsValid(val As %String) As %Status
Delete
ClassMethod Delete(id As %String) As %Status
Delete this project
Lock
Method Lock() As %Status
Lock the project.
Unlock
Method Unlock() As %Status
Unlock the project.
LockItem
ClassMethod LockItem(name As %String, lock As %Boolean) As %Status
Lock a project with the name. If lock is true then it is locked and if it is false then it is unlocked.
CreateClone
Method CreateClone(name As %String) As %Status [ ProcedureBlock = 1 ]
Create a clone of this project and then save it with a new name. Note that if the target name already exists then it will be deleted without warning. It is the responsibility of the caller to check if it wishes to overwrite the new name or not.
AddItem
Method AddItem(name As %String, type As %String = "") As %Status
Add an item to the project, you can just pass the full name in the name argument and nothing in the type argument and this will add the correct type information automatically.
RemoveItem
Method RemoveItem(name As %String, type As %String = "") As %Status
AddBreakPoint
Method AddBreakPoint(rtn As %String, offset As %Integer, condition As %String = "", label As %String = "") As %Status
RemoveBreakPoint
Method RemoveBreakPoint(rtn As %String, offset As %Integer, label As %String = "") As %Status
RemoveBreakPointsForRoutine
Method RemoveBreakPointsForRoutine(rtn As %String) As %Status
RemoveAllBreakPoints
Method RemoveAllBreakPoints() As %Status
Remove all break points from a project.
AddWatchPoint
Method AddWatchPoint(var As %String, condition As %String = "") As %Status
RemoveWatchPoint
Method RemoveWatchPoint(var As %String, condition As %String = "") As %Status
RemoveAllWatchPoints
Method RemoveAllWatchPoints() As %Status
Remove all break points from a project.
AddWatchVariable
Method AddWatchVariable(variable As %String, pane As %Integer) As %Status
RemoveWatchVariable
Method RemoveWatchVariable(variable As %String, pane As %Integer) As %Status
RemoveAllWatchVariables
Method RemoveAllWatchVariables() As %Status
Remove all watch variables from a project.
GetCurrentTimeStamp
Method GetCurrentTimeStamp() As %TimeStamp
Get the on-disk timestamp for the project.
ListWebPages
Method ListWebPages(ByRef pages As %String(MAXSTRING=""), qspec As %String = "") As %Status
Return comma separated list of items in this project which can be called as web pages
Compile
Method Compile(qspec As %String = "", ByRef %errorlog As %String) As %Status
Compile all the items in this project, using the qspec. The order of compilation is INT, CLS, MAC, CSR, CSP, other.
realCompile
ClassMethod realCompile(qstruct, ByRef %errorlog As %String, ByRef itemlist As %String, ByRef updatedlist As %String) As %Status
Compile all the items in itemlist. Used by Compile and Import.
compileUserType
ClassMethod compileUserType(name As %String, ByRef qstruct As %String) As %Status [ Private ]
Export
Method Export(ByRef filename As %String, qspec As %String, justproject As %Boolean, ByRef %errorlog As %String, Charset As %String = "", ShowFilename As %Boolean = 1) As %Status
Export this project in XML format to the filename.
If the justproject is true then it will only export the project definition, but not any items in this project, otherwise the default behavour is to export all the items in the project to the same XML file.
The qspec are the standard cache objects qualifiers.
Check
Method Check() As %Status
Check the project so that if any items are do not exist then we will remove them from the project
DeployToGbl
Method DeployToGbl(gbl As %String, qspec As %String, removesource As %Boolean = 0) As %Status
Package up this project into a global for deployment. This can be imported using the InstallFromGbl. The qualifiers are used to determine if we should export selectivity information using the /exportselectivity qualifier. Also the /keepsource will determine if we add intermediate compilation files such as User.Test.1.int when you are creating a package containing User.Test.cls. If you pass removesource=1 then it will strip out all source code in the package including class method code, and routines.
DeployToFile
Method DeployToFile(file As %String, qspec As %String, removesource As %Boolean = 0) As %Status
Package up this project into a global for deployment and then export this global to the file specified. This can be imported using the InstallFromFile. The qualifiers are used to determine if we should export selectivity information using the /exportselectivity qualifier. Also the /keepsource will determine if we add intermediate compilation files such as User.Test.1.int when you are creating a package containing User.Test.cls. If you pass removesource=1 then it will strip out all source code in the package including class method code, and routines. If the filename ends in .gz or .gzip it will automatically gzip the file.
Deploy
Method Deploy(ByRef deploydir As %String, qspec As %String, ByRef %errorlog As %String, ShowFilename As %Boolean = 1, gbl As %String = "", removesource As %Boolean = 0) As %Status
Export this project to a DAT file or a global for deployment. The DAT file will be stored in the deploydir directory.
The qspec are the standard cache objects qualifiers.
addclass
Method addclass(classname As %String) [ Internal, Private ]
createDatabase
Method createDatabase(ByRef deploydir As %String, ByRef qstruct As %String) As %Status [ Private ]
deployToDatabase
Method deployToDatabase(ByRef deploydir As %String, ByRef qstruct As %String, removesource As %Boolean = 0) As %Status [ Private ]
deployGbl
Method deployGbl(gbl As %String, ByRef qstruct As %String, removesource As %Boolean = 0) As %Status [ Private ]
packGbls
ClassMethod packGbls(target, type, name, ByRef gbls) [ Internal ]
BackupDeployContent
ClassMethod BackupDeployContent(gbl As %String, backupgbl As %String, qspec As %String) As %Status
Backup the items that will be replaced when installing a deployed set of items to backupgbl
InstallFromFile
ClassMethod InstallFromFile(file As %String, qspec As %String, runinstall As %Boolean = 1, ByRef project As %Studio.Project, listonly As %Boolean = 0, backupgbl As %String = "", validatesig As %Boolean = 0, transaction As %Boolean = 1)
This will install any routines, classes and globals into the current namespace from a file created with the DeployToFile. The qualifiers respects the /importselectivity item to determine of we should import selectivity information from this package. If you pass in a %Studio.Project in project then this will be returned with all the items in the deployment in gbl added to the project. If listonly is true then nothing will be actually changed in the database, so you can list items. If runinstall is false then if the deployment contains a routine called 'INSTALL' (note not in the database, but in the deployment) then we will not automatically run this after installing the items in this deployment. The default is to run the INSTALL routine if present.
InstallFromGbl
ClassMethod InstallFromGbl(gbl As %String, qspec As %String, runinstall As %Boolean = 1, ByRef project As %Studio.Project, listonly As %Integer = 0, backupgbl As %String = "", validatesig As %Boolean = 0, transaction As %Boolean = 1)
This will install any routines, classes and globals into the current namespace from a global created with the DeployToGbl. The qualifiers respects the /importselectivity item to determine if we should import selectivity information from this package. If you pass in a %Studio.Project in project then this will be returned with all the items in the deployment in gbl added to the project. If listonly is true then nothing will be actually changed in the database, so you can list items. If runinstall is true then if the deployment contains a routine called 'INSTALL' (note not in the database, but in the deployment) then we will automatically run PRE^INSTALL before the installation and ^INSTALL after installing the items in this deployment. The default is to run the INSTALL routine if present. If backupgbl is defined then any items which will be replaced by items in the package are backed up to this global location first. Also if the deployment contains an INSTALL routine then this will be placed in the backup as UNINSTALL, and if the deployment contains an UNINSTALL routine this will be placed in the backup as INSTALL. So when the backup is installed (do you uninstall this deployment) it will run the PRE^UNINSTALL routine of the original deployment and after it is uninstalled it will run ^UNINSTALL. If transaction is false then we will not use a transaction to allow rolling back the install. If validatesig is true we will validate any code being replaced is the original version installed from InterSystems.
internalInstall
ClassMethod internalInstall(gbl As %String, qspec As %String, runinstall As %Boolean = 1, ByRef items As %String, listonly As %Integer = 0, transaction As %Boolean = 1) [ Internal, Private ]
DeployToStream
Method DeployToStream(qspec As %String, ByRef %errorlog As %String) As %Status
Wrapper to Deploy which returns a binary stream in Stream rather than writing to a file.
ExportToStream
Method ExportToStream(qspec As %String, justproject As %Boolean, ByRef %errorlog As %String, file As %String = "", Charset As %String = "") As %Status
Wrapper to Export which returns a stream in Stream rather than writing to a file.
SetStreamName
Method SetStreamName(file As %String = "") As %Status
This will try and set the Stream to point to the filename file. This is used by the Studio so the Import method shows the filename the user expects.
GetStreamName
Method GetStreamName() As %String
Return the name of the stream. Used by Studio because it can not access the Stream property directly
ExportList
ClassMethod ExportList(ByRef filename As %String, ByRef list As %String, qspec As %String, Charset As %String = "", ShowFilename As %Boolean = 1) As %Status
Export a list of items to the filename specified. The list can either be comma delimited such as 'TEST.MAC,Example.CLS,/csp/samples/loop.csp' or a subscripted array with the first subscript being the name of the item to export. The qspec are the standard ObjectScript qualifiers, if the "d" is passed then it will output status information to the current device.
ExportListToStream
Method ExportListToStream(ByRef list As %String, qspec As %String, file As %String = "", Charset As %String = "") As %Status
Wrapper to ExportList which returns a stream in Stream rather than writing to a file.
Import
ClassMethod Import(filename As %String, qspec As %String, ByRef %errorlog As %String, ByRef imported As %String, listonly As %Boolean = 0, selecteditems As %String = "", displayname As %String) As %Status [ CodeMode = expression ]
Import the XML description of routines, classes, CSP files, and projects into this namespace. This returns the list of items imported in imported separated by commas. You can pass in the qspec to tell it if it should compile these imported elements as well. If listonly is true then it will just return the list of items to import and not import anything. selecteditems is an optional comma separated list of items, if present then it will only import these items and it will skip any item not in this list. The filename may be a comma separated list of files.
ImportFromStream
Method ImportFromStream(qspec As %String, ByRef %errorlog As %String, ByRef imported As %String, listonly As %Boolean = 0, selecteditems As %String = "") As %Status
Wrapper to Import which is passed a stream in Stream rather than a file.
ExportCDLToStream
Method ExportCDLToStream(classname As %String = "", qspec As %String = "", file As %String = "", Charset As %String = "") As %Status
Wrapper to ExportCDLList^%apiOBJ which returns a stream in stream rather than writing to a file. You pass this a comma separated list of classes, or an array subscripted by the class name. The file is the filename to output this to without the directory.
ExportRtnToStream
Method ExportRtnToStream(rtnlist As %String = "", qspec As %String = "", file As %String = "", Charset As %String = "") As %Status
Wrapper to Export^%apiRTN which returns a stream in stream rather than writing to a file. You pass this a comma separated list of routines or an array subscripted by the routine name. The file is the filename to output this to without the directory.
ExportRtn
ClassMethod ExportRtn(rtnlist As %String = "", qspec As %String = "", file As %String = "", Charset As %String = "", ShowFilename As %Boolean = 1) As %Status
Wrapper to Export^%apiRTN which returns a stream in stream rather than writing to a file. You pass this a comma separated list of routines or an array subscripted by the routine name. The file is the filename to output this to without the directory.
sLoadLargeList
ClassMethod sLoadLargeList(filestream As %GlobalCharacterStream, qspec As %String, ByRef errorlog As %String, loadedliststream As %GlobalCharacterStream, listonly As %Boolean, selecteditemstream As %GlobalCharacterStream) As %Status
sLoadStreamLargeList
Method sLoadStreamLargeList(qspec As %String, ByRef errorlog As %String, loadedliststream As %GlobalCharacterStream, listonly As %Boolean, selecteditemstream As %GlobalCharacterStream) As %Status
sCompileLargeList
ClassMethod sCompileLargeList(itemliststream As %GlobalCharacterStream, qspec As %String, ByRef errorlog As %String) As %Status
StreamToArray
ClassMethod StreamToArray(stream As %Stream.Object, ByRef array As %String, delim As %String = ",")
ArrayToStream
ClassMethod ArrayToStream(ByRef array As %String, stream As %Stream.Object)
ProjectItemsListExecute
ClassMethod ProjectItemsListExecute(ByRef QHandle As %Binary, project As %String(MAXLEN=512), noexpandpackages As %Boolean = 0) As %Status
List of all projects List of all items for a project
ProjectItemsListClose
ClassMethod ProjectItemsListClose(QHandle As %Binary) As %Status
ProjectItemsListFetch
ClassMethod ProjectItemsListFetch(ByRef QHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ CodeMode = expression ]
ProjectItemsListFetchRows
ClassMethod ProjectItemsListFetchRows(ByRef QHandle As %Binary, FetchCount As %Integer = 0, ByRef RowSet As %List, ByRef ReturnCount As %Integer, ByRef AtEnd As %Integer) As %Status
ProjectItemsListFetchRows returns the next FetchCount rows in the query.
FindInProject
Method FindInProject(String As %String, WholeWords As %Boolean = 0, CaseSensitive As %Boolean = 1, Max As %Integer = 200, wild As %Boolean = 1) As %Status
List of all break points for a project List of all break points for a project List of all watch variables for a project Find a particular string inside this project.
String is the string to search for. The list of matches is written to the screen. If WholeWords is true then it will only find whole words and not fragments, it defaults to false. If CaseSensitive is true (the default) then the search is case sensitive, otherwise it is case insensitive. The maximum number of matches it will find can be specified in Max which defaults to 200. If wild is false then the PatternList does not contain any wild cards and so should be treated as a string literal search even the pattern contains ?*\ characters.
FindInFilesAtelierv6
ClassMethod FindInFilesAtelierv6(pQuery As %String, pRegex As %Boolean = 0, pWholeWords As %Boolean = 0, pCaseSensitive As %Boolean = 1, pWildCards As %Boolean = 1, pMax As %Integer = 200, pProject As %String = "", pDocuments As %String(MAXLEN=512) = "", pSystem As %Boolean = 0, pGenerated As %Boolean = 0, pMapped As %Boolean = 1, pIncludeRegex As %String = "", pExcludeRegex As %String = "") As %Status [ Internal ]
Search a list of files or a project for a string, or using a Regular Expression. Writes matches to the current device.
Arguments:
pQuery
- The string to search for, or a Regular Expression ifpRegex
is1
.pRegex
- If1
,pQuery
will be interpreted as a Regular Expression andpWholeWords
,pCaseSensitive
, andpWildCards
will be ignored. Defaults to0
.pWholeWords
- If1
, only whole word matches will be returned, not fragments. Ignored ifpRegex
is1
. Defaults to0
.pCaseSensitive
- If1
, the search is case sensitive. Ignored ifpRegex
is1
. Defaults to1
.pWildCards
- If0
, wild card characters?*\
will be treated as literals. Ignored ifpRegex
is1
. Defaults to1
.pMax
- The maximum number of matches to return. Defaults to200
.pProject
- The project to search in. If empty,pDocuments
,pSystem
,pGenerated
, andpMapped
will be used to specify the files to search.pDocuments
- The list of files to search. See the documentation for theSpec
parameter of theStudioOpenDialog
query in %Library.RoutineMgr for allowed syntax. Ignored ifpProject
is not empty.pSystem
- If1
, system files will be searched (where source is available). Ignored ifpProject
is not empty. Defaults to0
.pGenerated
- If1
, generated files will be searched. Ignored ifpProject
is not empty. Defaults to0
.pMapped
- If1
, files mapped from other namespaces will be searched. Ignored ifpProject
is not empty. Defaults to1
.pIncludeRegex
- If a file name matches this Regular Expression, it will be included in the search. The matching is case sensitive and file names are normalized so that the first character and path separator are/
(for example,/%Api/Atelier/v6.cls
and/csp/user/menu.csp
). Defaults to the empty string and no matching is done.pExcludeRegex
- If a file name matches this Regular Expression, it will be excluded from the search. Follows the same rules aspIncludeRegex
. Defaults to the empty string and no matching is done.
FindInFiles
ClassMethod FindInFiles(String As %String, PatternList As %String, pSystem As %Boolean = 0, WholeWords As %Boolean = 0, CaseSensitive As %Boolean = 1, Max As %Integer = 200, Filter As %String(MAXLEN=512) = "", wild As %Boolean = 1, pGenerated As %Boolean = 1, pMapped As %Boolean = 1) As %Status
Find a particular string inside a list of files.
String is the string to search for. The PatternList is the list of items to search. Typically this will be '*.*' but you can specify just MAC and INC files with '*.mac,*.inc' or a list of individual files with 'abc.mac,def.cls'. The acceptable extensions at this time are int,mac,inc,bas,cls,csp,csr,prj,mvm,bam,mvb. The list of matches is written to the screen. If pSystem is true then it also searches system routines and classes (where the source is available) when searching the entire namespace. If WholeWords is true then it will only find whole words and not fragments, it defaults to false. If CaseSensitive is true (the default) then the search is case sensitive, otherwise it is case insensitive. The maximum number of matches it will find can be specified in Max which defaults to 200. If wild is false then the String does not contain any wild cards and so should be treated as a string literal search even if it contains ?*\ characters.
pattern
ClassMethod pattern(pattern As %String, wholewords As %Boolean = 0, ByRef wild As %Boolean) As %String [ Internal ]
searchItem
ClassMethod searchItem(pattern As %String, Name As %String, ByRef Found As %Integer = 0, wild As %Boolean = 0, CaseSensitive As %Boolean = 1, Max As %Integer = 200, Pattern As %String, WholeWords As %Boolean = 0) As %Boolean [ Private ]
Search this specific item for the string
searchClassNode
ClassMethod searchClassNode(Name As %String, ref As %String, type As %String, NewName As %String, pattern As %String, ByRef Found As %Integer, Tree As %String, CaseSensitive As %Boolean = 1, Max As %Integer = 200, Wild As %Boolean = 0) [ Private ]
Search this class for the string
FindInFilesRegex
ClassMethod FindInFilesRegex(Regex As %String, ItemList As %String, pSystem As %Boolean = 0, pGenerated As %Boolean = 0, Max As %Integer = 200, pMapped As %Boolean = 1) As %Status
Search a list of files, using a Regular Expression.
Regex is the Regular Expression for the search. The ItemList is the list of items to search. Typically this will be '*.*' but you can specify just MAC and INC files with '*.mac,*.inc' or a list of individual files with 'abc.mac,def.cls'. The acceptable extensions at this time are int,mac,inc,bas,cls,csp,csr,prj,mvm,bam,mvb.
The list of matches is written to the current device.
If pSystem is true then it also searches system routines and classes (where the source is available). If pGenerated is true then it also searches generated items. The maximum number of matches it will find can be specified in Max which defaults to 200.
searchItemRegex
ClassMethod searchItemRegex(Matcher As %Regex.Matcher, Name As %String, ByRef Found As %Integer, Max As %Integer = 200) As %Boolean [ Private ]
Search this specific item for the string
searchClassNodeRegex
ClassMethod searchClassNodeRegex(Matcher As %Regex.Matcher, Name As %String, ref As %String, type As %String, NewName As %String, ByRef Found As %Integer, Tree As %String, Max As %Integer = 200) [ Private ]
Search this class for the string
DeleteItem
ClassMethod DeleteItem(name As %String)
NormalizeName
ClassMethod NormalizeName(ByRef name As %String, ByRef type As %String = "", skiptype As %Boolean = 0) As %Status
Normalize the name passed in and determine its type
Normalize
ClassMethod Normalize() As %Status
IsUpToDate
Method IsUpToDate(ByRef uptodate As %Boolean, ByRef notuptodate As %String = "") As %Status [ Internal ]
Internal method to determine if all classes in this project are up to date. The uptodate is returned as a %Boolean value to indicate if everything is up to date or not. If some items are not up to date then the items in question are returned in a comma separated list in notuptodate.