Martin Taal's Blog

About EMF, Teneo, CDO, Texo, Hibernate, Open-Source ERP and other topics

Archive for the ‘Texo’ Category

EMF Texo and Teneo available for Maven

leave a comment »

Hi,

Traditionally Teneo and Texo are distributed through Eclipse update sites. The past year several people have asked me to make the Texo and Teneo runtime jar files also available through a Maven repository.

Recently this topic also came up for some sponsored Teneo development I am currently doing. With these requests from multiple sides it was time to make this happen!

So from today: Teneo/Texo (and their EMF dependencies) are uploaded to the Sonatype repositories (thank you Sonatype for providing this repo-service!) and from there synced to Maven central. They are all published in the org.eclipse.emf group.

The nightly builds are available on the Sonatype snapshot repository. The builds are released regularly to Maven central. You can find the jar files there:

See these Texo and Teneo wiki pages for some more information.

Thanks for reading and I hope this blog post helps to give Teneo and Texo a try. Let me know if you have any questions or remarks on the EMF/EMFT newsgroup or forum!

gr. Martin

ps: when using maven with Texo, make sure to check out this troubleshooting tip.

Written by martintaal

November 2, 2012 at 6:27 am

Posted in Teneo, Texo

EMFT Texo: integrating Texo in your build process

with one comment

Hi!

The latest Texo version supports headless/server code generation directly from Java or ANT. This makes it possible to integrate Texo code generation in your overall build process.

So how to setup headless/build-integrated code generation?

Texo uses Eclipse for code formatting and import resolving. So, start by downloading an Eclipse version suitable for your build platform. Then install the Texo plugins in this Eclipse version through the Texo update site and put this Eclipse version somewhere on your build server.

As a second step choose a location on the build server where Texo can create a workspace and Java project. And last, place the model (ecore/xsd) files on the build server.

To generate code using ANT you can use a macrodefinition. To run the macro:

<texo.gen eclipse=”/home/build/eclipse”

data=”/home/build/workspace”

projectName=”testgen”

modelLocation=”/home/build/models”

jpa=”true” dao=”false”/>

The parameters have the following meaning:

  • eclipse: the eclipse installation location
  • data: the workspace location
  • projectName: the name of a Java project to use, see here for more information
  • modelLocation: the location of the model files
  • jpa: generate code with JPA annotations
  • dao: generate a DAO layer

The generated code will be present in the Java project on your build server and can be copied/compiled from there.

Instead of using ANT, you can also execute headless code generation directly in Java.

That’s all, with these latest developments, code generation and your build process can be nicely tied together!

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!

gr. Martin

Written by martintaal

October 21, 2012 at 9:25 pm

Posted in Texo

EMFT Texo: using xtend2 for faster generation

with 2 comments

Hi!

A month back a Texo user asked me on the newsgroup about the speed of Texo code generation. His proposal was to use xtend2 as the template technology as it is much faster. As often with proposals and ideas, it takes a while, but then suddenly, motivation and time come together and coding starts.

So from today Texo as a default uses xtend2 as a templating technology. This indeed gives a considerable speed increase!

The nice thing is that I managed to still keep the great feature of allowing overriding and/or extending of templates within a development project. You can do this using xpand templates. So the base standard part of Texo uses fast xtend2, if you want to override/extend you use xpand. This is also nice for backward compatibility as your current xpand overriding/extending templates will work fine!

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!

gr. Martin

Written by martintaal

October 12, 2012 at 10:02 pm

Posted in Texo

Taking EMF to the third tier: the Texo JSON Resource

leave a comment »

Hi!

After supporting a 2-tier architecture it is now time to make the step to a full 3-tier application architecture for EMF based RCP’s connected to  a standard JPA web server. The server side of this 3-tier architecture was already done earlier: the Texo JSON web service layer. The only remaining topic was implementing the client side: an EMF resource which talks JSON with the server.

Well a first version is available now: the JSONTexoResource. This resource uses JSON to communicate with a server with JPA entities generated from ecore models using Texo.

The nice thing is that the JSONTexoResource transparently works with EMF Proxies. So EMF proxies are automatically resolved by sending a HTTP request to the server and getting the content of the object.

It is easy to override Texo code to add authentication support to the HTTP communication layer. An additional nice feature is that the server side can change/update objects when they are being persisted. Server-side changes are send back to the client (executing the persist action) and merged with the client side objects.

The Texo Resource also support loading objects using queries, counting, retrieving and refreshing individual objects (from the server) and cross-reference queries.

For more information:

  • specifics on the JSONTexoResource can be found here
  • for setting up the server side is check out this wiki page or see this video.

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!

gr. Martin

Written by martintaal

August 30, 2012 at 12:21 am

Posted in Texo

EMFT Texo: Auto-generate Java model code on model file changes

leave a comment »

Hi!

Next to the work I am doing on an EMF JSON resource, and solving some bugs, I was very motivated to get a nice new feature into Texo: automatic code generation on model file changes.

After each model change you have to go through the somewhat cumbersome right click on a project file and finding the Texo menu to generate your code.

This has now become a lot easier! In the Texo project properties you can now define, that code should be automatically generated when a model file changes. This includes changes to xsd’s and annotation model files.

The project properties allow you to set different things like if only certain model files should trigger a regenerate, or if JPA or DAO classes need to be generated. It is all described here.

So just check the correct flag in the project properties and your code is generated on-the-fly and more importantly: automatic.

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!

gr. Martin

Written by martintaal

May 18, 2012 at 12:54 am

Posted in Texo

EMFT Texo: EMF – RCP persistence using Texo generated JPA entities

with 6 comments

Hi!

After working on Texo JSON Rest, the next step for me has been to implement an EMF Resource which persists its data using JPA annotated entities in a standard ORM.

This makes it possible to use Texo in a RCP environment with an EMF generated front-end and a Texo generated JPA backend.

The first implementation of the TexoResource supports a 2-tier architecture: the JPA TexoResource communicates directly with the database through the JPA/ORM layer.

EMF RCP - Texo - 2-tier architecture

My next step will be to implement a Texo JSON Resource which communicates using JSON with a server running Texo. The server side of this 3 tier architecture is already done: the Texo JSON web service layer. For an example project running Texo in Tomcat/web container check out this wiki page or see this video.

For this new development I am developing EMF JSON converters, these could be useful also in other solutions, you can find the relevant plugin here in git.

I am cooperating with others to develop an example RCP using Texo. My goal is to provide more example projects. If you are interested in cooperating on this, ping me on the Texo forum.

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!

gr. Martin

Written by martintaal

May 9, 2012 at 8:38 am

Posted in Texo

EMF Texo: JSON REST web service support, connecting your client to an EMF supporting web-server!

with one comment

Hi!

As always, Eclipsecon was an inspiration to finally implement those features which I always wanted to do. This time it was implementing JSON REST web service support in Texo. This new feature is based on my experience implementing RIA user interfaces for business web apps.

Texo automatically provides the JSON REST web service support using the ecore/xsd domain model. So with just a few lines of code your domain model is accessible from browser/mobile web UIs.

Why would it be a good idea to try out and use the Texo JSON functionality? Well first it is quite feature complete, supporting full CRUD, querying in multiple ways, individual update/inserts, mass delete/update/insert, proxying, etc. The second good reason is that it is based on real application experience, this explains why attention has been paid to details as querying for multiple values to fill a grid, record counting and object titles. The third good reason: the combination of JSON REST with the other Texo features (JPA entity generation, runtime layer, etc.) makes it possible to have a running feature-complete JSON REST function within a few minutes, generated from an ecore/xsd model.

Texo JSON runs typically in a web container like Tomcat. The example project illustrates how to set this up. After installing/running the solution in a web container, you can for example do these type of uris/queries to retrieve information:

The first example will retrieve a single object in JSON format, the second all Writer objects and the third example shows how a free-format query can be passed. Security and SQL injection prevention are important topics here to.

Insert/update are supported through POST http methods, deletion is done through the DELETE http method.

Other features of the Texo JSON REST support:

  • Paging parameters to support efficient scrolling through a large grid of data
  • Setting the number of levels in the containment tree which should be returned
  • The proxy concept, references are sent back with a proxy uri, to prevent reading the complete database
  • Several ways of doing insert/update
  • Combining multiple insert/update/delete actions in one request

As a next step I am considering implementing a few example web apps using client side UI technology as provided by sencha or even try to connect a RCP with an EMF UI to the Texo JSON layer.

Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum.

gr. Martin

Written by martintaal

April 5, 2012 at 6:10 am

Posted in Texo

Follow

Get every new post delivered to your Inbox.