Hi Jean,
I personally like it because I think it could solve our issue with the XObject editor:
currently when you add a new XObject an empty XObject is added to the page and saved and
when the page is saved its properties are updated. Ideally the page should not get
modified at all before hitting save (or cancel).
I believe there’s a jira issue for the xobject editor but I couldn’t find it.
OTOH there’s also this related jira issue:
http://jira.xwiki.org/browse/XWIKI-217
I have no clue what’s involved to support what you want though and whether changing the
implementation of readObjectsFromForm() is enough or not or the consequences of changing
the behavior. Right now I can’t imagine any issue.
So I’d be +1 to do the change.
Thanks
-Vincent
On 10 Apr 2014 at 10:33:41, Jean SIMARD
(jean.simard@xwiki.com(mailto:jean.simard@xwiki.com)) wrote:
Hi devs,
In XWiki, if you send a POST request at the following URL
('MySpace.MyPage' is a document that doesn't exist at the moment)
/bin/save/MySpace/MyPage
with the following HTTP parameters:
* template=MySpace.MyTemplate
* XWiki.XWikiRights_0_users=XWiki.Me
*
with 'MySpace.MyTemplate' a template document and 'XWiki.Me' a user of
the wiki.
2 cases:
1. If 'MySpace.MyTemplate' contains a 'XWiki.XWikiRights' object, then
the resulting document 'MySpace.MyPage' will have this object with its
property 'users' initialize with the value 'XWiki.Me' (see HTTP
parameters)
2. If 'MySpace.MyTemplate' does not contain a 'XWiki.XWikiRights'
object, the resulting document 'MySpace.MyPage' will not contain it
either
### PROPOSAL
Create automatically the objects if they don't exist in the template
document.
###
To make it possible, it seems that we would need to refactor the method
'readObjectsFromForm(EditForm, XWikiContext)' in the
'com.xpn.xwiki.doc.XWikiDocument' class. And probably modify also the
'getObject(String)' from 'com.xpn.xwiki.web.EditForm' class.
2 things to take care:
* It seems there is no unit test for these methods.
* May this proposal be a security problem?
WDYT?
--
Jean
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs