Update of
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
In directory
james.mmbase.org:/tmp/cvs-serv1610/community/src/java/com/finalist/cmsc/community/forms
Modified Files:
Tag: b1_4
UserAddAction.java
Log Message:
CMSC-830 - change functionname to match argument (+formatting)
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
See also: http://www.mmbase.org/jira/browse/CMSC-830
Index: UserAddAction.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/UserAddAction.java,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.5
diff -u -b -r1.3.2.4 -r1.3.2.5
--- UserAddAction.java 25 Mar 2008 18:46:27 -0000 1.3.2.4
+++ UserAddAction.java 26 Mar 2008 09:31:57 -0000 1.3.2.5
@@ -33,16 +33,17 @@
private static Log log = LogFactory.getLog(UserAddInitAction.class);
- public ActionForward execute(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest,
- HttpServletResponse httpServletResponse) throws
Exception {
+ @Override
+ public ActionForward execute(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse)
+ throws Exception {
if (!isCancelled(httpServletRequest)) {
UserForm userForm = (UserForm) actionForm;
- //String accountName = userForm.getEmail();
+ // String accountName = userForm.getEmail();
String accountName = userForm.getAccount();
-// AuthorityService aus = getAuthorityService(); //Never
used (yet).
+ // AuthorityService aus = getAuthorityService(); //Never used (yet).
AuthenticationService as = getAuthenticationService();
PersonService ps = getPersonService();
@@ -50,10 +51,11 @@
Long authenticationId =
as.getAuthenticationIdForUserId(accountName);
if (authenticationId == null) {
Authentication authentication =
as.createAuthentication(userForm.getEmail(), userForm.getPasswordText());
-// Long authenticationId =
as.getAuthenticationIdForUserId(accountName);
+ // Long authenticationId =
+ // as.getAuthenticationIdForUserId(accountName);
if (authentication.getId() != null) {
Person person =
ps.createPerson(userForm.getFirstName(), userForm.getPrefix(),
userForm.getLastName(), authentication.getId());
-
person.setEmail(userForm.getEmail()); //Also add an email address to the user.
+ person.setEmail(userForm.getEmail()); // Also add an email
address to the user.
ps.updatePerson(person);
} else {
@@ -74,21 +76,22 @@
}
}
- //First retrieve the right person
object from the database
- Person person = ps.getPersonByAuthentication(authenticationId);
+ // First retrieve the right person object from the database
+ Person person =
ps.getPersonByAuthenticationId(authenticationId);
- if (person == null) { //User did not exists, so create it.
+ if (person == null) { // User did not exists, so create it.
person = new Person();
person.setAuthenticationId(authenticationId);
}
- //Also save other fields entered in the form to the right
person object
+ // Also save other fields entered in the form to the right
person
+ // object
person.setFirstName(userForm.getFirstName());
person.setInfix(userForm.getPrefix());
person.setLastName(userForm.getLastName());
person.setEmail(userForm.getEmail());
- //Store the new person data to the
database again.
+ // Store the new person data to the database again.
ps.updatePerson(person);
} else {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs