Package evolaris.platform.smssvc.web.form

Examples of evolaris.platform.smssvc.web.form.EmailInteractionEnterOrEditForm


   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward enter(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    EmailInteractionEnterOrEditForm emailInteractionEnterOrEditForm = (EmailInteractionEnterOrEditForm) form;

    if (emailInteractionEnterOrEditForm.getDestinationSelection() == null || emailInteractionEnterOrEditForm.getDestinationSelection() <= 0){
      emailInteractionEnterOrEditForm.setDestinationSelection(0)// initially select the sender as destination
    }
   
   
    Group group = groupFromSession(req);
    checkAccessRights(req, group);

    prepareEmailSenderAddress(emailInteractionEnterOrEditForm);
   
    // user sets
    prepareUserSets(req, emailInteractionEnterOrEditForm, group);
   
    // prepare templates
    prepareTemplate(req, emailInteractionEnterOrEditForm);
   
    emailInteractionEnterOrEditForm.setSortLabel(sortLabelProposalFromSession(req));
   
    // destination users
    Set<User> users = new HashSet<User>()// no user selection possible here
    SortedSet<EmailAddress> userAddresses = EmailAddress.availableAddresses(users);
    prepareUser(req, emailInteractionEnterOrEditForm, userAddresses);
View Full Code Here


   *      org.apache.struts.action.ActionForm,
   *      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);
   
View Full Code Here

   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    EmailInteractionEnterOrEditForm f = (EmailInteractionEnterOrEditForm) form;
    long commandEntryId = f.getCommandEntryId();
    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

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  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

  private ActionForward getFormDataByTemplate(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
   
    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

Related Classes of evolaris.platform.smssvc.web.form.EmailInteractionEnterOrEditForm

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.