Author: ludovic
Date: 2007-11-28 00:51:11 +0100 (Wed, 28 Nov 2007)
New Revision: 6102

Modified:
   
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/XWikiSpace.java
   
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/api/XWikiSpace.java
Log:
Added more apis

Modified: 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/XWikiSpace.java
===================================================================
--- 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/XWikiSpace.java
      2007-11-27 17:49:26 UTC (rev 6101)
+++ 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/XWikiSpace.java
      2007-11-27 23:51:11 UTC (rev 6102)
@@ -20,6 +20,7 @@
 package org.xwiki.plugin.spacemanager;
 
 import java.util.List;
+import java.util.Map;
 
 import com.xpn.xwiki.XWikiContext;
 import com.xpn.xwiki.api.Api;
@@ -30,15 +31,34 @@
 public interface XWikiSpace
 {       
     String getCreator(XWikiContext context);
-    
+
+    /**
+     * Title of a Group
+     * @param context
+     * @return
+     * TODO: this could be getTitle()
+     * TODO: do we need the context ?
+     */
     String getPrettyName(XWikiContext context);
-    
+
+    /**
+     *
+     * @param context
+     * @return
+     * TODO: to we need the context
+     */
     String getDescription(XWikiContext context);
     
     List getLastModifiedDocuments(XWikiContext context);
     
     List searchDocuments(String hql, XWikiContext context);
     
+    /**
+     *
+     * @param context
+     * @return
+     * TODO: to we need the context
+     */
     String getPreference(String prefName, XWikiContext context);
     
     String getURL(XWikiContext context);
@@ -46,24 +66,58 @@
     void addAdmin(String wikiname, XWikiContext context);
     
     void addAdmins(List wikinames, XWikiContext context);
-    
+
     /**
      * @return the list of all members of the space that are admins 
      */
     List getAdmins(XWikiContext context);
-        
+
+    void addUserToRole(String wikiname, String role, XWikiContext context);
+
+    void addUsersToRole(String wikiname, String role, XWikiContext context);
+
+    List getUsersForRole(String role, XWikiContext context);
+
     /**
      * Context user membership request against the space.
      * Register the request in the database, and possibly notify space admins 
of the request
      */
-    void requestMembership(XWikiContext context);
-    
+    void requestMembership(String message, XWikiContext context);
+
     /**
+     * Context user membership request against the space.
+     * Register the request in the database, and possibly notify space admins 
of the request
+     */
+    void requestMembership(String message, String role, XWikiContext context);
+
+    /**
+     * Context user membership request against the space.
+     * Register the request in the database, and possibly notify space admins 
of the request
+     */
+    void requestMembership(String message, List roles, XWikiContext context);
+
+    /**
+     * Context user membership request against the space.
+     * Register the request in the database, and possibly notify space admins 
of the request
+     */
+    void requestMembership(String message, List roles, Map map, XWikiContext 
context);
+
+
+    /**
      * If the context user belongs to space admins, returns the list of 
membership requests
      * that has not been processed (accepted/refused) yet.
      * If not, returns an empty list, and log a warning in the context
+     * List of object MemberShipRequest -> message, role, user, map of 
additional data
      */
     List getPendingMembershipRequests(XWikiContext context);
+
+     /**
+     * If the context user belongs to space admins, returns the list of 
membership requests
+     * that has not been processed (accepted/refused) yet.
+     * If not, returns an empty list, and log a warning in the context
+     * List of object MemberShipRequest -> status, message, role, user, map of 
additional data
+     */
+    List getMembershipRequests(XWikiContext context);
     
     /**
      * Accept a pending membership request.
@@ -80,6 +134,7 @@
      * Accept a pending membership (@see [EMAIL PROTECTED] 
#acceptMembership(String)}) using a custom email template
      * Which can differ from the space/wiki default one.
      * If the context user is not an admin of the space, does nothing and log 
a warning in the context
+     * TODO: shouldn't email templates just be configuration params and a 
boolean be passed when we want notification ?
      */
     void acceptMembership(String userName, String templateMail, XWikiContext 
context);
     
@@ -118,4 +173,14 @@
     void inviteUnregisteredUser(String email, XWikiContext context);
     
     void inviteUnregisteredUser(String email, String templateMail, 
XWikiContext context);
+
+    void acceptRegisteredUserInvitation(XWikiContext context);
+
+    /**
+     * This can throw an error is the current logged in user is already member
+     * @param email
+     * @param code
+     * @param context
+     */
+    void acceptUnregisteredUserInvitation(String email, String code, 
XWikiContext context);
 }
\ No newline at end of file

Modified: 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/api/XWikiSpace.java
===================================================================
--- 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/api/XWikiSpace.java
  2007-11-27 17:49:26 UTC (rev 6101)
+++ 
xwiki-sandbox/plugins/spacemanager/src/main/java/org/xwiki/plugin/spacemanager/api/XWikiSpace.java
  2007-11-27 23:51:11 UTC (rev 6102)
@@ -42,7 +42,7 @@
     public boolean requestMembership()
     {
         try{
-            space.requestMembership(context);
+            space.requestMembership("", context);
             return true;
         }
         catch (Exception e){

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to