Article
· Oct 11, 2022 2m read

ZPM Simple Implementation Cookbook

ZPM is designed to work with applications and modules for InterSystems IRIS Data Platform. It consists of two components, the ZPN Client which is a CLI to manage modules, and The Registry which is a database of modules and meta-information. We can use ZPM to search, install, upgrade, remove and publish modules. With ZPM you can install ObjectScript classes, Frontend applications, Interoperability productions, IRIS BI solutions, IRIS Datasets or any files such as Embedded Python wheels. 

Today this cookbook will go through 3 sections:

  1. Install ZPM
  2. Generate Module
  3. Find, Install, publish modules inside the Registry

 

1. Install ZPM

  • Download latest version of ZPM ( this should be one single XML file) Download link
  • Import XML you have downloaded to IRIS and it can only be deployed into IRIS open IRIS terminal and enter

write $SYSTEM.OBJ.Load("C:\zpm.xml", "c")

Note "C:\zpm.xml" is the path of the XML file downloaded, this step could take a while.

  • After finished installing, simply type zpm, press enter, you will see you are in zpm shell

2. Generate Module

Before we start generating module, we need to prepare a folder that has one or more files ready to load, Therefore I have created a folder under C drive called zpm.

Execute the command generate C:/zpm

After you specific all the necessary, your first module has been generated successfully, also you will see 

Note: 

  1. module version is using semantic versioning 
  2. module source folder is the folder has all the class file
  3. zpm also offers a option to add web applications and dependency, in this example I will leave it blank

Now, open the file explorer, you will see a file called "module.xml" as you can see from the screenshot below

Type command load C:\ZPM\ you will see your module has been reloaded, validated, compiled and activated

 

 

3. Find, Install, publish modules inside the Registry

Find packages available in the current Registry: zpm:USER>search

Install package from current Registry as an example lets install a module called zpmshow in public Registry: zpm:USER>install zpmshow (the command is install "moduleName")

Publish module after loaded: zpm:USER>publish myFirstZPMDemo

You can use zpm:USER>search to verify the publish, in my case you can see "myfirstzpmdemo 0.1.0" is sitting in current Registry.

Note: If you have an error when you are publishing a module that says: "ERROR! Publishing module, something went wrong", make sure that the status of the current Registry is enabled and available.

You can use zpm:USER>repo -list, to verify the status of current Registry.  

 

Video available: Click here

Discussion (10)3
Log in or sign up to continue

You can't publish manually to the public repository, you can do it only through OpenExchange, check IPM during application creation, and with the next release, it will publish your project for you

If you want to publish to your repo, you just have to specify login and password, with command like this

repo -r -n myrepo -url https://server/registry/ -user "test" -pass "test"