How to export the whole project

How would I export the WHOLE PROJECT rather than just a single class file out to an XML file?

 

I would like to, on every file change export the whole project to XML

 

Thanks for your time

Vote up!
Vote down!

Rating: 0

Comments: 7 Views: 77

3 answers

Answer

Coty, judging by the update you made here (where you originally raised this question as a comment one another post), for you the term "whole project" means "everything in a namespace". You have discovered that SET sc= $SYSTEM.OBJ.ExportAllClasses(filename) does what you want.

For many of us the word "project" refers to a Studio feature that allows us to group a subset of a namespace's code.

Studio projects can be manipulated programmatically using the %Studio.Project class.

Vote up!
Vote down!

Rating: 1

Wow, that's so much for your answer. Very informative that I needed to know

 

now what I need to do is export the INT ROUTINES that we also have

Vote up!
Vote down!

Rating: 0

Answer

I would like to, on every file change export the whole project to XML

What do you want to achieve with that?

Vote up!
Vote down!

Rating: 0

Custom git tool for GitHub. 

Ive read the documentation on the source control hooks, but I'm more interested in exporting all files from the database into typical file system files that I can have my way with in perl since I use that language often for working with files

 

For now I don't want to implement the check in and checkout for single files at a time. This is a startup so I'm trying to get everything stable first

Vote up!
Vote down!

Rating: 0

There is a GitHub Studio Hook already built out there in the wild. I wouldn't rewrite another one if I were you...

On the other hand, I wouldn't use this hook exactly because it generates XML exports of our files and I hate seeing my source code as XML on GitHub.

Instead, I would use Atelier with EGit plugin connected to my local Caché server. If you don't like Atelier, you can still use Studio if you want to. You will spend most of your time working with Studio on your local machine. When you are ready to commit your work to GitHub, you can open Atelier, synchronize your source code (what will export each class/routine to plain text files with your plain source code instead of XML) and commit the changes to GitHub.

It's like using Atelier as you would use Tortoise, except that Tortoise won't connect to Caché and export all/import all your source code for you like Atelier does... ;)

I like Atelier. I am used to it. Try it and maybe you will like it too. I can't wait to see the new release of it! Good luck!

 

Vote up!
Vote down!

Rating: 1

I already wrote the perl script to do if. It's like 30 lines of code. I was using it because I was exporting the whole project with csp files and int files. 

Literally the only thing I have left to finish is the export like done with studio GUI but have it done programmatically. 

I saw in the documentation you can use studio from the windows command line but I couldn't find/figure out how to have it export the whole project through an argument.

 

thanks so much for your reply! I will look into everything you mentioned!

Vote up!
Vote down!

Rating: 0

For the case of Github, I think one file per one program/class would be the better approach.

You can use Atelier, like @Amir Samary mentioned. And in case you have no Atelier I can recommend also this very simple util: cache-udl

Setup the folder with:

d ##class(sc.code).workdir("your/workdir")

And export everything in a namespace with:

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

For import use:

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

to import all, or:

d ##class(sc.code).importUpdated()

for the recently updated files.

And yes, it exports in UDL. I think for Github UDL is more suitable. 

May I ask you, why do you need XML for your code files?

 

 

 

Vote up!
Vote down!

Rating: 1

Answer

You can use $System.OBJ.Export() for it.

For every project where I need it I have a project cheatsheet file, where I have:

s list="MyPackage*.INC,MyPackage*.CLS,Folder*.DFI"
D $System.OBJ.Export(list,"release"_$tr($zd($h,3),"-","")_".xml")

So when I need to export the whole project into importable xml file I call these two lines in terminal.

 

Vote up!
Vote down!

Rating: 1

What about if I want to export the ROUTINES which are INT files

my supervisor said something about 

    %RO

and it worked but it's not XML ;,(

 

i guess im really having issues with understanding what exactly a "package" is

Vote up!
Vote down!

Rating: 0

Just add *.INT into the list var:

s list="MyPackage*.INC,MyPackage*.CLS,Folder*.DFI,*.INT"
Vote up!
Vote down!

Rating: 1

Log in to answer