| Apache Cayenne > Index > Summer of Code 2006 > cayenne-rop |
The proposal for this project can be found at http://wiki.apache.org/general/SummerOfCode2006/cayenne-rop-proposal
. The example app is now a visual database editor, both as an example and a framework. It is being developed in Eclipse using GEF.
A sandbox SVN repository can be found at https://svn.objectstyle.org/repos/soc/trunk/cayenne-rop/
- this app is under rop-browser.
The Control Panel is opened using the menu Window->Show View->Other...>ROP Browser>Control Panel. The server URL is entered, connection is made and a query is selected to run.
The picture below shows a small database completely expanded. The blue element is the root of the query. The yellow elements are collections, the result of following 1-n relationships which return more than one record. The grey elements are single objects, either 'popped out' from collections, the result of 1-1 relationships or the result of 1-n relationships returning only one record. Solid lines indicate that there is a relationship between the objects, and the arrowhead indicates the direction of expansion. Double arrowheads indicate a relationship which has been expanded both ways. Dashed lines indicate that the element is comes from the collection. The small label at the bottom right is a tooltip from the nearest relationship.
Relationships are expanded by selecting the appropriate element (selection handles don't appear at present) and clicking the relationship name. Double clicking a collection will cycle through its constituent elements, which can then be 'popped out' by clicking on the 'Pop Out' button.
Values can be edited by selecting an element and using the Eclipse properties view.

Pertinent excerpts from Andrus' mailing list messages relating to this:
------------
Not as a development tool, but as a framework for building a multi-user visual graph manager based on Cayenne model. It can have functionality similar to this Visual Graph Manager:
-------------
Showing *all* object graph means showing the entire database. This is certainly NOT how you want to do it. So let me reiterate: You'd start with a list of objects fetched for a given query (i.e. a small subset of a db), and then expand the graph on demand as the user clicks on a relationships of a specific objects. Cayenne yields itself extremely well to this type of navigation, lazily resolving relationships behind the scenes (so instead of "instance data won't be loaded" you may say "relationship data won't be loaded").
E.g. in response to a query a user may get a list of artists (a1, a2, ... an). (S)he clicks on some artist's "paintings" relationships, this would expand a list of paintings for this artist only, and so on.
For version 1.1, we may also take query "prefetching" into account to show more than one kind of objects on the initial graph.
Can you point me in the right direction for Cayenne's XML file parsing code please? Does Cayenne maintain an accessible (to the ROP client) model of the object graph, or will I have to build one based upon the XML file?
Cayenne provides all the metadata to you, on the client as well as on the server. And you don't need to parse any XML. ObjectContext.getEntityResolver() is what you are looking for.
Things being what they are, the Confluence editor project hit a wall (well, more like a three foot high speed bump - not insurmountable, but not pleasant either). The problem is that Confluence is not merely a layer on the DB, it wraps the DB and relies on all changes to the DB coming through the interfaces it exposes. Not unreasonable, but not very good for what we were aiming for. There was a potential solution available - writing an RPC plugin exposing a content refresh method - but it was felt better to continue with the project above. Much Cayenne-related experience was gained.
A sandbox SVN repository can be found at https://svn.objectstyle.org/repos/soc/trunk/cayenne-rop/
. There are folders for cws (the server side, mapping the Confluence database to objects) and crop (the GUI application for editing Confluence).
The server side bits and pieces seem to be running. At this stage it is not clear to me (as a Cayenne newbie) whether they are running completely correctly. Time - and advice from the dev team - will tell I'm sure.
Confluence discoveries:
The CWS side of things seems to be running fine, although it is bound to need periodic updates as the object models change.
The RCP side is progressing: it now contains a browser with an 'Edit Page' button. This button opens the current page for editing, which currently displays the title and the content of the page. Changes cannot be saved at present. Multiple pages can be viewed and edited at once.
