[xwiki-users] How to add a property to spaces?
Hi How can I add properties to my spaces? I'm looking for something like an editable SpaceClass. And a way to change the "Create Space" form to include the property. And finally a way to access that property with Groovy. But I've noticed that there aren't classes for Pages or Spaces. I'm using XE 2.0.3. -- Kevin
On Wed, Dec 2, 2009 at 06:39, Kevin Thiart <[email protected]> wrote:
Hi
How can I add properties to my spaces?
I'm looking for something like an editable SpaceClass. And a way to change the "Create Space" form to include the property. And finally a way to access that property with Groovy.
But I've noticed that there aren't classes for Pages or Spaces.
Well its more generic that that: you create a class and add instance(s) of this class (and other classes) to the targeted page. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel for more details. Space does not really exists technically so you can't add an object in a space but you can decide that some page will contains objects assigned to the space, for example we use the <space>.WebPreference page to store user rights management objects. To manipulate objects and classes you can look at examples in http://code.xwiki.org or dev manual (http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide).
I'm using XE 2.0.3.
-- Kevin _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Thanks for all the info! I guess the only question remaining then is: How can I extend the "create space script"? All I need to know is where this logic is. I want to extend it to add an object to the WebHome page automatically on creation. I want to use this object to categorize my spaces. At the moment I'm using tags and a custom panel, which feels too much like a hack. Thanks! -- Kevin -- View this message in context: http://n2.nabble.com/How-to-add-a-property-to-spaces-tp4098167p4099930.html Sent from the XWiki- Users mailing list archive at Nabble.com.
kevint wrote:
How can I extend the "create space script"? All I need to know is where this logic is. I want to extend it to add an object to the WebHome page automatically on creation.
Nevermind that. I'll create a panel to display on page edit that can add the object to the page. Similar to how the document information panel adds tags to a page. Thanks for all your help. Now I know the difference between spaces, pages and objects. If I get to the point where I can package all my changes, I'll see if I can create a xar file. Assuming I figure out HOW to create a xar file for something like this. -- View this message in context: http://n2.nabble.com/How-to-add-a-property-to-spaces-tp4098167p4100048.html Sent from the XWiki- Users mailing list archive at Nabble.com.
On Wed, Dec 2, 2009 at 3:00 PM, kevint <[email protected]> wrote:
Thanks for all the info!
I guess the only question remaining then is:
How can I extend the "create space script"? All I need to know is where this logic is.
The code you're looking for is in the create.vm template.
I want to extend it to add an object to the WebHome page automatically on creation.
I want to use this object to categorize my spaces. At the moment I'm using tags and a custom panel, which feels too much like a hack.
Thanks!
-- Kevin -- View this message in context: http://n2.nabble.com/How-to-add-a-property-to-spaces-tp4098167p4099930.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (4)
-
Jean-Vincent Drean -
Kevin Thiart -
kevint -
Thomas Mortagne