Written by

Question Salma Sarwar · Aug 8, 2019

Exporting Project whilst maintaining folder structure

Hi All,

I am currently looking for a way of exporting a project from within studio that would actually create the subfolders associated with it.  Is there an easy way of doing this.  Thanks in advance?

Kind Regards,

Salma

Comments

Jenna Makin · Aug 8, 2019

Hi Salma

What do you mean by "subfolders" . Is this a CSP project?

Jenna

0
Rubens Silva · Aug 8, 2019

You might want to try using Port. It was made exactly for that purpose.

Just install the port-prod.xml and restart your Studio, note that this tool will takeover your current source control class.

After that, open your project, Source Control->Export. If your language is not supported, then you might need to change your current session to english using ##class(%MessageDictionary).SetSessionLanguage("en").

0
Salma Sarwar  Aug 9, 2019 to Eduard Lebedyuk

Hi 

Thank you for your reply, I am already using the gitlab hook within Studio, what I wanted to do was export all the files with the relevant folder paths which I have done so using ##class(%SYSTEM.OBJ).ExportAllClassesIndividual however, if I create a project and try to export the files from within studio I can't find an easy way of maintaining the folder structure, it just exports all the classes in to one folder.

Kind Regards,

Salma

0
Eduard Lebedyuk  Aug 9, 2019 to Salma Sarwar

Documentation states there's an argument SubDir As %Boolean = 0 in ExportAllClassesIndividual  method.

Description: If SubDir is true then it will export sub-packages as subdirectories.

Try setting it to 1.

0
Ben Spead · Aug 9, 2019

I am assuming that when you are talking about 'folders' you mean the structure which individual items are exported into when you use your source control hooks, correct?  To achieve this you need to loop over all items in the namespace and call the source-control related export on each of them.

The way we do that for our internal systems is to the the BaselineExport() method in the %Studio.SourceControl.ISC class.  %Studio.SourceControl.ISC is our source control hooks class for Perforce, and I haven't tried calling BaselineExport() while another set of hooks are configured for the namespace, it may *just work*, especially if your GitLab hooks use the ^Sources global to describe the export structure.  Give is a try and let us know if it help (if not, I can get you the code for that method and you could adopt it for your purposes)

0
Salma Sarwar  Aug 19, 2019 to Ben Spead

Hi

This is exactly what I am looking for, are you able to get the code for me please so I have a starting point.  Thank you.

0
Salma Sarwar  Aug 19, 2019 to Ben Spead

Hi

This is exactly what I am looking for, are you able to get the code for me please so I have a starting point.  Thank you.

0
Evgeny Shvarov · Aug 19, 2019

Hi Salma!

If you import this file from this Open Exchange project it can do the export classes in folders:

Once imported call this to setup a folder:

USER>do ##class(dev.code).workdir("my/workdir/src")

Call this to export all classes, macro, deepsee resources in a given workdir.

USER> do ##class(dev.code).export()

You also can import the whole package too.

HTH

0
Salma Sarwar  Aug 23, 2019 to Evgeny Shvarov

Hi

Thank you for this link it seems very useful and has pointed me in the right direction.  I noticed when I exported the code it didn't seem to pick up the look up tables or the HL7 schemas? Also I was wondering if I gave the export routine a studio project path, would it be able to export the project.  Thanks so much for this as I can start thinking of ways to tweak this.

Kind Regards,

Salma

0