stream class %CSP.Routine
extends %FileCharacterStream
Subclass of %FileCharacterStream that is used to load, save, compile,
delete, etc. CSP files. To create one you pass it the URL of the CSP file you wish
to manipulate such as:
Set stream=##class(%CSP.Routine).%New("/csp/samples/inspector.csp")
Do stream.OutputToDevice()
parameter FILEEXT = "csp";
Override of file extension from %FileCharacterStream.
property Generated
as %Boolean;
True if this routine is generated from something else
property Locked
as %Integer [ InitialExpression = 0 ];
Number of times this routines has been locked.
property Namespace
as %String;
Readonly property holding the namespace for this CSP application.
property TimeStamp
as %TimeStamp [ Calculated ];
Caclulated property that contains the current timestamp for the routine.
property Url
as %String;
Property holding the URL for this CSP application.
method Compile(qspec As %String = "")
as %Status
Compile this CSP page. This calls SaveStream to flush the stream
out to disk before calling compile.
classmethod Delete(url As %String)
as %Status
Delete the file associated with this CSP url
classmethod Exists(url As %String)
as %Boolean
Return true if the CSP file exists (not the class) and false otherwise.
method GetCurrentTimeStamp()
as %TimeStamp
Get the timestamp for the routine.
classmethod GetDate(url As %String)
as %TimeStamp
Return the timestamp of this CSP/CSR file. If there is no file then return -1
method LinkToUrl(url As %String = "")
as %Status
Link this stream to the file pointed to by this url.
method Lock()
as %Status
Lock the current routine
classmethod LockRoutine(name As %String, lock As %Boolean = 1, checkfile As %Boolean = 1)
as %Status
Lock or unlock a particular routine name. If lock
is true then it will be locked else it will be unlocked.
method OpenStream(url As %String)
as %Status
Override of OpenStream method from %FileCharacterStream to open a %CSP.Routine.
method SaveStream(supressbackup As %Boolean = 0, Output Refresh As %Boolean)
as %Status
Override of SaveStream method from %FileCharacterStream to save this stream
method Unlock()
as %Status
Unlock the current routine