On 01/26/2010 02:30 PM, Guillaume Lerouge wrote:
Hi Valdis,
On Tue, Jan 26, 2010 at 12:52 PM, Valdis Vītoliņš<valdis.vitolins(a)odo.lv>wrote;wrote:
For custom application I need to add more
properties
for ../xwiki/bin/edit/XWiki/XWikiUsers?editor=class
Is it acceptable/recommended way or other (more complicated?) approach
would be better?
Do you have any experience?
It would work. However I'd recommend an alternative approach:
- Create a XWiki.ExtendUserClass holding your properties
- Add an object from this class to your user profiles
- Use it to store information
I also recommend this, but there's a problem: creating a new user only
adds the XWikiUsers object, since it doesn't create documents based on a
template. This means that somewhere you'll have to add this object.
A solution is to put a check in the user sheet, similar to what is done
for WebPreferences and a missing XWikiPreferences object.
#if(!$doc.getObject('XWiki.ExtendUserClass'))
$response.sendRedirect($doc.getURL('objectadd',
'classname=XWiki.ExtendUserClass'))
#end
This way you can upgrade the XWikiUsers class when
needed.
Guillaume
--
Sergiu Dumitriu
http://purl.org/net/sergiu/