Update of /var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms In directory james.mmbase.org:/tmp/cvs-serv10242/java/com/finalist/cmsc/community/forms
Modified Files: SearchConditionalUserAction.java Log Message: CMSC-990 merge add subscribers 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-990 Index: SearchConditionalUserAction.java =================================================================== RCS file: /var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/SearchConditionalUserAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- SearchConditionalUserAction.java 28 Jul 2008 06:36:14 -0000 1.4 +++ SearchConditionalUserAction.java 28 Jul 2008 14:49:13 -0000 1.5 @@ -25,71 +25,74 @@ import com.finalist.cmsc.services.community.person.Person; import com.finalist.cmsc.services.community.security.Authority; -public class SearchConditionalUserAction extends AbstractCommunityAction{ +public class SearchConditionalUserAction extends AbstractCommunityAction { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) - throws Exception{ + throws Exception { String groupName = request.getParameter("groupName"); SearchForm searchform = (SearchForm) actionForm; HashMap map = new HashMap(); - if(!StringUtil.isEmptyOrWhitespace(searchform.getFullName())){ + if (!StringUtil.isEmptyOrWhitespace(searchform.getFullName())) { map.put("fullname", searchform.getFullName()); } - if(!StringUtil.isEmptyOrWhitespace(searchform.getUserName())){ + if (!StringUtil.isEmptyOrWhitespace(searchform.getUserName())) { map.put("username", searchform.getUserName()); } - if(!StringUtil.isEmptyOrWhitespace(searchform.getemailAddr())){ + if (!StringUtil.isEmptyOrWhitespace(searchform.getemailAddr())) { map.put("email", searchform.getemailAddr()); } - if(!StringUtil.isEmptyOrWhitespace(searchform.getGroups())){ + if (!StringUtil.isEmptyOrWhitespace(searchform.getGroups())) { map.put("group", searchform.getGroups()); } - if(!StringUtil.isEmptyOrWhitespace(groupName)){ + if (!StringUtil.isEmptyOrWhitespace(groupName)) { map.put("group", groupName); } - if(!StringUtil.isEmptyOrWhitespace(groupName)){ + if (!StringUtil.isEmptyOrWhitespace(groupName)) { map.put("group", groupName); map.put("strict", "strict"); } PagingStatusHolder holder = PagingUtils.getStatusHolder(request); List<Person> persons; int totalCount = 0; - if(map.size()>0){ - persons = getPersonService().getAssociatedPersons(map,holder); - totalCount = getPersonService().getAssociatedPersonsNum(map,holder); - }else{ + if (map.size() > 0) { + persons = getPersonService().getAssociatedPersons(map, holder); + totalCount = getPersonService().getAssociatedPersonsNum(map, holder); + } else { persons = getPersonService().getAllPeople(holder); totalCount = getPersonService().countAllPersons(); } request.setAttribute("personForShow", convertToVO(persons)); request.setAttribute("totalCount", totalCount); - if(!StringUtil.isEmptyOrWhitespace(groupName)){ + request.setAttribute("newsletterId", request.getParameter("newsletterId")); + request.setAttribute("method", request.getParameter("method")); + if (!StringUtil.isEmptyOrWhitespace(groupName)) { request.setAttribute("groupName", groupName); return actionMapping.findForward("group"); } - removeFromSession(request,searchform); - return actionMapping.findForward("success"); + removeFromSession(request, searchform); + ActionForward ret = actionMapping.findForward("success"); + return ret; } private List<PersonForShow> convertToVO(List<Person> persons) { List<PersonForShow> perShow; perShow = new ArrayList<PersonForShow>(); - for(Person p:persons){ + for (Person p : persons) { PersonForShow per = new PersonForShow(); - per.setFullname(""+p.getFirstName()+" "+p.getLastName()); + per.setFullname("" + p.getFirstName() + " " + p.getLastName()); per.setEmail(p.getEmail()); per.setUsername(getAuthenticationService().getAuthenticationById(p.getAuthenticationId()).getUserId()); String groupsName = ""; Set<String> authorityNames = getAuthorityService().getAuthorityNamesForUser(getAuthenticationService().getAuthenticationById(p.getAuthenticationId()).getUserId()); - if(authorityNames.size()>=1) { + if (authorityNames.size() >= 1) { Iterator iter = authorityNames.iterator(); - while(iter.hasNext()){ - groupsName += iter.next()+", "; + while (iter.hasNext()) { + groupsName += iter.next() + ", "; } - groupsName = groupsName.substring(0, groupsName.length()-2); + groupsName = groupsName.substring(0, groupsName.length() - 2); per.setGroups(groupsName); - }else{ + } else { per.setGroups(""); } per.setAuthId(p.getAuthenticationId()); _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs