Hey,

Am 04.04.2011 um 11:51 schrieb Andrew Manson:

Hi,

I'm working on an internal project that is using QooXdoo for our next 
generation web application. I have come across a quick architectural "issue" 
and I'm wondering what the best way to solve it is using QooXdoo.

We are implementing a virtual file system for a user, the implementation is not 
important but it is important to note that there is custom authentication 
method, custom virtual folder structure and a custom request model (very close 
to WebDAV)  for this user store so there will be need to be quite a lot of code 
to interface with it.

I have recently use the JSON store and really quite like the way it deals with 
getting the JSON file transparently based on a URI. I would really like to 
create a similar functionality for my custom file store where by I would just 
be able to provide a URI like custom:///user/files/file.xml and the Store 
itself would "know" how to access that file based on the custom code in the 
file store.

That sounds like a good idea in general to implement a custom store for that. 
If you are retrieving JSON data, make sure you use the JSON marshaler to 
convert your plain JavaScript objects into qooxdoo data models which then can 
be used by the data binding layer.

I have been looking around the documentation and have not quite found anything 
related to creating custom data stores but I have found some "hints" around the 
place that it should be possible. In the documentation for qx.data.marshal.Json 
( http://demo.qooxdoo.org/current/apiviewer/#qx.data.marshal.Json ) it talks 
about passing a delegate to the constructor. I can't find the exact position in 
the documentation but I have seen other references to making custom marshallers.
We don't have any documentation for such an advanced topic yet. But you can 
take a look at the implementation of the JSON store, which is really not that 
much code. Should be quite obvious how it works.

Is there a tutorial or blog post anywhere that has dealt with the possibility 
of creating a custom data store?
No, sorry, there is nothing like that.

If so then could someone please point me in the direction of it. If not then 
could someone please give me some pointers so that I can implement what I have 
discussed above or if anyone thinks that I'm going about it wrong then please 
let me know and tell me what they think the "QooXdoo" way of doing it is.
The basic idea is good and exactly the "qooxdoo" way. I would try to check out 
the JSON store, make sure I can convert my loaded data into a JavaScript object 
and use the JSON marshaler. Thats tested code you can benefit from.

I hope that gets you started,
Martin
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to