ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 1.0
35 stars 22 forks source link

Management of images in Capella description #428

Open bsphane opened 3 years ago

bsphane commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

See https://forum.mbse-capella.org/t/m2doc-and-images-embedded-in-descriptions/4703/4

I have an image in the description of a Capella element. The image referenced using a relative path. But in the generated document I get the following error: https://forum.mbse-capella.org/uploads/default/original/1X/59ec52d4499e398d9c6c47dc36e2e3238ed62662.png

It looks like M2Doc is inserting a "template" folder in the path of the file. Maybe because my Word template is actually in a template folder in my Capella project?

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


M2Doc version: 3.1.0
Sirius version: 6.3.3
Platform version:   Windows

Others:

bsphane commented 3 years ago

If my Word template is at the root of my project, I don't have the issue

ylussaud commented 3 years ago

I think the URI is relative and is resolved against the template path. You can to change the URI:

platform:///resource/...

ylussaud commented 1 year ago

This URI is not relative and for some reason M2Doc try to resolve it. It should not change the URI tough...

a sample URI created by Capella in the description:

platform:/resource/Myproject/images/image_xxxx.png

Its resolved by M2Doc to:

/Myproject/templates/Myproject/images/image_xxxx.png

Maybe we need to configure the URIConverter to specify the path to the current workspace.