Postprocessing of M2Doc Documents by Visual Basic

Checking the image propertie in the generated doc I have observed that the image sizes are set to more than 100% of the size of the original (e.g. 133%). That is not correct or is it?

I understand… I also found that event static bookmarks without updating fields can be destroyed by M2Doc. I opened two issues:

Did you try to use the ID of the ref with the asBookmarkRef() service ? This might work… even if it’s not perfect.

I see the same in M2Doc tests. Not sure if it’s an issue but I’ll open an issue to double check that later:

Do you mean somethign like

m: ‘Figure’.asBookmarkRef(’_Ref65060723’)

instead of the field code generated by Word REF _Ref65060723 \h ?
That would not solve the problem how the sequence number of the Figure should be displayed as teh visible text (label) of the bookmark - it is generated by word so I cannot use a string constant as the 1st parameter for as BookmarkRef.

And currently I cannot try it out as we are again all blocked by the “Couldn’t find the ‘fromHTMLBodyString(EClassifier=EString)’ service” error during Validation. It occured after our admin has changed the default Capella workspace setting…

For the first issue you are right. I will not have time to fix this right now.

For the second problem you need to install the “M2Doc HTML Integration (experimental)” feature.

I have checked that feature has been installed already.

Then it should work. An other issue might be that path longer that 256 characters doesn’t work under Windows that might cause weird issues like this. Do you have more information about the change made by your admin ?

Hi Yvan,
we had installed M2Doc 3.10. Then upgraded to M2Doc 3.11. Just a standard installation from update site.

The m2doc.html features are located in:
D:\Orchestra\Thales\MelodyAdvanceTeam\melody\eclipse\features\org.obeonetwork.m2doc.html.feature.source_3.1.1.202102191638
D:\Orchestra\Thales\MelodyAdvanceTeam\melody\eclipse\features\org.obeonetwork.m2doc.html.feature_3.1.1.202102191638

So, the path is much shorter than 256 characters.

Is there any other place where we could check.
Maybe, any relevant logfile?

Thx, Uwe

Can you try to call the

''.trace()

service in your template and check if the fromHTMLBodyString() appears in the output ?
If it appears you might also try to explicitly cast your EString to a String with toString() for instance.

fromHTMLBodyString doesn’t appear anywhere in the output.

Find the generated document with the output:
template.generated.docx (21.9 KB)

Some more background:
With M2Doc 3.10 we never had issues. With 3.11 it had worked under certain conditions for certain users - not knowing what the conditions are; maybe, for those users there was something specific left over in the configuration coming from 3.10 - just a guess.

Thx, Uwe

Find also the template and genconf attached:
template.docx (22.8 KB) template.genconf (649 Bytes)

This service is initialized using this extension, so you can check if the plugin org.obeonetwork.m2doc.html.ide is started in your environment after running a generation with M2Doc.
You can also try to put a breakpoint here to see if the service is initialized.
If the plugin is not started, it’s might be possible to try to start it manually and see why it won’t start… probably a dependency issue…
You can also check the error log view or the .log file in your workspace and see if something wrong shows up regarding the feature or the plugin.

Hi Yvan,

we are able to reproduce the error: it works with m2doc 3.1.0, as it does with 3.1.1 too, but only if it is installed after 3.1.0 and as long as the Capella “p2” and “configuration” directories are not removed. As sson as they are removed, the error occurs. This seems to corroborate the hypothesis mentioned by Uwe.

To set a breakpoint means to import and build the m2doc project in Capella and debug it - that would be a last resort for us as it is more or less a development activity for the m2doc project. So first we´d like to check if org.obeonetwork.m2doc.html.ide is started. It seems it is not, as it is not present in the .trace() output attached above.
In the .metadata/.log file in my workspace there is a Runtime Exception “org.eclipse.core.runtime.CoreException: Problems occurred while resolving the target contents” thrown in org.eclipse.pde.internal.core.PluginModelManager.getExternalBundles(PluginModelManager.java:681) - pls see the atatched stack trace. This seems related to it. issue_HTMLBody2String_.log.txt (23.1 KB) . There are some Eclipse bug reports around this, e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=501393.

How could we start the plugin manually to check why it won´t start?
Br, M.

p2 is the equivalent of a package manager for Eclipse. You should probably not delete directories from Capella if you want it to work properly.

You can have a look at this page to debug bundle loading. But my advice would be to keep the files inside your Capella installation.


1417 INSTALLED org.obeonetwork.m2doc.html_3.1.1.202102191638
1418 INSTALLED org.obeonetwork.m2doc.html.ide_3.1.1.202102191638
1419 STARTING org.obeonetwork.m2doc.ide_3.1.1.202102191638
1420 STARTING org.obeonetwork.m2doc.ide.jdt_3.1.1.202102191638
1421 STARTING org.obeonetwork.m2doc.ide.ui_3.1.1.202102191638
1422 RESOLVED org.obeonetwork.m2doc.launcher_3.1.1.202102191638
1423 ACTIVE org.obeonetwork.m2doc.sirius_3.1.1.202102191638
1424 RESOLVED org.obeonetwork.m2doc.sirius.ui_3.1.1.202102191638
1425 INSTALLED org.obeonetwork.m2doc.wikitext_3.1.1.202102191638
1426 INSTALLED org.obeonetwork.m2doc.wikitext.ide_3.1.1.202102191638
1427 INSTALLED org.obeonetwork.m2doc.word.addin_3.1.1.202102191638
1428 INSTALLED org.obeonetwork.m2doc.word.addin.ide.ui_3.1.1.202102191638
osgi> diag 1417
org.obeonetwork.m2doc.html [1417]
** Unresolved requirement: Require-Bundle: org.jsoup; bundle-version="[1.8.3,1.8.4)"**
osgi> diag 1418
org.obeonetwork.m2doc.html.ide [1418]
** Unresolved requirement: Require-Bundle: org.obeonetwork.m2doc.html; bundle-version="[3.0.0,4.0.0)"**
** -> Bundle-SymbolicName: org.obeonetwork.m2doc.html; bundle-version=“3.1.1.202102191638”**
** org.obeonetwork.m2doc.html [1417]**
** Unresolved requirement: Require-Bundle: org.jsoup; bundle-version="[1.8.3,1.8.4)"**
osgi>

If we come from m2doc 3.10 without deleting the user’s p2/configuration it looks like this:
1417 RESOLVED org.obeonetwork.m2doc.html_3.1.1.202102191638
1418 RESOLVED org.obeonetwork.m2doc.html.ide_3.1.1.202102191638

It seems that there remains something in the user’s local config area, which is not installed with 3.11 in the share config area

Why is org.jsoup installed with 3.10, but not with 3.11? Where does it come from?

I made some more investigations and have a bit a different picture now.

It seems the issue is not restricted to 3.11. If I uninstall 3.11 and install 3.10, I have the same issue now.

Still it seems to be linked to “Unresolved requirement: Require-Bundle: org.jsoup”.
org.jsoup_1.8.3.v20181012-1713.jar is available in the installation in …/eclipse/plugins.

But, it is not visible in the list of installed bundles (osgi> ss) nor in the Installation Details/Installed Software.

What is missing?

The configuration of bundle is probably in the configuration folder you deleted… But jsoup is available in the M2Doc update site.

Thanks Yvan for guiding us to https://wiki.eclipse.org/Where_Is_My_Bundle. We are trying to find out why jsoup is not installed. Regarding this, we wonder why - contrary to the explanations in “OSGi Can’t See My Bundle” in the above mentioned link - there is still also present the directory configuration/ and therein org,eclipse.update/platform.xml. Actually, I would expect only p2/. It is Eclipse 4.12 - wrt Capella, is there any special reason for this that is known to you? br, M.

No, only the length of the path (256 characters limit) but I think we already checked that…
You can revert an installation in the installation history of Eclipse maybe you could reach a point where you can reinstall M2Doc or the M2Doc extensions. Or maybe you can start from a fresh install.

Obviously, the situation is complicated and may be not really well structured/designed, because after installing bare Capella + m2doc, everything is ok (jsoup is a RESOLVED bundle), but when adding the Thales dropins, it simply disappears (is not present in the list of bundeles). May be p2 garbage collection removes it. So currently we simply try to install the jsoup bundle. But on jsoup.org only the jar is available and from the m2doc update site it cannot be installed after m2doc has been installed already. Also when creating the plugin project from existing jar in Capella, the plugin has a different structure than the zip files below p/m2doc. Do you know how to create and install the jsoup bundle?