Update of 
/var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community
In directory 
james.mmbase.org:/tmp/cvs-serv3937/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community

Modified Files:
      Tag: b1_4
        CommunityService.java Community.java 
        DummyCommunityService.java 
Log Message:
CMSC-830 - *added* some functionality to send the password, but at the same 
time *removed* it from the portlet because it doesn't belong there.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community
See also: http://www.mmbase.org/jira/browse/CMSC-830


Index: CommunityService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community/CommunityService.java,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -u -b -r1.9.2.2 -r1.9.2.3
--- CommunityService.java       21 Mar 2008 16:46:18 -0000      1.9.2.2
+++ CommunityService.java       27 Mar 2008 15:32:47 -0000      1.9.2.3
@@ -36,6 +36,10 @@
 
    public abstract Map<String, Map<String, String>> getUserProperty(String 
userName);
 
-   public abstract boolean sendPassword(String username, String emailText, 
String emailHeader);
-
+   /**
+    * Do not use.
+    *
+    * @see Community#sendPassword(String, String, String)
+    */
+   abstract boolean sendPassword(String username, String emailSubject, String 
emailBody);
 }


Index: Community.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community/Community.java,v
retrieving revision 1.8.2.2
retrieving revision 1.8.2.3
diff -u -b -r1.8.2.2 -r1.8.2.3
--- Community.java      21 Mar 2008 16:46:18 -0000      1.8.2.2
+++ Community.java      27 Mar 2008 15:32:47 -0000      1.8.2.3
@@ -6,18 +6,16 @@
 import com.finalist.cmsc.services.ServiceManager;
 
 /**
- * Community, this is a CMSc service class.
- * This class is the abstract service class that wil be implemented
- * by the "CommunityServiceMysqlImpl".
- * In this class comes the request from a portlet or module and will be
- * redirected to the "CommunityServiceMysqlImpl".
+ * Community, this is a CMSc service class. This class is the abstract service
+ * class that wil be implemented by the "CommunityServiceMysqlImpl". In this
+ * class comes the request from a portlet or module and will be redirected to
+ * the "CommunityServiceMysqlImpl".
  *
  * @author menno menninga
  */
 public class Community {
 
-       private final static CommunityService communityService =
-          (CommunityService) ServiceManager.getService(CommunityService.class);
+   private final static CommunityService communityService = (CommunityService) 
ServiceManager.getService(CommunityService.class);
 
    public static void login(String userName, String password) {
       communityService.login(userName, password);
@@ -47,24 +45,47 @@
       return communityService.getPreferenceValues(module, userId, key);
    }
 
-   public static Map<String, Map<String,List<String>>> getPreferences(String 
module, String userId, String key, String value){
+   public static Map<String, Map<String, List<String>>> getPreferences(String 
module, String userId, String key, String value) {
       return communityService.getPreferences(module, userId, key, value);
    }
 
-   public static void createPreference(String module, String userId, String 
key, List<String> values){
+   public static void createPreference(String module, String userId, String 
key, List<String> values) {
       communityService.createPreference(module, userId, key, values);
    }
 
-   public static void removePreferences(String module, String userId, String 
key){
+   public static void removePreferences(String module, String userId, String 
key) {
       communityService.removePreferences(module, userId, key);
    }
 
-   public static Map<String, Map<String, String>> getUserProperty(String 
userName){
+   public static Map<String, Map<String, String>> getUserProperty(String 
userName) {
       return communityService.getUserProperty(userName);
    }
 
-   public static boolean sendPassword(String username, String emailText, 
String emailHeader) {
-      return communityService.sendPassword(username, emailText, emailHeader);
+   /**
+    * DO NOT USE THIS METHOD. Really, <strong>DO NOT USE THIS METHOD</strong>.
+    * <br />
+    * <br />
+    * The passwords should normally be stored in an encrypted form which makes
+    * this method useless. For 4en5mei.nl the passwords are stored in plain 
text
+    * and we moved this method here instead of creating a dependency hell on 
the
+    * login-portlet. This is so we can remove this functionality easily and
+    * trade it for a way to <em>reset</em> a password rather than email the
+    * account data.
+    *
+    * @param username
+    *           The username to search for a password.
+    * @param emailSubject
+    *           The email subject
+    * @param emailBody
+    *           The email body
+    * @return <code>true</code> if a password was succesfully send to the
+    *         user, <code>false</code> otherwise.
+    *
+    * @deprecated Don't use this method, this functionality should be
+    *             implemented somewhere else.
+    */
+   public static boolean sendPassword(String username, String emailSubject, 
String emailBody) {
+      return communityService.sendPassword(username, emailSubject, emailBody);
    }
 
 }


Index: DummyCommunityService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/community/DummyCommunityService.java,v
retrieving revision 1.8.2.2
retrieving revision 1.8.2.3
diff -u -b -r1.8.2.2 -r1.8.2.3
--- DummyCommunityService.java  21 Mar 2008 16:46:18 -0000      1.8.2.2
+++ DummyCommunityService.java  27 Mar 2008 15:32:47 -0000      1.8.2.3
@@ -23,5 +23,5 @@
        @Override public void createPreference(String module, String userId, 
String key, List<String> values) {}
        @Override public void removePreferences(String module, String userId, 
String key) {}
        @Override public Map<String, Map<String, String>> 
getUserProperty(String userName) { return null; }
-   @Override public boolean sendPassword(String email, String emailText, 
String emailHeader) { return true; }
+   @Override boolean sendPassword(String email, String emailSubject, String 
emailBody) { return true; }
 }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to