Update of 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person
In directory 
james.mmbase.org:/tmp/cvs-serv15345/community/src/java/com/finalist/cmsc/services/community/person

Modified Files:
      Tag: b1_4
        PersonHibernateService.java PersonService.java 
Log Message:
CMSC-830 - Add Send Password functionality: major updates to Community and Form 
validations.


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


Index: PersonHibernateService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person/PersonHibernateService.java,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -b -r1.2.2.2 -r1.2.2.3
--- PersonHibernateService.java 21 Mar 2008 16:46:29 -0000      1.2.2.2
+++ PersonHibernateService.java 25 Mar 2008 18:46:26 -0000      1.2.2.3
@@ -13,8 +13,6 @@
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.hibernate.Criteria;
 import org.hibernate.criterion.Example;
 import org.hibernate.criterion.Restrictions;
@@ -29,8 +27,6 @@
  */
 public class PersonHibernateService extends HibernateService implements 
PersonService {
 
-       private static Log log = 
LogFactory.getLog(PersonHibernateService.class);
-
        private AuthenticationService authenticationService;
 
        /** [EMAIL PROTECTED] */
@@ -86,6 +82,7 @@
    @Transactional
    public void updatePerson(Person person) {
       getSession().saveOrUpdate(person);
+      getSession().flush();
    }
 
 
@@ -104,14 +101,7 @@
 
        private Person findPersonByUserId(String userId) {
                Long authenticationId = 
authenticationService.getAuthenticationIdForUserId(userId);
-               Person person = null;
-               if (authenticationId != null) {
-                       Criteria criteria = getSession()
-                                                                       
.createCriteria(Person.class)
-                                                                       
.add(Restrictions.eq("authenticationId", authenticationId));
-                       person = findPersonByCriteria(criteria);
-               }
-               return person;
+               return getPersonByAuthentication(authenticationId);
        }
 
        @SuppressWarnings("unchecked")
@@ -125,4 +115,17 @@
                this.authenticationService = authenticationService;
        }
 
+   /** [EMAIL PROTECTED] */
+       @Transactional(readOnly = true)
+   public Person getPersonByAuthentication(Long authenticationId) {
+      Person person = null;
+      if (authenticationId != null) {
+         Criteria criteria = getSession()
+                           .createCriteria(Person.class)
+                           .add(Restrictions.eq("authenticationId", 
authenticationId));
+         person = findPersonByCriteria(criteria);
+      }
+      return person;
+   }
+
 }


Index: PersonService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person/PersonService.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- PersonService.java  21 Mar 2008 16:46:29 -0000      1.2.2.1
+++ PersonService.java  25 Mar 2008 18:46:26 -0000      1.2.2.2
@@ -27,6 +27,8 @@
     
     List<Person> getPerson(Person person);
     
+    Person getPersonByAuthentication(Long authenticationId);
+    
     Person createPerson(String firstName, String infix, String lastName, Long 
authenticationId);
     
     /* Save or update the person to the database
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to