Re: XML data service

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Dec 15 2005 - 04:31:06 EST

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-408) cayenne.xml not found in servlet context path though it is there"

    Cris,

    I don't have time right now to go through the code, but this is
    totally along the lines I see Cayenne developing in the future. I
    suggest you create a page on Wiki and upload the code, and we'll go
    from there.

    Andrus

    On Dec 15, 2005, at 3:59 AM, Cris Daniluk wrote:
    > I've prepared a simple implementation of a generic data service for
    > Cayenne, based on the one I wrote for a proprietary application (see
    > http://www.objectstyle.org/cayenne/lists/cayenne-devel/
    > 2005/11/0038.html).
    > Before I put it on the Wiki, I wanted to get some comment on it here.
    >
    > Basically what I've done is created a GenericDataService which is a
    > simple facade to the Cayenne query API. It takes a class or stored
    > query name, expression, ordering, etc and returns the XML-encoded
    > result. It also supports mapping files. I then created
    > AbstractDataService implementations in Struts, WebWork, and as a plain
    > servlet. To use it, you just implement whichever one matches your
    > framework and extend getObjectMap(), mapping literals to your
    > DataObjects. Then, a query like this:
    >
    > http://.../dataService?objectType=painting
    >
    > or...
    >
    > http://.../dataService.do?objectType=painting
    >
    > or...
    >
    > http://.../dataService.action?objectType=painting
    >
    > would return an XML data set of all artists, in no particular order.
    > You could add sorting:
    >
    > http://.../dataService.action?objectType=painting&ordering=
    > +paintingTitle
    >
    > or a filter:
    >
    > http://.../dataService.action?
    > objectType=painting&expression=toArtist.artistName="Altdorfer,
    > Albrecht"
    >
    > Everything has been tested at a high level, but not exhaustively. An
    > example implementation for each abstract service is provided. I didn't
    > include the libs since there's nearly 10mb, but basically there are no
    > dependencies but Cayenne - and Struts or Webwork if you use that.
    >
    > I think it works and is fairly secure (at least, as secure as the
    > developer is). I also included a simple app that uses jsXml and Dojo
    > to browse paintings and lookup artists, all on a single "static" html
    > page. I thought a simple example might be helpful to connect the dots.
    >
    > Cris
    > <genericDataService.zip>



    This archive was generated by hypermail 2.0.0 : Thu Dec 15 2005 - 04:31:08 EST