Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Today's Messages (on)  | Unanswered Messages (off)

Forum: EMF
 Topic: Search engine for EMF?
Re: Search engine for EMF? [message #1060745 is a reply to message #1060657] Tue, 28 May 2013 06:35
Jan Reimann is currently offline Jan Reimann
Messages: 66
Registered: July 2009
Member
Hi Mauro,
you could also use IncQuery: http://www.eclipse.org/incquery/

best regards,
Jan
 Topic: [EMF] Change volatile and transient properties
Re: Change volatile and transient properties [message #1060760 is a reply to message #1060651] Tue, 28 May 2013 07:44
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Aleksandar,

Comments below.


On 27/05/2013 3:31 PM, Aleksandar Toshovski wrote:
> Hello,
> When I store some instances of an ECore model and then change violate
> value, would I have an error when I try to read the file and what kind
> of exception will occur?
That setting only affects the generated code, bug given that no field
will be generated and only stubs that throw exceptions for the accessors
are generated, so that won't work without some hand written code.
>
> And the same question about transient. If something is transient=true
> and then is changed to false. If i have instancies from the old ECore
> model, should I expect some kind of errors?
Transient things in the serialization won't generally cause exceptions
in deserialization (except possibly in cases of bidirectional
references; I'm not sure).
> And when transient=false and gets changed to transient=true. Would the
> stored values be ignored, or I'll recieve an error?
They'll generally just be read into the model, but won't be written back
out again.
>
> Regards,
> Aleksandar
 Topic: EMF's Jet templates costumization
Re: EMF's Jet templates costumization [message #1060761 is a reply to message #1060683] Tue, 28 May 2013 07:44
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Amine,

You have to use generator adapters for that. Try installing the
Generator Adapter Example into your workspace for an example.

On 27/05/2013 8:36 PM, Amine BEN wrote:
> Hi all,
> I'm trying to costumize the EMF API generation of model code by adding
> a new file.
> I created a new project where I copied the templates from
> *.codegen.ecore preserving the folder's hierarchy, then I changed the
> templates directory in the genmodel options to the one I just copied.
> In order to make sure that the generation process uses these templates
> I added some java comments to the templates. This worked just fine.
>
> When adding a new jet template to the template's folder, and running
> the generation, a java class for this template is not generated in the
> JETemitter project.
>
> How can I solve this problem
> Thank you in advance
 Topic: define getter of derived volatile attribute
define getter of derived volatile attribute [message #1060723] Tue, 28 May 2013 04:55
Jens von Pilgrim is currently offline Jens von Pilgrim
Messages: 277
Registered: July 2009
Senior Member
Hi,

I have defined a derived volatile attribute. Now I need to implement the
getter. By default, the EMF generator creates a method stub, and I have
to manually implement the body. In order to avoid trouble in case of
re-generation (actually, I'm using an Xtext post processor to add the
derived attribute, so "@generate not" is not working), I would like to
define the body of the getter in the model, similar to the body of an
operation (which can to be defined in an annotation). Is that possible?
Actually, I would like to simply add the body in the post processing
step, when I define the attribute.

Regards,
Jens
Re: define getter of derived volatile attribute [message #1060765 is a reply to message #1060723] Tue, 28 May 2013 07:47
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Jens,

The generator has methods like this

protected String getGetterBody()
{
EStructuralFeature eStructuralFeature = getEcoreFeature();
EAnnotation eAnnotation =
eStructuralFeature.getEAnnotation(GenModelPackage.eNS_URI);
return eAnnotation == null ? null :
(String)eAnnotation.getDetails().get("get");
}

that will extract the stub into the generated code.


On 28/05/2013 10:55 AM, Jens v.P. wrote:
> Hi,
>
> I have defined a derived volatile attribute. Now I need to implement
> the getter. By default, the EMF generator creates a method stub, and I
> have to manually implement the body. In order to avoid trouble in case
> of re-generation (actually, I'm using an Xtext post processor to add
> the derived attribute, so "@generate not" is not working), I would
> like to define the body of the getter in the model, similar to the
> body of an operation (which can to be defined in an annotation). Is
> that possible? Actually, I would like to simply add the body in the
> post processing step, when I define the attribute.
>
> Regards,
> Jens
 Topic: Can trigger a method call for an attribute change in an EMF model?
Re: Can trigger a method call for an attribute change in an EMF model? [message #1060728 is a reply to message #1059586] Tue, 28 May 2013 05:19
Kosala Yapa is currently offline Kosala Yapa
Messages: 134
Registered: September 2010
Senior Member
Hi Ed,

Thanks.

Attribute changes in an EMF model need to trigger OCL rules validation. OCL rules validate EMF model for changed attributes, and error results(if available) are displayed on the tool.

Cheers,
Kosala
Re: Can trigger a method call for an attribute change in an EMF model? [message #1060769 is a reply to message #1060728] Tue, 28 May 2013 07:50
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Kosala,

The latest version of EMF supports generating a live validator that will
revalidate all the instrinct constraints in the model after each command
stack execution. It's possible to expression such constraints using
OCL; you can look at that project's documentation.


On 28/05/2013 11:19 AM, Kosala Yapa wrote:
> Hi Ed,
>
> Thanks.
>
> Attribute changes in an EMF model need to trigger OCL rules
> validation. OCL rules validate EMF model for changed attributes, and
> error results(if available) are displayed on the tool.
>
> Cheers,
> Kosala
 Topic: [CDO] ArrayIndexOutOfBoundsException on rollback
Re: [CDO] ArrayIndexOutOfBoundsException on rollback [message #1060816 is a reply to message #1060480] Tue, 28 May 2013 09:50
Jack Lechner is currently offline Jack Lechner
Messages: 11
Registered: December 2012
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=409287

Thank you!
 Topic: Run generated Editors in Eclipse4 RCP
Re: Run generated Editors in Eclipse4 RCP [message #1060713 is a reply to message #1060687] Tue, 28 May 2013 04:06
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 695
Registered: July 2009
Senior Member
On 27-05-13 21:44, Régent L Archevêque wrote:
> Hi,
>
> I know it is highly related to Eclipse4 framework but I believe it is more appropriate to publish this question in this forum.
>
Hi Regent,

It's not an answer to your question, but perhaps this project would be
of your interest.

https://github.com/dzonekl/e4mf

rgds Christophe

> I started to test Eclipse4 framework. So far, it is going well with the 3.x compatibility layer. I try to build a Eclipse4 RCP application that includes an EMF generated Editor. The product starts properly but I get an error the first time the generated EMF editor is invoked (new model instance | simple open in the Navigator view). It complaints about "cannot find ID additions" (Popup menu entry point). I close the editor and try a second time and now it works. I believe there is a bundle startlevel that must set to resolve this issue but I do not know which one. If I navigate the model instance, the editor fails when right-clicking to get the popup menu. Is it possible to run EMF generated editor in Eclipse4?
>
> I created a simple Eclipse4 RCP that reflects this.
> -test (EMF model including Root that contains multiple Element.
>
> -test.edit
> -test.editor
> -test.rcp (Product, E4 application etc).
>
> Eclipse Build
> -Eclipse 4.3RC1 (I20130516-2200)
> -EMF Common 2.9.0.v20130515-0805
> -EMF Ecore 2.9.0.v20130515-0805
> -XCore 1.1.0.v20130522-0607
>
> Steps to reproduce the problem:
> 1) Import the exiting projects (zip in attachment)
> 2) Open test.rcp->test.rcp.product
> 3) Launch an Eclipse Application (this will fail).
> 4) Go in Run->Run Configurations..
> 5) Select Ecplise Application->test.rcp.product
> 6) Select Plug-ins tab
> 7) Click on Add Required Plug-ins
> 8) Click on Run
> 9) In the Navigation View, create a new project named test (Right-Click -> New -> Project...)
> 10) Select the project test, right-click New->Other->Example EMF Model Creation Wizards->Test Model, Click on Next
> 11) Set the name of the file (ex. My1.test).
> 12) In the Model Object combo box select Root then Finish.
> 13) You get the editor opening error (see Log View in the bottom)
> 14) Close the editor
> 15) Open My1.test
> 16) Now the editor works.
> 17) Browse the EMF instance and select Root element.
> 18) Right-click to invoke the popup menu.
> 19) You get the popup menu error. (see Log view in the bottom).
>
Re: Run generated Editors in Eclipse4 RCP [message #1060764 is a reply to message #1060687] Tue, 28 May 2013 07:45
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Régent,

I won't have time to look until later this week. Please open a bugzilla
with the details and I'll try to reproduce it and fix or redirect it as
appropriate.


On 27/05/2013 9:44 PM, Régent L Archevêque wrote:
> Hi,
>
> I know it is highly related to Eclipse4 framework but I believe it is more appropriate to publish this question in this forum.
>
> I started to test Eclipse4 framework. So far, it is going well with the 3.x compatibility layer. I try to build a Eclipse4 RCP application that includes an EMF generated Editor. The product starts properly but I get an error the first time the generated EMF editor is invoked (new model instance | simple open in the Navigator view). It complaints about "cannot find ID additions" (Popup menu entry point). I close the editor and try a second time and now it works. I believe there is a bundle startlevel that must set to resolve this issue but I do not know which one. If I navigate the model instance, the editor fails when right-clicking to get the popup menu. Is it possible to run EMF generated editor in Eclipse4?
>
> I created a simple Eclipse4 RCP that reflects this.
> -test (EMF model including Root that contains multiple Element.
>
> -test.edit
> -test.editor
> -test.rcp (Product, E4 application etc).
>
> Eclipse Build
> -Eclipse 4.3RC1 (I20130516-2200)
> -EMF Common 2.9.0.v20130515-0805
> -EMF Ecore 2.9.0.v20130515-0805
> -XCore 1.1.0.v20130522-0607
>
> Steps to reproduce the problem:
> 1) Import the exiting projects (zip in attachment)
> 2) Open test.rcp->test.rcp.product
> 3) Launch an Eclipse Application (this will fail).
> 4) Go in Run->Run Configurations..
> 5) Select Ecplise Application->test.rcp.product
> 6) Select Plug-ins tab
> 7) Click on Add Required Plug-ins
> 8) Click on Run
> 9) In the Navigation View, create a new project named test (Right-Click -> New -> Project...)
> 10) Select the project test, right-click New->Other->Example EMF Model Creation Wizards->Test Model, Click on Next
> 11) Set the name of the file (ex. My1.test).
> 12) In the Model Object combo box select Root then Finish.
> 13) You get the editor opening error (see Log View in the bottom)
> 14) Close the editor
> 15) Open My1.test
> 16) Now the editor works.
> 17) Browse the EMF instance and select Root element.
> 18) Right-click to invoke the popup menu.
> 19) You get the popup menu error. (see Log view in the bottom).
Re: Run generated Editors in Eclipse4 RCP [message #1060804 is a reply to message #1060764] Tue, 28 May 2013 09:14
Régent L Archevêque is currently offline Régent L Archevêque
Messages: 37
Registered: May 2010
Member
Ok. I'll post a bug on this. Meanwhile I continue my investigation!!!

Thanks Wink
Re: Run generated Editors in Eclipse4 RCP [message #1060811 is a reply to message #1060687] Tue, 28 May 2013 09:39
Régent L Archevêque is currently offline Régent L Archevêque
Messages: 37
Registered: May 2010
Member
I posted bug [url=https://bugs.eclipse.org/bugs/show_bug.cgi?id=409283]

I made some check and I realize that if I change in the Run Configurations...
Run a product -> org.eclipse.sdk.ide
Run an application -> org.eclipse.ui.ide.workbench
Then it works!
Re: Run generated Editors in Eclipse4 RCP [message #1060822 is a reply to message #1060811] Tue, 28 May 2013 10:14
Régent L Archevêque is currently offline Régent L Archevêque
Messages: 37
Registered: May 2010
Member
Just to be clear in my previous post. It works with the Eclipse SDK application but not with my RCP application.
Wink
 Topic: [CDO] Saving resources in transaction
[CDO] Saving resources in transaction [message #1060834] Tue, 28 May 2013 10:54
Martin  odloucký is currently offline Martin odloucký
Messages: 38
Registered: July 2010
Member
Hello,

I have this issue: I want to upload my existing file-based resources to CDO server. These resources are contained in ResourceSet and have cross-document references. The URIs in the ResourceSet are file-based since the ResourceSet is loaded from my local hard drive. However, on the CDO server I need to have those URIs little bit differently structured. For exmaple instead of having

/project/content.xmi

I would like to have something like

/allprojects/project/content

Is there any simple way to achieve this?

Regards

Martin
Re: [CDO] Saving resources in transaction [message #1060839 is a reply to message #1060834] Tue, 28 May 2013 11:17
Eike Stepper is currently offline Eike Stepper
Messages: 5163
Registered: July 2009
Senior Member
Am 28.05.2013 16:54, schrieb Martin odloucký:
> Hello,
> I have this issue: I want to upload my existing file-based resources to CDO server. These resources are contained in
> ResourceSet and have cross-document references. The URIs in the ResourceSet are file-based since the ResourceSet is
> loaded from my local hard drive. However, on the CDO server I need to have those URIs little bit differently
> structured. For exmaple instead of having
>
> /project/content.xmi
>
> I would like to have something like
>
> /allprojects/project/content
>
> Is there any simple way to achieve this?
The new "Resource Transfer Framework" is made for this purpose. With this framework the generic CDO UI supports drag and
drop of multiple files/folders between workspace, file system and repositories.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Current Time: Tue May 28 11:26:46 EDT 2013

Powered by FUDForum. Page generated in 0.02246 seconds