Hi,
I've continued to make progress on the CRUD actions (which will have to
be converted to REST).
I've created a "create" action which allows to get a creation form. The
name of the page is automatically derived from one of the fields of the
page or by a counter as specified in the class config.
It calls to the "save" action which has been modified to handle the page
name generation as well as being compatible with validation and
reloading the create action when you came from creeate.
Also a list and create actions have been created.
Currently the these actions have to be called on the class document:
/xwiki/bin/create/XWiki/ArticleClass
would launch create on a blog article. It then create a save URL in the
default space set in the class definition and a non existant page. In
case of validation error we get to see that intermediary URL in the
location bar.
I'm not especially happy about this URL since it is not in the "space"
of where the document will be created. You could get a right error after
clicking Save instead of right away showing a permission error.
I could use this type of URL
/xwiki/bin/create?class=XWiki.ArticleClass
or
/xwiki/bin/create/SpaceWhereToCreate/?class=XWiki.ArticleClass
or
/xwiki/bin/create/SpaceWhereToCreate/XWiki.ArticleClass
This is the same with the list and search URLs. Currently it's
/xwiki/bin/list/XWiki/ArticleClass
it could be
/xwiki/bin/list/?class=XWiki/ArticleClass
We could also detect the space name and automatically find the class name that defaults to
this space for creation.
Also I currently have the save code in SaveAction. Now this make the code a little like a
hack. Should I move it to a CreateSaveAction ? or another name ?
WDYT ?
Ludovic
--
Ludovic Dubost
Blog:
http://blog.ludovic.org/
XWiki:
http://www.xwiki.com
Skype: ldubost GTalk: ldubost