Class Reference
IRIS for UNIX 2024.1.2
|
|
Private
Storage
|
Ens.Deployment.Utils provides APIs to create deployment packages and is used with
Examples:
/* Create a deployment file from a Studio Project */ Set tProjectName = "HL7v2Driver" Set tProductionName = "HL7v2Driver.SampleProduction" Set tProductionClassIncluded = 1 Set tExportFilename = "/SomeDirectory/Deployment_"_tProjectName_".xml" Set tComments =##class(%Stream.TmpCharacter).%New() /* tComments can be a stream or string */ Do tComments.WriteLine("This is a test exporting the whole production") Do tComments.WriteLine("Created to show HL7 message generation") Do tComments.Rewind() Set tSC =##class(Ens.Deployment.Utils).CreateExportPackageFromProjectList(tProjectName,.tContentsList,tExportFilename,tProductionName,tComments,tProductionClassIncluded)
/* Create a deployment file from a list of items */ Set tProjectName = "HL7v2Driver" Set tProductionName = "HL7v2Driver.SampleProduction" Set tProductionClassIncluded = 0 Set tExportFilename = "/SomeDirectory/Deployment_one_class_"_tProjectName_".xml" Set tComments = "Exporting one class and one routine." Set tContentsList("HL7v2Gen.MAC")="" Set tContentsList("HL7v2Driver.Service.CLS")="" Set tSC =##class(Ens.Deployment.Utils).CreateExportPackageFromProjectList(tProjectName,.tContentsList,tExportFilename,tProductionName,tComments,tProductionClassIncluded)
/* Create a Project text document containing settings for an Item */ Set tItemName = "ToMainLabADT" Set tProjectName = "HL7v2Driver" Set tProductionName = "HL7v2Driver.SampleProduction" Set:(tItemName '[ "||") tItemName = tProductionName_"||"_tItemName Set tItem = ##class(Ens.Config.Production).OpenItemByConfigName(tItemName) If $IsObject(tItem) Set tSC = ##class(Ens.Deployment.Utils).CreatePTDFromItem(.tItem,.tPTDName) If tPTDName '= "" { Set tProductionClassIncluded = 0 Set tExportFilename = $$$DeployDirectory_"Deployment_item_"_tProjectName_".xml" Set tComments = "just an item" Set tContentsList(tPTDName_".PTD")="" Set tSC =##class(Ens.Deployment.Utils).CreateExportPackageFromProjectList(tProjectName,.tContentsList,tExportFilename,tProductionName,tComments,tProductionClassIncluded) } Do ##class(Ens.Util.ProjectTextDocument).Delete(tPTDName_".PTD")
/* Create a Project text document containing settings for a Production */ Set tProjectName = "HL7v2Driver" Set tProductionName = "HL7v2Driver.SampleProduction" Set tProduction = ##class(Ens.Config.Production).%OpenId(tProductionName) If $IsObject(tProduction) Set tSC = ##class(Ens.Deployment.Utils).CreatePTDFromProduction(tProduction,.tPTDName) If tPTDName '= "" { Set tProductionClassIncluded = 0 Set tExportFilename = "/SomeDirectory/Deployment_prod_settings_"_tProjectName_".xml" Set tComments = "Production settings" Set tContentsList(tPTDName_".PTD")="" Set tSC =##class(Ens.Deployment.Utils).CreateExportPackageFromProjectList(tProjectName,.tContentsList,tExportFilename,tProductionName,tComments,tProductionClassIncluded) } Do ##class(Ens.Util.ProjectTextDocument).Delete(tPTDName_".PTD") /* Clean up tPTDName_".PTD" unless want to keep */
/* Create a Project text document containing list of items to remove. This can then be included in a call to CreateExportPackageFromProjectList() To remove a busines host item create the PTD for that item first. */ Set tItemName = "ToMainLabADT" Set tProjectName = "HL7v2Driver" Set tProductionName = "HL7v2Driver.SampleProduction" Set:(tItemName '[ "||") tItemName = tProductionName_"||"_tItemName Set tItem = ##class(Ens.Config.Production).OpenItemByConfigName(tItemName) If $IsObject(tItem) Set tSC = ##class(Ens.Deployment.Utils).CreatePTDFromItem(.tItem,.tPTDName) If tPTDName '= "" { Set tItemsToRemove(tPTDName_".PTD")="" Set tSC =##class(Ens.Deployment.Utils).CreateExportRemovePTD(tProjectName,tProductionName,.tItemsToRemove,.tPTDNameRemove) If tPTDNameRemove '= "" { Set tProductionClassIncluded = 0 Set tExportFilename = "/SomeDirectory/Deployment_remove_item_"_tProjectName_".xml" Set tComments = "Remove one item but we could have included other items" Set tContentsList(tPTDNameRemove_".PTD")="" Set tSC =##class(Ens.Deployment.Utils).CreateExportPackageFromProjectList(tProjectName,.tContentsList,tExportFilename,tProductionName,tComments,tProductionClassIncluded) } } Do ##class(Ens.Util.ProjectTextDocument).Delete(tPTDName_".PTD") /* Clean up tPTDName_".PTD" unless want to keep */ Do ##class(Ens.Util.ProjectTextDocument).Delete(tPTDNameRemove_".PTD") /* Clean up tPTDNameRemove_".PTD" unless want to keep */
|
|
|
|
Create a deployment Export Notes Project Text Document pProjectName is a name given to the export project. The notes PTD will be this preceded by EnsExportNotes. The name does not include the .PTD extension. pSourceProduction is the name of the Source production for the notes. pComments is a stream of comments. pContentsList is an array of items that will be exported by a subsequent process. pProductionClassIncluded indicates if the export will include a Production class. pRollbackFilename if specified indicates that these are notes for a rollback deployment file. This is passed by the deployment process. pDeploymentFile if pRollbackFilename is specified then this is the name of the corresponding deployment file.
Create a deployment Export package from a studio project pProjectName is the name of the studio project or the name to be used if providing list in pContentsListArray pContentsList - optional. An array of items to include in the export package. If defined this is used and not the StudioProject. If not defined then it is populated with the list of items from the project. After completion the list will also include the temporary project and project text document created and exported. pExportFilename is the OS file to create. If not specified the file name will be generated as EnsExport-then the project name then a date timestamp in the current working directory. pSourceProduction is the name of the Source production for the notes. pComments is a stream of comments to include in the Export notes. pProductionClassIncluded indicates if the export will include a Production class.
Create a deployment Export Items to Remove Project Text Document If pPTDName is passed back "" then no PTD created as nothing to remove. The name does not include the .PTD extension. pProjectName is a name given to the export project. The notes PTD will be this preceded by EnsExportNotes. pSourceProduction is the name of the Source production for the notes. pItemsToRemove is an array of items that will be added by the deployment and hence need to be marked for removal. pRollbackFilename if specified indicates that these are notes for a rollback deployment file. This is passed by the deployment process. pDeploymentFile if pRollbackFilename is specified then this is the name of the corresponding deployment file.
Create a Project Document Text entry for a given Production Item.
Create a Project Document Text for Production Settings This includes the production defined settings only and also does not include Items or SubProductions.
Generate rollback, log & report file names based on Deployment file name Used in InterSystems IRIS code: Portal deployment interface.
Used to retrieve contents of the export file by item number Used in InterSystemsm IRIS code: Portal deployment interface.
Load code and compile code. Check out items if Source Control is enabled (Check in will be done at the end of deployment. Compilation flags default to "ck-d" but can be changed setting the global ^Ens.Configuration("deploy","CompileFlags") the desired compilation flags.
Loop through pDeployDetails("SourceControl","") and for any item that is listed and GetStatus reports item checked out by this user then call CheckIn.
Loop through pObjectsToLoad and if item exists and is not in source control call AddToSourceControl If the item does not yet exist in the system mark it to be added in pDeployDetails array.
Loop through pDeployDetails("Items","") and find source control status. Update information about the item.
Log information to combination of Console, Web, Event Log, File pEventLogType is used to have variable control over Event log entry types if the initial log where setting includes EI for Event Log Information
Retrieve User Document Extensions and their associated Document Classes.