Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%Studio] >  [SourceControl] >  [ItemSet]
Private  Storage   

persistent class %Studio.SourceControl.ItemSet extends %Persistent, %XML.Adaptor

Class which lists things coming to or from the client as part of the CCR process

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
4 28 37 3 6


Summary

Properties
CCR ClientResponses Committed CommittedTimestamp
CreateTimestamp CreatedBy Deployed DeployedTimestamp
Environment ExportTimestamp FileLabel ImportTimestamp
ItemList ItemSetFile ItemSetFilename Job
Log LogHistory Name Payload
PayloadFile PayloadFilename ServerItemSetID SessionToken
Source System Target

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PhysicalAddress %PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject Bundle
ChangeWritableState CheckWritableState Create DisplayLog
Download Export ExportToFile FindReplaceInFile
GetPathTranslation IRISLIBReadOnly Import InstanceVersion
IsValidOSProcessName Load LoadToNS LoadToOS
LogTags LogToggle LogToggleCore NameCVT
P4Revert P4SubmitItemSet ServerItemSetCount ServerItemSetIDGet
ServerItemSetIDSet SessionTokenGet SessionTokenSet SetUpProxyUnauth
Upload WSConfirmLoad WSDownload WSList
WSUpload XMLDTD XMLExport XMLExportToStream
XMLExportToString XMLNew XMLSchema XMLSchemaNamespace
XMLSchemaType


Parameters

• parameter CSPAppLink = "itemsetsourcelink";
This is the string used for naming the default proxy CSPApplication that is referenced for exporting/importing files
• parameter MANAGEDEXTENT = 0;
The MANAGEDEXTENT parameter can be set to 0 (zero) to cause the Extent Manager to ignore this class. If set to 1 then the Extent Manager will register globals used by the class and detect collisions. Unmanaged extents (MANAGEDEXTENT = 0) are not checked. Currently, only classes using default storage (%Storage.Persistent) can be managed. This is required since each Namespace will have it's own Change extent
• parameter SrcVer = "$Id: //iris/2019.2.0/databases/sys/cls/Studio/SourceControl/ItemSet.xml#1 $";
This Parameter should be updated when synced from Perforce
• parameter Version = 122;
Revision number of this class when compiled as part of the //custom_ccrs/_common/config/... branch. This version will not be updated (by design) when the class is integrated to other branches. This allows the user to tell what version of the Studio client tools are in use.

Properties

• property CCR as %String;
CCR for which this ItemSet was created
• property ClientResponses as array of %Integer(XMLPROJECTION="NONE");
Tracks the deployment of the ItemSet to Primary and Secondary Environments by EID using same values as Deployed (0,1,2,3) Does not need abandoned or stale since these are specific to the whole ItemSet

a value of 0 means that it has not been deployed

a value of 1 means that it has been downloaded but not yet deployed

a value of 2 means that it has been deployed successfully

a value of 3 means that there has been an attempt to deploy but there was an error

• property Committed as %Integer(XMLPROJECTION="NONE") [ InitialExpression = "0" ];
Indicates that this ItemSet (created on a Client) has been committed to Perforce by the CCR Server

a value of 0 means that it has not been committed

a value of 1 means that it is currently being committed

a value of 2 means that it has been committed successfully

a value of -1 means that it has been aborted

• property CommittedTimestamp as %TimeStamp;
Time the ItemSet was committed to Perforce
• property CreateTimestamp as %TimeStamp [ InitialExpression = $zdt($H,3),Required ];
Time the ItemSet was created
• property CreatedBy as %String;
User who created or imported this ItemSet; this should be a CCR Username
• property Deployed as %Integer(XMLPROJECTION="NONE") [ InitialExpression = "0" ];
Indicates the status of the deployment of this ItemSet

a value of 0 means that it has not been deployed

a value of 1 means that it has been downloaded but not yet deployed

a value of 2 means that it has been deployed successfully

a value of 3 means that there has been an attempt to deploy but there was an error

a value of -1 means that it has been abandoned

• property DeployedTimestamp as %TimeStamp;
Time the ItemSet was deployed
• property Environment as %String(VALUELIST=",BASE,TEST,UAT,LIVE");
Environment for/from which this ItemSet was created
• property ExportTimestamp as %TimeStamp;
Time the ItemSet was exported
• property FileLabel as %String;
Additional identifying Label for the Payload filename
• property ImportTimestamp as %TimeStamp;
Time the ItemSet was imported
• property ItemList as array of %String(COLLATION="EXACT");
List of Items in this ItemSet, where the key is the item name, and the value is add/edit/delete/failed
• property ItemSetFile as %String(MAXLEN=200,XMLPROJECTION="NONE");
Location path and filename on local file system where exported XML for this ItemSet is stored
• property ItemSetFilename as %String [ Calculated ];
name of ItemSet file for this ItemSet
• property Job as %String [ Calculated ];
Perforce Job that was exported in this ItemSet; or Job associated with this CCR on this Server
• property Log as %Stream.GlobalCharacter(XMLPROJECTION="NONE");
Global stream storing the most recent Log for this system
• property LogHistory as %Stream.GlobalCharacter(XMLPROJECTION="NONE");
Global stream storing the cumulative logs for this ItemSet on this system
• property Name as %String(MAXLEN=128);
readable name of this ItemSet; used for file names and project name
• property Payload as %FileCharacterStream(TRANSLATETABLE="RAW");
Object forthe payload file for this ItemSet
• property PayloadFile as %String(MAXLEN=200,XMLPROJECTION="NONE");
Location on local file system where Payload for this ItemSet is stored
• property PayloadFilename as %String [ Calculated ];
name of Payload for this ItemSet
• property ServerItemSetID as %String(XMLPROJECTION="NONE") [ Calculated ];
Transient property to store the server-side ID for this ItemSet
• property SessionToken as %String(XMLPROJECTION="NONE") [ Calculated ];
Transient property to store the session token to pull this ItemSet from the Server
• property Source as %String(MAXLEN=100) [ InitialExpression = $get(^SYS("SourceControl","ItemSetConfig","Source"),$zu(54,0)) ];
Name of the server where this ItemSet was created
• property System as %String;
System for which this CCR was created
• property Target as %String(VALUELIST=",Server,Client") [ Required ];
generic intended destination for this ItemSet

Methods

• classmethod Bundle(pInteractive As %Boolean = 1, pIncludeAllUncommitted As %Boolean = 0, pCCR="", pCreatedBy, pPerformUpload=1, pEmailRecipient="") as %Status
Wrapper method for bundling pending changes, and added them to an ItemSet which can be uploaded to CCR for check-in Can be either interactive or scripted
• classmethod ChangeWritableState(pList="", pReadOnly As %Boolean = 0, ByRef pLog As %Stream.Object = "") as %Status
method takes a file name, or an array of filenames, and changes the pReadonly state to the pReadOnly value
• classmethod CheckWritableState(pList="", ByRef pReadOnly, ByRef pReadWrite, ByRef pAbsent, ByRef pLog As %Stream.Object = "") as %Status
Given a list of files on the OS, returns a list of those that are Readonly, and a list of those that are writable
• method Create(pItems="", pJob="", pCreatedBy="", pLabel="", pTarget="Server", pCCR="", pEnv="") as %Status
Method to create a ItemSet and Payload file which can be passed to another system for import pItems is an array subscripted by the item name (full file name on file system), with a value of add/edit/delete
• classmethod DisplayLog(pID) as %Status
Displays the LogHistory of an ItemSet
• classmethod Download(pLoad As %Boolean = 1)
Wrapper method for interactively downloading list of ItemSets from server via Web Service, and then selecting and saving one to disk
• classmethod Export(pID="", ByRef pItemSetFile) as %Status
Export the ItemSet to the file system
• method ExportToFile(ByRef pItemSetFile) as %Status
Export the ItemSet to the file system
• classmethod FindReplaceInFile(pFind, pReplace, pFile, pExtensionRename="", pLog As %Stream.Object = "") as %Status
as cspapplication paths must be unique, if multiple namespaces on this instance need to send/receive ItemSets, then we may be using a secondary cspApp naming convention which is '/..#CSPAppLink/' When this is the case, this method exchanges the values in an XML file on disk to or from the standard (/..#CSPAppLink/) or local csp application name.
• classmethod GetPathTranslation(ByRef pRoot, ByRef pPath) as %Status
the Utility CSPApplication, called '/itemsetsourcelink*' acts as a mechanism to 'tar' and 'untar' ItemSets for transport to/from Server/Client this makes sure that the CSP Application is defined for this namespace, and finds where it points on the file system
• classmethod IRISLIBReadOnly(mode="") as %Boolean
Utility method to change mount setting for IRISLIB; passing no mode argument will return the current status
• classmethod Import(pItemSetFile, ByRef pObj As %Studio.SourceControl.ItemSet = "", pServerISID As %String, pToken As %String) as %Status
Import a ItemSet from the file system
• classmethod InstanceVersion() as %Numeric
Returns value the Major.Minor version for this instance, so it can be used in comparison code which makes sure certain features are used in appropriate versions
• classmethod IsValidOSProcessName(ByRef pCurrentProcess, ByRef pSServer) as %Boolean
Utility method to check the OS username of the current process make sure for UNIX it matches the username that the Super Server is running as
• classmethod Load(pInteractive As %Boolean = 1, pItemSetFile="", pLoadToOS As %Boolean = "", pOverwrite As %Boolean = 0, pLoadToNS As %Boolean = "", pCompile As %Boolean = "", pQspec={$get(^SYS("SourceControl", "Misc", "ImportFlags"), "kvfbryu")}, pP4user, pP4pass, ByRef pNewID As %String, pServerISID="", pToken="") as %Status
Wrapper method for importing, loading to file system (OS), loading to namespace and compiling ItemSet into this namespace Can be either interactive or scripted
• method LoadToNS(pQspec As %String = {$get(^SYS("SourceControl", "Misc", "ImportFlags"), "kvfbryu")}, pLoadedlist, pListonly As %Boolean = 0, pCompileProject As %Boolean = 0, ByRef pIncPercent As %String, ByRef pProjectName As %String) as %Status
Loads the files from the file system into the namespace; creates a project and (optionally) compiles the project

When pCompileProject=1, the project will be compiled after load is complete

When pCompileProject=2, the project will only be compiled after load if the ItemSet does not contain this class in it's payload (i.e. pIncPercent'=2)

• method LoadToOS(pQspec As %String = {$get(^SYS("SourceControl", "Misc", "ImportFlags"), "kvfbryu")}, ByRef pErrorlog As %String, ByRef pLoadedlist As %String, ByRef pReadWrite As %String, pListonly As %Boolean = 0, pOverwrite As %Boolean = 0, pP4user="", pP4pass="") as %Status
Load the items in this ItemSet into the local file system If the file already exists and is ReadOnly, then it will be changed to ReadWrite, loaded to the OS, and then marked as ReadOnly again If the file exists and is ReadWrite, it will not be overwritten by the ItemSet load, unless pOverwrite is set to true
• classmethod LogTags() as %String
holder method for output redirect tags; returns the name of the compiled routine where these tags exist [Previously private]
• method LogToggle(ByRef pIO="")
Logging instance method for this object; redirects IO to ..Log, and then saves it to ..LogHistory and saves the object when logging is turned off
• classmethod LogToggleCore(ByRef pIO="", ByRef pLog As %Stream.Object)
Logging class method; redirects IO to either a %Stream.GlobalCharacter or a %Stream.FileCharacter
• classmethod NameCVT(ByRef pNameList="", pValidate As %Boolean = 0, pDropLeadingSlash As %Boolean = 0) as %Status
takes an item name (or an array of names), and converts it from the file system representation to the csp application representation, or vice versa if pName includes a Perforce version identifier (e.g. <file>#<ver> ignore the version when validating the file's existence

When pValidate is '1', when the method will confirm that the file exists and that it is not empty (there is no usecase for passing empty files in ItemSets).

• method P4Revert(SCs="", changelist="", perforceBranch="", pP4user, pP4pass) as %Status
• method P4SubmitItemSet(pQspec As %String = "kvfbryu", ByRef pErrorlog As %String, ByRef pLoadedlist As %String, pP4user As %String = "", pP4pass As %String = "") as %Status
Logic used on the server to submit contents of a ChangeList to Perforce
• classmethod ServerItemSetCount(pCCR) as %Integer
Returns the count of ItemSets destined for the Server
• method ServerItemSetIDGet() as %String
This is a Get accessor method for the ServerItemSetID property.
• method ServerItemSetIDSet(val) as %Status
This is a Set accessor method for the ServerItemSetID property.
• method SessionTokenGet() as %String
This is a Get accessor method for the SessionToken property.
• method SessionTokenSet(val) as %Status
This is a Set accessor method for the SessionToken property.
• classmethod SetUpProxyUnauth(ByRef ws As %SOAP.WebClient)
Proxy configuration for un-authenticated proxy connection
• classmethod Upload(pInteractive As %Boolean = 1, pCCR, pToken, pItemSetFile, pEmailRecipient="") as %Status
Wrapper method for Uploading uncommitted changes to CCR for check-in Can be either interactive or scripted
• classmethod WSConfirmLoad(pISID As %String = "", pJob As %String = "", pEnv As %String = "", pToken As %String = "", pLoadStatus As %Status = "", ByRef pLog As %GlobalCharacterStream) as %Status
Wrapper that calls ConfirmLoad WebService to send back the results of an ItemSetLoad
• classmethod WSDownload(pJob As %String = "", pEnv As %String = "", pToken As %String = "", pDir As %String = "", pISID As %String = "", ByRef pFilename As %String) as %Status
Wrapper that calls Download WebService to download an ItemSet XML for a given ID to the local filesystem
• classmethod WSList(pJob As %String = "", pEnv As %String = "", pToken As %String = "", ByRef pRS As %XML.DataSet) as %Status
Wrapper that calls List WebService to get a result-set listing ItemSets for a given pJob and pEnv
• classmethod WSUpload(pItemSetFile As %String = "", pCCR As %String = "", pToken As %String = "", pEmailRecipient As %String = "") as %Status
Wrapper that calls Upload WebService to upload an ItemSet XML for a given ID to the ItemSet Server

Queries

• query ClientItemSetsByRID(pRID As %String)
SQL Query :
SELECT ID, Name, CreateTimestamp, Deployed
FROM ItemSet
WHERE CCR = :pRID AND Target='Client'
ORDER BY CreateTimestamp DESC
• query ServerItemSetCountByRID(pRID As %String)
SQL Query :
SELECT COUNT(ID) As Num FROM ItemSet WHERE CCR = :pRID AND Target='Server'
• query ServerItemSetsByRID(pRID As %String, pCommitted As %String = "")
SQL Query :
SELECT ID, Name, CreateTimestamp, CommittedTimestamp, ImportTimestamp
FROM ItemSet WHERE CCR = :pRID AND Target='Server' AND ''=:pCommitted UNION
SELECT ID, Name, CreateTimestamp, CommittedTimestamp, ImportTimestamp
FROM ItemSet WHERE CCR = :pRID AND Target='Server' AND Committed=:pCommitted
ORDER BY CommittedTimestamp DESC, CreateTimestamp DESC, ImportTimestamp DESC

Indices

•index (CCR on CCR);
•index (CommittedMap on Committed) [Type = bitmap];
•index (DeployedMap on Deployed) [Type = bitmap];
•index (ItemMap on ItemList(KEYS));
Enables Fast lookup of all ItemSets containing a given Item
•index (ItemSetMap on %PL97361,ItemList(KEYS));
Index to match items in the itemlist This is called item map because it maps items to the individual itemset When PL97361 is resolved for all supported client versions, the first subscript should be changed from %PL97361 to %%ID
•index (TargetBitMap on Target) [Type = bitmap];


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.