Author: dward Date: 2008-02-08 18:53:57 +0100 (Fri, 08 Feb 2008) New Revision: 7410
Modified: xwiki-products/curriki/trunk/plugins/currikispacemanager/src/main/java/org/curriki/plugin/spacemanager/impl/CurrikiSpaceManager.java Log: - CURRIKI-1566 - getRoles() now returns all available roles in the space Modified: xwiki-products/curriki/trunk/plugins/currikispacemanager/src/main/java/org/curriki/plugin/spacemanager/impl/CurrikiSpaceManager.java =================================================================== --- xwiki-products/curriki/trunk/plugins/currikispacemanager/src/main/java/org/curriki/plugin/spacemanager/impl/CurrikiSpaceManager.java 2008-02-08 17:32:32 UTC (rev 7409) +++ xwiki-products/curriki/trunk/plugins/currikispacemanager/src/main/java/org/curriki/plugin/spacemanager/impl/CurrikiSpaceManager.java 2008-02-08 17:53:57 UTC (rev 7410) @@ -1,9 +1,5 @@ package org.curriki.plugin.spacemanager.impl; -import java.util.List; - -import org.curriki.plugin.spacemanager.plugin.CurrikiSpaceManagerPluginApi; - import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.api.Api; @@ -12,7 +8,12 @@ import com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException; import com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension; import com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerImpl; +import org.curriki.plugin.spacemanager.plugin.CurrikiSpaceManagerPluginApi; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + /** * Created by IntelliJ IDEA. * User: ludovic @@ -144,4 +145,23 @@ } } + /** + * [EMAIL PROTECTED] + */ + public Collection getRoles(String spaceName, XWikiContext context) throws SpaceManagerException { + List parameterValues = new ArrayList(); + String where = "where doc.web = ? and doc.name like ? order by doc.title"; + parameterValues.add(spaceName); + parameterValues.add("Role_%Group"); + + List roles; + try { + roles = context.getWiki().getStore().searchDocumentsNames(where, 0, 0, parameterValues, context); + } catch (XWikiException e) { + throw new SpaceManagerException(e); + } + + return roles; + } + } _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications