Examples of EmailCommandEntry


Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

   * @return  created/modified entry
   */
  public EmailCommandEntry toEntry(EmailCommandEntry emailCommandEntry, Locale locale, Session session, MessageResources resources) {
    EmailInteractionEnterOrEditForm f = this;
    if (emailCommandEntry == null){
      emailCommandEntry = new EmailCommandEntry();
    }
    emailCommandEntry.setId(f.getCommandEntryId());
    emailCommandEntry.setSortLabel(f.getSortLabel().trim().length() == 0 ? null : f.getSortLabel());
    emailCommandEntry.setMimeType(f.getMimeType());
    emailCommandEntry.setSubject(f.getSubject());
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

    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, emailSendForm, group, new EmailCommandEntry());

    // set defaults, if no user or template entries

    if (emailSendForm.getDestinationSelection() == null){
      emailSendForm.setDestinationSelection(-1)// none selected
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

    DisplayableInteractionContent[] interactions = null;
    SortedSet<CommandEntry> sortedCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.TemplateCommandEntryComparator());
    for (CommandEntry entry : templates) {
      if(!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) && entry.getClass().isInstance(new UpcallCommandEntry())
          || !req.isUserInRole(SmsDbManager.SMS_SENDER) && entry.getClass().isInstance(new SmsCommandEntry())
          || !req.isUserInRole(SmsDbManager.EMAIL_SENDER) && entry.getClass().isInstance(new EmailCommandEntry())){
        // only users in role interaction_administrator are allowed to view upcall command templates,
        // users in roles sms_sender / email_sender are allowed to see sms / email templates
      } else {
        sortedCommandEntries.add(entry);
      }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    EmailInteractionEnterOrEditForm emailInteractionEnterOrEditForm = (EmailInteractionEnterOrEditForm) form;
    EmailCommandEntry emailCommandEntry = (EmailCommandEntry)commandEntryFromRequest(req);
    Group group = emailCommandEntry.getGroup();
    checkAccessRights(req, group);
    if (emailCommandEntry.getUseAsTemplate() == 1){
      req.getSession().setAttribute("attributeId", null)// application-independent selection lists in case of template editing
    }

    emailInteractionEnterOrEditForm.initialize(emailCommandEntry,false);

    prepareUserSets(req, emailInteractionEnterOrEditForm, 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 (emailInteractionEnterOrEditForm.getUserId() != null && emailInteractionEnterOrEditForm.getUserId() >= 1){
      users.add(emailCommandEntry.getDestinationUser());
    }
    SortedSet<EmailAddress> userAddresses = EmailAddress.availableAddresses(users);
    prepareUser(req, emailInteractionEnterOrEditForm, userAddresses);
   
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<EmailCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(group, new EmailCommandEntry());
    req.getSession().setAttribute("templates",commandEntries);

    req.getSession().setAttribute("interactionGroupName",group.getGroupname());
    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof EmailCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    EmailCommandEntry emailCommandEntry = (EmailCommandEntry)commandEntry;
    Group group = emailCommandEntry.getGroup();
    checkAccessRights(req, group);
    commandEntryManager.evict(emailCommandEntry)// do not modify in this session yet (might be erroneous)
    f.toEntry(emailCommandEntry, locale, session, getResources(req));
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase()
        + ": Modified message command entry #" + emailCommandEntry.getId()
        + "; label: " + emailCommandEntry.getSortLabel() + "; subject: " + emailCommandEntry.getSubject());
    setCommandEntryInRequest(req, emailCommandEntry);
    return mapping.findForward("modified");
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

   */
  public ActionForward create(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {

    EmailInteractionEnterOrEditForm f = (EmailInteractionEnterOrEditForm) form;

    EmailCommandEntry emailCommandEntry = new EmailCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    emailCommandEntry.setGroup(group);
    f.toEntry(emailCommandEntry, locale, session, getResources(req));
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase()
        + ": Created message command entry #" + emailCommandEntry.getId()
        + "; label: " + emailCommandEntry.getSortLabel() + "; with subject: " + emailCommandEntry.getSubject());
    setCommandEntryInRequest(req, emailCommandEntry);
    return mapping.findForward("created");
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

   */
  @SuppressWarnings("unchecked")
  private void prepareTemplate(HttpServletRequest req, EmailInteractionEnterOrEditForm sendForm) {

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<EmailCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(groupFromSession(req), new EmailCommandEntry());
    req.getSession().setAttribute("templates",commandEntries);

    Long selectedTemplateId = sendForm.getTemplateId();
    sendForm.setTemplateId(-1L)// none selected
    if (selectedTemplateId != null && selectedTemplateId != -1){
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.EmailCommandEntry

    Long selectedTemplateId = Long.parseLong(req.getParameter("id"));
   
    if (selectedTemplateId != null && selectedTemplateId != -1){
      EmailInteractionEnterOrEditForm f = new EmailInteractionEnterOrEditForm();
      CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
      EmailCommandEntry templateEntry = (EmailCommandEntry)commandEntryManager.getCommandEntry(selectedTemplateId);
      f.initializeFromTemplate(templateEntry);
     
      JSONObject jsonObject = JSONObject.fromObject(f);
      writeJsonResult(jsonObject.toString(), resp);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.