Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Building a CRUD client
[Texo] Building a CRUD client [message #1582728] Sat, 24 January 2015 20:26 Go to next message
Mr Cur is currently offline Mr CurFriend
Messages: 35
Registered: September 2014
Member
Hi all,

I succeeded in building a simple client with Texo.
Now I want to build a generic CRUD editor for my class hierarchy.
I see that the Texo examples include a RCP client, but it is not
clear to my how it works.
What would be a good way to build such a CRUD client, preferably
with as much code generation as possible based on my ecore spec.

All the best,

Mr. Cir.
Re: [Texo] Building a CRUD client [message #1585253 is a reply to message #1582728] Mon, 26 January 2015 06:51 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Mr Cur,

I'm using Texo in a 3-Tier-Architecture (but I suppose it wouldn't be a big difference to use it in a 2-Tier-Architecture). If you would use the default generated EMF editor you would just have to replace the XML Resource with the Texo Resource. This be done by adjusting the code here: http://www.vogella.com/tutorials/EclipseEMFPersistence/article.html. You only have to register your protocol (in my case http is registered in the createResource method in the ResourceFactory). This method is called in a custom ResourceSet implementation and returns a Texo resource (I'm using the JSONTexoResource). If you want to load objects to this resource you can call query("select r from example_Root r", new HashMap<String, Object>(), 0, Integer.MAX_VALUE). This will load all root objects to the specified childLevel (this is set in the store).
Then you can use the resource like the default XML resource, performing CRUD operations using EMF commands and so on. And that would be all to make the default EMF editor work.

I hope this helped.

Beste regards
Bastian
Re: [Texo] Building a CRUD client [message #1586252 is a reply to message #1585253] Mon, 26 January 2015 19:10 Go to previous messageGo to next message
Mr Cur is currently offline Mr CurFriend
Messages: 35
Registered: September 2014
Member
Hi Bastian,

Thanks for the answer and pointer.
I am going to try this.

All the best,

Cur.
Re: [Texo] Building a CRUD client [message #1593791 is a reply to message #1585253] Fri, 30 January 2015 22:18 Go to previous messageGo to next message
Mr Cur is currently offline Mr CurFriend
Messages: 35
Registered: September 2014
Member
Dear Bastian,

Right now, I have a Texo JSON setup running on the server, and I can also generate model/edit/editor code based on my ecore model.

For the editor, I have JSONResourceFactoryClass that produces the JSO resource. I tested this to create programmatically instances in the database and that works.

However, it is not really clear me how to change the generator editor code.
I tried to change resource creation in the generated modelwizzard (as here the resource is created) but this does not work.

Any suggestions?

Thanks.

Cur
Re: [Texo] Building a CRUD client [message #1596201 is a reply to message #1593791] Sun, 01 February 2015 13:43 Go to previous message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi,

so you want to replace the XML loading mechanism (loading into a Resource) with the Texo Resource? I'm not using the EMF generated editor so I'm not aware how this is working in detail. I suppose this can be done by registering the a Texo ResourceFactory that can create a custom Texo Resource. When the Resource creation method is called with a URI it can load the needed objects into the Resource.
But maybe this could also be a question for the EMF forum.

Best regards and good luck
Bastian
Previous Topic:[EMF][EMFStore][Sirius] Change Operations and graphs
Next Topic:How to detect Ctrl-Z in eclipse for the EcoreDiagramEditor
Goto Forum:
  


Current Time: Fri Apr 26 17:05:43 GMT 2024

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

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

Back to the top