[xwiki-users] Custom properties for XWikiUsers class
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? Thanks in advance, Valdis
Hi Valdis, On Tue, Jan 26, 2010 at 12:52 PM, Valdis Vītoliņš <[email protected]>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 This way you can upgrade the XWikiUsers class when needed. Guillaume
Thanks in advance, Valdis _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
On 01/26/2010 02:30 PM, Guillaume Lerouge wrote:
Hi Valdis,
On Tue, Jan 26, 2010 at 12:52 PM, Valdis Vītoliņš<[email protected]>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/
Hi, On Tue, Jan 26, 2010 at 4:09 PM, Sergiu Dumitriu <[email protected]> wrote:
On 01/26/2010 02:30 PM, Guillaume Lerouge wrote:
Hi Valdis,
On Tue, Jan 26, 2010 at 12:52 PM, Valdis Vītoliņš<[email protected] 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
By the way, this reminds me that right now the WebPreferences page is created in syntax 2.0 while its content is XWiki 1.0 syntax that doesn't get displayed correctly. Guillaule
This way you can upgrade the XWikiUsers class when needed.
Guillaume
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
On Jan 26, 2010, at 4:15 PM, Guillaume Lerouge wrote:
Hi,
On Tue, Jan 26, 2010 at 4:09 PM, Sergiu Dumitriu <[email protected]> wrote:
On 01/26/2010 02:30 PM, Guillaume Lerouge wrote:
Hi Valdis,
On Tue, Jan 26, 2010 at 12:52 PM, Valdis Vītoliņš<[email protected] 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
By the way, this reminds me that right now the WebPreferences page is created in syntax 2.0 while its content is XWiki 1.0 syntax that doesn't get displayed correctly.
I cannot reproduce this. Can you give the steps to reproduce? thanks -Vincent
Guillaule
This way you can upgrade the XWikiUsers class when needed.
Guillaume
For custom application I need to add more properties for ../xwiki/bin/edit/XWiki/XWikiUsers?editor=class Do you have any experience? - 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 works (though need not to be scared and save it) for user's wiki document content another line should be added to show data properly: #includeForm("XWiki.XWikiUsersExtSheet") Do you have any ideas about this? Thanks! Valdis
For custom application I need to add more properties for ../xwiki/bin/edit/XWiki/XWikiUsers?editor=class Do you have any experience? - 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 works (though need not to be scared and save it) for user's wiki document content another line should be added to show data properly: #includeForm("XWiki.XWikiUsersExtSheet")
Solved this adding this line at the end of "/xwiki/bin/edit/XWiki/XWikiUserSheet" ;-) Valdis
participants (4)
-
Guillaume Lerouge -
Sergiu Dumitriu -
Valdis Vītoliņš -
Vincent Massol