Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » How to regenerate gmfgen?
How to regenerate gmfgen? [message #472359] Wed, 16 January 2008 15:27 Go to next message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello,

I need to add some features to the gmfgraph, gmftool and gmfmap files
and regenerate gmfgen file then, i think i will be able to Generate
UML2Tools Diagrams containing modificiations i made.

So, i'm wondering how you actually do the gmfgen creation without losing
customization you made in previous .gmfgen file (if you did some)?

Also, i would like to know how custom-src and @NOT-generated code are
link to the new generated code?

Thank you
Martin
Re: How to regenerate gmfgen? [message #472362 is a reply to message #472359] Wed, 16 January 2008 20:13 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Martin,

To be honest, I do CVS merge to prevent loosing previous customizations.
org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen transformation.
You could change the class in accordance with your needs.

I tried to find any article about code-merge in GMF. My attempts were failed.
Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will help you.

In short, code is generated by GMF only into src folder. Only fields marked
with 'generated' tag will be overridden. So, technically there is no difference
whether to use 'generated NOT' tag or not to use any tag at all. But 'generated
NOT' tag is more preferrable:
'For generated classes, if modifying a method that contains a '@generated'
tag, be sure to place 'NOT' after it to prevent it from being overwritten.
Note that it is preferable to create '@generated NOT' tags, rather than removing
the '@generated' tag completely.'
(from http://wiki.eclipse.org/GMF_Development_Guidelines).
Other code (code which is not conformably tagged) will _not_ be touched by
GMF-generator, it will stay the same.

Best wishes,
Tatiana.

> Hello,
>
> I need to add some features to the gmfgraph, gmftool and gmfmap files
> and regenerate gmfgen file then, i think i will be able to Generate
> UML2Tools Diagrams containing modificiations i made.
>
> So, i'm wondering how you actually do the gmfgen creation without
> losing customization you made in previous .gmfgen file (if you did
> some)?
>
> Also, i would like to know how custom-src and @NOT-generated code are
> link to the new generated code?
>
> Thank you
> Martin
Re: How to regenerate gmfgen? [message #472456 is a reply to message #472362] Wed, 16 January 2008 21:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana,

Thank you very much for your comment. It will really help me. I noted
your suggestion and ask a question on GMF newsgroups (hope someone will
help!)

I would like to ask you another question: where can i find the best
documentation to better understand how code generation work (i mean
learn a little more on "all the templates and utility classes that
trigger the code generation") ?

Thanks again!

Martin



Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #472459 is a reply to message #472456] Thu, 17 January 2008 11:50 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Martin,

Welcome.
I'm not sure if such documentation exists. It's more reliable to ask in gmf
newgroup. Probably they will refer to Richard Gronback's book(news://news.eclipse.org/fmfjrh$9js$1@build.eclipse.org)
=)

Best wishes,
Tatiana.

> Hello Tatiana,
>
> Thank you very much for your comment. It will really help me. I noted
> your suggestion and ask a question on GMF newsgroups (hope someone
> will help!)
>
> I would like to ask you another question: where can i find the best
> documentation to better understand how code generation work (i mean
> learn a little more on "all the templates and utility classes that
> trigger the code generation") ?
>
> Thanks again!
>
> Martin
>
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous
>> customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your
>> needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>> will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there
>> is
>> no difference whether to use 'generated NOT' tag or not to use any
>> tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated
>> NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by
>> GMF-generator,
>> it will stay the same.
>> Best wishes,
>> Tatiana.
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>> files and regenerate gmfgen file then, i think i will be able to
>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code
>>> are link to the new generated code?
>>>
>>> Thank you
>>> Martin
Re: How to regenerate gmfgen? [message #472461 is a reply to message #472459] Thu, 17 January 2008 14:18 Go to previous messageGo to next message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana,

Thanks a lot. I'll take a look at this book when available!

Ciao!

Martin

Tatiana Fesenko wrote:
> Hi Martin,
>
> Welcome.
> I'm not sure if such documentation exists. It's more reliable to ask in
> gmf newgroup. Probably they will refer to Richard Gronback's
> book(news://news.eclipse.org/fmfjrh$9js$1@build.eclipse.org) =)
>
> Best wishes,
> Tatiana.
>
>> Hello Tatiana,
>>
>> Thank you very much for your comment. It will really help me. I noted
>> your suggestion and ask a question on GMF newsgroups (hope someone
>> will help!)
>>
>> I would like to ask you another question: where can i find the best
>> documentation to better understand how code generation work (i mean
>> learn a little more on "all the templates and utility classes that
>> trigger the code generation") ?
>>
>> Thanks again!
>>
>> Martin
>>
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>> To be honest, I do CVS merge to prevent loosing previous
>>> customizations.
>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>> transformation. You could change the class in accordance with your
>>> needs.
>>>
>>> I tried to find any article about code-merge in GMF. My attempts were
>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>> will
>>> help you.
>>> In short, code is generated by GMF only into src folder. Only fields
>>> marked with 'generated' tag will be overridden. So, technically there
>>> is
>>> no difference whether to use 'generated NOT' tag or not to use any
>>> tag
>>> at all. But 'generated NOT' tag is more preferrable:
>>> 'For generated classes, if modifying a method that contains a
>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>> being overwritten. Note that it is preferable to create '@generated
>>> NOT'
>>> tags, rather than removing the '@generated' tag completely.' (from
>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>> which is not conformably tagged) will _not_ be touched by
>>> GMF-generator,
>>> it will stay the same.
>>> Best wishes,
>>> Tatiana.
>>>> Hello,
>>>>
>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>> files and regenerate gmfgen file then, i think i will be able to
>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>
>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>> losing customization you made in previous .gmfgen file (if you did
>>>> some)?
>>>>
>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>> are link to the new generated code?
>>>>
>>>> Thank you
>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #472465 is a reply to message #472362] Thu, 17 January 2008 17:22 Go to previous messageGo to next message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Again Tatiana,

I'm wondering what you do with VisualID when you make your merge? Do you
keep new ones or old ones? Is there any importance?

thank you

Martin

Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #472467 is a reply to message #472465] Thu, 17 January 2008 17:39 Go to previous messageGo to next message
Richard Gronback is currently offline Richard Gronback
Messages: 605
Registered: July 2009
Senior Member
Visual IDs are supported during regeneration by the
org.eclipse.gmf.bridge.trace plug-in. If you see a .trace file produced
during gmfmap->gmfgen transformation, you have it installed (take a look
inside). Otherwise, try installing the "Experimental SDK."

- Rich


On 1/17/08 12:22 PM, in article fmo2so$91p$1@build.eclipse.org, "Martin
Nadeau" <martin.nadeau@scg.ulaval.ca> wrote:

> Hello Again Tatiana,
>
> I'm wondering what you do with VisualID when you make your merge? Do you
> keep new ones or old ones? Is there any importance?
>
> thank you
>
> Martin
>
> Tatiana Fesenko wrote:
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
>> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there is
>> no difference whether to use 'generated NOT' tag or not to use any tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by GMF-generator,
>> it will stay the same.
>>
>> Best wishes,
>> Tatiana.
>>
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>>> and regenerate gmfgen file then, i think i will be able to Generate
>>> UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code are
>>> link to the new generated code?
>>>
>>> Thank you
>>> Martin
>>
>>
Re: How to regenerate gmfgen? [message #472473 is a reply to message #472362] Fri, 18 January 2008 03:02 Go to previous messageGo to next message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello Tatiana,

I would like to have some precision on that point. Are you saying that
you do CVS Merge between (for example) the old gmfgen and the new gmfgen ?

I tried this method this afternoon, I observed a lot of unexpected
difference, please find attached both files. I didn't even modified the
initial gmfmap, I just "Create Generator Model" from classDiagram.gmfmap
to compare with the actual classDiagram.gmfgen (from cvs).

For instance, there is a lot of generated line pointing to
"org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
different from what is in cvs ("org.eclipse.draw2d.Label").

Is it because the version of GMF I used to generate my gmfgen is newer
than the one you used ?

Thank you,
Mathieu





Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #472480 is a reply to message #472473] Fri, 18 January 2008 14:20 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Mathieu,

We override standard functionality in this place.

To have the same gmfgen as we have do the following:
1) Find page 'Specify transformation options' in 'Create generator model...'
dialog (it's fifth page).
2) Write '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
string in the 'GMFGraph dynamic templates' field.
Voila!

Best wishes,
Tatiana.

> Hello Tatiana,
>
> I would like to have some precision on that point. Are you saying that
> you do CVS Merge between (for example) the old gmfgen and the new
> gmfgen ?
>
> I tried this method this afternoon, I observed a lot of unexpected
> difference, please find attached both files. I didn't even modified
> the initial gmfmap, I just "Create Generator Model" from
> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
> (from cvs).
>
> For instance, there is a lot of generated line pointing to
> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
> different from what is in cvs ("org.eclipse.draw2d.Label").
>
> Is it because the version of GMF I used to generate my gmfgen is newer
> than the one you used ?
>
> Thank you,
> Mathieu
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous
>> customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your
>> needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>> will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there
>> is
>> no difference whether to use 'generated NOT' tag or not to use any
>> tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated
>> NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by
>> GMF-generator,
>> it will stay the same.
>> Best wishes,
>> Tatiana.
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>> files and regenerate gmfgen file then, i think i will be able to
>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code
>>> are link to the new generated code?
>>>
>>> Thank you
>>> Martin
Re: How to regenerate gmfgen? [message #472486 is a reply to message #472480] Sat, 19 January 2008 01:34 Go to previous messageGo to next message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Thank you,
It work as you said.

Mathieu

Tatiana Fesenko wrote:
> Hi Mathieu,
>
> We override standard functionality in this place.
>
> To have the same gmfgen as we have do the following:
> 1) Find page 'Specify transformation options' in 'Create generator
> model...' dialog (it's fifth page). 2) Write
> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
> string in the 'GMFGraph dynamic templates' field. Voila!
>
> Best wishes,
> Tatiana.
>
>> Hello Tatiana,
>>
>> I would like to have some precision on that point. Are you saying that
>> you do CVS Merge between (for example) the old gmfgen and the new
>> gmfgen ?
>>
>> I tried this method this afternoon, I observed a lot of unexpected
>> difference, please find attached both files. I didn't even modified
>> the initial gmfmap, I just "Create Generator Model" from
>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>> (from cvs).
>>
>> For instance, there is a lot of generated line pointing to
>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
>> different from what is in cvs ("org.eclipse.draw2d.Label").
>>
>> Is it because the version of GMF I used to generate my gmfgen is newer
>> than the one you used ?
>>
>> Thank you,
>> Mathieu
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>> To be honest, I do CVS merge to prevent loosing previous
>>> customizations.
>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>> transformation. You could change the class in accordance with your
>>> needs.
>>>
>>> I tried to find any article about code-merge in GMF. My attempts were
>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>> will
>>> help you.
>>> In short, code is generated by GMF only into src folder. Only fields
>>> marked with 'generated' tag will be overridden. So, technically there
>>> is
>>> no difference whether to use 'generated NOT' tag or not to use any
>>> tag
>>> at all. But 'generated NOT' tag is more preferrable:
>>> 'For generated classes, if modifying a method that contains a
>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>> being overwritten. Note that it is preferable to create '@generated
>>> NOT'
>>> tags, rather than removing the '@generated' tag completely.' (from
>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>> which is not conformably tagged) will _not_ be touched by
>>> GMF-generator,
>>> it will stay the same.
>>> Best wishes,
>>> Tatiana.
>>>> Hello,
>>>>
>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>> files and regenerate gmfgen file then, i think i will be able to
>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>
>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>> losing customization you made in previous .gmfgen file (if you did
>>>> some)?
>>>>
>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>> are link to the new generated code?
>>>>
>>>> Thank you
>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #472671 is a reply to message #472486] Tue, 22 January 2008 22:37 Go to previous messageGo to next message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello again ! :)

Specifying GMFGraph dynamic templates helped a lot, but I have still
some difference between the gmfgen I generate and the one contained on cvs.

1 - gmfen on cvs have lines like those ones that mine doesn't have:
---
<attributes
xsi:type="gmfgen:StyleAttributes"
fixedForeground="true"/>
---
(example: line 509, 513, 516, 519)
I don't understand why those element are not generated...



2- gmfgen on cvs have lines like those ones that mine doesn't have:
---
<attributes
xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLocator "/>
---
In fact, gmfgen on cvs have a lot of extra lines involving
AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
DetailsLevelAttributes and SubstituableByAttributes. (From
org.eclipse.uml2.diagram.codegen.gmfgenext).

I think it may be related to the plugin org.eclipse.uml2.diagram.codegen
not doing his job correctly, what do you think ? I don't understand why,
I have the head version of org.eclipse.uml2.diagram.codegen and
org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
(plus each plugin installed is m4)



3- Also, each attribute classbody generated is very different.
Differences are like those ones:
---
generated classbody: "classBody="&#xA;/**&#xA; *............{lot of code}"
should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of code} *

I don't understand what is generated and I don't know if the difference
is important... Maybe somebody could tell us more. :)

Thank you again,
Mathieu



Mathieu Bertrand wrote:
> Thank you,
> It work as you said.
>
> Mathieu
>
> Tatiana Fesenko wrote:
>> Hi Mathieu,
>>
>> We override standard functionality in this place.
>>
>> To have the same gmfgen as we have do the following:
>> 1) Find page 'Specify transformation options' in 'Create generator
>> model...' dialog (it's fifth page). 2) Write
>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
>> string in the 'GMFGraph dynamic templates' field. Voila!
>>
>> Best wishes,
>> Tatiana.
>>
>>> Hello Tatiana,
>>>
>>> I would like to have some precision on that point. Are you saying that
>>> you do CVS Merge between (for example) the old gmfgen and the new
>>> gmfgen ?
>>>
>>> I tried this method this afternoon, I observed a lot of unexpected
>>> difference, please find attached both files. I didn't even modified
>>> the initial gmfmap, I just "Create Generator Model" from
>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>> (from cvs).
>>>
>>> For instance, there is a lot of generated line pointing to
>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
>>> different from what is in cvs ("org.eclipse.draw2d.Label").
>>>
>>> Is it because the version of GMF I used to generate my gmfgen is newer
>>> than the one you used ?
>>>
>>> Thank you,
>>> Mathieu
>>> Tatiana Fesenko wrote:
>>>
>>>> Hello Martin,
>>>>
>>>> To be honest, I do CVS merge to prevent loosing previous
>>>> customizations.
>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>>> transformation. You could change the class in accordance with your
>>>> needs.
>>>>
>>>> I tried to find any article about code-merge in GMF. My attempts were
>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>>> will
>>>> help you.
>>>> In short, code is generated by GMF only into src folder. Only fields
>>>> marked with 'generated' tag will be overridden. So, technically there
>>>> is
>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>> tag
>>>> at all. But 'generated NOT' tag is more preferrable:
>>>> 'For generated classes, if modifying a method that contains a
>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>>> being overwritten. Note that it is preferable to create '@generated
>>>> NOT'
>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>>> which is not conformably tagged) will _not_ be touched by
>>>> GMF-generator,
>>>> it will stay the same.
>>>> Best wishes,
>>>> Tatiana.
>>>>> Hello,
>>>>>
>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>
>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>> losing customization you made in previous .gmfgen file (if you did
>>>>> some)?
>>>>>
>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>> are link to the new generated code?
>>>>>
>>>>> Thank you
>>>>> Martin
>>
>>
Re: How to regenerate gmfgen? [message #472675 is a reply to message #472671] Wed, 23 January 2008 18:17 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello again Mathieu =)

1)2) UML2Tools have its own genmodel extension. These are our custom attributes
from this extension. We were talking about how to preserve them in the beginning
of this branch - news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.

3) As I can see you work on Unix-like system.
This is carriage return symbol. MS-DOS-based systems use combination of carriage-return
and line-feed, while Unix uses only carriage-return. In XML "In attribute
values, the characters TAB (#x9), linefeed (#xA), and carriage-return (#xD)
are represented by "&#x9;", "&#xA;", and "&#xD;" respectively." (http://www.w3.org/1999/07/WD-xml-c14n-19990729).
This is explais why we (Windows people) have '&#xD;&#xA;' where Unix-fellows
get '&#xA;'.

Good luck!
Tatiana.

> Hello again ! :)
>
> Specifying GMFGraph dynamic templates helped a lot, but I have still
> some difference between the gmfgen I generate and the one contained on
> cvs.
>
> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
> ---
> <attributes
> xsi:type="gmfgen:StyleAttributes"
> fixedForeground="true"/>
> ---
> (example: line 509, 513, 516, 519)
> I don't understand why those element are not generated...
> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
> ---
> <attributes
> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLo
> cator"/>
> ---
> In fact, gmfgen on cvs have a lot of extra lines involving
> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
> DetailsLevelAttributes and SubstituableByAttributes. (From
> org.eclipse.uml2.diagram.codegen.gmfgenext).
> I think it may be related to the plugin
> org.eclipse.uml2.diagram.codegen not doing his job correctly, what do
> you think ? I don't understand why, I have the head version of
> org.eclipse.uml2.diagram.codegen and
> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
> (plus each plugin installed is m4)
>
> 3- Also, each attribute classbody generated is very different.
> Differences are like those ones:
> ---
> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
> code}"
> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
> code} *
> I don't understand what is generated and I don't know if the
> difference is important... Maybe somebody could tell us more. :)
>
> Thank you again,
> Mathieu
> Mathieu Bertrand wrote:
>
>> Thank you,
>> It work as you said.
>> Mathieu
>>
>> Tatiana Fesenko wrote:
>>
>>> Hi Mathieu,
>>>
>>> We override standard functionality in this place.
>>>
>>> To have the same gmfgen as we have do the following:
>>> 1) Find page 'Specify transformation options' in 'Create generator
>>> model...' dialog (it's fifth page). 2) Write
>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gm
>>> f-graph'
>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>> Best wishes,
>>> Tatiana.
>>>> Hello Tatiana,
>>>>
>>>> I would like to have some precision on that point. Are you saying
>>>> that you do CVS Merge between (for example) the old gmfgen and the
>>>> new gmfgen ?
>>>>
>>>> I tried this method this afternoon, I observed a lot of unexpected
>>>> difference, please find attached both files. I didn't even
>>>> modified the initial gmfmap, I just "Create Generator Model" from
>>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>>> (from cvs).
>>>>
>>>> For instance, there is a lot of generated line pointing to
>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line
>>>> are different from what is in cvs ("org.eclipse.draw2d.Label").
>>>>
>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>> newer than the one you used ?
>>>>
>>>> Thank you,
>>>> Mathieu
>>>> Tatiana Fesenko wrote:
>>>>> Hello Martin,
>>>>>
>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>> customizations.
>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sforme
>>>>> r from org.eclipse.gmf.bridge plugin is responsible for
>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>> accordance with your needs.
>>>>>
>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>> were
>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>> they
>>>>> will
>>>>> help you.
>>>>> In short, code is generated by GMF only into src folder. Only
>>>>> fields
>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>> there
>>>>> is
>>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>>> tag
>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>> 'For generated classes, if modifying a method that contains a
>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>> from
>>>>> being overwritten. Note that it is preferable to create
>>>>> '@generated
>>>>> NOT'
>>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>> (code
>>>>> which is not conformably tagged) will _not_ be touched by
>>>>> GMF-generator,
>>>>> it will stay the same.
>>>>> Best wishes,
>>>>> Tatiana.
>>>>>> Hello,
>>>>>>
>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>>
>>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>>> losing customization you made in previous .gmfgen file (if you
>>>>>> did some)?
>>>>>>
>>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>>> are link to the new generated code?
>>>>>>
>>>>>> Thank you
>>>>>> Martin
Re: How to regenerate gmfgen? [message #472693 is a reply to message #472675] Wed, 23 January 2008 21:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana, ;-)

I didn't understand your first part of response to Mathieu...

We found that these custom attributes that are missing are in
org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
can't figure how they are added to the .gmfgen when we do .gmfmap --->
..gmfgen transformation. :-(

What do you mean by "UML2Tools have its own genmodel extension". Do you
mean codegen and codegen.edit plugins? Or, are we supposed to have (on
the gmfmap) a custom menu like the "Generate UML2Tools Diagrams" on gmfgen?

and when you say "We were talking about how to preserve them in the
beginning of this branch"... Do you mean making merge?

We're so close! :-)

Martin

Tatiana Fesenko wrote:
> Hello again Mathieu =)
>
> 1)2) UML2Tools have its own genmodel extension. These are our custom
> attributes from this extension. We were talking about how to preserve
> them in the beginning of this branch -
> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>
> 3) As I can see you work on Unix-like system. This is carriage return
> symbol. MS-DOS-based systems use combination of carriage-return and
> line-feed, while Unix uses only carriage-return. In XML "In attribute
> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why we
> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
> Good luck!
> Tatiana.
>
>> Hello again ! :)
>>
>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>> some difference between the gmfgen I generate and the one contained on
>> cvs.
>>
>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>> ---
>> <attributes
>> xsi:type="gmfgen:StyleAttributes"
>> fixedForeground="true"/>
>> ---
>> (example: line 509, 513, 516, 519)
>> I don't understand why those element are not generated...
>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>> ---
>> <attributes
>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLo
>> cator"/>
>> ---
>> In fact, gmfgen on cvs have a lot of extra lines involving
>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>> DetailsLevelAttributes and SubstituableByAttributes. (From
>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>> I think it may be related to the plugin
>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what do
>> you think ? I don't understand why, I have the head version of
>> org.eclipse.uml2.diagram.codegen and
>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>> (plus each plugin installed is m4)
>>
>> 3- Also, each attribute classbody generated is very different.
>> Differences are like those ones:
>> ---
>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>> code}"
>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>> code} *
>> I don't understand what is generated and I don't know if the
>> difference is important... Maybe somebody could tell us more. :)
>>
>> Thank you again,
>> Mathieu
>> Mathieu Bertrand wrote:
>>
>>> Thank you,
>>> It work as you said.
>>> Mathieu
>>>
>>> Tatiana Fesenko wrote:
>>>
>>>> Hi Mathieu,
>>>>
>>>> We override standard functionality in this place.
>>>>
>>>> To have the same gmfgen as we have do the following:
>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>> model...' dialog (it's fifth page). 2) Write
>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gm
>>>> f-graph'
>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>> Best wishes,
>>>> Tatiana.
>>>>> Hello Tatiana,
>>>>>
>>>>> I would like to have some precision on that point. Are you saying
>>>>> that you do CVS Merge between (for example) the old gmfgen and the
>>>>> new gmfgen ?
>>>>>
>>>>> I tried this method this afternoon, I observed a lot of unexpected
>>>>> difference, please find attached both files. I didn't even
>>>>> modified the initial gmfmap, I just "Create Generator Model" from
>>>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>>>> (from cvs).
>>>>>
>>>>> For instance, there is a lot of generated line pointing to
>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line
>>>>> are different from what is in cvs ("org.eclipse.draw2d.Label").
>>>>>
>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>> newer than the one you used ?
>>>>>
>>>>> Thank you,
>>>>> Mathieu
>>>>> Tatiana Fesenko wrote:
>>>>>> Hello Martin,
>>>>>>
>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>> customizations.
>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sforme
>>>>>> r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>> accordance with your needs.
>>>>>>
>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>> were
>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>> they
>>>>>> will
>>>>>> help you.
>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>> fields
>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>> there
>>>>>> is
>>>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>>>> tag
>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>> from
>>>>>> being overwritten. Note that it is preferable to create
>>>>>> '@generated
>>>>>> NOT'
>>>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>> (code
>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>> GMF-generator,
>>>>>> it will stay the same.
>>>>>> Best wishes,
>>>>>> Tatiana.
>>>>>>> Hello,
>>>>>>>
>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>>>
>>>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>>>> losing customization you made in previous .gmfgen file (if you
>>>>>>> did some)?
>>>>>>>
>>>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>>>> are link to the new generated code?
>>>>>>>
>>>>>>> Thank you
>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #472701 is a reply to message #472693] Thu, 24 January 2008 12:24 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Martin,

> We found that these custom attributes that are missing are in
> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
> can't figure how they are added to the .gmfgen when we do .gmfmap --->
> .gmfgen transformation. :-(

They are added manually.

> What do you mean by "UML2Tools have its own genmodel extension". Do
> you mean codegen and codegen.edit plugins? Or, are we supposed to have
> (on the gmfmap) a custom menu like the "Generate UML2Tools Diagrams"
> on gmfgen?

We have our own genmodel extension to have such features as AssociationClass,
action to change notation an so on automatically generated. "Generate UML2Tools
Diagrams" takes these attributes into account and generates appropriate code.

> and when you say "We were talking about how to preserve them in the
> beginning of this branch"... Do you mean making merge?

Yes, I was talking about making merge.

Good luck! I''ll gladly answer all your new questions =)
Tatiana.

> We're so close! :-)
>
> Martin
>
> Tatiana Fesenko wrote:
>
>> Hello again Mathieu =)
>>
>> 1)2) UML2Tools have its own genmodel extension. These are our custom
>> attributes from this extension. We were talking about how to preserve
>> them in the beginning of this branch -
>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>>
>> 3) As I can see you work on Unix-like system. This is carriage
>> return
>> symbol. MS-DOS-based systems use combination of carriage-return and
>> line-feed, while Unix uses only carriage-return. In XML "In attribute
>> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why
>> we
>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>> Good luck!
>> Tatiana.
>>> Hello again ! :)
>>>
>>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>>> some difference between the gmfgen I generate and the one contained
>>> on cvs.
>>>
>>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>>> ---
>>> <attributes
>>> xsi:type="gmfgen:StyleAttributes"
>>> fixedForeground="true"/>
>>> ---
>>> (example: line 509, 513, 516, 519)
>>> I don't understand why those element are not generated...
>>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>>> ---
>>> <attributes
>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Template
>>> Lo
>>> cator"/>
>>> ---
>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>> I think it may be related to the plugin
>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>> do
>>> you think ? I don't understand why, I have the head version of
>>> org.eclipse.uml2.diagram.codegen and
>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>>> (plus each plugin installed is m4)
>>> 3- Also, each attribute classbody generated is very different.
>>> Differences are like those ones:
>>> ---
>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>>> code}"
>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>>> code} *
>>> I don't understand what is generated and I don't know if the
>>> difference is important... Maybe somebody could tell us more. :)
>>> Thank you again,
>>> Mathieu
>>> Mathieu Bertrand wrote:
>>>> Thank you,
>>>> It work as you said.
>>>> Mathieu
>>>> Tatiana Fesenko wrote:
>>>>
>>>>> Hi Mathieu,
>>>>>
>>>>> We override standard functionality in this place.
>>>>>
>>>>> To have the same gmfgen as we have do the following:
>>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>>> model...' dialog (it's fifth page). 2) Write
>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/
>>>>> gm
>>>>> f-graph'
>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>> Best wishes,
>>>>> Tatiana.
>>>>>> Hello Tatiana,
>>>>>>
>>>>>> I would like to have some precision on that point. Are you saying
>>>>>> that you do CVS Merge between (for example) the old gmfgen and
>>>>>> the new gmfgen ?
>>>>>>
>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>> unexpected difference, please find attached both files. I didn't
>>>>>> even modified the initial gmfmap, I just "Create Generator Model"
>>>>>> from classDiagram.gmfmap to compare with the actual
>>>>>> classDiagram.gmfgen (from cvs).
>>>>>>
>>>>>> For instance, there is a lot of generated line pointing to
>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>> line are different from what is in cvs
>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>
>>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>>> newer than the one you used ?
>>>>>>
>>>>>> Thank you,
>>>>>> Mathieu
>>>>>> Tatiana Fesenko wrote:
>>>>>>> Hello Martin,
>>>>>>>
>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>> customizations.
>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sfor
>>>>>>> me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>> accordance with your needs.
>>>>>>>
>>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>>> were
>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>> they
>>>>>>> will
>>>>>>> help you.
>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>> fields
>>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>>> there
>>>>>>> is
>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>> any
>>>>>>> tag
>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>>> from
>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>> '@generated
>>>>>>> NOT'
>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>> (from
>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>>> (code
>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>> GMF-generator,
>>>>>>> it will stay the same.
>>>>>>> Best wishes,
>>>>>>> Tatiana.
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>>> files and regenerate gmfgen file then, i think i will be able
>>>>>>>> to Generate UML2Tools Diagrams containing modificiations i
>>>>>>>> made.
>>>>>>>>
>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>> without losing customization you made in previous .gmfgen file
>>>>>>>> (if you did some)?
>>>>>>>>
>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>> code are link to the new generated code?
>>>>>>>>
>>>>>>>> Thank you
>>>>>>>> Martin
Re: How to regenerate gmfgen? [message #472703 is a reply to message #472701] Thu, 24 January 2008 20:19 Go to previous messageGo to next message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello Tatiana,

Thanks for the last answers, they helped again to understand everything.

Just by curiosity, do you have plan to automate the generation of these
elements manually added to gmfgen ? A kind of menu "Generate UML2Tools
Diagrams" but on *.gmfmap ?

If I understand correctly, the extensibility mechanisms of GMF do not
provide enough flexibility or expressiveness to create a tool like
uml2tools... (And it's why you have to add manually some element to the
gmfgen generated) Am I correct ? Did you reach the limits of GMF in
your project or could your added elements have been generated via
dynamic template or some other extension (maybe you evaluated that it
was too much time to implement ? :) )

Thank you,
Mathieu



Tatiana Fesenko wrote:
> Hello Martin,
>
>> We found that these custom attributes that are missing are in
>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>> can't figure how they are added to the .gmfgen when we do .gmfmap --->
>> .gmfgen transformation. :-(
>
> They are added manually.
>> What do you mean by "UML2Tools have its own genmodel extension". Do
>> you mean codegen and codegen.edit plugins? Or, are we supposed to have
>> (on the gmfmap) a custom menu like the "Generate UML2Tools Diagrams"
>> on gmfgen?
>
> We have our own genmodel extension to have such features as
> AssociationClass, action to change notation an so on automatically
> generated. "Generate UML2Tools Diagrams" takes these attributes into
> account and generates appropriate code.
>
>> and when you say "We were talking about how to preserve them in the
>> beginning of this branch"... Do you mean making merge?
>
> Yes, I was talking about making merge.
>
> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>
>> We're so close! :-)
>>
>> Martin
>>
>> Tatiana Fesenko wrote:
>>
>>> Hello again Mathieu =)
>>>
>>> 1)2) UML2Tools have its own genmodel extension. These are our custom
>>> attributes from this extension. We were talking about how to preserve
>>> them in the beginning of this branch -
>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>>>
>>> 3) As I can see you work on Unix-like system. This is carriage
>>> return
>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>> line-feed, while Unix uses only carriage-return. In XML "In attribute
>>> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why
>>> we
>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>> Good luck!
>>> Tatiana.
>>>> Hello again ! :)
>>>>
>>>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>>>> some difference between the gmfgen I generate and the one contained
>>>> on cvs.
>>>>
>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>>>> ---
>>>> <attributes
>>>> xsi:type="gmfgen:StyleAttributes"
>>>> fixedForeground="true"/>
>>>> ---
>>>> (example: line 509, 513, 516, 519)
>>>> I don't understand why those element are not generated...
>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>>>> ---
>>>> <attributes
>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Template
>>>> Lo
>>>> cator"/>
>>>> ---
>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>> I think it may be related to the plugin
>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>> do
>>>> you think ? I don't understand why, I have the head version of
>>>> org.eclipse.uml2.diagram.codegen and
>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>>>> (plus each plugin installed is m4)
>>>> 3- Also, each attribute classbody generated is very different.
>>>> Differences are like those ones:
>>>> ---
>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>>>> code}"
>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>>>> code} *
>>>> I don't understand what is generated and I don't know if the
>>>> difference is important... Maybe somebody could tell us more. :)
>>>> Thank you again,
>>>> Mathieu
>>>> Mathieu Bertrand wrote:
>>>>> Thank you,
>>>>> It work as you said.
>>>>> Mathieu
>>>>> Tatiana Fesenko wrote:
>>>>>
>>>>>> Hi Mathieu,
>>>>>>
>>>>>> We override standard functionality in this place.
>>>>>>
>>>>>> To have the same gmfgen as we have do the following:
>>>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/
>>>>>> gm
>>>>>> f-graph'
>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>> Best wishes,
>>>>>> Tatiana.
>>>>>>> Hello Tatiana,
>>>>>>>
>>>>>>> I would like to have some precision on that point. Are you saying
>>>>>>> that you do CVS Merge between (for example) the old gmfgen and
>>>>>>> the new gmfgen ?
>>>>>>>
>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>> unexpected difference, please find attached both files. I didn't
>>>>>>> even modified the initial gmfmap, I just "Create Generator Model"
>>>>>>> from classDiagram.gmfmap to compare with the actual
>>>>>>> classDiagram.gmfgen (from cvs).
>>>>>>>
>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>> line are different from what is in cvs
>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>
>>>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>>>> newer than the one you used ?
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Mathieu
>>>>>>> Tatiana Fesenko wrote:
>>>>>>>> Hello Martin,
>>>>>>>>
>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>> customizations.
>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sfor
>>>>>>>> me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>> accordance with your needs.
>>>>>>>>
>>>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>>>> were
>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>> they
>>>>>>>> will
>>>>>>>> help you.
>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>> fields
>>>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>>>> there
>>>>>>>> is
>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>> any
>>>>>>>> tag
>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>>>> from
>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>> '@generated
>>>>>>>> NOT'
>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>> (from
>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>>>> (code
>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>> GMF-generator,
>>>>>>>> it will stay the same.
>>>>>>>> Best wishes,
>>>>>>>> Tatiana.
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>>>> files and regenerate gmfgen file then, i think i will be able
>>>>>>>>> to Generate UML2Tools Diagrams containing modificiations i
>>>>>>>>> made.
>>>>>>>>>
>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>> without losing customization you made in previous .gmfgen file
>>>>>>>>> (if you did some)?
>>>>>>>>>
>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>> code are link to the new generated code?
>>>>>>>>>
>>>>>>>>> Thank you
>>>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #473255 is a reply to message #472703] Wed, 30 January 2008 17:59 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Mathieu,

You are correct. 'Pure' GMF cannot handle all the tasks we face. To implement
all our functionality with a minimum us of 'generated-not' code we made our
extension for the gmfgen model. As you have noticed there are a lot of custom
attributes in *.gmfgen file. Some of them cannot be introdiced in the *.gmfgraph
file, because they have genmodel-specific properties. For example, 'SubstitutableByAttributes'
element needs Visual ID of the element it references:

<attributes
xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
<substitutableByIDs>2016</substitutableByIDs>
</attributes>

Visual ID is not available in the gmfmap model, it's available only in gmfgen
model. Our dynamic templates pick such attributes up and generate appropriate
code.

Did I answer your question?

Good luck,
Tatiana.

> Hello Tatiana,
>
> Thanks for the last answers, they helped again to understand
> everything.
>
> Just by curiosity, do you have plan to automate the generation of
> these elements manually added to gmfgen ? A kind of menu "Generate
> UML2Tools Diagrams" but on *.gmfmap ?
>
> If I understand correctly, the extensibility mechanisms of GMF do not
> provide enough flexibility or expressiveness to create a tool like
> uml2tools... (And it's why you have to add manually some element to
> the gmfgen generated) Am I correct ? Did you reach the limits of GMF
> in your project or could your added elements have been generated via
> dynamic template or some other extension (maybe you evaluated that it
> was too much time to implement ? :) )
>
> Thank you,
> Mathieu
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>>> We found that these custom attributes that are missing are in
>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>>> can't figure how they are added to the .gmfgen when we do .gmfmap
>>> ---> .gmfgen transformation. :-(
>>>
>> They are added manually.
>>
>>> What do you mean by "UML2Tools have its own genmodel extension". Do
>>> you mean codegen and codegen.edit plugins? Or, are we supposed to
>>> have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>> Diagrams" on gmfgen?
>>>
>> We have our own genmodel extension to have such features as
>> AssociationClass, action to change notation an so on automatically
>> generated. "Generate UML2Tools Diagrams" takes these attributes into
>> account and generates appropriate code.
>>
>>> and when you say "We were talking about how to preserve them in the
>>> beginning of this branch"... Do you mean making merge?
>>>
>> Yes, I was talking about making merge.
>>
>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>
>>> We're so close! :-)
>>>
>>> Martin
>>>
>>> Tatiana Fesenko wrote:
>>>
>>>> Hello again Mathieu =)
>>>>
>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>> custom attributes from this extension. We were talking about how to
>>>> preserve them in the beginning of this branch -
>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>>>>
>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>> return
>>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>> attribute
>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>> carriage-return
>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>> respectively."
>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>> why
>>>> we
>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>>> Good luck!
>>>> Tatiana.
>>>>> Hello again ! :)
>>>>>
>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>> still some difference between the gmfgen I generate and the one
>>>>> contained on cvs.
>>>>>
>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>> have:
>>>>> ---
>>>>> <attributes
>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>> fixedForeground="true"/>
>>>>> ---
>>>>> (example: line 509, 513, 516, 519)
>>>>> I don't understand why those element are not generated...
>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>> have:
>>>>> ---
>>>>> <attributes
>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Templa
>>>>> te
>>>>> Lo
>>>>> cator"/>
>>>>> ---
>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>> I think it may be related to the plugin
>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>>> do
>>>>> you think ? I don't understand why, I have the head version of
>>>>> org.eclipse.uml2.diagram.codegen and
>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>> M4
>>>>> (plus each plugin installed is m4)
>>>>> 3- Also, each attribute classbody generated is very different.
>>>>> Differences are like those ones:
>>>>> ---
>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>> of
>>>>> code}"
>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot
>>>>> of
>>>>> code} *
>>>>> I don't understand what is generated and I don't know if the
>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>> Thank you again,
>>>>> Mathieu
>>>>> Mathieu Bertrand wrote:
>>>>>> Thank you,
>>>>>> It work as you said.
>>>>>> Mathieu
>>>>>> Tatiana Fesenko wrote:
>>>>>>> Hi Mathieu,
>>>>>>>
>>>>>>> We override standard functionality in this place.
>>>>>>>
>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>> generator
>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp late
>>>>>>> s/
>>>>>>> gm
>>>>>>> f-graph'
>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>> Best wishes,
>>>>>>> Tatiana.
>>>>>>>> Hello Tatiana,
>>>>>>>>
>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>
>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>
>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>> line are different from what is in cvs
>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>
>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>> is newer than the one you used ?
>>>>>>>>
>>>>>>>> Thank you,
>>>>>>>> Mathieu
>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>> Hello Martin,
>>>>>>>>>
>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>> customizations.
>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sf
>>>>>>>>> or me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>>> accordance with your needs.
>>>>>>>>>
>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>> attempts
>>>>>>>>> were
>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>>> they
>>>>>>>>> will
>>>>>>>>> help you.
>>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>>> fields
>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>> technically
>>>>>>>>> there
>>>>>>>>> is
>>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>>> any
>>>>>>>>> tag
>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>> it
>>>>>>>>> from
>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>> '@generated
>>>>>>>>> NOT'
>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>> (from
>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>> code
>>>>>>>>> (code
>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>> GMF-generator,
>>>>>>>>> it will stay the same.
>>>>>>>>> Best wishes,
>>>>>>>>> Tatiana.
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i will
>>>>>>>>>> be able to Generate UML2Tools Diagrams containing
>>>>>>>>>> modificiations i made.
>>>>>>>>>>
>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>> file (if you did some)?
>>>>>>>>>>
>>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>>> code are link to the new generated code?
>>>>>>>>>>
>>>>>>>>>> Thank you
>>>>>>>>>> Martin
Re: How to regenerate gmfgen? [message #473257 is a reply to message #473255] Wed, 30 January 2008 22:19 Go to previous messageGo to next message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Yes, it answer my questions.

Thank you again, for now we are well started on our project, but I'm
sure we'll have some more questions in the next month ! :)

Mathieu


Tatiana Fesenko wrote:
> Hi Mathieu,
>
> You are correct. 'Pure' GMF cannot handle all the tasks we face. To
> implement all our functionality with a minimum us of 'generated-not'
> code we made our extension for the gmfgen model. As you have noticed
> there are a lot of custom attributes in *.gmfgen file. Some of them
> cannot be introdiced in the *.gmfgraph file, because they have
> genmodel-specific properties. For example, 'SubstitutableByAttributes'
> element needs Visual ID of the element it references:
>
> <attributes
> xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
> <substitutableByIDs>2016</substitutableByIDs>
> </attributes>
>
> Visual ID is not available in the gmfmap model, it's available only in
> gmfgen model. Our dynamic templates pick such attributes up and generate
> appropriate code.
> Did I answer your question?
> Good luck,
> Tatiana.
>
>> Hello Tatiana,
>>
>> Thanks for the last answers, they helped again to understand
>> everything.
>>
>> Just by curiosity, do you have plan to automate the generation of
>> these elements manually added to gmfgen ? A kind of menu "Generate
>> UML2Tools Diagrams" but on *.gmfmap ?
>>
>> If I understand correctly, the extensibility mechanisms of GMF do not
>> provide enough flexibility or expressiveness to create a tool like
>> uml2tools... (And it's why you have to add manually some element to
>> the gmfgen generated) Am I correct ? Did you reach the limits of GMF
>> in your project or could your added elements have been generated via
>> dynamic template or some other extension (maybe you evaluated that it
>> was too much time to implement ? :) )
>>
>> Thank you,
>> Mathieu
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>>> We found that these custom attributes that are missing are in
>>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>>>> can't figure how they are added to the .gmfgen when we do .gmfmap
>>>> ---> .gmfgen transformation. :-(
>>>>
>>> They are added manually.
>>>
>>>> What do you mean by "UML2Tools have its own genmodel extension". Do
>>>> you mean codegen and codegen.edit plugins? Or, are we supposed to
>>>> have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>>> Diagrams" on gmfgen?
>>>>
>>> We have our own genmodel extension to have such features as
>>> AssociationClass, action to change notation an so on automatically
>>> generated. "Generate UML2Tools Diagrams" takes these attributes into
>>> account and generates appropriate code.
>>>
>>>> and when you say "We were talking about how to preserve them in the
>>>> beginning of this branch"... Do you mean making merge?
>>>>
>>> Yes, I was talking about making merge.
>>>
>>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>>
>>>> We're so close! :-)
>>>>
>>>> Martin
>>>>
>>>> Tatiana Fesenko wrote:
>>>>
>>>>> Hello again Mathieu =)
>>>>>
>>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>>> custom attributes from this extension. We were talking about how to
>>>>> preserve them in the beginning of this branch -
>>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>>>>>
>>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>>> return
>>>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>>> attribute
>>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>>> carriage-return
>>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>>> respectively."
>>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>>> why
>>>>> we
>>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>>>> Good luck!
>>>>> Tatiana.
>>>>>> Hello again ! :)
>>>>>>
>>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>>> still some difference between the gmfgen I generate and the one
>>>>>> contained on cvs.
>>>>>>
>>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>>> have:
>>>>>> ---
>>>>>> <attributes
>>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>>> fixedForeground="true"/>
>>>>>> ---
>>>>>> (example: line 509, 513, 516, 519)
>>>>>> I don't understand why those element are not generated...
>>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>>> have:
>>>>>> ---
>>>>>> <attributes
>>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Templa
>>>>>> te
>>>>>> Lo
>>>>>> cator"/>
>>>>>> ---
>>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>>> I think it may be related to the plugin
>>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>>>> do
>>>>>> you think ? I don't understand why, I have the head version of
>>>>>> org.eclipse.uml2.diagram.codegen and
>>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>>> M4
>>>>>> (plus each plugin installed is m4)
>>>>>> 3- Also, each attribute classbody generated is very different.
>>>>>> Differences are like those ones:
>>>>>> ---
>>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>>> of
>>>>>> code}"
>>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot
>>>>>> of
>>>>>> code} *
>>>>>> I don't understand what is generated and I don't know if the
>>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>>> Thank you again,
>>>>>> Mathieu
>>>>>> Mathieu Bertrand wrote:
>>>>>>> Thank you,
>>>>>>> It work as you said.
>>>>>>> Mathieu
>>>>>>> Tatiana Fesenko wrote:
>>>>>>>> Hi Mathieu,
>>>>>>>>
>>>>>>>> We override standard functionality in this place.
>>>>>>>>
>>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>>> generator
>>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp late
>>>>>>>> s/
>>>>>>>> gm
>>>>>>>> f-graph'
>>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>>> Best wishes,
>>>>>>>> Tatiana.
>>>>>>>>> Hello Tatiana,
>>>>>>>>>
>>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>>
>>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>>
>>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>>> line are different from what is in cvs
>>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>>
>>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>>> is newer than the one you used ?
>>>>>>>>>
>>>>>>>>> Thank you,
>>>>>>>>> Mathieu
>>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>>> Hello Martin,
>>>>>>>>>>
>>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>>> customizations.
>>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sf
>>>>>>>>>> or me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>>>> accordance with your needs.
>>>>>>>>>>
>>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>>> attempts
>>>>>>>>>> were
>>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>>>> they
>>>>>>>>>> will
>>>>>>>>>> help you.
>>>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>>>> fields
>>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>>> technically
>>>>>>>>>> there
>>>>>>>>>> is
>>>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>>>> any
>>>>>>>>>> tag
>>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>>> it
>>>>>>>>>> from
>>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>>> '@generated
>>>>>>>>>> NOT'
>>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>>> (from
>>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>>> code
>>>>>>>>>> (code
>>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>>> GMF-generator,
>>>>>>>>>> it will stay the same.
>>>>>>>>>> Best wishes,
>>>>>>>>>> Tatiana.
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i will
>>>>>>>>>>> be able to Generate UML2Tools Diagrams containing
>>>>>>>>>>> modificiations i made.
>>>>>>>>>>>
>>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>>> file (if you did some)?
>>>>>>>>>>>
>>>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>>>> code are link to the new generated code?
>>>>>>>>>>>
>>>>>>>>>>> Thank you
>>>>>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #473258 is a reply to message #473257] Thu, 31 January 2008 13:47 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
You are welcome, Mathieu =)


> Yes, it answer my questions.
>
> Thank you again, for now we are well started on our project, but I'm
> sure we'll have some more questions in the next month ! :)
>
> Mathieu
>
> Tatiana Fesenko wrote:
>
>> Hi Mathieu,
>>
>> You are correct. 'Pure' GMF cannot handle all the tasks we face. To
>> implement all our functionality with a minimum us of 'generated-not'
>> code we made our extension for the gmfgen model. As you have noticed
>> there are a lot of custom attributes in *.gmfgen file. Some of them
>> cannot be introdiced in the *.gmfgraph file, because they have
>> genmodel-specific properties. For example,
>> 'SubstitutableByAttributes' element needs Visual ID of the element it
>> references:
>>
>> <attributes xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
>> <substitutableByIDs>2016</substitutableByIDs> </attributes>
>>
>> Visual ID is not available in the gmfmap model, it's available only
>> in
>> gmfgen model. Our dynamic templates pick such attributes up and
>> generate
>> appropriate code.
>> Did I answer your question?
>> Good luck,
>> Tatiana.
>>> Hello Tatiana,
>>>
>>> Thanks for the last answers, they helped again to understand
>>> everything.
>>>
>>> Just by curiosity, do you have plan to automate the generation of
>>> these elements manually added to gmfgen ? A kind of menu "Generate
>>> UML2Tools Diagrams" but on *.gmfmap ?
>>>
>>> If I understand correctly, the extensibility mechanisms of GMF do
>>> not provide enough flexibility or expressiveness to create a tool
>>> like uml2tools... (And it's why you have to add manually some
>>> element to the gmfgen generated) Am I correct ? Did you reach the
>>> limits of GMF in your project or could your added elements have been
>>> generated via dynamic template or some other extension (maybe you
>>> evaluated that it was too much time to implement ? :) )
>>>
>>> Thank you,
>>> Mathieu
>>> Tatiana Fesenko wrote:
>>>> Hello Martin,
>>>>
>>>>> We found that these custom attributes that are missing are in
>>>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But
>>>>> we can't figure how they are added to the .gmfgen when we do
>>>>> .gmfmap ---> .gmfgen transformation. :-(
>>>>>
>>>> They are added manually.
>>>>
>>>>> What do you mean by "UML2Tools have its own genmodel extension".
>>>>> Do you mean codegen and codegen.edit plugins? Or, are we supposed
>>>>> to have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>>>> Diagrams" on gmfgen?
>>>>>
>>>> We have our own genmodel extension to have such features as
>>>> AssociationClass, action to change notation an so on automatically
>>>> generated. "Generate UML2Tools Diagrams" takes these attributes
>>>> into account and generates appropriate code.
>>>>
>>>>> and when you say "We were talking about how to preserve them in
>>>>> the beginning of this branch"... Do you mean making merge?
>>>>>
>>>> Yes, I was talking about making merge.
>>>>
>>>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>>>
>>>>> We're so close! :-)
>>>>>
>>>>> Martin
>>>>>
>>>>> Tatiana Fesenko wrote:
>>>>>
>>>>>> Hello again Mathieu =)
>>>>>>
>>>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>>>> custom attributes from this extension. We were talking about how
>>>>>> to preserve them in the beginning of this branch -
>>>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org.
>>>>>>
>>>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>>>> return
>>>>>> symbol. MS-DOS-based systems use combination of carriage-return
>>>>>> and
>>>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>>>> attribute
>>>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>>>> carriage-return
>>>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>>>> respectively."
>>>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>>>> why
>>>>>> we
>>>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get
>>>>>> '&#xA;'.
>>>>>> Good luck!
>>>>>> Tatiana.
>>>>>>> Hello again ! :)
>>>>>>>
>>>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>>>> still some difference between the gmfgen I generate and the one
>>>>>>> contained on cvs.
>>>>>>>
>>>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>>>> have:
>>>>>>> ---
>>>>>>> <attributes
>>>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>>>> fixedForeground="true"/>
>>>>>>> ---
>>>>>>> (example: line 509, 513, 516, 519)
>>>>>>> I don't understand why those element are not generated...
>>>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>>>> have:
>>>>>>> ---
>>>>>>> <attributes
>>>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Temp
>>>>>>> la
>>>>>>> te
>>>>>>> Lo
>>>>>>> cator"/>
>>>>>>> ---
>>>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>>>> I think it may be related to the plugin
>>>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly,
>>>>>>> what
>>>>>>> do
>>>>>>> you think ? I don't understand why, I have the head version of
>>>>>>> org.eclipse.uml2.diagram.codegen and
>>>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>>>> M4
>>>>>>> (plus each plugin installed is m4)
>>>>>>> 3- Also, each attribute classbody generated is very different.
>>>>>>> Differences are like those ones:
>>>>>>> ---
>>>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>>>> of
>>>>>>> code}"
>>>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;....
>>>>>>> {lot
>>>>>>> of
>>>>>>> code} *
>>>>>>> I don't understand what is generated and I don't know if the
>>>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>>>> Thank you again,
>>>>>>> Mathieu
>>>>>>> Mathieu Bertrand wrote:
>>>>>>>> Thank you,
>>>>>>>> It work as you said.
>>>>>>>> Mathieu
>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>> Hi Mathieu,
>>>>>>>>>
>>>>>>>>> We override standard functionality in this place.
>>>>>>>>>
>>>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>>>> generator
>>>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp la
>>>>>>>>> te
>>>>>>>>> s/
>>>>>>>>> gm
>>>>>>>>> f-graph'
>>>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>>>> Best wishes,
>>>>>>>>> Tatiana.
>>>>>>>>>> Hello Tatiana,
>>>>>>>>>>
>>>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>>>
>>>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>>>
>>>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>>>> line are different from what is in cvs
>>>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>>>
>>>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>>>> is newer than the one you used ?
>>>>>>>>>>
>>>>>>>>>> Thank you,
>>>>>>>>>> Mathieu
>>>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>
>>>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>>>> customizations.
>>>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran
>>>>>>>>>>> sf or me r from org.eclipse.gmf.bridge plugin is responsible
>>>>>>>>>>> for gmfmap->gmfgen transformation. You could change the
>>>>>>>>>>> class in accordance with your needs.
>>>>>>>>>>>
>>>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>>>> attempts
>>>>>>>>>>> were
>>>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm
>>>>>>>>>>> sure
>>>>>>>>>>> they
>>>>>>>>>>> will
>>>>>>>>>>> help you.
>>>>>>>>>>> In short, code is generated by GMF only into src folder.
>>>>>>>>>>> Only
>>>>>>>>>>> fields
>>>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>>>> technically
>>>>>>>>>>> there
>>>>>>>>>>> is
>>>>>>>>>>> no difference whether to use 'generated NOT' tag or not to
>>>>>>>>>>> use
>>>>>>>>>>> any
>>>>>>>>>>> tag
>>>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>>>> 'For generated classes, if modifying a method that contains
>>>>>>>>>>> a
>>>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>>>> it
>>>>>>>>>>> from
>>>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>>>> '@generated
>>>>>>>>>>> NOT'
>>>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>>>> (from
>>>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>>>> code
>>>>>>>>>>> (code
>>>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>>>> GMF-generator,
>>>>>>>>>>> it will stay the same.
>>>>>>>>>>> Best wishes,
>>>>>>>>>>> Tatiana.
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i
>>>>>>>>>>>> will be able to Generate UML2Tools Diagrams containing
>>>>>>>>>>>> modificiations i made.
>>>>>>>>>>>>
>>>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>>>> file (if you did some)?
>>>>>>>>>>>>
>>>>>>>>>>>> Also, i would like to know how custom-src and
>>>>>>>>>>>> @NOT-generated code are link to the new generated code?
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you
>>>>>>>>>>>> Martin
Re: How to regenerate gmfgen? [message #616730 is a reply to message #472359] Wed, 16 January 2008 20:13 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Martin,

To be honest, I do CVS merge to prevent loosing previous customizations.
org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen transformation.
You could change the class in accordance with your needs.

I tried to find any article about code-merge in GMF. My attempts were failed.
Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will help you.

In short, code is generated by GMF only into src folder. Only fields marked
with 'generated' tag will be overridden. So, technically there is no difference
whether to use 'generated NOT' tag or not to use any tag at all. But 'generated
NOT' tag is more preferrable:
'For generated classes, if modifying a method that contains a '@generated'
tag, be sure to place 'NOT' after it to prevent it from being overwritten.
Note that it is preferable to create '@generated NOT' tags, rather than removing
the '@generated' tag completely.'
(from http://wiki.eclipse.org/GMF_Development_Guidelines).
Other code (code which is not conformably tagged) will _not_ be touched by
GMF-generator, it will stay the same.

Best wishes,
Tatiana.

> Hello,
>
> I need to add some features to the gmfgraph, gmftool and gmfmap files
> and regenerate gmfgen file then, i think i will be able to Generate
> UML2Tools Diagrams containing modificiations i made.
>
> So, i'm wondering how you actually do the gmfgen creation without
> losing customization you made in previous .gmfgen file (if you did
> some)?
>
> Also, i would like to know how custom-src and @NOT-generated code are
> link to the new generated code?
>
> Thank you
> Martin
Re: How to regenerate gmfgen? [message #616736 is a reply to message #472362] Wed, 16 January 2008 21:11 Go to previous message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana,

Thank you very much for your comment. It will really help me. I noted
your suggestion and ask a question on GMF newsgroups (hope someone will
help!)

I would like to ask you another question: where can i find the best
documentation to better understand how code generation work (i mean
learn a little more on "all the templates and utility classes that
trigger the code generation") ?

Thanks again!

Martin



Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #616737 is a reply to message #472456] Thu, 17 January 2008 11:50 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Martin,

Welcome.
I'm not sure if such documentation exists. It's more reliable to ask in gmf
newgroup. Probably they will refer to Richard Gronback's book(news://news.eclipse.org/fmfjrh$9js$1@build.eclipse.org)
=)

Best wishes,
Tatiana.

> Hello Tatiana,
>
> Thank you very much for your comment. It will really help me. I noted
> your suggestion and ask a question on GMF newsgroups (hope someone
> will help!)
>
> I would like to ask you another question: where can i find the best
> documentation to better understand how code generation work (i mean
> learn a little more on "all the templates and utility classes that
> trigger the code generation") ?
>
> Thanks again!
>
> Martin
>
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous
>> customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your
>> needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>> will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there
>> is
>> no difference whether to use 'generated NOT' tag or not to use any
>> tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated
>> NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by
>> GMF-generator,
>> it will stay the same.
>> Best wishes,
>> Tatiana.
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>> files and regenerate gmfgen file then, i think i will be able to
>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code
>>> are link to the new generated code?
>>>
>>> Thank you
>>> Martin
Re: How to regenerate gmfgen? [message #616738 is a reply to message #472459] Thu, 17 January 2008 14:18 Go to previous message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana,

Thanks a lot. I'll take a look at this book when available!

Ciao!

Martin

Tatiana Fesenko wrote:
> Hi Martin,
>
> Welcome.
> I'm not sure if such documentation exists. It's more reliable to ask in
> gmf newgroup. Probably they will refer to Richard Gronback's
> book(news://news.eclipse.org/fmfjrh$9js$1@build.eclipse.org) =)
>
> Best wishes,
> Tatiana.
>
>> Hello Tatiana,
>>
>> Thank you very much for your comment. It will really help me. I noted
>> your suggestion and ask a question on GMF newsgroups (hope someone
>> will help!)
>>
>> I would like to ask you another question: where can i find the best
>> documentation to better understand how code generation work (i mean
>> learn a little more on "all the templates and utility classes that
>> trigger the code generation") ?
>>
>> Thanks again!
>>
>> Martin
>>
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>> To be honest, I do CVS merge to prevent loosing previous
>>> customizations.
>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>> transformation. You could change the class in accordance with your
>>> needs.
>>>
>>> I tried to find any article about code-merge in GMF. My attempts were
>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>> will
>>> help you.
>>> In short, code is generated by GMF only into src folder. Only fields
>>> marked with 'generated' tag will be overridden. So, technically there
>>> is
>>> no difference whether to use 'generated NOT' tag or not to use any
>>> tag
>>> at all. But 'generated NOT' tag is more preferrable:
>>> 'For generated classes, if modifying a method that contains a
>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>> being overwritten. Note that it is preferable to create '@generated
>>> NOT'
>>> tags, rather than removing the '@generated' tag completely.' (from
>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>> which is not conformably tagged) will _not_ be touched by
>>> GMF-generator,
>>> it will stay the same.
>>> Best wishes,
>>> Tatiana.
>>>> Hello,
>>>>
>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>> files and regenerate gmfgen file then, i think i will be able to
>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>
>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>> losing customization you made in previous .gmfgen file (if you did
>>>> some)?
>>>>
>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>> are link to the new generated code?
>>>>
>>>> Thank you
>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #616740 is a reply to message #472362] Thu, 17 January 2008 17:22 Go to previous message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Again Tatiana,

I'm wondering what you do with VisualID when you make your merge? Do you
keep new ones or old ones? Is there any importance?

thank you

Martin

Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #616741 is a reply to message #472465] Thu, 17 January 2008 17:39 Go to previous message
Richard Gronback is currently offline Richard Gronback
Messages: 605
Registered: July 2009
Senior Member
Visual IDs are supported during regeneration by the
org.eclipse.gmf.bridge.trace plug-in. If you see a .trace file produced
during gmfmap->gmfgen transformation, you have it installed (take a look
inside). Otherwise, try installing the "Experimental SDK."

- Rich


On 1/17/08 12:22 PM, in article fmo2so$91p$1@build.eclipse.org, "Martin
Nadeau" <martin.nadeau@scg.ulaval.ca> wrote:

> Hello Again Tatiana,
>
> I'm wondering what you do with VisualID when you make your merge? Do you
> keep new ones or old ones? Is there any importance?
>
> thank you
>
> Martin
>
> Tatiana Fesenko wrote:
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
>> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there is
>> no difference whether to use 'generated NOT' tag or not to use any tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by GMF-generator,
>> it will stay the same.
>>
>> Best wishes,
>> Tatiana.
>>
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>>> and regenerate gmfgen file then, i think i will be able to Generate
>>> UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code are
>>> link to the new generated code?
>>>
>>> Thank you
>>> Martin
>>
>>
Re: How to regenerate gmfgen? [message #616743 is a reply to message #472362] Fri, 18 January 2008 03:02 Go to previous message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello Tatiana,

I would like to have some precision on that point. Are you saying that
you do CVS Merge between (for example) the old gmfgen and the new gmfgen ?

I tried this method this afternoon, I observed a lot of unexpected
difference, please find attached both files. I didn't even modified the
initial gmfmap, I just "Create Generator Model" from classDiagram.gmfmap
to compare with the actual classDiagram.gmfgen (from cvs).

For instance, there is a lot of generated line pointing to
"org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
different from what is in cvs ("org.eclipse.draw2d.Label").

Is it because the version of GMF I used to generate my gmfgen is newer
than the one you used ?

Thank you,
Mathieu





Tatiana Fesenko wrote:
> Hello Martin,
>
> To be honest, I do CVS merge to prevent loosing previous customizations.
> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer from
> org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
> transformation. You could change the class in accordance with your needs.
>
> I tried to find any article about code-merge in GMF. My attempts were
> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they will
> help you.
> In short, code is generated by GMF only into src folder. Only fields
> marked with 'generated' tag will be overridden. So, technically there is
> no difference whether to use 'generated NOT' tag or not to use any tag
> at all. But 'generated NOT' tag is more preferrable:
> 'For generated classes, if modifying a method that contains a
> '@generated' tag, be sure to place 'NOT' after it to prevent it from
> being overwritten. Note that it is preferable to create '@generated NOT'
> tags, rather than removing the '@generated' tag completely.' (from
> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
> which is not conformably tagged) will _not_ be touched by GMF-generator,
> it will stay the same.
>
> Best wishes,
> Tatiana.
>
>> Hello,
>>
>> I need to add some features to the gmfgraph, gmftool and gmfmap files
>> and regenerate gmfgen file then, i think i will be able to Generate
>> UML2Tools Diagrams containing modificiations i made.
>>
>> So, i'm wondering how you actually do the gmfgen creation without
>> losing customization you made in previous .gmfgen file (if you did
>> some)?
>>
>> Also, i would like to know how custom-src and @NOT-generated code are
>> link to the new generated code?
>>
>> Thank you
>> Martin
>
>
Re: How to regenerate gmfgen? [message #617046 is a reply to message #472473] Fri, 18 January 2008 14:20 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Mathieu,

We override standard functionality in this place.

To have the same gmfgen as we have do the following:
1) Find page 'Specify transformation options' in 'Create generator model...'
dialog (it's fifth page).
2) Write '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
string in the 'GMFGraph dynamic templates' field.
Voila!

Best wishes,
Tatiana.

> Hello Tatiana,
>
> I would like to have some precision on that point. Are you saying that
> you do CVS Merge between (for example) the old gmfgen and the new
> gmfgen ?
>
> I tried this method this afternoon, I observed a lot of unexpected
> difference, please find attached both files. I didn't even modified
> the initial gmfmap, I just "Create Generator Model" from
> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
> (from cvs).
>
> For instance, there is a lot of generated line pointing to
> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
> different from what is in cvs ("org.eclipse.draw2d.Label").
>
> Is it because the version of GMF I used to generate my gmfgen is newer
> than the one you used ?
>
> Thank you,
> Mathieu
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>> To be honest, I do CVS merge to prevent loosing previous
>> customizations.
>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>> transformation. You could change the class in accordance with your
>> needs.
>>
>> I tried to find any article about code-merge in GMF. My attempts were
>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>> will
>> help you.
>> In short, code is generated by GMF only into src folder. Only fields
>> marked with 'generated' tag will be overridden. So, technically there
>> is
>> no difference whether to use 'generated NOT' tag or not to use any
>> tag
>> at all. But 'generated NOT' tag is more preferrable:
>> 'For generated classes, if modifying a method that contains a
>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>> being overwritten. Note that it is preferable to create '@generated
>> NOT'
>> tags, rather than removing the '@generated' tag completely.' (from
>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>> which is not conformably tagged) will _not_ be touched by
>> GMF-generator,
>> it will stay the same.
>> Best wishes,
>> Tatiana.
>>> Hello,
>>>
>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>> files and regenerate gmfgen file then, i think i will be able to
>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>
>>> So, i'm wondering how you actually do the gmfgen creation without
>>> losing customization you made in previous .gmfgen file (if you did
>>> some)?
>>>
>>> Also, i would like to know how custom-src and @NOT-generated code
>>> are link to the new generated code?
>>>
>>> Thank you
>>> Martin
Re: How to regenerate gmfgen? [message #617055 is a reply to message #472480] Sat, 19 January 2008 01:34 Go to previous message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Thank you,
It work as you said.

Mathieu

Tatiana Fesenko wrote:
> Hi Mathieu,
>
> We override standard functionality in this place.
>
> To have the same gmfgen as we have do the following:
> 1) Find page 'Specify transformation options' in 'Create generator
> model...' dialog (it's fifth page). 2) Write
> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
> string in the 'GMFGraph dynamic templates' field. Voila!
>
> Best wishes,
> Tatiana.
>
>> Hello Tatiana,
>>
>> I would like to have some precision on that point. Are you saying that
>> you do CVS Merge between (for example) the old gmfgen and the new
>> gmfgen ?
>>
>> I tried this method this afternoon, I observed a lot of unexpected
>> difference, please find attached both files. I didn't even modified
>> the initial gmfmap, I just "Create Generator Model" from
>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>> (from cvs).
>>
>> For instance, there is a lot of generated line pointing to
>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
>> different from what is in cvs ("org.eclipse.draw2d.Label").
>>
>> Is it because the version of GMF I used to generate my gmfgen is newer
>> than the one you used ?
>>
>> Thank you,
>> Mathieu
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>> To be honest, I do CVS merge to prevent loosing previous
>>> customizations.
>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>> transformation. You could change the class in accordance with your
>>> needs.
>>>
>>> I tried to find any article about code-merge in GMF. My attempts were
>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>> will
>>> help you.
>>> In short, code is generated by GMF only into src folder. Only fields
>>> marked with 'generated' tag will be overridden. So, technically there
>>> is
>>> no difference whether to use 'generated NOT' tag or not to use any
>>> tag
>>> at all. But 'generated NOT' tag is more preferrable:
>>> 'For generated classes, if modifying a method that contains a
>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>> being overwritten. Note that it is preferable to create '@generated
>>> NOT'
>>> tags, rather than removing the '@generated' tag completely.' (from
>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>> which is not conformably tagged) will _not_ be touched by
>>> GMF-generator,
>>> it will stay the same.
>>> Best wishes,
>>> Tatiana.
>>>> Hello,
>>>>
>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>> files and regenerate gmfgen file then, i think i will be able to
>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>
>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>> losing customization you made in previous .gmfgen file (if you did
>>>> some)?
>>>>
>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>> are link to the new generated code?
>>>>
>>>> Thank you
>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #617080 is a reply to message #472486] Tue, 22 January 2008 22:37 Go to previous message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello again ! :)

Specifying GMFGraph dynamic templates helped a lot, but I have still
some difference between the gmfgen I generate and the one contained on cvs.

1 - gmfen on cvs have lines like those ones that mine doesn't have:
---
<attributes
xsi:type="gmfgen:StyleAttributes"
fixedForeground="true"/>
---
(example: line 509, 513, 516, 519)
I don't understand why those element are not generated...



2- gmfgen on cvs have lines like those ones that mine doesn't have:
---
<attributes
xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLocator "/>
---
In fact, gmfgen on cvs have a lot of extra lines involving
AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
DetailsLevelAttributes and SubstituableByAttributes. (From
org.eclipse.uml2.diagram.codegen.gmfgenext).

I think it may be related to the plugin org.eclipse.uml2.diagram.codegen
not doing his job correctly, what do you think ? I don't understand why,
I have the head version of org.eclipse.uml2.diagram.codegen and
org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
(plus each plugin installed is m4)



3- Also, each attribute classbody generated is very different.
Differences are like those ones:
---
generated classbody: "classBody="&#xA;/**&#xA; *............{lot of code}"
should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of code} *

I don't understand what is generated and I don't know if the difference
is important... Maybe somebody could tell us more. :)

Thank you again,
Mathieu



Mathieu Bertrand wrote:
> Thank you,
> It work as you said.
>
> Mathieu
>
> Tatiana Fesenko wrote:
>> Hi Mathieu,
>>
>> We override standard functionality in this place.
>>
>> To have the same gmfgen as we have do the following:
>> 1) Find page 'Specify transformation options' in 'Create generator
>> model...' dialog (it's fifth page). 2) Write
>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gmf-graph'
>> string in the 'GMFGraph dynamic templates' field. Voila!
>>
>> Best wishes,
>> Tatiana.
>>
>>> Hello Tatiana,
>>>
>>> I would like to have some precision on that point. Are you saying that
>>> you do CVS Merge between (for example) the old gmfgen and the new
>>> gmfgen ?
>>>
>>> I tried this method this afternoon, I observed a lot of unexpected
>>> difference, please find attached both files. I didn't even modified
>>> the initial gmfmap, I just "Create Generator Model" from
>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>> (from cvs).
>>>
>>> For instance, there is a lot of generated line pointing to
>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line are
>>> different from what is in cvs ("org.eclipse.draw2d.Label").
>>>
>>> Is it because the version of GMF I used to generate my gmfgen is newer
>>> than the one you used ?
>>>
>>> Thank you,
>>> Mathieu
>>> Tatiana Fesenko wrote:
>>>
>>>> Hello Martin,
>>>>
>>>> To be honest, I do CVS merge to prevent loosing previous
>>>> customizations.
>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sformer
>>>> from org.eclipse.gmf.bridge plugin is responsible for gmfmap->gmfgen
>>>> transformation. You could change the class in accordance with your
>>>> needs.
>>>>
>>>> I tried to find any article about code-merge in GMF. My attempts were
>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure they
>>>> will
>>>> help you.
>>>> In short, code is generated by GMF only into src folder. Only fields
>>>> marked with 'generated' tag will be overridden. So, technically there
>>>> is
>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>> tag
>>>> at all. But 'generated NOT' tag is more preferrable:
>>>> 'For generated classes, if modifying a method that contains a
>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it from
>>>> being overwritten. Note that it is preferable to create '@generated
>>>> NOT'
>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code (code
>>>> which is not conformably tagged) will _not_ be touched by
>>>> GMF-generator,
>>>> it will stay the same.
>>>> Best wishes,
>>>> Tatiana.
>>>>> Hello,
>>>>>
>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>
>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>> losing customization you made in previous .gmfgen file (if you did
>>>>> some)?
>>>>>
>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>> are link to the new generated code?
>>>>>
>>>>> Thank you
>>>>> Martin
>>
>>
Re: How to regenerate gmfgen? [message #617082 is a reply to message #472671] Wed, 23 January 2008 18:17 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello again Mathieu =)

1)2) UML2Tools have its own genmodel extension. These are our custom attributes
from this extension. We were talking about how to preserve them in the beginning
of this branch - news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org

3) As I can see you work on Unix-like system.
This is carriage return symbol. MS-DOS-based systems use combination of carriage-return
and line-feed, while Unix uses only carriage-return. In XML "In attribute
values, the characters TAB (#x9), linefeed (#xA), and carriage-return (#xD)
are represented by "&#x9;", "&#xA;", and "&#xD;" respectively." (http://www.w3.org/1999/07/WD-xml-c14n-19990729).
This is explais why we (Windows people) have '&#xD;&#xA;' where Unix-fellows
get '&#xA;'.

Good luck!
Tatiana.

> Hello again ! :)
>
> Specifying GMFGraph dynamic templates helped a lot, but I have still
> some difference between the gmfgen I generate and the one contained on
> cvs.
>
> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
> ---
> <attributes
> xsi:type="gmfgen:StyleAttributes"
> fixedForeground="true"/>
> ---
> (example: line 509, 513, 516, 519)
> I don't understand why those element are not generated...
> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
> ---
> <attributes
> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLo
> cator"/>
> ---
> In fact, gmfgen on cvs have a lot of extra lines involving
> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
> DetailsLevelAttributes and SubstituableByAttributes. (From
> org.eclipse.uml2.diagram.codegen.gmfgenext).
> I think it may be related to the plugin
> org.eclipse.uml2.diagram.codegen not doing his job correctly, what do
> you think ? I don't understand why, I have the head version of
> org.eclipse.uml2.diagram.codegen and
> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
> (plus each plugin installed is m4)
>
> 3- Also, each attribute classbody generated is very different.
> Differences are like those ones:
> ---
> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
> code}"
> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
> code} *
> I don't understand what is generated and I don't know if the
> difference is important... Maybe somebody could tell us more. :)
>
> Thank you again,
> Mathieu
> Mathieu Bertrand wrote:
>
>> Thank you,
>> It work as you said.
>> Mathieu
>>
>> Tatiana Fesenko wrote:
>>
>>> Hi Mathieu,
>>>
>>> We override standard functionality in this place.
>>>
>>> To have the same gmfgen as we have do the following:
>>> 1) Find page 'Specify transformation options' in 'Create generator
>>> model...' dialog (it's fifth page). 2) Write
>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gm
>>> f-graph'
>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>> Best wishes,
>>> Tatiana.
>>>> Hello Tatiana,
>>>>
>>>> I would like to have some precision on that point. Are you saying
>>>> that you do CVS Merge between (for example) the old gmfgen and the
>>>> new gmfgen ?
>>>>
>>>> I tried this method this afternoon, I observed a lot of unexpected
>>>> difference, please find attached both files. I didn't even
>>>> modified the initial gmfmap, I just "Create Generator Model" from
>>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>>> (from cvs).
>>>>
>>>> For instance, there is a lot of generated line pointing to
>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line
>>>> are different from what is in cvs ("org.eclipse.draw2d.Label").
>>>>
>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>> newer than the one you used ?
>>>>
>>>> Thank you,
>>>> Mathieu
>>>> Tatiana Fesenko wrote:
>>>>> Hello Martin,
>>>>>
>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>> customizations.
>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sforme
>>>>> r from org.eclipse.gmf.bridge plugin is responsible for
>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>> accordance with your needs.
>>>>>
>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>> were
>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>> they
>>>>> will
>>>>> help you.
>>>>> In short, code is generated by GMF only into src folder. Only
>>>>> fields
>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>> there
>>>>> is
>>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>>> tag
>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>> 'For generated classes, if modifying a method that contains a
>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>> from
>>>>> being overwritten. Note that it is preferable to create
>>>>> '@generated
>>>>> NOT'
>>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>> (code
>>>>> which is not conformably tagged) will _not_ be touched by
>>>>> GMF-generator,
>>>>> it will stay the same.
>>>>> Best wishes,
>>>>> Tatiana.
>>>>>> Hello,
>>>>>>
>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>>
>>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>>> losing customization you made in previous .gmfgen file (if you
>>>>>> did some)?
>>>>>>
>>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>>> are link to the new generated code?
>>>>>>
>>>>>> Thank you
>>>>>> Martin
Re: How to regenerate gmfgen? [message #617100 is a reply to message #472675] Wed, 23 January 2008 21:15 Go to previous message
Eclipse User
Originally posted by: martin.nadeau.scg.ulaval.ca

Hello Tatiana, ;-)

I didn't understand your first part of response to Mathieu...

We found that these custom attributes that are missing are in
org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
can't figure how they are added to the .gmfgen when we do .gmfmap --->
..gmfgen transformation. :-(

What do you mean by "UML2Tools have its own genmodel extension". Do you
mean codegen and codegen.edit plugins? Or, are we supposed to have (on
the gmfmap) a custom menu like the "Generate UML2Tools Diagrams" on gmfgen?

and when you say "We were talking about how to preserve them in the
beginning of this branch"... Do you mean making merge?

We're so close! :-)

Martin

Tatiana Fesenko wrote:
> Hello again Mathieu =)
>
> 1)2) UML2Tools have its own genmodel extension. These are our custom
> attributes from this extension. We were talking about how to preserve
> them in the beginning of this branch -
> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>
> 3) As I can see you work on Unix-like system. This is carriage return
> symbol. MS-DOS-based systems use combination of carriage-return and
> line-feed, while Unix uses only carriage-return. In XML "In attribute
> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why we
> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
> Good luck!
> Tatiana.
>
>> Hello again ! :)
>>
>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>> some difference between the gmfgen I generate and the one contained on
>> cvs.
>>
>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>> ---
>> <attributes
>> xsi:type="gmfgen:StyleAttributes"
>> fixedForeground="true"/>
>> ---
>> (example: line 509, 513, 516, 519)
>> I don't understand why those element are not generated...
>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>> ---
>> <attributes
>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.TemplateLo
>> cator"/>
>> ---
>> In fact, gmfgen on cvs have a lot of extra lines involving
>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>> DetailsLevelAttributes and SubstituableByAttributes. (From
>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>> I think it may be related to the plugin
>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what do
>> you think ? I don't understand why, I have the head version of
>> org.eclipse.uml2.diagram.codegen and
>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>> (plus each plugin installed is m4)
>>
>> 3- Also, each attribute classbody generated is very different.
>> Differences are like those ones:
>> ---
>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>> code}"
>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>> code} *
>> I don't understand what is generated and I don't know if the
>> difference is important... Maybe somebody could tell us more. :)
>>
>> Thank you again,
>> Mathieu
>> Mathieu Bertrand wrote:
>>
>>> Thank you,
>>> It work as you said.
>>> Mathieu
>>>
>>> Tatiana Fesenko wrote:
>>>
>>>> Hi Mathieu,
>>>>
>>>> We override standard functionality in this place.
>>>>
>>>> To have the same gmfgen as we have do the following:
>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>> model...' dialog (it's fifth page). 2) Write
>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/gm
>>>> f-graph'
>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>> Best wishes,
>>>> Tatiana.
>>>>> Hello Tatiana,
>>>>>
>>>>> I would like to have some precision on that point. Are you saying
>>>>> that you do CVS Merge between (for example) the old gmfgen and the
>>>>> new gmfgen ?
>>>>>
>>>>> I tried this method this afternoon, I observed a lot of unexpected
>>>>> difference, please find attached both files. I didn't even
>>>>> modified the initial gmfmap, I just "Create Generator Model" from
>>>>> classDiagram.gmfmap to compare with the actual classDiagram.gmfgen
>>>>> (from cvs).
>>>>>
>>>>> For instance, there is a lot of generated line pointing to
>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses line
>>>>> are different from what is in cvs ("org.eclipse.draw2d.Label").
>>>>>
>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>> newer than the one you used ?
>>>>>
>>>>> Thank you,
>>>>> Mathieu
>>>>> Tatiana Fesenko wrote:
>>>>>> Hello Martin,
>>>>>>
>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>> customizations.
>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sforme
>>>>>> r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>> accordance with your needs.
>>>>>>
>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>> were
>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>> they
>>>>>> will
>>>>>> help you.
>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>> fields
>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>> there
>>>>>> is
>>>>>> no difference whether to use 'generated NOT' tag or not to use any
>>>>>> tag
>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>> from
>>>>>> being overwritten. Note that it is preferable to create
>>>>>> '@generated
>>>>>> NOT'
>>>>>> tags, rather than removing the '@generated' tag completely.' (from
>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>> (code
>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>> GMF-generator,
>>>>>> it will stay the same.
>>>>>> Best wishes,
>>>>>> Tatiana.
>>>>>>> Hello,
>>>>>>>
>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>> files and regenerate gmfgen file then, i think i will be able to
>>>>>>> Generate UML2Tools Diagrams containing modificiations i made.
>>>>>>>
>>>>>>> So, i'm wondering how you actually do the gmfgen creation without
>>>>>>> losing customization you made in previous .gmfgen file (if you
>>>>>>> did some)?
>>>>>>>
>>>>>>> Also, i would like to know how custom-src and @NOT-generated code
>>>>>>> are link to the new generated code?
>>>>>>>
>>>>>>> Thank you
>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #617556 is a reply to message #472693] Thu, 24 January 2008 12:24 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Martin,

> We found that these custom attributes that are missing are in
> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
> can't figure how they are added to the .gmfgen when we do .gmfmap --->
> .gmfgen transformation. :-(

They are added manually.

> What do you mean by "UML2Tools have its own genmodel extension". Do
> you mean codegen and codegen.edit plugins? Or, are we supposed to have
> (on the gmfmap) a custom menu like the "Generate UML2Tools Diagrams"
> on gmfgen?

We have our own genmodel extension to have such features as AssociationClass,
action to change notation an so on automatically generated. "Generate UML2Tools
Diagrams" takes these attributes into account and generates appropriate code.

> and when you say "We were talking about how to preserve them in the
> beginning of this branch"... Do you mean making merge?

Yes, I was talking about making merge.

Good luck! I''ll gladly answer all your new questions =)
Tatiana.

> We're so close! :-)
>
> Martin
>
> Tatiana Fesenko wrote:
>
>> Hello again Mathieu =)
>>
>> 1)2) UML2Tools have its own genmodel extension. These are our custom
>> attributes from this extension. We were talking about how to preserve
>> them in the beginning of this branch -
>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>>
>> 3) As I can see you work on Unix-like system. This is carriage
>> return
>> symbol. MS-DOS-based systems use combination of carriage-return and
>> line-feed, while Unix uses only carriage-return. In XML "In attribute
>> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why
>> we
>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>> Good luck!
>> Tatiana.
>>> Hello again ! :)
>>>
>>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>>> some difference between the gmfgen I generate and the one contained
>>> on cvs.
>>>
>>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>>> ---
>>> <attributes
>>> xsi:type="gmfgen:StyleAttributes"
>>> fixedForeground="true"/>
>>> ---
>>> (example: line 509, 513, 516, 519)
>>> I don't understand why those element are not generated...
>>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>>> ---
>>> <attributes
>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Template
>>> Lo
>>> cator"/>
>>> ---
>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>> I think it may be related to the plugin
>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>> do
>>> you think ? I don't understand why, I have the head version of
>>> org.eclipse.uml2.diagram.codegen and
>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>>> (plus each plugin installed is m4)
>>> 3- Also, each attribute classbody generated is very different.
>>> Differences are like those ones:
>>> ---
>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>>> code}"
>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>>> code} *
>>> I don't understand what is generated and I don't know if the
>>> difference is important... Maybe somebody could tell us more. :)
>>> Thank you again,
>>> Mathieu
>>> Mathieu Bertrand wrote:
>>>> Thank you,
>>>> It work as you said.
>>>> Mathieu
>>>> Tatiana Fesenko wrote:
>>>>
>>>>> Hi Mathieu,
>>>>>
>>>>> We override standard functionality in this place.
>>>>>
>>>>> To have the same gmfgen as we have do the following:
>>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>>> model...' dialog (it's fifth page). 2) Write
>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/
>>>>> gm
>>>>> f-graph'
>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>> Best wishes,
>>>>> Tatiana.
>>>>>> Hello Tatiana,
>>>>>>
>>>>>> I would like to have some precision on that point. Are you saying
>>>>>> that you do CVS Merge between (for example) the old gmfgen and
>>>>>> the new gmfgen ?
>>>>>>
>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>> unexpected difference, please find attached both files. I didn't
>>>>>> even modified the initial gmfmap, I just "Create Generator Model"
>>>>>> from classDiagram.gmfmap to compare with the actual
>>>>>> classDiagram.gmfgen (from cvs).
>>>>>>
>>>>>> For instance, there is a lot of generated line pointing to
>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>> line are different from what is in cvs
>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>
>>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>>> newer than the one you used ?
>>>>>>
>>>>>> Thank you,
>>>>>> Mathieu
>>>>>> Tatiana Fesenko wrote:
>>>>>>> Hello Martin,
>>>>>>>
>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>> customizations.
>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sfor
>>>>>>> me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>> accordance with your needs.
>>>>>>>
>>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>>> were
>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>> they
>>>>>>> will
>>>>>>> help you.
>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>> fields
>>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>>> there
>>>>>>> is
>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>> any
>>>>>>> tag
>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>>> from
>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>> '@generated
>>>>>>> NOT'
>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>> (from
>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>>> (code
>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>> GMF-generator,
>>>>>>> it will stay the same.
>>>>>>> Best wishes,
>>>>>>> Tatiana.
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>>> files and regenerate gmfgen file then, i think i will be able
>>>>>>>> to Generate UML2Tools Diagrams containing modificiations i
>>>>>>>> made.
>>>>>>>>
>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>> without losing customization you made in previous .gmfgen file
>>>>>>>> (if you did some)?
>>>>>>>>
>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>> code are link to the new generated code?
>>>>>>>>
>>>>>>>> Thank you
>>>>>>>> Martin
Re: How to regenerate gmfgen? [message #617560 is a reply to message #472701] Thu, 24 January 2008 20:19 Go to previous message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Hello Tatiana,

Thanks for the last answers, they helped again to understand everything.

Just by curiosity, do you have plan to automate the generation of these
elements manually added to gmfgen ? A kind of menu "Generate UML2Tools
Diagrams" but on *.gmfmap ?

If I understand correctly, the extensibility mechanisms of GMF do not
provide enough flexibility or expressiveness to create a tool like
uml2tools... (And it's why you have to add manually some element to the
gmfgen generated) Am I correct ? Did you reach the limits of GMF in
your project or could your added elements have been generated via
dynamic template or some other extension (maybe you evaluated that it
was too much time to implement ? :) )

Thank you,
Mathieu



Tatiana Fesenko wrote:
> Hello Martin,
>
>> We found that these custom attributes that are missing are in
>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>> can't figure how they are added to the .gmfgen when we do .gmfmap --->
>> .gmfgen transformation. :-(
>
> They are added manually.
>> What do you mean by "UML2Tools have its own genmodel extension". Do
>> you mean codegen and codegen.edit plugins? Or, are we supposed to have
>> (on the gmfmap) a custom menu like the "Generate UML2Tools Diagrams"
>> on gmfgen?
>
> We have our own genmodel extension to have such features as
> AssociationClass, action to change notation an so on automatically
> generated. "Generate UML2Tools Diagrams" takes these attributes into
> account and generates appropriate code.
>
>> and when you say "We were talking about how to preserve them in the
>> beginning of this branch"... Do you mean making merge?
>
> Yes, I was talking about making merge.
>
> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>
>> We're so close! :-)
>>
>> Martin
>>
>> Tatiana Fesenko wrote:
>>
>>> Hello again Mathieu =)
>>>
>>> 1)2) UML2Tools have its own genmodel extension. These are our custom
>>> attributes from this extension. We were talking about how to preserve
>>> them in the beginning of this branch -
>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>>>
>>> 3) As I can see you work on Unix-like system. This is carriage
>>> return
>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>> line-feed, while Unix uses only carriage-return. In XML "In attribute
>>> values, the characters TAB (#x9), linefeed (#xA), and carriage-return
>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively."
>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais why
>>> we
>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>> Good luck!
>>> Tatiana.
>>>> Hello again ! :)
>>>>
>>>> Specifying GMFGraph dynamic templates helped a lot, but I have still
>>>> some difference between the gmfgen I generate and the one contained
>>>> on cvs.
>>>>
>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't have:
>>>> ---
>>>> <attributes
>>>> xsi:type="gmfgen:StyleAttributes"
>>>> fixedForeground="true"/>
>>>> ---
>>>> (example: line 509, 513, 516, 519)
>>>> I don't understand why those element are not generated...
>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't have:
>>>> ---
>>>> <attributes
>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Template
>>>> Lo
>>>> cator"/>
>>>> ---
>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>> I think it may be related to the plugin
>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>> do
>>>> you think ? I don't understand why, I have the head version of
>>>> org.eclipse.uml2.diagram.codegen and
>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse M4
>>>> (plus each plugin installed is m4)
>>>> 3- Also, each attribute classbody generated is very different.
>>>> Differences are like those ones:
>>>> ---
>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot of
>>>> code}"
>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot of
>>>> code} *
>>>> I don't understand what is generated and I don't know if the
>>>> difference is important... Maybe somebody could tell us more. :)
>>>> Thank you again,
>>>> Mathieu
>>>> Mathieu Bertrand wrote:
>>>>> Thank you,
>>>>> It work as you said.
>>>>> Mathieu
>>>>> Tatiana Fesenko wrote:
>>>>>
>>>>>> Hi Mathieu,
>>>>>>
>>>>>> We override standard functionality in this place.
>>>>>>
>>>>>> To have the same gmfgen as we have do the following:
>>>>>> 1) Find page 'Specify transformation options' in 'Create generator
>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp lates/
>>>>>> gm
>>>>>> f-graph'
>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>> Best wishes,
>>>>>> Tatiana.
>>>>>>> Hello Tatiana,
>>>>>>>
>>>>>>> I would like to have some precision on that point. Are you saying
>>>>>>> that you do CVS Merge between (for example) the old gmfgen and
>>>>>>> the new gmfgen ?
>>>>>>>
>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>> unexpected difference, please find attached both files. I didn't
>>>>>>> even modified the initial gmfmap, I just "Create Generator Model"
>>>>>>> from classDiagram.gmfmap to compare with the actual
>>>>>>> classDiagram.gmfgen (from cvs).
>>>>>>>
>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>> line are different from what is in cvs
>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>
>>>>>>> Is it because the version of GMF I used to generate my gmfgen is
>>>>>>> newer than the one you used ?
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Mathieu
>>>>>>> Tatiana Fesenko wrote:
>>>>>>>> Hello Martin,
>>>>>>>>
>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>> customizations.
>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sfor
>>>>>>>> me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>> accordance with your needs.
>>>>>>>>
>>>>>>>> I tried to find any article about code-merge in GMF. My attempts
>>>>>>>> were
>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>> they
>>>>>>>> will
>>>>>>>> help you.
>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>> fields
>>>>>>>> marked with 'generated' tag will be overridden. So, technically
>>>>>>>> there
>>>>>>>> is
>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>> any
>>>>>>>> tag
>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent it
>>>>>>>> from
>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>> '@generated
>>>>>>>> NOT'
>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>> (from
>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other code
>>>>>>>> (code
>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>> GMF-generator,
>>>>>>>> it will stay the same.
>>>>>>>> Best wishes,
>>>>>>>> Tatiana.
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I need to add some features to the gmfgraph, gmftool and gmfmap
>>>>>>>>> files and regenerate gmfgen file then, i think i will be able
>>>>>>>>> to Generate UML2Tools Diagrams containing modificiations i
>>>>>>>>> made.
>>>>>>>>>
>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>> without losing customization you made in previous .gmfgen file
>>>>>>>>> (if you did some)?
>>>>>>>>>
>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>> code are link to the new generated code?
>>>>>>>>>
>>>>>>>>> Thank you
>>>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #617586 is a reply to message #472703] Wed, 30 January 2008 17:59 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Mathieu,

You are correct. 'Pure' GMF cannot handle all the tasks we face. To implement
all our functionality with a minimum us of 'generated-not' code we made our
extension for the gmfgen model. As you have noticed there are a lot of custom
attributes in *.gmfgen file. Some of them cannot be introdiced in the *.gmfgraph
file, because they have genmodel-specific properties. For example, 'SubstitutableByAttributes'
element needs Visual ID of the element it references:

<attributes
xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
<substitutableByIDs>2016</substitutableByIDs>
</attributes>

Visual ID is not available in the gmfmap model, it's available only in gmfgen
model. Our dynamic templates pick such attributes up and generate appropriate
code.

Did I answer your question?

Good luck,
Tatiana.

> Hello Tatiana,
>
> Thanks for the last answers, they helped again to understand
> everything.
>
> Just by curiosity, do you have plan to automate the generation of
> these elements manually added to gmfgen ? A kind of menu "Generate
> UML2Tools Diagrams" but on *.gmfmap ?
>
> If I understand correctly, the extensibility mechanisms of GMF do not
> provide enough flexibility or expressiveness to create a tool like
> uml2tools... (And it's why you have to add manually some element to
> the gmfgen generated) Am I correct ? Did you reach the limits of GMF
> in your project or could your added elements have been generated via
> dynamic template or some other extension (maybe you evaluated that it
> was too much time to implement ? :) )
>
> Thank you,
> Mathieu
> Tatiana Fesenko wrote:
>
>> Hello Martin,
>>
>>> We found that these custom attributes that are missing are in
>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>>> can't figure how they are added to the .gmfgen when we do .gmfmap
>>> ---> .gmfgen transformation. :-(
>>>
>> They are added manually.
>>
>>> What do you mean by "UML2Tools have its own genmodel extension". Do
>>> you mean codegen and codegen.edit plugins? Or, are we supposed to
>>> have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>> Diagrams" on gmfgen?
>>>
>> We have our own genmodel extension to have such features as
>> AssociationClass, action to change notation an so on automatically
>> generated. "Generate UML2Tools Diagrams" takes these attributes into
>> account and generates appropriate code.
>>
>>> and when you say "We were talking about how to preserve them in the
>>> beginning of this branch"... Do you mean making merge?
>>>
>> Yes, I was talking about making merge.
>>
>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>
>>> We're so close! :-)
>>>
>>> Martin
>>>
>>> Tatiana Fesenko wrote:
>>>
>>>> Hello again Mathieu =)
>>>>
>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>> custom attributes from this extension. We were talking about how to
>>>> preserve them in the beginning of this branch -
>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>>>>
>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>> return
>>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>> attribute
>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>> carriage-return
>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>> respectively."
>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>> why
>>>> we
>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>>> Good luck!
>>>> Tatiana.
>>>>> Hello again ! :)
>>>>>
>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>> still some difference between the gmfgen I generate and the one
>>>>> contained on cvs.
>>>>>
>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>> have:
>>>>> ---
>>>>> <attributes
>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>> fixedForeground="true"/>
>>>>> ---
>>>>> (example: line 509, 513, 516, 519)
>>>>> I don't understand why those element are not generated...
>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>> have:
>>>>> ---
>>>>> <attributes
>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Templa
>>>>> te
>>>>> Lo
>>>>> cator"/>
>>>>> ---
>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>> I think it may be related to the plugin
>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>>> do
>>>>> you think ? I don't understand why, I have the head version of
>>>>> org.eclipse.uml2.diagram.codegen and
>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>> M4
>>>>> (plus each plugin installed is m4)
>>>>> 3- Also, each attribute classbody generated is very different.
>>>>> Differences are like those ones:
>>>>> ---
>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>> of
>>>>> code}"
>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot
>>>>> of
>>>>> code} *
>>>>> I don't understand what is generated and I don't know if the
>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>> Thank you again,
>>>>> Mathieu
>>>>> Mathieu Bertrand wrote:
>>>>>> Thank you,
>>>>>> It work as you said.
>>>>>> Mathieu
>>>>>> Tatiana Fesenko wrote:
>>>>>>> Hi Mathieu,
>>>>>>>
>>>>>>> We override standard functionality in this place.
>>>>>>>
>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>> generator
>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp late
>>>>>>> s/
>>>>>>> gm
>>>>>>> f-graph'
>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>> Best wishes,
>>>>>>> Tatiana.
>>>>>>>> Hello Tatiana,
>>>>>>>>
>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>
>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>
>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>> line are different from what is in cvs
>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>
>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>> is newer than the one you used ?
>>>>>>>>
>>>>>>>> Thank you,
>>>>>>>> Mathieu
>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>> Hello Martin,
>>>>>>>>>
>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>> customizations.
>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sf
>>>>>>>>> or me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>>> accordance with your needs.
>>>>>>>>>
>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>> attempts
>>>>>>>>> were
>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>>> they
>>>>>>>>> will
>>>>>>>>> help you.
>>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>>> fields
>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>> technically
>>>>>>>>> there
>>>>>>>>> is
>>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>>> any
>>>>>>>>> tag
>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>> it
>>>>>>>>> from
>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>> '@generated
>>>>>>>>> NOT'
>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>> (from
>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>> code
>>>>>>>>> (code
>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>> GMF-generator,
>>>>>>>>> it will stay the same.
>>>>>>>>> Best wishes,
>>>>>>>>> Tatiana.
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i will
>>>>>>>>>> be able to Generate UML2Tools Diagrams containing
>>>>>>>>>> modificiations i made.
>>>>>>>>>>
>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>> file (if you did some)?
>>>>>>>>>>
>>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>>> code are link to the new generated code?
>>>>>>>>>>
>>>>>>>>>> Thank you
>>>>>>>>>> Martin
Re: How to regenerate gmfgen? [message #617593 is a reply to message #473255] Wed, 30 January 2008 22:19 Go to previous message
Mathieu Bertrand is currently offline Mathieu Bertrand
Messages: 22
Registered: July 2009
Junior Member
Yes, it answer my questions.

Thank you again, for now we are well started on our project, but I'm
sure we'll have some more questions in the next month ! :)

Mathieu


Tatiana Fesenko wrote:
> Hi Mathieu,
>
> You are correct. 'Pure' GMF cannot handle all the tasks we face. To
> implement all our functionality with a minimum us of 'generated-not'
> code we made our extension for the gmfgen model. As you have noticed
> there are a lot of custom attributes in *.gmfgen file. Some of them
> cannot be introdiced in the *.gmfgraph file, because they have
> genmodel-specific properties. For example, 'SubstitutableByAttributes'
> element needs Visual ID of the element it references:
>
> <attributes
> xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
> <substitutableByIDs>2016</substitutableByIDs>
> </attributes>
>
> Visual ID is not available in the gmfmap model, it's available only in
> gmfgen model. Our dynamic templates pick such attributes up and generate
> appropriate code.
> Did I answer your question?
> Good luck,
> Tatiana.
>
>> Hello Tatiana,
>>
>> Thanks for the last answers, they helped again to understand
>> everything.
>>
>> Just by curiosity, do you have plan to automate the generation of
>> these elements manually added to gmfgen ? A kind of menu "Generate
>> UML2Tools Diagrams" but on *.gmfmap ?
>>
>> If I understand correctly, the extensibility mechanisms of GMF do not
>> provide enough flexibility or expressiveness to create a tool like
>> uml2tools... (And it's why you have to add manually some element to
>> the gmfgen generated) Am I correct ? Did you reach the limits of GMF
>> in your project or could your added elements have been generated via
>> dynamic template or some other extension (maybe you evaluated that it
>> was too much time to implement ? :) )
>>
>> Thank you,
>> Mathieu
>> Tatiana Fesenko wrote:
>>
>>> Hello Martin,
>>>
>>>> We found that these custom attributes that are missing are in
>>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But we
>>>> can't figure how they are added to the .gmfgen when we do .gmfmap
>>>> ---> .gmfgen transformation. :-(
>>>>
>>> They are added manually.
>>>
>>>> What do you mean by "UML2Tools have its own genmodel extension". Do
>>>> you mean codegen and codegen.edit plugins? Or, are we supposed to
>>>> have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>>> Diagrams" on gmfgen?
>>>>
>>> We have our own genmodel extension to have such features as
>>> AssociationClass, action to change notation an so on automatically
>>> generated. "Generate UML2Tools Diagrams" takes these attributes into
>>> account and generates appropriate code.
>>>
>>>> and when you say "We were talking about how to preserve them in the
>>>> beginning of this branch"... Do you mean making merge?
>>>>
>>> Yes, I was talking about making merge.
>>>
>>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>>
>>>> We're so close! :-)
>>>>
>>>> Martin
>>>>
>>>> Tatiana Fesenko wrote:
>>>>
>>>>> Hello again Mathieu =)
>>>>>
>>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>>> custom attributes from this extension. We were talking about how to
>>>>> preserve them in the beginning of this branch -
>>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>>>>>
>>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>>> return
>>>>> symbol. MS-DOS-based systems use combination of carriage-return and
>>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>>> attribute
>>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>>> carriage-return
>>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>>> respectively."
>>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>>> why
>>>>> we
>>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get '&#xA;'.
>>>>> Good luck!
>>>>> Tatiana.
>>>>>> Hello again ! :)
>>>>>>
>>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>>> still some difference between the gmfgen I generate and the one
>>>>>> contained on cvs.
>>>>>>
>>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>>> have:
>>>>>> ---
>>>>>> <attributes
>>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>>> fixedForeground="true"/>
>>>>>> ---
>>>>>> (example: line 509, 513, 516, 519)
>>>>>> I don't understand why those element are not generated...
>>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>>> have:
>>>>>> ---
>>>>>> <attributes
>>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Templa
>>>>>> te
>>>>>> Lo
>>>>>> cator"/>
>>>>>> ---
>>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>>> I think it may be related to the plugin
>>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly, what
>>>>>> do
>>>>>> you think ? I don't understand why, I have the head version of
>>>>>> org.eclipse.uml2.diagram.codegen and
>>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>>> M4
>>>>>> (plus each plugin installed is m4)
>>>>>> 3- Also, each attribute classbody generated is very different.
>>>>>> Differences are like those ones:
>>>>>> ---
>>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>>> of
>>>>>> code}"
>>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;.... {lot
>>>>>> of
>>>>>> code} *
>>>>>> I don't understand what is generated and I don't know if the
>>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>>> Thank you again,
>>>>>> Mathieu
>>>>>> Mathieu Bertrand wrote:
>>>>>>> Thank you,
>>>>>>> It work as you said.
>>>>>>> Mathieu
>>>>>>> Tatiana Fesenko wrote:
>>>>>>>> Hi Mathieu,
>>>>>>>>
>>>>>>>> We override standard functionality in this place.
>>>>>>>>
>>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>>> generator
>>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp late
>>>>>>>> s/
>>>>>>>> gm
>>>>>>>> f-graph'
>>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>>> Best wishes,
>>>>>>>> Tatiana.
>>>>>>>>> Hello Tatiana,
>>>>>>>>>
>>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>>
>>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>>
>>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>>> line are different from what is in cvs
>>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>>
>>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>>> is newer than the one you used ?
>>>>>>>>>
>>>>>>>>> Thank you,
>>>>>>>>> Mathieu
>>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>>> Hello Martin,
>>>>>>>>>>
>>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>>> customizations.
>>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran sf
>>>>>>>>>> or me r from org.eclipse.gmf.bridge plugin is responsible for
>>>>>>>>>> gmfmap->gmfgen transformation. You could change the class in
>>>>>>>>>> accordance with your needs.
>>>>>>>>>>
>>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>>> attempts
>>>>>>>>>> were
>>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm sure
>>>>>>>>>> they
>>>>>>>>>> will
>>>>>>>>>> help you.
>>>>>>>>>> In short, code is generated by GMF only into src folder. Only
>>>>>>>>>> fields
>>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>>> technically
>>>>>>>>>> there
>>>>>>>>>> is
>>>>>>>>>> no difference whether to use 'generated NOT' tag or not to use
>>>>>>>>>> any
>>>>>>>>>> tag
>>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>>> 'For generated classes, if modifying a method that contains a
>>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>>> it
>>>>>>>>>> from
>>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>>> '@generated
>>>>>>>>>> NOT'
>>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>>> (from
>>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>>> code
>>>>>>>>>> (code
>>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>>> GMF-generator,
>>>>>>>>>> it will stay the same.
>>>>>>>>>> Best wishes,
>>>>>>>>>> Tatiana.
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i will
>>>>>>>>>>> be able to Generate UML2Tools Diagrams containing
>>>>>>>>>>> modificiations i made.
>>>>>>>>>>>
>>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>>> file (if you did some)?
>>>>>>>>>>>
>>>>>>>>>>> Also, i would like to know how custom-src and @NOT-generated
>>>>>>>>>>> code are link to the new generated code?
>>>>>>>>>>>
>>>>>>>>>>> Thank you
>>>>>>>>>>> Martin
>
>
Re: How to regenerate gmfgen? [message #617595 is a reply to message #473257] Thu, 31 January 2008 13:47 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
You are welcome, Mathieu =)


> Yes, it answer my questions.
>
> Thank you again, for now we are well started on our project, but I'm
> sure we'll have some more questions in the next month ! :)
>
> Mathieu
>
> Tatiana Fesenko wrote:
>
>> Hi Mathieu,
>>
>> You are correct. 'Pure' GMF cannot handle all the tasks we face. To
>> implement all our functionality with a minimum us of 'generated-not'
>> code we made our extension for the gmfgen model. As you have noticed
>> there are a lot of custom attributes in *.gmfgen file. Some of them
>> cannot be introdiced in the *.gmfgraph file, because they have
>> genmodel-specific properties. For example,
>> 'SubstitutableByAttributes' element needs Visual ID of the element it
>> references:
>>
>> <attributes xsi:type="uml2.gmfgenext:SubstitutableByAttributes">
>> <substitutableByIDs>2016</substitutableByIDs> </attributes>
>>
>> Visual ID is not available in the gmfmap model, it's available only
>> in
>> gmfgen model. Our dynamic templates pick such attributes up and
>> generate
>> appropriate code.
>> Did I answer your question?
>> Good luck,
>> Tatiana.
>>> Hello Tatiana,
>>>
>>> Thanks for the last answers, they helped again to understand
>>> everything.
>>>
>>> Just by curiosity, do you have plan to automate the generation of
>>> these elements manually added to gmfgen ? A kind of menu "Generate
>>> UML2Tools Diagrams" but on *.gmfmap ?
>>>
>>> If I understand correctly, the extensibility mechanisms of GMF do
>>> not provide enough flexibility or expressiveness to create a tool
>>> like uml2tools... (And it's why you have to add manually some
>>> element to the gmfgen generated) Am I correct ? Did you reach the
>>> limits of GMF in your project or could your added elements have been
>>> generated via dynamic template or some other extension (maybe you
>>> evaluated that it was too much time to implement ? :) )
>>>
>>> Thank you,
>>> Mathieu
>>> Tatiana Fesenko wrote:
>>>> Hello Martin,
>>>>
>>>>> We found that these custom attributes that are missing are in
>>>>> org.eclipse.uml2.diagram.codegen and codegen.edit plugin... But
>>>>> we can't figure how they are added to the .gmfgen when we do
>>>>> .gmfmap ---> .gmfgen transformation. :-(
>>>>>
>>>> They are added manually.
>>>>
>>>>> What do you mean by "UML2Tools have its own genmodel extension".
>>>>> Do you mean codegen and codegen.edit plugins? Or, are we supposed
>>>>> to have (on the gmfmap) a custom menu like the "Generate UML2Tools
>>>>> Diagrams" on gmfgen?
>>>>>
>>>> We have our own genmodel extension to have such features as
>>>> AssociationClass, action to change notation an so on automatically
>>>> generated. "Generate UML2Tools Diagrams" takes these attributes
>>>> into account and generates appropriate code.
>>>>
>>>>> and when you say "We were talking about how to preserve them in
>>>>> the beginning of this branch"... Do you mean making merge?
>>>>>
>>>> Yes, I was talking about making merge.
>>>>
>>>> Good luck! I''ll gladly answer all your new questions =) Tatiana.
>>>>
>>>>> We're so close! :-)
>>>>>
>>>>> Martin
>>>>>
>>>>> Tatiana Fesenko wrote:
>>>>>
>>>>>> Hello again Mathieu =)
>>>>>>
>>>>>> 1)2) UML2Tools have its own genmodel extension. These are our
>>>>>> custom attributes from this extension. We were talking about how
>>>>>> to preserve them in the beginning of this branch -
>>>>>> news://news.eclipse.org/fml7p6$lho$1@build.eclipse.org
>>>>>>
>>>>>> 3) As I can see you work on Unix-like system. This is carriage
>>>>>> return
>>>>>> symbol. MS-DOS-based systems use combination of carriage-return
>>>>>> and
>>>>>> line-feed, while Unix uses only carriage-return. In XML "In
>>>>>> attribute
>>>>>> values, the characters TAB (#x9), linefeed (#xA), and
>>>>>> carriage-return
>>>>>> (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;"
>>>>>> respectively."
>>>>>> (http://www.w3.org/1999/07/WD-xml-c14n-19990729). This is explais
>>>>>> why
>>>>>> we
>>>>>> (Windows people) have '&#xD;&#xA;' where Unix-fellows get
>>>>>> '&#xA;'.
>>>>>> Good luck!
>>>>>> Tatiana.
>>>>>>> Hello again ! :)
>>>>>>>
>>>>>>> Specifying GMFGraph dynamic templates helped a lot, but I have
>>>>>>> still some difference between the gmfgen I generate and the one
>>>>>>> contained on cvs.
>>>>>>>
>>>>>>> 1 - gmfen on cvs have lines like those ones that mine doesn't
>>>>>>> have:
>>>>>>> ---
>>>>>>> <attributes
>>>>>>> xsi:type="gmfgen:StyleAttributes"
>>>>>>> fixedForeground="true"/>
>>>>>>> ---
>>>>>>> (example: line 509, 513, 516, 519)
>>>>>>> I don't understand why those element are not generated...
>>>>>>> 2- gmfgen on cvs have lines like those ones that mine doesn't
>>>>>>> have:
>>>>>>> ---
>>>>>>> <attributes
>>>>>>> xsi:type="uml2.gmfgenext:CustomLocatorAttributes"
>>>>>>> customLocatorFQN="org.eclipse.uml2.diagram.clazz.edit.parts.Temp
>>>>>>> la
>>>>>>> te
>>>>>>> Lo
>>>>>>> cator"/>
>>>>>>> ---
>>>>>>> In fact, gmfgen on cvs have a lot of extra lines involving
>>>>>>> AuxSecondaryDiagramnodeAttribute, CustomLocatorAttributes,
>>>>>>> DetailsLevelAttributes and SubstituableByAttributes. (From
>>>>>>> org.eclipse.uml2.diagram.codegen.gmfgenext).
>>>>>>> I think it may be related to the plugin
>>>>>>> org.eclipse.uml2.diagram.codegen not doing his job correctly,
>>>>>>> what
>>>>>>> do
>>>>>>> you think ? I don't understand why, I have the head version of
>>>>>>> org.eclipse.uml2.diagram.codegen and
>>>>>>> org.eclipse.uml2.diagram.codegen.edit and I'm working on eclipse
>>>>>>> M4
>>>>>>> (plus each plugin installed is m4)
>>>>>>> 3- Also, each attribute classbody generated is very different.
>>>>>>> Differences are like those ones:
>>>>>>> ---
>>>>>>> generated classbody: "classBody="&#xA;/**&#xA; *............{lot
>>>>>>> of
>>>>>>> code}"
>>>>>>> should be : "classBody="&#xD;&#xA;/**&#xD;&#xA;....
>>>>>>> {lot
>>>>>>> of
>>>>>>> code} *
>>>>>>> I don't understand what is generated and I don't know if the
>>>>>>> difference is important... Maybe somebody could tell us more. :)
>>>>>>> Thank you again,
>>>>>>> Mathieu
>>>>>>> Mathieu Bertrand wrote:
>>>>>>>> Thank you,
>>>>>>>> It work as you said.
>>>>>>>> Mathieu
>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>> Hi Mathieu,
>>>>>>>>>
>>>>>>>>> We override standard functionality in this place.
>>>>>>>>>
>>>>>>>>> To have the same gmfgen as we have do the following:
>>>>>>>>> 1) Find page 'Specify transformation options' in 'Create
>>>>>>>>> generator
>>>>>>>>> model...' dialog (it's fifth page). 2) Write
>>>>>>>>> '${your-workspace}/org.eclipse.uml2.diagram.def/dynamic-temp la
>>>>>>>>> te
>>>>>>>>> s/
>>>>>>>>> gm
>>>>>>>>> f-graph'
>>>>>>>>> string in the 'GMFGraph dynamic templates' field. Voila!
>>>>>>>>> Best wishes,
>>>>>>>>> Tatiana.
>>>>>>>>>> Hello Tatiana,
>>>>>>>>>>
>>>>>>>>>> I would like to have some precision on that point. Are you
>>>>>>>>>> saying that you do CVS Merge between (for example) the old
>>>>>>>>>> gmfgen and the new gmfgen ?
>>>>>>>>>>
>>>>>>>>>> I tried this method this afternoon, I observed a lot of
>>>>>>>>>> unexpected difference, please find attached both files. I
>>>>>>>>>> didn't even modified the initial gmfmap, I just "Create
>>>>>>>>>> Generator Model" from classDiagram.gmfmap to compare with the
>>>>>>>>>> actual classDiagram.gmfgen (from cvs).
>>>>>>>>>>
>>>>>>>>>> For instance, there is a lot of generated line pointing to
>>>>>>>>>> "org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel". Thoses
>>>>>>>>>> line are different from what is in cvs
>>>>>>>>>> ("org.eclipse.draw2d.Label").
>>>>>>>>>>
>>>>>>>>>> Is it because the version of GMF I used to generate my gmfgen
>>>>>>>>>> is newer than the one you used ?
>>>>>>>>>>
>>>>>>>>>> Thank you,
>>>>>>>>>> Mathieu
>>>>>>>>>> Tatiana Fesenko wrote:
>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>
>>>>>>>>>>> To be honest, I do CVS merge to prevent loosing previous
>>>>>>>>>>> customizations.
>>>>>>>>>>> org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTran
>>>>>>>>>>> sf or me r from org.eclipse.gmf.bridge plugin is responsible
>>>>>>>>>>> for gmfmap->gmfgen transformation. You could change the
>>>>>>>>>>> class in accordance with your needs.
>>>>>>>>>>>
>>>>>>>>>>> I tried to find any article about code-merge in GMF. My
>>>>>>>>>>> attempts
>>>>>>>>>>> were
>>>>>>>>>>> failed. Try to ask in eclipse.modeling.gmf newsgroup. I'm
>>>>>>>>>>> sure
>>>>>>>>>>> they
>>>>>>>>>>> will
>>>>>>>>>>> help you.
>>>>>>>>>>> In short, code is generated by GMF only into src folder.
>>>>>>>>>>> Only
>>>>>>>>>>> fields
>>>>>>>>>>> marked with 'generated' tag will be overridden. So,
>>>>>>>>>>> technically
>>>>>>>>>>> there
>>>>>>>>>>> is
>>>>>>>>>>> no difference whether to use 'generated NOT' tag or not to
>>>>>>>>>>> use
>>>>>>>>>>> any
>>>>>>>>>>> tag
>>>>>>>>>>> at all. But 'generated NOT' tag is more preferrable:
>>>>>>>>>>> 'For generated classes, if modifying a method that contains
>>>>>>>>>>> a
>>>>>>>>>>> '@generated' tag, be sure to place 'NOT' after it to prevent
>>>>>>>>>>> it
>>>>>>>>>>> from
>>>>>>>>>>> being overwritten. Note that it is preferable to create
>>>>>>>>>>> '@generated
>>>>>>>>>>> NOT'
>>>>>>>>>>> tags, rather than removing the '@generated' tag completely.'
>>>>>>>>>>> (from
>>>>>>>>>>> http://wiki.eclipse.org/GMF_Development_Guidelines). Other
>>>>>>>>>>> code
>>>>>>>>>>> (code
>>>>>>>>>>> which is not conformably tagged) will _not_ be touched by
>>>>>>>>>>> GMF-generator,
>>>>>>>>>>> it will stay the same.
>>>>>>>>>>> Best wishes,
>>>>>>>>>>> Tatiana.
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> I need to add some features to the gmfgraph, gmftool and
>>>>>>>>>>>> gmfmap files and regenerate gmfgen file then, i think i
>>>>>>>>>>>> will be able to Generate UML2Tools Diagrams containing
>>>>>>>>>>>> modificiations i made.
>>>>>>>>>>>>
>>>>>>>>>>>> So, i'm wondering how you actually do the gmfgen creation
>>>>>>>>>>>> without losing customization you made in previous .gmfgen
>>>>>>>>>>>> file (if you did some)?
>>>>>>>>>>>>
>>>>>>>>>>>> Also, i would like to know how custom-src and
>>>>>>>>>>>> @NOT-generated code are link to the new generated code?
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you
>>>>>>>>>>>> Martin
Previous Topic:Associations: Are they good for anything?
Next Topic:Which UML2 "Diagram Element" should be selected for GMF
Goto Forum:
  


Current Time: Thu Oct 23 11:07:34 GMT 2014

Powered by FUDForum. Page generated in 0.04220 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software