Trying to make multiple docs and replacing a single variable in each, the goal is to do so without going through the template and renaming the element being used can creating a new doc to save. Was planning on doing so via python scripts but is there a way to do so via the command line? (open to other suggestions)
Thank you for the command. I was looking at the documentation for generating automatically but I was confused on how to use it through java as it is in the documentation. I was trying to figure out how to develop in java, is there an easier way to learn to programmatically create the generation code, because I’m not sure how to use the java code given in the documentation. May be a simple answer but it has me quite confused.
Also, when I run that command, the Capella terminal window pops-up but shuts-down after a second after it tries generating. Is there somewhere I can see the error log to see what is causing it to close/crash?
Not sure what to make of this error message, here is the command and log info (I also chan):
Command:
capella.exe -nosplash -consolelog -application org.polarsys.capella.core.commandline.core -appid org.obeonetwork.capella.m2doc.commandline -filepath ./workspace/In-Flight Entertainment System With M2Doc/Template LA Complete.genconf -data ./workspace -outputfolder ./workspace/In-Flight Entertainment System With M2Doc/generated -forceoutputfoldercreation
Error:
java.lang.NullPointerException: Cannot invoke “org.obeonetwork.capella.m2doc.commandline.M2DocCommandLinePlugin$Implementation.log(Object)” because the return value of “org.obeonetwork.capella.m2doc.commandline.M2DocCommandLinePlugin.getPlugin()” is null
The .genconf file can’t be loaded. Maybe try an URI in the form file:///C:/... or file:///home/... also if you have spaces in the path try to surround the URI with double quote. You can also try to replace spaces with %20 (URI escape).
I thought is was strange to compute the URI this way, but I think for the Capella session to open the URI needs to be a platform URI. And the aird URI is computed with the genconf URI…
After some time I’ve returned to the thought of using docker to build documentation using m2doc. Before I had docker image already that was created manually by installing different packages. Now I’ve created dockerfile that can be used to create docker image for m2doc using docker build. It works. I will share it soon. But it needs capella workspace with imported projects to build documentation. And it’s not good. It would be great to have possibility to clone repo from git and start build documentation without the need to create Capella workspace (in Jenkins, for example)
made test modification to M2DocCommandLine and was able to publish doc without prepared
capella workspace
In details:
for test changed in M2DocCommandLine to
genconfs[0] = CommandLineArgumentHelper.getInstance().getFilePath();
i.e. removed “platform:/resource/” +
and rebuild CapellaExtensions repository
in command line arguments used -data pointing to non existing folder for capella workspace
in command line arguments used -filepath with absolute path to genconf
file:///publish/genconfs/relative.genconf
in genconf used relative paths to capella and aird file