Postprocessing of M2Doc Documents by Visual Basic

I thought you were talking about the table of figures referencing figures in the generated document. For the references to a bookmark you probably want to use asBookmark() and asBookmarkRef(). This will prevent the duplication of a bookmark with the same ID in a for loop for instance. Also this services will let you know if you produce duplicated bookmarks and/or if you are making a reference to a not existing bookmark. That can be very helpful to prevent the generation of broken references in the generated document.
Anyway, I will investigate the bug on bookmark references.

Yes, we are using asBookmark{Ref}() already, but to refer to the figure nr. defined in SEQ Word field, those are not an alternative. I have to use the normal Word field code REF.

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.