How to export a project via Visual Studio Code?
Hi everyone,
Does anyone know how to export projects via VSC?
I opened the project through the "InterSystems Tools" plugin (command is "Edit Code in Project") and I can correctly work on it.
However, when I try using the "ObjectScript" plugin to export the project (right click on the project -> "Export Project Contents")
.png)
This message appears and it is not possible to export the project:
.png)
I've tried also to open a new window, then a folder and finally the project, but nothing changes.
This is an example of my workspace:
.png)
Anyone knows how to do it?
Thank you!
Comments
@Pietro Di Leo
When you say "export a project", what do you mean by that? Do you mean "export the documents in the project to edit them", or "export the contents as a single legacy XML file for deployment/sharing"?
I would like to export the project as an XML file, as is it possible in Studio
The "Export Project Contents" command that you clicked is for exporting as individual UDL files in your workspace for editing with local source control. To export server documents in a single XML file, you an use the "Export Documents to XML File..." command that's documented here.
Hi Brett, Unfortunately, your answer is not fully satisfactory, as Export Documents to XML File... does not automatically export the project and all its content (at least not for me), and it doesn't fire the server-side studio extension hook "ExportProject" that in our case would automatically
* Check that the project contains all necessary classes and files by checking the content of about 1000 classes.
* Export the project's individual files for server-side source control into individual files.
* Export the entire project into a single XML file to be given away or as a backup of the project at a certain point in time.
Am I missing something, or is that very convenient method of automation not possible with the VS Code integration?
* Check that the project contains all necessary classes and files by checking the content of about 1000 classes.
* Export the project's individual files for server-side source control into individual files.
* Export the entire project into a single XML file to be given away or as a backup of the project at a certain point in time.
Am I missing something, or is that very convenient method of automation not possible with the VS Code integration?
Ah I forgot to mention ExportProject is in our case fired by "OnBeforeLoad" of any prj file and on OnAfterSave if an "prj" item saves. Unfortunately these two operations seem to never fire when working with projects in VS Code
Hi @Stephan Gertsobbe, there is no exact equivalent for exporting an entire Studio project in a single XML file. The command I mentioned is the closest approximation. The best workaround is to use a terminal to do the export. Since you mentioned using these exports for backup and that you have server-side source control in use, I would expect that your files being tracked in source control would constitute the backup.
Source control support for projects files themselves is limited due to the way we edit them. The Atelier REST API used by VS Code has no support for Studio Projects since the concept didn't exist in Atelier. VS Code uses SQL to modify projects instead. This mechanism was chosen for its backwards compatibility since Studio Projects users tended to be on older server versions. Source control UserActions are fired for projects, but not all of the lifecycle hooks will because we are not using object access.
Hi Leo,
You can try this from the terminal.
Do$System.OBJ.Export("YourProject.prj", "C:\\Exports\\YourProject.xml")