You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2008/01/20 19:14:25 UTC
Interoperability with ExtJS
Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I got
the demo (below) working on my Tomcat server using a static XML file
as the datasource, but that is far removed from bi-directional
communication with Cayenne. Check out the field-editing capabilities
of this interface:
http://extjs.com/deploy/dev/examples/grid/edit-grid.html
The problem is that ExtJS tutorials fall somewhat short of proving
that ExtJS-grid can interoperate with an ORM (even though they claim
that it works with JSP). There is one comment about using DRW to
accomplish this easier.
http://getahead.org/dwr
But again, I have seen no working example that proves the concept.
If the answer is no, then I will continue hammering on it and then
post the results. My theory is that an "Editable Grid" (aka
spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
combination.
Joe
PS I have been using Cayenne for a few months now in development, and
it is one of the most stable components I have tested to date.
Re: Interoperability with ExtJS
Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jan 21, 2008, at 3:25 AM, Joe Baldwin wrote:
> I am interested in your idea. The downside is that, while I am
> motivated, I am not familiar with your code and would have to rely
> on you for coaching in order to conform to your team's design goals.
That much we can guarantee :-)
> I have been looking at some use cases (implemented with totally
> different utilities): Navicat & OpenOffice. Both can connect with a
> database, execute bi-directional data transfer, and present the data
> in a spreadsheet format. The (*big*) downside is that you lose the
> security features of the 3-tier design (i.e. you can totally destroy
> your database integrity if your user make mistakes.) Still, the
> UPDATE solutions are interesting: Navicat allows multiple edits and
> with multiple rows without updating, then with a single user
> command, it updates all the changes at once. OpenOffice, however,
> makes each change as soon as you move your cursor to a new cell.
> Both work well, the Navicat design seems more efficient.
I think ExtJS also goes with a single commit of multiple changes -
something that we certainly want.
> I would love to just get one entity represented by one grid working
> for right now. If you want me to help out with code, then please
> let me know if you think this is a worthwhile goal, the scope, the
> the amount of time.
I think it is. A few things to note:
* Let's move further discussion to dev@cayenne.apache.org, as backend
design threads tend to be long and boring for most end users, even if
they are interested in the final product.
* My brain hurts because of the number of choices in the JS world, and
we'd like to keep our design as portable as possible... But we have to
start somewhere, and from what I've seen so far, DWR remoting seems
like a good starting point, so let's maybe concentrate on that for now.
Andrus
Re: Interoperability with ExtJS
Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jan 21, 2008, at 3:25 AM, Joe Baldwin wrote:
> I am interested in your idea. The downside is that, while I am
> motivated, I am not familiar with your code and would have to rely
> on you for coaching in order to conform to your team's design goals.
That much we can guarantee :-)
> I have been looking at some use cases (implemented with totally
> different utilities): Navicat & OpenOffice. Both can connect with a
> database, execute bi-directional data transfer, and present the data
> in a spreadsheet format. The (*big*) downside is that you lose the
> security features of the 3-tier design (i.e. you can totally destroy
> your database integrity if your user make mistakes.) Still, the
> UPDATE solutions are interesting: Navicat allows multiple edits and
> with multiple rows without updating, then with a single user
> command, it updates all the changes at once. OpenOffice, however,
> makes each change as soon as you move your cursor to a new cell.
> Both work well, the Navicat design seems more efficient.
I think ExtJS also goes with a single commit of multiple changes -
something that we certainly want.
> I would love to just get one entity represented by one grid working
> for right now. If you want me to help out with code, then please
> let me know if you think this is a worthwhile goal, the scope, the
> the amount of time.
I think it is. A few things to note:
* Let's move further discussion to dev@cayenne.apache.org, as backend
design threads tend to be long and boring for most end users, even if
they are interested in the final product.
* My brain hurts because of the number of choices in the JS world, and
we'd like to keep our design as portable as possible... But we have to
start somewhere, and from what I've seen so far, DWR remoting seems
like a good starting point, so let's maybe concentrate on that for now.
Andrus
Re: Interoperability with ExtJS
Posted by Joe Baldwin <jf...@earthlink.net>.
Andrus,
I am interested in your idea. The downside is that, while I am
motivated, I am not familiar with your code and would have to rely on
you for coaching in order to conform to your team's design goals.
I have been looking at some use cases (implemented with totally
different utilities): Navicat & OpenOffice. Both can connect with a
database, execute bi-directional data transfer, and present the data
in a spreadsheet format. The (*big*) downside is that you lose the
security features of the 3-tier design (i.e. you can totally destroy
your database integrity if your user make mistakes.) Still, the
UPDATE solutions are interesting: Navicat allows multiple edits and
with multiple rows without updating, then with a single user command,
it updates all the changes at once. OpenOffice, however, makes each
change as soon as you move your cursor to a new cell. Both work well,
the Navicat design seems more efficient.
As far as representing relationships goes: the ORM "fault" pattern is
a brilliant solution for Enterprise Objects. I just don't know how
that could be easily represented with a "grid" display. I think some
solutions I have seen have attempted to presented multiple grids with
each representing a relationship. (Idea: maybe abstracting the
standardized cell updating philosophy, like presenting a calendar for
a date, perhaps when a relationship is made editable it is depicted by
displaying a second grid.)
My brain hurts! :) You guys must have these discussions all the time.
I would love to just get one entity represented by one grid working
for right now. If you want me to help out with code, then please let
me know if you think this is a worthwhile goal, the scope, the the
amount of time.
Thanks,
Joe
On Jan 20, 2008, at 4:18 PM, Andrus Adamchik wrote:
> I wanted to implement this kind of technology for some time.
> Unfortunately given all other things we are working on, I didn't get
> too far in actually doing it.
>
> My first idea was to provide a JS client for Cayenne ROP, but then
> we'd have to code ObjectContext implementation for the client
> side... Seemed like an overkill at the time... Now that I checked
> ExtJS, it looks like its Store concept can serve as an analog of a
> caching client context, with a benefit being that it is already tied
> to a bunch of nice UI widgets...
>
> DWR looks very promising as a back-and-force data transport, tied to
> the ExtJS Store on the client... So the last missing piece is a DWR
> Cayenne service... We can follow ROP (HessianService) in defining
> such service... although since the same DataContext will be used for
> JSP page generation as well DWR request processing, we don't have to
> write any Cayenne bootstrapping code, and simply use
> DataContext.getThreadDataContext()... Instead of supporting all
> types of queries like ROP does, the JS service can (and should - for
> security reasons) support only mapped named queries.
>
> I think it should be fairly easy to build such framework for the
> simplest case of fetching and updating a single entity... Handling
> relationships can be trickier.
>
> Anyways, that's some food for thought. If you are motivated to build
> such framework, maybe we can collaborate on it on cayenne dev list?
> I won't promise to dedicate much time to it, but I am very
> interested in this technology as I said above, and would like to see
> it either as a part of Cayenne or readily available to Cayenne users
> via other venues.
>
> Andrus
>
>
> On Jan 20, 2008, at 8:14 PM, Joe Baldwin wrote:
>
>> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
>> got the demo (below) working on my Tomcat server using a static XML
>> file as the datasource, but that is far removed from bi-directional
>> communication with Cayenne. Check out the field-editing
>> capabilities of this interface:
>>
>> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
>>
>> The problem is that ExtJS tutorials fall somewhat short of proving
>> that ExtJS-grid can interoperate with an ORM (even though they
>> claim that it works with JSP). There is one comment about using
>> DRW to accomplish this easier.
>>
>> http://getahead.org/dwr
>>
>> But again, I have seen no working example that proves the concept.
>>
>> If the answer is no, then I will continue hammering on it and then
>> post the results. My theory is that an "Editable Grid" (aka
>> spreadsheet-interface-pattern), JSP, and Cayenne would be a
>> powerful combination.
>>
>> Joe
>>
>> PS I have been using Cayenne for a few months now in development,
>> and it is one of the most stable components I have tested to date.
>>
>>
>>
>>
>>
>
Re: Interoperability with ExtJS
Posted by Andrus Adamchik <an...@objectstyle.org>.
I wanted to implement this kind of technology for some time.
Unfortunately given all other things we are working on, I didn't get
too far in actually doing it.
My first idea was to provide a JS client for Cayenne ROP, but then
we'd have to code ObjectContext implementation for the client side...
Seemed like an overkill at the time... Now that I checked ExtJS, it
looks like its Store concept can serve as an analog of a caching
client context, with a benefit being that it is already tied to a
bunch of nice UI widgets...
DWR looks very promising as a back-and-force data transport, tied to
the ExtJS Store on the client... So the last missing piece is a DWR
Cayenne service... We can follow ROP (HessianService) in defining such
service... although since the same DataContext will be used for JSP
page generation as well DWR request processing, we don't have to write
any Cayenne bootstrapping code, and simply use
DataContext.getThreadDataContext()... Instead of supporting all types
of queries like ROP does, the JS service can (and should - for
security reasons) support only mapped named queries.
I think it should be fairly easy to build such framework for the
simplest case of fetching and updating a single entity... Handling
relationships can be trickier.
Anyways, that's some food for thought. If you are motivated to build
such framework, maybe we can collaborate on it on cayenne dev list? I
won't promise to dedicate much time to it, but I am very interested in
this technology as I said above, and would like to see it either as a
part of Cayenne or readily available to Cayenne users via other venues.
Andrus
On Jan 20, 2008, at 8:14 PM, Joe Baldwin wrote:
> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
> got the demo (below) working on my Tomcat server using a static XML
> file as the datasource, but that is far removed from bi-directional
> communication with Cayenne. Check out the field-editing
> capabilities of this interface:
>
> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
>
> The problem is that ExtJS tutorials fall somewhat short of proving
> that ExtJS-grid can interoperate with an ORM (even though they claim
> that it works with JSP). There is one comment about using DRW to
> accomplish this easier.
>
> http://getahead.org/dwr
>
> But again, I have seen no working example that proves the concept.
>
> If the answer is no, then I will continue hammering on it and then
> post the results. My theory is that an "Editable Grid" (aka
> spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
> combination.
>
> Joe
>
> PS I have been using Cayenne for a few months now in development,
> and it is one of the most stable components I have tested to date.
>
>
>
>
>
Re: Interoperability with ExtJS
Posted by Marek Wawrzyczny <ma...@internode.on.net>.
Hi Andrus,
I've been going through my unread email and came across this.
This is really interesting, I've been thinking of this type of functionality
for some time.
I've used DWR recently to implement some AJAX calls. The thing about DWR is
that the developer must implement a Facade with static methods which are then
exposed by the DWR framework. One defines which methods and which properties
of the entities are exposed in yet another xml config file.
Initially, it would be good to see how a hand written app would handle Cayenne
interaction and validation. Ideally we could write something that would
automatically expose entities and CRUD operations for entities with defined
client properties.
I could investigate if DWR can be configured programatically.
We could use the existing client configuration in cayenne to define which
properties to expose in JS.
Finally, I don't know how ExtJS works, but I'd imagine that the generic CRUD
operations that need to be exposed are fetch, save(record) and fetch(record).
Additionally we'd have to handle validation... if the methods are generic,
writing the JavaScript to handle callbacks and decorate logic should be quite
simple...
I wonder if there is a sample web application (preferably using Spring as
that's all I know atm) floating around I could use to prototype this. I'm
still getting the hang of J2EE configuration :)
Cheers,
Marek Wawrzyczny
On Mon, 21 Jan 2008 22:37:31 Andrus Adamchik wrote:
> Dan,
>
> Like I said in my reply to Joe, my head hurts of all the JS framework
> choices :-) I'd like us to design a service that can be integrated as
> a data layer into the most of the leading frameworks... (if this is
> even possible...) In this respect your experience with Spry and other
> things JS may be helpful to us. So feel free to jump on the
> discussion, that I hope will continue on dev.
>
> Andrus
>
> On Jan 21, 2008, at 9:39 AM, Daniel Kvasnička jr. wrote:
> > Hi Joe,
> >
> > not exactly what you're asking for, but my experiences... As regards
> > one-directional AJAX (server -> client), I use Cayenne with Adobe
> > Spry's (http://labs.adobe.com/technologies/spry/home.html) XML
> > DataSets and I've been very happy with this combination so far.
> > Cayenne's suport for XML serializarion is a big plus for that. I
> > studied Ext for a while, but stayed with Spry, as it is more low-level
> > and allows me to play with it more. Moreover, I like their idea of
> > using custom XML namespaces on the client side instead of writing a
> > lot of JS. I've written a JSP tag for that and now creating a new
> > paginated AJAX-enabled list of records with deleting capabilities
> > means writing one tag for me (as for the client side, and no editing).
> >
> > As for the other direction (e.g. ajax command to delete a row), I'm
> > using jQuery and the plugin that integrates Taconite with it. I like
> > Taconite's principle a lot. We've used DWR at work (not with cayenne)
> > and I've been quite amazed, but for now I don't use it (maybe again
> > because Taconite shields me from JS most of the time).
> >
> > Dan
> >
> > On Jan 20, 2008 7:14 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> >> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
> >> got
> >> the demo (below) working on my Tomcat server using a static XML file
> >> as the datasource, but that is far removed from bi-directional
> >> communication with Cayenne. Check out the field-editing
> >> capabilities
> >> of this interface:
> >>
> >> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
> >>
> >> The problem is that ExtJS tutorials fall somewhat short of proving
> >> that ExtJS-grid can interoperate with an ORM (even though they claim
> >> that it works with JSP). There is one comment about using DRW to
> >> accomplish this easier.
> >>
> >> http://getahead.org/dwr
> >>
> >> But again, I have seen no working example that proves the concept.
> >>
> >> If the answer is no, then I will continue hammering on it and then
> >> post the results. My theory is that an "Editable Grid" (aka
> >> spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
> >> combination.
> >>
> >> Joe
> >>
> >> PS I have been using Cayenne for a few months now in development, and
> >> it is one of the most stable components I have tested to date.
> >
> > --
> > http://www.danielkvasnicka.net -- webdesign & corporate design,
> > programování internetových a intranetových aplikací
Re: Interoperability with ExtJS
Posted by Andrus Adamchik <an...@objectstyle.org>.
Dan,
Like I said in my reply to Joe, my head hurts of all the JS framework
choices :-) I'd like us to design a service that can be integrated as
a data layer into the most of the leading frameworks... (if this is
even possible...) In this respect your experience with Spry and other
things JS may be helpful to us. So feel free to jump on the
discussion, that I hope will continue on dev.
Andrus
On Jan 21, 2008, at 9:39 AM, Daniel Kvasnička jr. wrote:
> Hi Joe,
>
> not exactly what you're asking for, but my experiences... As regards
> one-directional AJAX (server -> client), I use Cayenne with Adobe
> Spry's (http://labs.adobe.com/technologies/spry/home.html) XML
> DataSets and I've been very happy with this combination so far.
> Cayenne's suport for XML serializarion is a big plus for that. I
> studied Ext for a while, but stayed with Spry, as it is more low-level
> and allows me to play with it more. Moreover, I like their idea of
> using custom XML namespaces on the client side instead of writing a
> lot of JS. I've written a JSP tag for that and now creating a new
> paginated AJAX-enabled list of records with deleting capabilities
> means writing one tag for me (as for the client side, and no editing).
>
> As for the other direction (e.g. ajax command to delete a row), I'm
> using jQuery and the plugin that integrates Taconite with it. I like
> Taconite's principle a lot. We've used DWR at work (not with cayenne)
> and I've been quite amazed, but for now I don't use it (maybe again
> because Taconite shields me from JS most of the time).
>
> Dan
>
>
> On Jan 20, 2008 7:14 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
>> got
>> the demo (below) working on my Tomcat server using a static XML file
>> as the datasource, but that is far removed from bi-directional
>> communication with Cayenne. Check out the field-editing
>> capabilities
>> of this interface:
>>
>> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
>>
>> The problem is that ExtJS tutorials fall somewhat short of proving
>> that ExtJS-grid can interoperate with an ORM (even though they claim
>> that it works with JSP). There is one comment about using DRW to
>> accomplish this easier.
>>
>> http://getahead.org/dwr
>>
>> But again, I have seen no working example that proves the concept.
>>
>> If the answer is no, then I will continue hammering on it and then
>> post the results. My theory is that an "Editable Grid" (aka
>> spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
>> combination.
>>
>> Joe
>>
>> PS I have been using Cayenne for a few months now in development, and
>> it is one of the most stable components I have tested to date.
>>
>>
>>
>>
>>
>>
>
>
>
> --
> http://www.danielkvasnicka.net -- webdesign & corporate design,
> programování internetových a intranetových aplikací
>
Re: Interoperability with ExtJS
Posted by Andrus Adamchik <an...@objectstyle.org>.
Dan,
Like I said in my reply to Joe, my head hurts of all the JS framework
choices :-) I'd like us to design a service that can be integrated as
a data layer into the most of the leading frameworks... (if this is
even possible...) In this respect your experience with Spry and other
things JS may be helpful to us. So feel free to jump on the
discussion, that I hope will continue on dev.
Andrus
On Jan 21, 2008, at 9:39 AM, Daniel Kvasnička jr. wrote:
> Hi Joe,
>
> not exactly what you're asking for, but my experiences... As regards
> one-directional AJAX (server -> client), I use Cayenne with Adobe
> Spry's (http://labs.adobe.com/technologies/spry/home.html) XML
> DataSets and I've been very happy with this combination so far.
> Cayenne's suport for XML serializarion is a big plus for that. I
> studied Ext for a while, but stayed with Spry, as it is more low-level
> and allows me to play with it more. Moreover, I like their idea of
> using custom XML namespaces on the client side instead of writing a
> lot of JS. I've written a JSP tag for that and now creating a new
> paginated AJAX-enabled list of records with deleting capabilities
> means writing one tag for me (as for the client side, and no editing).
>
> As for the other direction (e.g. ajax command to delete a row), I'm
> using jQuery and the plugin that integrates Taconite with it. I like
> Taconite's principle a lot. We've used DWR at work (not with cayenne)
> and I've been quite amazed, but for now I don't use it (maybe again
> because Taconite shields me from JS most of the time).
>
> Dan
>
>
> On Jan 20, 2008 7:14 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
>> got
>> the demo (below) working on my Tomcat server using a static XML file
>> as the datasource, but that is far removed from bi-directional
>> communication with Cayenne. Check out the field-editing
>> capabilities
>> of this interface:
>>
>> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
>>
>> The problem is that ExtJS tutorials fall somewhat short of proving
>> that ExtJS-grid can interoperate with an ORM (even though they claim
>> that it works with JSP). There is one comment about using DRW to
>> accomplish this easier.
>>
>> http://getahead.org/dwr
>>
>> But again, I have seen no working example that proves the concept.
>>
>> If the answer is no, then I will continue hammering on it and then
>> post the results. My theory is that an "Editable Grid" (aka
>> spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
>> combination.
>>
>> Joe
>>
>> PS I have been using Cayenne for a few months now in development, and
>> it is one of the most stable components I have tested to date.
>>
>>
>>
>>
>>
>>
>
>
>
> --
> http://www.danielkvasnicka.net -- webdesign & corporate design,
> programování internetových a intranetových aplikací
>
Re: Interoperability with ExtJS
Posted by "Daniel Kvasnička jr." <da...@gmail.com>.
Hi Joe,
not exactly what you're asking for, but my experiences... As regards
one-directional AJAX (server -> client), I use Cayenne with Adobe
Spry's (http://labs.adobe.com/technologies/spry/home.html) XML
DataSets and I've been very happy with this combination so far.
Cayenne's suport for XML serializarion is a big plus for that. I
studied Ext for a while, but stayed with Spry, as it is more low-level
and allows me to play with it more. Moreover, I like their idea of
using custom XML namespaces on the client side instead of writing a
lot of JS. I've written a JSP tag for that and now creating a new
paginated AJAX-enabled list of records with deleting capabilities
means writing one tag for me (as for the client side, and no editing).
As for the other direction (e.g. ajax command to delete a row), I'm
using jQuery and the plugin that integrates Taconite with it. I like
Taconite's principle a lot. We've used DWR at work (not with cayenne)
and I've been quite amazed, but for now I don't use it (maybe again
because Taconite shields me from JS most of the time).
Dan
On Jan 20, 2008 7:14 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I got
> the demo (below) working on my Tomcat server using a static XML file
> as the datasource, but that is far removed from bi-directional
> communication with Cayenne. Check out the field-editing capabilities
> of this interface:
>
> http://extjs.com/deploy/dev/examples/grid/edit-grid.html
>
> The problem is that ExtJS tutorials fall somewhat short of proving
> that ExtJS-grid can interoperate with an ORM (even though they claim
> that it works with JSP). There is one comment about using DRW to
> accomplish this easier.
>
> http://getahead.org/dwr
>
> But again, I have seen no working example that proves the concept.
>
> If the answer is no, then I will continue hammering on it and then
> post the results. My theory is that an "Editable Grid" (aka
> spreadsheet-interface-pattern), JSP, and Cayenne would be a powerful
> combination.
>
> Joe
>
> PS I have been using Cayenne for a few months now in development, and
> it is one of the most stable components I have tested to date.
>
>
>
>
>
>
--
http://www.danielkvasnicka.net -- webdesign & corporate design,
programování internetových a intranetových aplikací