Question
· Jul 26, 2018

Export all code in one file

Hi all,

I want to export a production in one file, but it has some code in macros, include and class files. I'm exporting using portal (Classes / Select All / Export) but I need the same in macro's tab and copy the content in one file.Is there any whay to export all of then in just one file xml? By that way I can load using $System.OBJ.Load("file","ck")

Best regards.

Discussion (6)2
Log in or sign up to continue

Did you consider creating a Studio Project containing everything you need? Then you can export the project to XML in a way that includes all the members of the project as well as the project definition.

It's also worth knowing that if you go to the Namespace tab of the Workspace pane, then expand Classes, you can right-click on a package and add the package to your current project. This may be better that adding individual classes to your project, because by adding the package you ensure that any classes added later to the package will be exported too.

If you don’t use Studio, you can consider to try isc-dev tool, which is intended to simplify routine processes of import/export code, releases and patches.

Import it to e.g. USER and map to %All.

After that you’ll be able to import, export, release and patch in any namespace.

To work in a given namespace point the tool to a directory on the disk which contains repository in UDL or XML classes (preferablly UDL) with the following command:

d ##class(dev.code).workdir(“/work/github/myproject/src”)

Use following to import the code:

d ##class(dev.code).import()

To setup the mask introduce isc.json file into .../src folder with following content:

{“compileList”:”A*.INC,B*.CLS,C*.CLS,D*.DFI,E*.GBL”

”projectName”:”myproject”

”git”:0}

Example

Call Init class to let dev.code use settings in the given namespace:

d ##class(dev.code).init()

After that you’ll be able to export all the project in one file with the release command:

d ##class(dev.code).release()

it will export all into one /mgr/database/myproject_release_ddmmyyy.xml file.

Once you commit your changes to git repo you’ll be able to have a patch release. Call

d ##class(dev.code).patch()

to get all the changed code into one patch release in /mgr/database/myproject_patch_ddmmyyyy.xml file.

To export all source code (including DeepSee staff)  in UDL and organized in folders call:

d ##class(dev.code).export()

And call compile method to compile everything in your project, but not the whole namespace:

d ##class(dev.code).compile()

One of the projects which is maintained with this util is dsw-map: classes, globals, DFIs, releases.

  
  
  

creating a new Project and adding the classes/routines you want to export

USER>s p=##class(%Studio.Project).%New()
USER>s rc=p.AddItem("TestPackage.Test.cls")

Of course this could be done it studio as well....

USER>s sc=p.DeployToGbl("^depl","k",1)
TestPackage.Test.cls
USER>d $System.OBJ.Export("depl.gbl","/home/kazamatzuri/deplgbl.xml")

Exporting to XML started on 01/13/2010 08:48:30
Exporting global: ^depl
Export finished successfully.

USER>w

p=<OBJECT REFERENCE>[1@%Studio.Project]
rc=1
sc=1
USER>k

On the customers system .. (I just used another namespace)

USER>zn "TEST"

TEST>d $System.OBJ.Load("/home/kazamatzuri/deplgbl.xml")

Load started on 01/13/2010 08:48:58
Loading file /home/kazamatzuri/deplgbl.xml as xml
Imported global: ^depl
Load finished successfully.

TEST>s sc=##class(%Studio.Project).InstallFromGbl("^depl")
TestPackage.Test.cls

TEST>