%Atelier.v1.Utils.General
Class %Atelier.v1.Utils.General Extends %RegisteredObject [ Owner = {%Developer} ]
Methods
GetCSPAppPath
ClassMethod GetCSPAppPath(pName As %String, Output pPath) As %Status
This method returns the path for the named CSP application
GetNameFromDocArray
ClassMethod GetNameFromDocArray(ByRef pTextArray, Output pName)
This method parses a document header and extracts the name
AccessibleNamespaces
ClassMethod AccessibleNamespaces(Output pList As %String)
This method returns a list of accessible namespaces
GetDocHash
ClassMethod GetDocHash(pName As %String, Output pHash As %String, Output pTextArray As %String) As %Status
This method takes a document name and computes a hash value by applying the sha1 hash function to normalized source
CalcHash
ClassMethod CalcHash(ByRef pTextArray As %String, Output pHash) As %Status
Given an array of normalized text lines, compute the textual hash value
BeginCaptureOutput
ClassMethod BeginCaptureOutput(Output pCookie As %String) As %Status
This method starts capturing the output from a program
EndCaptureOutput
ClassMethod EndCaptureOutput(pCookie As %String, Output pText As %DynamicArray) As %Status
This method retrieves the captured output and delivers it as an array of lines
ValidateDocName
ClassMethod ValidateDocName(pDocName As %String, Output pStatus, Output pCategory As %String, Output pBinary As %Boolean) As %Boolean
ValidateDocName tests that a DocName has legal syntax
Returns a %Boolean:
- 1 - If pDocName has legal DocName syntax
- 0 - Otherwise
Also returns the Category of the document and a Boolean of whether the document needs to be transmitted as binary or not.
GetDocCategory
ClassMethod GetDocCategory(pDocName As %String, Output pCategory As %String) As %Status
Given a document name, return the category. The %Status value is from ValidateDocName.
NormalizeDocName
ClassMethod NormalizeDocName(pDocName As %String) As %String
NormalizeDocName adds the default package name to .cls files. It also down cases the DocName type for class and routine types.
The pDocName is assumed to have been validated by ..ValidateDocName.
Returns the normalized DocName as a %String.
ExistsDoc
ClassMethod ExistsDoc(pDocName As %String, Output pStatus) As %Boolean
ExistsDoc checks that the item named by pDocName exists and returns the appropriate %Boolean value.
ValidType
ClassMethod ValidType(pType As %String, ByRef pKeywords As %String) As %String
ValidType(pType,pKeyword) checks that a Type attribute is valid. If the type is valid then it is changed to upper case, inserted into the pKeywords array (passsed by reference) and returned as the result of ValidType
If the type is invalid then ValidType returns "".
Note: If the pKeywords array contains a conflicting Type value or a conflicting LanguageMode value then the Type attribute is invalid.
ValidLANG
ClassMethod ValidLANG(pMode As %String, ByRef pKeywords As %String) As %String
ValidLANG(pMode,pKeyword) checks that a LanguageMode attribute is valid. If the mode is valid then it is inserted into the pKeywords array (passed by reference) and returned as the result of ValidLANG
If the mode is invalid then ValidLANG returns "".
Note: If the pKeywords array contains a conflicting Type value or a conflicting LanguageMode value then the mode attribute is invalid.
WrapRtnDocWithXML
ClassMethod WrapRtnDocWithXML(pDocumentArray As %String, Output pWrappedDocument As %Stream) As %Status
This method wraps a client document with an XML wrapper which allows it to be imported into InterSystems IRIS
TS
ClassMethod TS(pDocName, ByRef pUpToDate) As %String
Return a normalized timestamp for a document
GetDbForDoc
ClassMethod GetDbForDoc(pDocName As %String, Output pDatabase) As %Status
Given the name of a class, return the database to which it is mapped
GetModifiedDocuments
ClassMethod GetModifiedDocuments(ByRef pHashes, pType As %String, ByRef pGbl As %String, pShowGenerated As %Boolean = 1) As %Status
Given an array of hashes which represent databases, and using the database mappings for the current namespace, return a list of documents of the requested type which have been modified after the given hash was generated. The list is in the returned process private global.
GetModifiedClassesIndex
ClassMethod GetModifiedClassesIndex(ByRef dirlist, dbdir As %String, dbname As %String, pShowGenerated As %Boolean, hashIn As %String, ByRef hashOut As %String) As %Status [ Private ]
GetModifiedRoutinesIndex
ClassMethod GetModifiedRoutinesIndex(pType As %String, ByRef dirlist, dbdir As %String, dbname As %String, pShowGenerated As %Boolean, hashIn As %String, ByRef hashOut As %String) As %Status [ Private ]
GetModifiedDocumentsDB
ClassMethod GetModifiedDocumentsDB(pDatabase As %String, ByRef pHash As %String, pType As %String, Output pDocs As %String, pShowGenerated As %Boolean = 1) As %Status
Given a database name and a hash value, return a list of documents of the requested type which have been modified after the given hash was generated. The current hash value will be returned in the pHash argument.
GetDbNameFromDir
ClassMethod GetDbNameFromDir(pDir As %String) As %String
CreateDocumentObject
ClassMethod CreateDocumentObject(Output pDocObject As %DynamicObject, ByRef pDocArray, pName As %String, pDocStatus As %Status, pTimeStamp As %String, pUpToDate As %Boolean) As %Status
Create a document object
CreateDocumentCollection
ClassMethod CreateDocumentCollection(ByRef pArray) As %Atelier.v1.Utils.LazyCollection
Create a document collection object from an array of document objects
WriteMsg
ClassMethod WriteMsg(ByRef pMsgArray As %String)
Output a message array
Hash
ClassMethod Hash(pValue As %String) As %String [ CodeMode = expression ]
Compute a hash value but replace potentially problematic characters
Base64FromStream
ClassMethod Base64FromStream(pStream As %Stream, Output pEncoded As %Stream) As %Status
Encode a stream as BASE64
NamespaceDbList
ClassMethod NamespaceDbList(pNamespace As %String, Output pDB As %String) As %Status
Return list of databases where the routines for a namespace are mapped. It does not include the default database.
GetDbdirCrhash
ClassMethod GetDbdirCrhash(pDbdir As %String, Output pHash As %String) As %Status
Given the database directory definition, get the creation time hash value
Compile
ClassMethod Compile(ByRef pItemArray As %String, pFlags As %String, pGetSource As %Boolean = 1, Output pResult As %DynamicObject) As %Status
GetCSPToken
ClassMethod GetCSPToken(pPage As %String, pToken As %String = "") As %String [ SqlProc ]
For use via the Query API (/:namespace/action/query): Returns a token for use in CSPCHD in a URL May validate and extend an existing token (pToken)
GetRoutineMappings
ClassMethod GetRoutineMappings(Output rtndir) As %Status
Get the routine mappings and break them out into lists for each routine type