Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service to return diagram name #282

Closed
apinsonneau opened this issue Feb 22, 2018 · 2 comments
Closed

Service to return diagram name #282

apinsonneau opened this issue Feb 22, 2018 · 2 comments
Milestone

Comments

@apinsonneau
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] 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

Current services allow to display diagrams but not to return their name (to provide it as legend in the document).

Expected behavior

Define a service to easilly return a diagram name.
It shall be as easy as the existing service as for example asImageByRepresentationDescriptionName('System Architecture Blank').

Moreover, in the case of a loop on existing diagrams, it shall be able to get the name of each diagram.
For example:

m:for im | self.containedSystemAnalysis.ownedSystem.asImageByRepresentationDescr
iptionName('System Architecture Blank')
m:im.fit(500,400)
[DIAGRAM NAME]
m:endfor

Minimal reproduction of the problem with instructions

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

Provide image legend in generated documents

Environment


M2Doc version: 1.0
Eclipse version: X.Y.Z
Platform version:   X.Y.Z

Others:

@ldelaigue
Copy link
Contributor

ldelaigue commented Mar 12, 2018

For this to work in a loop, it means that the model element that represents an image should be enriched with a name (or caption, or title; And maybe some other relevant information, depending on what can be attached to diagrams and images in general, although I don't see any right now)
Then the synta would be
{ m:im.fit(500,400) } <-- produce the image
{ m:im.title } <-- produce the image title/name/caption/whatever

@ylussaud
Copy link
Collaborator

I added two services to get the DRepresentation itself. You can tests them using the nightly p2 repository.

Change your template as follow:

m:for rep | self.containedSystemAnalysis.ownedSystem.representationByDescriptionName('System Architecture Blank')
m:rep.name
m:rep.asImage().fit(500,400)
[DIAGRAM NAME]
m:endfor

The build should be ready in few minutes.

@ylussaud ylussaud added this to the 2.0.0 milestone Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants