Update of
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person
In directory james.mmbase.org:/tmp/cvs-serv10794/services/community/person
Modified Files:
PersonHibernateService.java PersonService.java
Log Message:
CMSC-1265 Community: improve import and export options of community users
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-1265
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.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- PersonHibernateService.java 3 Mar 2009 09:06:15 -0000 1.29
+++ PersonHibernateService.java 3 Mar 2009 10:28:54 -0000 1.30
@@ -502,68 +502,4 @@
criteria = criteria.setResultTransformer(criteria.DISTINCT_ROOT_ENTITY);
return criteria.list();
}
- @Transactional
- public void importDataFromFileRecord(String level,
- PersonExportImportVO importPerson) {
- Person p =
getPersonByUserId(importPerson.getAuthentication().getUserId());
- if ("over".equals(level)) {
- if(p != null) {
-
authenticationService.updateAuthenticationPassword(importPerson.getAuthentication().getUserId(),
importPerson.getAuthentication().getPassword());
- p.setEmail(importPerson.getEmail());
- p.setActive(importPerson.getActive());
- updatePerson(p);
- }
- else {
- Authentication authentication =
authenticationService.createAuthentication(importPerson.getAuthentication());
- if (authentication.getId() != null) {
- if(importPerson.getAuthorityId()>0 ){
- Authority authority =
this.getAuthorityById(importPerson.getAuthorityId());
- if (null!=authentication.getAuthorities()) {
- authentication.getAuthorities().add(authority);
- }
- }
- addPerson(importPerson, authentication);
- }
- }
- }
- else{
- // add new users or put user to another group
- createNewPerson(importPerson);
- }
-
- }
- @Transactional
- private void addPerson(PersonExportImportVO importPerson,
- Authentication authentication) {
- Person person = new Person();
- person.setEmail(importPerson.getEmail());
- person.setActive(importPerson.getActive());
- person.setAuthenticationId(authentication.getId());
- getSession().saveOrUpdate(authentication);
- updatePerson(person);
- }
- @Transactional(propagation = Propagation.REQUIRED)
- private void createNewPerson(PersonExportImportVO xperson) {
-
- Authentication authentication = xperson.getAuthentication();
-
if(authenticationService.authenticationExists(authentication.getUserId()) &&
xperson.getAuthorityId()>0 ){
- Authority authority = this.getAuthorityById(xperson.getAuthorityId());
- if(null!=authority){
- authentication =
authenticationService.getAuthenticationById(authenticationService.getAuthenticationIdForUserId(authentication.getUserId()));
- authentication.getAuthorities().add(authority);
- getSession().saveOrUpdate(authentication);
- }
- }
- else
if(!authenticationService.authenticationExists(authentication.getUserId())){
- authentication =
authenticationService.createAuthentication(authentication);
- if(xperson.getAuthorityId()>0 ){
- Authority authority =
this.getAuthorityById(xperson.getAuthorityId());
- if (null!=authentication.getAuthorities()) {
- authentication.getAuthorities().add(authority);
- }
- }
- addPerson(xperson, authentication);
- }
-
- }
}
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.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- PersonService.java 3 Mar 2009 09:06:15 -0000 1.21
+++ PersonService.java 3 Mar 2009 10:28:54 -0000 1.22
@@ -89,5 +89,4 @@
public List<Authority> getAllAuthorities();
- public void importDataFromFileRecord(String level, PersonExportImportVO
importPerson);
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs