Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %CSP.Routine
Private  Storage   

%CSP.Routine


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

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 7 24


Summary


Properties
%Location AtEnd Attributes BOM
CanonicalFilename Directory Filename Generated
Id IsModified LastModified LineTerminator
Locked Namespace ReadSize RemoveOnClose
Size StreamFormatWrite TimeStamp TranslateTable
UpToDate Url UseVMSVersion

Methods
%%OIDGet %AddToSaveSet %BindExport %BuildObjectGraph
%CheckUnique %ClassIsLatestVersion %ClassName %Close
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %DowngradeConcurrency
%Exists %ExistsId %Extends %GetParameter
%GetSwizzleObject %Id %IncrementCount %IsA
%IsModified %IsNull %KillExtent %LOBPrefetch
%LocationGet %LocationSet %LockStream %New
%NormalizeObject %ObjectIsNull %ObjectModified %ObjectSize
%Oid %Open %OpenId %OriginalNamespace
%PackageName %ReleaseLock %Reload %RemoveFromSaveSet
%RollBack %Save %SerializeObject %SetModified
%UnlockStream %UpgradeConcurrency %ValidateObject CanonicalFilenameGet
Clear ClearGatewayCache Compile CopyFile
CopyFrom CopyFromAndSave CreateBackup Delete
DeleteAttribute DeleteStream Exists FileBinarySize
FilenameGet FilenameSet FindAt Flush
GetAttribute GetAttributeList GetCurrentTimeStamp GetDate
GetStreamId GetStreamIdForFile InputFromDevice IsCharacter
IsDefinedAttribute IsFileUnicode IsNull LastModifiedGet
LineTerminatorSet LinkToFile LinkToUrl Lock
LockRoutine MoveTo MoveToEnd NewFileName
NextAttribute OpenStream OutputToDevice OutputToDeviceAt
Read ReadLine ReadLineIntoStream ReadSQL
Rewind SaveStream SerializeToSyncSet SetAttribute
SetAttributeList SizeGet StreamOIDIsNull SyncStreamIn
TimeStampGet TranslateTableSet Unlock UpToDateGet
UrlSet Write WriteLine


Parameters


• parameter FILEEXT = "csp";
Override of file extension from %FileCharacterStream.

Properties


• property Generated as %Boolean;
True if this routine is generated from something else
• property IsModified as %Boolean [ InitialExpression = 0 ];
• 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 UpToDate as %Boolean [ Calculated ];
• property Url as %String;
Property holding the URL for this CSP application.

Methods


• private method %OnClose() as %Status
Override of %OnClose method from %FileCharacterStream
• private method %OnNew(url As %String = "") as %Status
Override of %OnNew method from %FileCharacterStream
• method Clear(permanent As %Boolean = 1) as %Status
Clear the contents of this Stream from permanent storage. This will remove the permanent stream storage and any temporary stream and initialise the stream to its initial state that it starts in, including removing all the stream attributes.

Returns a %Status value indicating success or failure.

• classmethod ClearGatewayCache(url As %String, clear As %List = "") as %Status
If needed this will clear the gateway cache of this static url
• 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 CopyFile(oldn As %String, newn As %String) as %Boolean
Copy file.
• classmethod CreateBackup(url As %String, store As %String) as %Status
Internal method to create backups of CSP routines
• 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
• private method GetReadOpenParameter(filename As %String, mode As %Integer, ByRef pos As %Integer) as %String
Override of GetReadOpenParameter from %FileCharacterStream
• private method GetWriteOpenParameter(filename As %String, mode As %Integer) as %String
• private method IOGetStreamId() as %String
Override of IOGetStreamId method from %FileCharacterStream
• 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.
• private method NamespaceSet(val As %String) as %Status
Set method for Namespace property to make it readonly
• 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 TimeStampGet() as %TimeStamp
Get method for TimeStamp property.
• method Unlock() as %Status
Unlock the current routine
• method UpToDateGet() as %Boolean
This is a Get accessor method for the UpToDate property.
• method UrlSet(url As %String) as %Status
Set method for Url property