Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.Group


    if (breakInteractionEnterOrEditForm.getSortLabel() == null ||  breakInteractionEnterOrEditForm.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }

    BreakCommandEntry commandEntry = new BreakCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    commandEntry.setResultString(breakInteractionEnterOrEditForm.getResultString().length() == 0 ? null : breakInteractionEnterOrEditForm.getResultString())// empty input => null
    commandEntry.setSortLabel(breakInteractionEnterOrEditForm.getSortLabel());
    commandEntry.setTypeOfBreak(breakInteractionEnterOrEditForm.getTypeOfBreak());
View Full Code Here


   
    if (upcallForm.getJndiName() == null || upcallForm.getJndiName().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.NameMustBeProvided"));
    }
   
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    UpcallCommandEntry upcallCommandEntry = new UpcallCommandEntry();
    upcallCommandEntry.setGroup(group);
    upcallCommandEntry.setJndiName(upcallForm.getJndiName());
    upcallCommandEntry.setSortLabel(upcallForm.getSortLabel());
View Full Code Here

 
  /**
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    Group groupToDisplay = getCurrentGroup(req);
    SmsDbManager smsDbManager = new SmsDbManager(locale, session);
   
    List<Fragment> fragments = smsDbManager.getFragments(groupToDisplay);
    for (Fragment fragment : fragments) {  // fill the cache
      Hibernate.initialize(fragment);
View Full Code Here

    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
   
    ContentParseCommandEntry commandEntry = new ContentParseCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    transferFormValuesIntoCommandEntry(f, commandEntry);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Created content parser entry #" + commandEntry.getId());
    setCommandEntryInRequest(req, commandEntry);
View Full Code Here

    }

    smsInteractionEnterOrEditForm.setSortLabel(sortLabelProposalFromSession(req));
   
    smsInteractionEnterOrEditForm.setSortLabel(sortLabelProposalFromSession(req));
    Group group = groupFromSession(req);
    checkAccessRights(req, group);

    // user sets
    prepareUserSets(req, smsInteractionEnterOrEditForm, group);
   
    // destination users
    Set<User> users = new HashSet<User>()// no user selection possible here
    SortedSet<SmsDestinationAddress> userAddresses = SmsDestinationAddress.smsDestinationAddresses(users);
    prepareUser(req, smsInteractionEnterOrEditForm, userAddresses);

    // prepare templates
    prepareTemplate(req, smsInteractionEnterOrEditForm);
   
    String[] senderList = configuredSenderMsisdns(req, group,null);
    req.getSession().setAttribute("msisdnList",senderList);
    if (group.getDefaultSender() != null) {
      smsInteractionEnterOrEditForm.setSendingMsisdn(group.getDefaultSender().getMsisdn()+"");
    } else {
      smsInteractionEnterOrEditForm.setSendingMsisdn(senderList[0])// first one is default
    }
    req.getSession().setAttribute("interactionGroupName",group.getGroupname());

    req.getSession().setAttribute("enterOrEdit", "enter");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    return mapping.findForward("enter");
  }
View Full Code Here

   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    SmsInteractionEnterOrEditForm smsInteractionEnterOrEditForm = (SmsInteractionEnterOrEditForm) form;
    SmsCommandEntry smsCommandEntry = (SmsCommandEntry)commandEntryFromRequest(req);
    Group group = smsCommandEntry.getGroup();
    checkAccessRights(req, group);
    if (smsCommandEntry.getUseAsTemplate() == 1){
      req.getSession().setAttribute("attributeId", null)// application-independent selection lists in case of template editing
    }
   
    smsInteractionEnterOrEditForm.setCommandEntryId(smsCommandEntry.getId())// not to be used when editing
    smsInteractionEnterOrEditForm.setSortLabel(smsCommandEntry.getSortLabel());
    smsInteractionEnterOrEditForm.setMessage(smsCommandEntry.getTextContent());
    smsInteractionEnterOrEditForm.setDelayInSeconds(smsCommandEntry.getDelayInSeconds());
   
    prepareUserSets(req, smsInteractionEnterOrEditForm, group);
   
    // destination users (no users selectable because refresh does not work; already selected user may be inserted below)
    Set<User> users = new HashSet<User>();

    if(smsCommandEntry.getDestinationContact() == 1){
      smsInteractionEnterOrEditForm.setDestinationSelection(2);
      smsInteractionEnterOrEditForm.setCountryCode("43");
    } else if(smsCommandEntry.getDestinationUserSet() != null || smsCommandEntry.getCurrentUserSetAsDestination() == 1){
      smsInteractionEnterOrEditForm.setDestinationSelection(4);
      smsInteractionEnterOrEditForm.setUserSetId(smsCommandEntry.getDestinationUserSet() != null ? smsCommandEntry.getDestinationUserSet().getId() : -2);
      smsInteractionEnterOrEditForm.setCountryCode("43");
    } else if(smsCommandEntry.getDestinationUser() != null){
      smsInteractionEnterOrEditForm.setDestinationSelection(5);
      smsInteractionEnterOrEditForm.setUserId(smsCommandEntry.getDestinationUser().getId());
      users.add(smsCommandEntry.getDestinationUser());
      smsInteractionEnterOrEditForm.setCountryCode("43");
    } else if (smsCommandEntry.getDestinationMsisdn() != null){
      smsInteractionEnterOrEditForm.setDestinationSelection(6);
      smsInteractionEnterOrEditForm.setUserSetId(-1L);
      smsInteractionEnterOrEditForm.setCountryCode(UserManager.countryCode(smsCommandEntry.getDestinationMsisdn()));
      smsInteractionEnterOrEditForm.setMobileNumber(UserManager.mobileNumber(smsCommandEntry.getDestinationMsisdn()));
    } else { // the sender of the request is also the receiver
      smsInteractionEnterOrEditForm.setCountryCode("43");
      smsInteractionEnterOrEditForm.setDestinationSelection(1);
    }
    SortedSet<SmsDestinationAddress> userAddresses = SmsDestinationAddress.smsDestinationAddresses(users);
    prepareUser(req, smsInteractionEnterOrEditForm, userAddresses);

    String[] senderList = configuredSenderMsisdns(req, group,smsCommandEntry.getSender());
    smsInteractionEnterOrEditForm.setSendingMsisdn((smsCommandEntry.getSender() == null || senderList[0].startsWith("(")) ? senderList[0] :smsCommandEntry.getSender().getMsisdn() + "");

    req.getSession().setAttribute("msisdnList",senderList);
    req.getSession().setAttribute("interactionGroupName",group.getGroupname());

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<SmsCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(group, new SmsCommandEntry());
    req.getSession().setAttribute("templates",commandEntries);
   
View Full Code Here

    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof SmsCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    SmsCommandEntry smsCommandEntry = (SmsCommandEntry)commandEntry;
    Group group = smsCommandEntry.getGroup();
    checkAccessRights(req, group);
    commandEntryManager.evict(smsCommandEntry)// do not modify in this session yet (might be erroneous)

    String messageText = msgForm.getMessage();
    if (grossSmsMessageLength(messageText) > MAX_MESSAGE_TEXT_LENGTH){
View Full Code Here

    String messageText = msgForm.getMessage();
    if (grossSmsMessageLength(messageText) > MAX_MESSAGE_TEXT_LENGTH){
      throw new InputException(getResources(req).getMessage(locale,"smssvc.messageLongerThan450characters"));
    }
    SmsCommandEntry smsCommandEntry = new SmsCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    Sender sender = senderFromMsisdn(req, msgForm.getSendingMsisdn(), group);
    SmsTextValidator.checkForValidLatin1AndSmsAllowingPlaceholders(msgForm.getMessage(), locale);
    smsCommandEntry.setSender(sender);
    smsCommandEntry.setTextContent(messageText);
View Full Code Here

  }

  // prepares selection lists in session; optional storedMsisdn and storedEmail can be provided to always be included in the lists
  private void prepareSelectionLists(ActionForm form,HttpServletRequest req,Long storedMsisdn,String storedEmail) {
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Group group = groupPreparation(req, f.getGroupId());
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    SortedSet<InvocationEnterOrEditForm.SelectableMsisdn> selectableMsisdns = new TreeSet<InvocationEnterOrEditForm.SelectableMsisdn>();
    SortedSet<InvocationEnterOrEditForm.SelectableEmail> selectableEmails = new TreeSet<InvocationEnterOrEditForm.SelectableEmail>();
    String storedMsisdnLabel = null;
    String storedEmailLabel = null;
View Full Code Here

  @SuppressWarnings("unchecked")
  public ActionForward enter(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    SmsSendForm smsSendForm = (SmsSendForm) form;
    smsSendForm.setSendConfirmationPending(false);

    Group group = getCurrentGroup(req);

    // template selector: first set content from the template, if selected; content will be changed later if not allowed (except destination group, which  has to be checked explicitly)
    prepareTemplate(req, smsSendForm, group, new SmsCommandEntry());

    // set defaults, if no user or template entries

    if (smsSendForm.getDestinationSelection() == null){
      smsSendForm.setDestinationSelection(-1)// none selected
    }
    if ((smsSendForm.getCountryCode() == null || smsSendForm.getCountryCode().length() == 0)
        && (smsSendForm.getMobileNumber() == null || smsSendForm.getMobileNumber().length() == 0)){
      smsSendForm.setCountryCode("43")// we are from Austria
    }

    // user sets
    UserSet userSet = prepareUserSets(req, smsSendForm, group);

    // destination users
    Set<User> users = userSet == null ? group.getUsers() : userSet.getUsers();
    SortedSet<SmsDestinationAddress> userAddresses = SmsDestinationAddress.smsDestinationAddresses(users);
    prepareUser(req, smsSendForm, userAddresses);

    // senders
    SmsSenderManager smsSenderManager = new SmsSenderManager(locale,session);
    List<Sender> senders = smsSenderManager.getSmsSenders(group,null);
    Long senderId = smsSendForm.getSenderId();
    if (senderId != null){
      Sender sender = smsSenderManager.getSmsSenderById(senderId);
      if (sender == null || !smsSenderManager.isValidForGroup(sender, group)){
        senderId = null;
      }
    }
    if (senderId == null) {
      if (group.getDefaultSender() != null
        && smsSenderManager.isValidForGroup(group.getDefaultSender(), group)
        && senders.contains(group.getDefaultSender())) {
        smsSendForm.setSenderId(group.getDefaultSender().getId());
      } else {
        smsSendForm.setSenderId(senders.size() == 0 ? -1 : senders.get(0).getId())// default the first one
      }
    }
    req.getSession().setAttribute("senders", senders);
    req.getSession().setAttribute("groupName",group.getGroupname());
   
    // initial send date
    prepareSendDate(smsSendForm);
   
    saveToken(req);
View Full Code Here

TOP

Related Classes of evolaris.framework.um.datamodel.Group

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.