Package evolaris.framework.sys.business

Examples of evolaris.framework.sys.business.GroupManager


    }
    allowedAllowedInvocation.setId(f.getId());
    allowedAllowedInvocation.setMsisdn(isProvided("msisdn") ? Long.parseLong(f.getMsisdn().trim()) : null);
    allowedAllowedInvocation.setEmail(isProvided("email") ? f.getEmail().trim() : null);
    allowedAllowedInvocation.setKeywordBase(isProvided("keywordBase") ? f.getKeywordBase().trim() : null);
    GroupManager groupMgr = new GroupManager(locale, session);
    Group group = groupMgr.getGroup(f.getGroupId());
    allowedAllowedInvocation.setGroup(group);
    return allowedAllowedInvocation;
  }
View Full Code Here


    invocation.setDescription(f.getDescription());
    invocation.setKeywords(f.getKeywords() != null && f.getKeywords().trim().length() > 0 ? f.getKeywords().trim() : null);
    invocation.setMessagequeue(f.getMessageQueue());
    invocation.setServiceId(f.getService() != null && f.getService().trim().length() > 0 ? f.getService().trim() : null);
    invocation.setAuthenticationKey(f.getAuthenticationKey() != null && f.getAuthenticationKey().trim().length() > 0 ? f.getAuthenticationKey() : null);
    GroupManager groupMgr = new GroupManager(locale, session);
    Group group = groupMgr.getGroup(f.getGroupId());
    invocation.setGroup(group);

    // "logical" validations
    if (invocation.getBeginAt() != null && invocation.getEndAt() != null && invocation.getBeginAt().after(invocation.getEndAt())) {
      throw new InputException(resources.getMessage("admin.keywordBeginDateMustBeBeforeEndDate"));     
View Full Code Here

    group.setLoginDisabled(loginDisabled?1:0);
    group.setTimerEventsDisabled(timerEventsDisabled?1:0);
    group.setHomePagePath(homePagePath);

    // client project
    GroupManager groupMgm = new GroupManager(locale,session);
    ClientProject clientProject = groupMgm.getClientProject(clientProjectId);
    if (clientProject == null){
      throw new InputException(resources.getMessage(locale,"um.clientProjectDeleted"));
    }
    group.setClientProject(clientProject);
View Full Code Here

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward create(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    GroupEnterOrEditForm groupEnterOrEditForm = (GroupEnterOrEditForm) form;
    GroupManager manager = new GroupManager(locale,session);   
    Group group = new Group();
    groupEnterOrEditForm.modifyGroup(group, locale, session, getResources(req),req.isUserInRole(UserManagerBase.ADMINISTRATOR));
    checkAccessRights(req, group);
    manager.createGroup(group);
    return mapping.findForward("created");
  }
View Full Code Here

   *      javax.servlet.http.HttpServletResponse)
   */
  @SuppressWarnings("unused")
  public ActionForward modify(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    GroupEnterOrEditForm groupEnterOrEditForm = (GroupEnterOrEditForm) form;
    GroupManager groupManager = new GroupManager(locale,session);
    Group group = groupManager.getGroup(groupEnterOrEditForm.getGroupId())// groups never get deleted => always found
    groupEnterOrEditForm.modifyGroup(group, locale, session, getResources(req),req.isUserInRole(UserManagerBase.ADMINISTRATOR));
    checkAccessRights(req, group);
    groupManager.modifyGroup(group);
    return mapping.findForward("modified");
  }
View Full Code Here

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    GroupEnterOrEditForm groupEnterOrEditForm = (GroupEnterOrEditForm) form;
    GroupManager groupMgm = new GroupManager(locale,session);
    Group group = groupMgm.getGroup(getGroupId(req))// groups never get deleted => always found
    checkAccessRights(req, group);
    groupEnterOrEditForm.initialize(group, locale, session, getResources(req));
    prepareSession(req, group);
    return mapping.findForward("edit");
  }
View Full Code Here

   * @param group  group to edit; null => new group
   */
  private void prepareSession(HttpServletRequest req, Group group) {
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    SmsSenderManager senderManager = new SmsSenderManager(locale, session);
    GroupManager groupMgm = new GroupManager(locale,session);
    req.getSession().setAttribute("senderList", senderManager.getSmsSenders());   
    req.getSession().setAttribute("clientProjects", groupMgm.getClientProjects());
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    List<Application> applications;
    if (group != null){
      applications = applicationManager.getApplications(group);
    } else {
View Full Code Here

      fragment = new Fragment();
    }
    fragment.setId(f.getId());
    fragment.setFragmentName(f.getName());
    fragment.setDescription(f.getDescription() == null || f.getDescription().trim().length() == 0 ? null : f.getDescription());
    GroupManager groupMgr = new GroupManager(locale, session);
    Group group = groupMgr.getGroup(f.getGroupId());
    fragment.setGroup(group);
    return fragment;
  }
View Full Code Here

    userSetAssignmentListForm.setUserSetId(userSet.getId());
 
     
    String[] choosenUsers = null;
    if(userSetAssignmentListForm.getDisplayAll() != null && userSetAssignmentListForm.getDisplayAll()){
      GroupManager groupMgm = new GroupManager(locale,session);
      users = groupMgm.getUsers(currentGroup, pageNumber, PAGE_SIZE, sortCriterion, sortOrderDb,true,filter);
      listFullSize = groupMgm.getUsers(currentGroup,true,filter).length;
      // create a list containing all users for which the check box should be selected
      choosenUsers = new String[users.length];
      for(int i=0;i<users.length;i++){
        if(userSetManager.isUserInUserset(userSet, users[i])){
          choosenUsers[i]= String.valueOf(users[i].getId());
View Full Code Here

    UserEnterOrEditForm f = this;
    if (user == null){
      user = new User();
    }
    user.setId(f.getId());
    GroupManager groupManager = new GroupManager(locale, session);
    Group group = groupManager.getGroup(f.getGroupId());
    user.setGroup(group);
    String username = f.getUsername();
    user.setUsername(username.length() == 0?null:username)// empty input means: no username
     if (f.getPassword().replaceAll("\\*", " ").trim().length() != 0){  // do not change existing (encoded) password if user did not edit the asterisks
       user.setPassword(f.getPassword().length() == 0 ? null : f.getPassword())// will be encoded during creation/modification
     }
    user.setTitle(f.getTitle().trim().length() == 0 ? null : f.getTitle());
    user.setFirstName(f.getFirstName().trim().length() == 0 ? null : f.getFirstName());
    user.setLastName(f.getLastName().trim().length() == 0 ? null : f.getLastName());
    user.setPersonalNumber(f.getPersonalNumber().trim().length() == 0 ? null : f.getPersonalNumber());
    user.setAddress(f.getAddress().trim().length() == 0 ? null : f.getAddress());
    user.setPostalCode(f.getPostalCode().trim().length() == 0 ? null : f.getPostalCode());
    user.setCity(f.getCity().trim().length() == 0 ? null : f.getCity());
    user.setState(f.getState().trim().length() == 0 ? null : f.getState());
    user.setEmail(f.getEmail().trim().length() == 0 ? null : f.getEmail());
    user.setFixedPhone(f.getFixedPhone().trim().length() == 0 ? null : f.getFixedPhone());
    String msisdn = "";
    if(f.getCountryCode() != null && f.getCountryCode().trim().length() >= 1){
      msisdn = f.getCountryCode();
    }

    if(f.getMobileNumber() != null && f.getMobileNumber().trim().length() >= 1){
      msisdn +=  Long.parseLong(f.getMobileNumber()); //the convertion is used to cut the leading zero
      user.setMsisdn(Long.parseLong(msisdn));
    } else {
      user.setMsisdn(null)// ignore also if only country code
    }
    user.setMobilePhoneProducer(f.getMobilePhoneProducer() != null ? f.getMobilePhoneProducer() : UserManager.PRODUCER_NOT_NOKIA);
   
    user.setExternallyModifiedAt(getDateTime(f.getExternallyModifiedAt(), f.getExternallyModifiedAtTime()));
   
    String[] selectedRoleIds = f.getSelectedRoleIds();
    Set<Role> roles = new HashSet<Role>();
    if (selectedRoleIds != null){
      for (String selectedRoleId : selectedRoleIds) {
        UserManager userManager = new UserManager(locale,session);
        Role role = userManager.getRole(Long.parseLong(selectedRoleId));
        if (role == null){
          throw new BugException("illegal role id");
        }
        roles.add(role);
      }
    }
    user.setRoles(roles)// may even be empty
    String birthDayParameter = f.getBirthDay();
    String birthMonthParameter = f.getBirthMonth();
    String birthYearParameter = f.getBirthYear();
    if (birthDayParameter.length() >= 1 && birthMonthParameter.length() >= 1 && birthYearParameter.length() >= 1) {
      int birthDay = Integer.parseInt(birthDayParameter);
      int birthMonth = Integer.parseInt(birthMonthParameter);
      int birthYear = Integer.parseInt(birthYearParameter);
      Calendar cal = Calendar.getInstance();
      cal.clear();
      cal.set(Calendar.DAY_OF_MONTH, birthDay);
      cal.set(Calendar.MONTH, birthMonth - 1);
      cal.set(Calendar.YEAR, birthYear);
      user.setBirthdate(cal.getTime());
    } else {
      user.setBirthdate(null);
    }
    String languageCode = f.getLanguage();
    if (languageCode.length() >= 2){
      user.setLocale(languageCode);
    } else {
      user.setLocale(null);
    }
    user.setUnlimitedRedemptions(f.getUnlimitedRedemptions() ? 1 : 0);
    user.setGroup(new GroupManager(locale,session).getGroup(f.getGroupId()));
   
    UserSetManager userSetMgr = new UserSetManager(locale, session);
    Set<UserSet> userSets = new HashSet<UserSet>();
    if (f.getUserSets() != null) {
      for (Long id : f.getUserSets()) {
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.GroupManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.