[xwiki-devs] Create List Search Actions
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
Hi,
I've continued to make progress on the CRUD actions (which will have to be converted to REST).
Great.
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
Given the strong link between applications and spaces (since most well-developed XWiki applications will have one document per item, using a space WebHome as the app homepage and space docs to store its data is quite natural), I'd say that it would be better to have the create URL in the space where the new item will be created. My personal favorite would be /xwiki/bin/create/ApplicationSpace/?class=XWiki.ApplicationClass as it looks close to the URL we already do write most of the time.
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
The "list" action would also need to work on a per-space basis, especially since using space rights to manage application rights is quite handy. So we would have : /xwiki/bin/list/ApplicationSpace/?class=XWiki.ApplicationClass 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 ?
Guillaume
Guillaume Lerouge wrote:
Hi,
I've continued to make progress on the CRUD actions (which will have to be converted to REST).
Great.
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
Given the strong link between applications and spaces (since most well-developed XWiki applications will have one document per item, using a space WebHome as the app homepage and space docs to store its data is quite natural), I'd say that it would be better to have the create URL in the space where the new item will be created.
My personal favorite would be
/xwiki/bin/create/ApplicationSpace/?class=XWiki.ApplicationClass
as it looks close to the URL we already do write most of the time.
Why not directly /xwiki/bin/create/ApplicationSpace/ And we find the class automatically when the ?class= param is not specified We could store the default class in the space config, or lookup the default space field in the class config (this case causes problem if 2 classes define the same space) Same for list and search.. Ludovic
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
The "list" action would also need to work on a per-space basis, especially since using space rights to manage application rights is quite handy. So we would have :
/xwiki/bin/list/ApplicationSpace/?class=XWiki.ApplicationClass
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 ?
Guillaume _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
[snip]
Why not directly
/xwiki/bin/create/ApplicationSpace/
And we find the class automatically when the ?class= param is not specified We could store the default class in the space config, or lookup the default space field in the class config (this case causes problem if 2 classes define the same space)
Same for list and search..
Sure, it will simply mean that we assume a strong link between the space and the application... Then thee is the question of applications that require the creation of various classes : how would you handle creating a bulletin board category from the application homepage (easy) then a topic page from the BB category page ? Could you have "subhomepages" in your application space ? I'm aware that the option of adding ?application=XWiki.App remains available to solve the issue anyway. [snip] Guillaume
I've been thinking that if there is a conflict and no param passed to fix the conflict, then we just ask the user This is the same thing we need to do on clicking a ? link in the wiki. We need to ask the type of document the user wants to create and it which space. The user should never have to name the document or place it in the space by writing the wiki link. We should just set some defaults and ask him if he wants to make different choices. Ludovic Guillaume Lerouge wrote:
[snip]
Why not directly
/xwiki/bin/create/ApplicationSpace/
And we find the class automatically when the ?class= param is not specified We could store the default class in the space config, or lookup the default space field in the class config (this case causes problem if 2 classes define the same space)
Same for list and search..
Sure, it will simply mean that we assume a strong link between the space and the application... Then thee is the question of applications that require the creation of various classes : how would you handle creating a bulletin board category from the application homepage (easy) then a topic page from the BB category page ? Could you have "subhomepages" in your application space ?
I'm aware that the option of adding ?application=XWiki.App remains available to solve the issue anyway.
[snip]
Guillaume _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
participants (3)
-
Guillaume Lerouge -
Ludovic Dubost -
Ludovic Dubost