Skip to main content

%CSP.Routine

Class %CSP.Routine Extends %FileCharacterStream [ System = 3 ]

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()

Parameters

FILEEXT

Parameter FILEEXT = "csp";

Override of file extension from %FileCharacterStream.

Properties

Generated

Property Generated As %Boolean;

True if this routine is generated from something else

IsModified

Property IsModified As %Boolean [ InitialExpression = 0 ];

UpToDate

Property UpToDate As %Boolean [ Calculated ];

Url

Property Url As %String;

Property holding the URL for this CSP application.

Namespace

Property Namespace As %String;

Readonly property holding the namespace for this CSP application.

TimeStamp

Property TimeStamp As %TimeStamp [ Calculated ];

Caclulated property that contains the current timestamp for the routine.

Locked

Property Locked As %Integer [ InitialExpression = 0 ];

Number of times this routines has been locked.

Methods

UpToDateGet

Method UpToDateGet() As %Boolean

%OnClose

Method %OnClose() As %Status [ Internal, Private ]

Override of %OnClose method from %FileCharacterStream

IOGetStreamId

Method IOGetStreamId() As %String [ Internal, Private ]

Override of IOGetStreamId method from %FileCharacterStream

%OnNew

Method %OnNew(url As %String = "") As %Status [ Internal, Private ]

Override of %OnNew method from %FileCharacterStream

OpenStream

Method OpenStream(url As %String) As %Status

Override of OpenStream method from %FileCharacterStream to open a %CSP.Routine.

SaveStream

Method SaveStream(supressbackup As %Boolean = 1, Output Refresh As %Boolean) As %Status

Override of SaveStream method from %FileCharacterStream to save this stream

ClearGatewayCache

ClassMethod ClearGatewayCache(url As %String, clear As %List = "") As %Status

If needed this will clear the gateway cache of this static url

UrlSet

Method UrlSet(url As %String) As %Status [ Internal ]

Set method for Url property

NamespaceSet

Method NamespaceSet(val As %String) As %Status [ Internal, Private ]

Set method for Namespace property to make it readonly

LinkToUrl

Method LinkToUrl(url As %String = "") As %Status

Link this stream to the file pointed to by this url.

CopyFile

ClassMethod CopyFile(oldn As %String, newn As %String) As %Boolean [ Internal ]

Copy file.

Compile

Method Compile(qspec As %String = "") As %Status

Compile this CSP page. This calls SaveStream to flush the stream out to disk before calling compile.

Delete

ClassMethod Delete(url As %String) As %Status [ ProcedureBlock = 1 ]

Delete the file associated with this CSP url

Exists

ClassMethod Exists(url As %String) As %Boolean

Return true if the CSP file exists (not the class) and false otherwise.

GetDate

ClassMethod GetDate(url As %String) As %TimeStamp

Return the timestamp of this CSP/CSR file. If there is no file then return -1

GetCurrentTimeStamp

Method GetCurrentTimeStamp() As %TimeStamp

Get the timestamp for the routine.

TimeStampGet

Method TimeStampGet() As %TimeStamp [ CodeMode = expression, Internal ]

Get method for TimeStamp property.

Lock

Method Lock() As %Status

Lock the current routine

Unlock

Method Unlock() As %Status

Unlock the current routine

LockRoutine

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.

GetReadOpenParameter

Method GetReadOpenParameter(filename As %String, mode As %Integer, ByRef pos As %Integer) As %String [ Internal, Private ]

Override of GetReadOpenParameter from %FileCharacterStream

GetWriteOpenParameter

Method GetWriteOpenParameter(filename As %String, mode As %Integer) As %String [ Private ]

Clear

Method Clear(permanent As %Boolean = 1) As %Status