Package org.dspace.app.webui.cris.dto

Examples of org.dspace.app.webui.cris.dto.MailDTO


  public boolean supports(Class arg0) {
    return clazz.isAssignableFrom(arg0);
  }
 
  public void validate(Object arg0, Errors arg1) {
      MailDTO dto = (MailDTO)arg0;
      if(dto.getText()==null || dto.getText().isEmpty()) {
          arg1.reject("error.textmail.mandatory", "Mail text is mandatory");
      }   
  }
View Full Code Here


        {
            id = Integer.parseInt(id_s);
        }
        ResearcherPage researcher = applicationService.get(
                ResearcherPage.class, id);
        MailDTO dto = new MailDTO();
        dto.setSubmitter(researcher.getId());
        dto.setRp(ResearcherPageUtils.getPersistentIdentifier(researcher));
        Locale supportedLocale = request.getLocale();
        ResourceBundle labels = ResourceBundle.getBundle("Messages",
                supportedLocale);
        switch (mode)
        {

        case MODE_BIBLIOMETRIC:
            dto.setTemplate(TEMPLATE_BIBLIOMETRIC);
            dto.setSubject(labels
                    .getString("subject.mail.hku.request-changes.two"));
            break;

        case MODE_ITEMS:
            dto.setTemplate(TEMPLATE_ITEMS);
            dto.setSubject(labels
                    .getString("subject.mail.hku.request-changes.three"));
            break;

        default:
            dto.setTemplate(TEMPLATE_MEDIA);
            dto.setSubject(labels
                    .getString("subject.mail.hku.request-changes.one"));
            break;
        }
        return dto;
    }
View Full Code Here

    protected ModelAndView onSubmit(HttpServletRequest request,
            HttpServletResponse response, Object command, BindException errors)
            throws Exception
    {

        MailDTO dto = (MailDTO) command;

        // send mail
        Email email = Email.getEmail(ConfigurationManager
                .getProperty("dspace.dir")
                + File.separatorChar
                + "config"
                + File.separatorChar
                + "emails"
                + File.separatorChar + dto.getTemplate());
        email.addArgument(dto.getRp());
        email.addArgument(dto.getText());
        email.addRecipient(ConfigurationManager
                .getProperty("feedback.recipient"));
        email.setReplyTo(UIUtil.obtainContext(request).getCurrentUser()
                .getEmail());
        email.send();
        return new ModelAndView(getSuccessView() + dto.getRp());
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.webui.cris.dto.MailDTO

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.