Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Problems with multiple packages in the emf file and eugenia(Generated diagram code imports non existing clases)
Problems with multiple packages in the emf file and eugenia [message #662345] Wed, 30 March 2011 10:04 Go to next message
LD  is currently offline LD Friend
Messages: 28
Registered: March 2011
Junior Member
Hi all, I am using eugenia for generating a GMF editor. But I have a problem when creating multiple packages in the ecore file or in the emf file.

The emf code:
@namespace(uri="general", prefix="general")
package general;

@namespace(uri="domain", prefix="domain")
package domain {

@gmf.diagram(foo="bar")
class Domain {
   val Block[*] blocks;
   val Street[*] streets;
   val basic.ExternalNode [*] externals;
}
@gmf.node(label="name")
  class Block extends basic.NamedElement {
    ref basic.ExternalNode [*] Port;
  }

@gmf.link(source="source", target="target")
  class Street extends basic.NamedElement {
    ref Block source;
    ref Block target;
   attr String sourceLabel;
   attr String targetLabel;
  }

}

@namespace(uri="basic", prefix="basic")
package basic {

  @gmf.node(label="name")
  class ExternalNode extends NamedElement {
  }

  abstract class NamedElement {
    attr String name;
  }

}


The generated diagram project has many clases whith imports like:
- import general.basic.ExternalNode
- import general.domain.Block

The problem with the imports is that the model code, generated does not include anything about general. Although is a simple problem of fixing the imports and delete the text "general". I think is a problem with eugenia generation workflow.

By the way, I have these questions too:
- If I want the to have packages in the source folder of the model code (e.g. src. dev.general.domain.impl, dev.general.domain.util, dev.general.domain) how should I do. As nested packages in ecore is not the answer.

- I want to modify the worflow of eugenia generation, is it possible to do it with epsilon ant tasks?

- I didn't find documentation about eugenia. I just found http://www.eclipse.org/gmt/epsilon/doc/eugenia/ which contains examples and says that eugenia is based on epsilon. Is there any detailed information beyond examples.

- Does eugenia generation workflow considers gmf customization templates with aspects?

- Is posible to modify the generated code of certain classes of the generated projects with eugenia?


Thanks in advance.

Re: Problems with multiple packages in the emf file and eugenia [message #662578 is a reply to message #662345] Thu, 31 March 2011 08:19 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi,

Please see comments below

>Hi all, I am using eugenia for generating a GMF editor. But I have a problem when creating multiple packages in the ecore file or in the emf file.
>
>The emf code:
>@namespace(uri="general", prefix="general")
>package general;
>
>@namespace(uri="domain", prefix="domain")
>package domain {
>
>@gmf.diagram(foo="bar")
>class Domain {
> val Block[*] blocks;
> val Street[*] streets;
> val basic.ExternalNode [*] externals;
>}
>@gmf.node(label="name")
> class Block extends basic.NamedElement {
> ref basic.ExternalNode [*] Port;
> }
>
>@gmf.link(source="source", target="target")
> class Street extends basic.NamedElement {
> ref Block source;
> ref Block target;
> attr String sourceLabel;
> attr String targetLabel;
> }
>
>}
>
>@namespace(uri="basic", prefix="basic")
>package basic {
>
> @gmf.node(label="name")
> class ExternalNode extends NamedElement {
> }
>
> abstract class NamedElement {
> attr String name;
> }
>
>}
>
>
>The generated diagram project has many clases whith imports like:
>- import general.basic.ExternalNode
>- import general.domain.Block
>
>The problem with the imports is that the model code, generated does not include anything about general. Although is a simple problem of fixing the imports and delete the text "general". I think is a problem with eugenia generation workflow.
>

Eugenia doesn't generate any code itself. By default, it only goes as far as generating the gmfmap model - so I suspect this is an issue with the GMF code generator. Generally speaking, EMF isn't very happy with nested packages (see http://www.eclipse.org/forums/index.php?t=tree&goto=5011 02&#page_top) so I'd recommend trying to avoid them altogether.

>By the way, I have these questions too:
>- If I want the to have packages in the source folder of the model code (e.g. src. dev.general.domain.impl, dev.general.domain.util, dev.general.domain) how should I do. As nested packages in ecore is not the answer.
>

Please see comment above.

>- I want to modify the worflow of eugenia generation, is it possible to do it with epsilon ant tasks?
>
>- I didn't find documentation about eugenia. I just found http:>www.eclipse.org/gmt/epsilon/doc/eugenia/ which contains examples and says that eugenia is based on epsilon. Is there any detailed information beyond examples.
>

Have you perhaps come across these?

http://eclipse.org/gmt/epsilon/doc/articles/eugenia-gmf-tuto rial/
http://eclipse.org/gmt/epsilon/doc/articles/eugenia-polishin g/

>- Does eugenia generation workflow considers gmf customization templates with aspects?
>
>- Is posible to modify the generated code of certain classes of the generated projects with eugenia?
>

As stated above, Eugenia only invokes the built-in code generator of EMF so the only way it can influence the results of the code generation process is by polishing the .gmfgen model

>
>Thanks in advance.

Cheers,
Dimitris
Re: Problems with multiple packages in the emf file and eugenia [message #662614 is a reply to message #662578] Thu, 31 March 2011 09:55 Go to previous message
LD  is currently offline LD Friend
Messages: 28
Registered: March 2011
Junior Member
Hi Dimitrios, thank you. I'll try to polish EMF model with FixGenModel as you said, I need to use packages because two editors will have some basic elements and shortcuts will be through them. Although the issue about EMF is suspicious, and that forum there was no answer to the problem.

Sure I check your tutorials. Perhaps I have problems to find how did you include the icons to the graphic elements of the file system example in the tool, and I could not.

I know the ecore and the gmf models can be manipulated with the ECore2GMF.eol and FixGMFGen.eol files. As well as the for the EMF model. The point is they grow according to details added and dificults maintainance.

I was wondering to know if eugenia is implemented using a workflow in which I can include (call) EOL structurd modules, additional to the default ones.

As you said eugenia doesn't generate any code, but uses GMF generators, and as GMF uses templates that can be customized, I mean to ask if eugenia affects this function or not. And if additional elements should be considered in the ECore2GMF.eol or FixGMFGen.eol files to have customized templates with aspects.

Cheers,
Previous Topic:Comparing Object Properties in ECL
Next Topic:[Eugenia] Exception loading the resource
Goto Forum:
  


Current Time: Thu Apr 25 21:36:41 GMT 2024

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

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

Back to the top