From: Thomas W. <tho...@gm...> - 2009-11-25 23:51:31
|
Dear all, Bellow is my vision about admin RESTful URLs. We should try to pass the parameters as parts of the URL if we can distinguish the paramemeters easily : {application}/{module}/{object-type}/{action}/{single-parameter} {application}/{module}/{object-type}/{action}/{id}/{old-value}/{new-value} *A. Server Configuration.* Module name: configuration.xql. We can have the following types of updates: A.1 whole file: HTTP PUT /admin/configuration/conf.xml/replace A.2 an XML fragment: HTTP PUT /admin/configuration/conf.xml/node-replace/db-connection/pool A.3 an element or attribute value: the last part of the URL is the new value. GET /admin/configuration/conf.xml/update-value/ db-connection/pool/@cacheSize/128M A.4 Configuration save/restore GET /admin/configuration/conf.xml/save?to=c:/config-data GET /admin/configuration/conf.xml/load?from=c:/config-data * B. Server information (view only).* Module name: state.xql /admin/state/status /admin/state/statistics /admin/state/performance-monitor /admin/state/statistics/ profiling * C. Job management.* Module name: jobs.xql /admin/jobs/list-running-jobs /admin/jobs/list-scheduled-jobs /admin/jobs/kill/job-id /admin/jobs/set-priority/job-id/priority *D. Admin actions.* Module name: actions.xql /admin/do/restart /admin/do/reload /admin/do/shutdown /admin/do/backup/{root-collection-of-the backup}[?to=c:/backups] /admin/do/restore/{root-collection-of-the backup}?from=c:/backups/backup-file.zip /admin/do/reindex/{collection-URI} *E. Security, User and Group Management.* Module name: sequrity.xql /admin/security/user/add/new-user-id/password/{home-collection} /admin/security/user/delete/user-id /admin/security/user/add-to-group/user-id-to-add /admin-users-group /admin/security/user/rename/old-user-name/new-user-name /admin/security/group/add/group-name/group-description /admin/security/group/rename/old-group-name/new-group-name /admin/security/group/add-user/admin-users-group/user-id-to-add /admin/security/list-groups?page=x&page-size=xx /admin/security/list-users?page=x&page-size=xx /admin/security/global/default-access/{permissions} /admin/security/collection/permissions-set/{URI}/{ permissions } /admin/security/resource/permissions-set/{URI}/{ permissions } /admin/security/resource/owner-set/{URI}/{new-owner} /admin/security/resource/group-set/{URI}/{ new-group } *) User bulk operations - I do not have a clear idea jet *) Bulk(recursive) security operations - I do not have a clear idea jet * F. Data browser.* Module name browser.xql F.1. browse collections/resources. To get all set page-size to 0, sort is optional: /admin/browser/list-sub-collections/{collection-URI}/{page}/{page-size}?sort-by=[name|date|size] /admin/browser/list-resources/{collection-URI}/{page}/{page-size}?sort-by=[name|date|size] F.2 collections/resources operations: /admin/browser/collection/move/db/collection-abc?to=/db/new-parent-collection /admin/browser/resource/move/db/collection-abc/data.xml?to=/db/new-parent-collection /admin/browser/collection/clone/db/collection-abc?to=/db/new-parent-collection /admin/browser/resource/clone/db/collection-abc/data.xml?to=/db/new-parent-collection Note: clone copies all permitions as well /admin/browser/collection/backup/db/collection-abc?to=/db/new-parent-collection /admin/browser/collection/restore/db/collection-abc?from=c:/backups/backup.zip /admin/browser/collection/export/db/collection-abc/data.xml?to=c:/exported-xml-data /admin/browser/collection/import/db/collection-abc/data.xml?from=c:/exported-xml-data /admin/browser/resource/import/db/collection-abc?from=c:/exported-xml-data/data.xml /admin/browser/resource/export/db/collection-abc/data.xml?to=c:/exported-xml-data It is important to put all code that perform the actions into the module files and every specific user interface implementation like XForms, AJAX, plane HTML or iPhone will include the module to call the action first and later return whatever specific implementation content is needed. Module files will be in application collection/directory. All files from a specifc user interface implementation will be in a single sub-collection under admin, like /admin/XForms, /admin/iPhone or /admin/jQuery. A controller.xql in admin collection/directory will translate the URLs into XQuery URI and parameters. The preferred implementation will be added as a prefix to the XQuery URI. Any comments or questions? Thomas ------ Thomas White Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 Linked-In:http://www.linkedin.com/in/thomaswhite0007 facebook: http://www.facebook.com/thomas.0007 |