From: Dan M. <dan...@gm...> - 2009-11-25 15:30:40
|
We now have some more clear ideas on how we can use URL rewriting to create a nice URL interface for the new proposed eXist administrative functions. The basic idea is to give the users a clean URL API but then redirect the incoming requests to a database administration application area wherever they may be. For example: Incomming URL: /admin/collection/copy?from=/db/a&to=/db/b Rewrite-to: /db/apps/exist-admin/actions/collection-copy.xq?from=/db/a&to=/db/b Here is a example URL data set that shows how this might be done: http://demo.syntactica.com/exist/rest/db/cust/exist-admin/apps/rewrite/admin-rewrite-samples.xml I have also created a sample of a fully RESTful version of the collection-copy function and two sample web forms. One in plain-old HTML and one using XSLTforms. Very Simple HTML (with no CSS for the field widths): http://demo.syntactica.com/exist/rest/db/cust/exist-admin/apps/collection-browser/forms/collection-copy-html.xq XSLTForms: http://demo.syntactica.com/exist/rest/db/cust/exist-admin/apps/collection-browser/forms/collection-copy-xsltforms.xq Both of these forms will call the same REST interface. Here is an example of the "from" and "to" parameters on the copy action before the rewrite: $HOST..../db/cust/exist-admin/apps/collection-browser/actions/collection-copy.xq?from=/db/a&to=/db/b and after the rewrite: $HOST/admin/collection/copy?from=/db/a&to=/db/b We have started to put in some basic checking for required parameters but it is clear that getting good warnings and error message back to the users will be critical for overall usability. These forms can be enhanced and any time by users with nice JQuery drag-and-drop functions, as-you-type checking, progress bars etc. in the future. But the basic framework of calling a REST interface and returning error high-quality messages should not change. You can do a "view source" on these to see how these forms work and we are currently thinking about a good place to put the source code and if all exist distributions should include all possible versions of the administrative tools. For each of the collection functions we now can start to gather more detailed requirements like: What are the parameters? Which one are required? What are the edit checks? What are the rules to enable a button for any given collection? How should error messages from forms be handled in a consistent way? We will also be working on some user account administration forms. - Dan -- Dan McCreary Semantic Solutions Architect syntactica.com 952-460-1674 VOIP: 111@69.199.167.229 |