How to insert extra information for each element of document via LibreOffice API?

Hi everyone,

I'm working with the Eclipse Papyrus team on a UML to odt generator. Besides one way generating, it should be able to handle bidirectional synchronization between these two "worlds".
For reaching this goal, I need to map each model element with its respective doc element. For example, a package name will be transformed to a section in a document or a comment in a paragraph. I am looking for a way to reference the UML element from the odt document, for example adding the ID of the UML element to an odt "paragraph".

Does anyone have a suggestion?

Best regards,

Yupanqui

Hi Yupanqui,

Hi everyone,

I'm working with the Eclipse Papyrus team on a UML to odt generator. Besides one way generating, it should be able to handle bidirectional synchronization between these two "worlds".
For reaching this goal, I need to map each model element with its respective doc element. For example, a package name will be transformed to a section in a document or a comment in a paragraph. I am looking for a way to reference the UML element from the odt document, for example adding the ID of the UML element to an odt "paragraph".

Does anyone have a suggestion?

I think, that it should be possible by using bookmarks.
https://wiki.openoffice.org/wiki/Documentation/DevGuide/Text/Bookmarks

For using bookmarks from the LibreOffice UI look in help and user guides.

Kind regards
Regina

Hi Regina,

Thanks for your very fast answer.

I forgot to tell you this extra information must be hidden for users.
There is anoher way?

If it not has another way. I will use bookmarks and try to handle their
inconivience.

Best Regards

Yupanqui

Hi Yupanqui,

Hi Regina,

Thanks for your very fast answer.

I forgot to tell you this extra information must be hidden for users.
There is anoher way?

I had considered your request "via LibreOffice API".

You might find something in https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1xml.html
But I do not know whether and how it works.

The file format is able to use xml:id. Those values are not available via UI. I do not know, whether they are accessible via API. Another problem is, whether LibreOffice preserves the attribute and preserves its value. Some xml:id are generated by LibreOffice, e.g. for lists. Those are not preserved. So you would need extensive testing.

Perhaps you ask on the developer IRC irc://chat.freenode.net/libreoffice-dev ?

Kind regards
Regina

Hi Regina,

Regina Henschel wrote

The file format is able to use xml:id. Those values are not available
via UI. I do not know, whether they are accessible via API. Another
problem is, whether LibreOffice preserves the attribute and preserves
its value. Some xml:id are generated by LibreOffice, e.g. for lists.
Those are not preserved. So you would need extensive testing.

I have tried to set "ListId" attribute of ParagraphProperty but it did not
work.

I can send this kind of question to developers mailing list ?

Thanks again.

Best regards

Yupanqui

Hi Yupanqui,

Hi Regina,

Regina Henschel wrote

The file format is able to use xml:id. Those values are not available
via UI. I do not know, whether they are accessible via API. Another
problem is, whether LibreOffice preserves the attribute and preserves
its value. Some xml:id are generated by LibreOffice, e.g. for lists.
Those are not preserved. So you would need extensive testing.

I have tried to set "ListId" attribute of ParagraphProperty but it did not
work.

? A list is a separate element, not a paragraph.

I can send this kind of question to developers mailing list ?

I think yes, but the response it usually slower and you mail might need to be moderated.
libreoffice@lists.freedesktop.org

Kind regards
Regina

HI Regina,

Regina Henschel wrote

? A list is a separate element, not a paragraph.

I found this
https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1style_1_1ParagraphProperties.html#a459e269cd6c19cd01214239ec972bdf5

But, I think it is only usefull for list.

Best regards,

Yupanqui