Package com.centraview.administration.emailsettings

Examples of com.centraview.administration.emailsettings.EmailSettingsHome


    ActionErrors allErrors = new ActionErrors();

    // "customerProfileForm", defined in cv-struts-config.xml
    DynaActionForm profileForm = (DynaActionForm)form;
   
    EmailSettingsHome emailSettingsHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
   
    try {
      EmailSettings emailSettingsRemote = (EmailSettings)emailSettingsHome.create();
      emailSettingsRemote.setDataSource(dataSource);
     
      // Its a predefined Template for the replying message for the Change Of Profile Information
      EmailTemplateForm custProfileTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_CUST_PROFILE);
      String toAddress = custProfileTemplateForm.getToAddress();
View Full Code Here


    ActionErrors allErrors = new ActionErrors();

    DynaActionForm profileForm = (DynaActionForm)form;

  EmailSettingsHome emailSettingsHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
   
    try {
    EmailSettings emailSettingsRemote = (EmailSettings)emailSettingsHome.create();
    emailSettingsRemote.setDataSource(dataSource);

    // Its a predefined Template for the replying message for the Change Of user Information Information
    EmailTemplateForm userInfoTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_USER_PROFILE);
    String toAddress = userInfoTemplateForm.getToAddress();
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
      String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    EmailSettingsHome emailSettingsHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
    try
    {
      HttpSession session = request.getSession(true);
      UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );
      int individualID = userobjectd.getIndividualID();

      DynaActionForm dynaForm = (DynaActionForm)form;
      String body = (String) dynaForm.get( "suggestion" );

      EmailSettings emailSettingsRemote = (EmailSettings)emailSettingsHome.create();
      emailSettingsRemote.setDataSource(dataSource);

      // Its a predefined Template for the replying message for the newly created Suggestion
      EmailTemplateForm suggestionTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUGGESTIONBOX);
      String toAddress = suggestionTemplateForm.getToAddress();
View Full Code Here

          "com.centraview.administration.user.UserHome", "User");
          User remoteUser = (User) ab.create();
          remoteUser.setDataSource(dataSource);
          remoteUser.setNewPassword(individualID, rand);

          EmailSettingsHome emailSettingsHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
          EmailSettings emailSettingsRemote = (EmailSettings)emailSettingsHome.create();
          emailSettingsRemote.setDataSource(dataSource);

          // Its a predefined Template for the replying message for the Forgot Password
          EmailTemplateForm forgotPasswordTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_FORGOT_PASSWORD);
          String fromAddress = forgotPasswordTemplateForm.getFromAddress();
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    EmailSettingsHome emailSettingsHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome", "EmailSettings");
   
    try {
      EmailTemplateForm emailTemplateForm = (EmailTemplateForm) form;
      ActionErrors allErrors = new ActionErrors();

      boolean requiredToAddress = emailTemplateForm.getRequiredToAddress();
      boolean requiredFromAddress = emailTemplateForm.getRequiredFromAddress();
      boolean requiredSubject = emailTemplateForm.getRequiredSubject();
      boolean requiredBody = emailTemplateForm.getRequiredBody();

      String toAddress = emailTemplateForm.getToAddress();
      String fromAddress = emailTemplateForm.getFromAddress();
      String replyTo = emailTemplateForm.getReplyTo();
      String subject = emailTemplateForm.getSubject();
      String body = emailTemplateForm.getBody();

      if (replyTo != null) {
        if (replyTo.equals("")) {
          emailTemplateForm.setReplyTo(null);
          replyTo = null;
        } else {
          if (! CVUtility.isEmailAddressValid(replyTo)) {
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.email.invalidAddress", "ReplyTo"));
          }
        }
      }

      if (requiredToAddress) {
        if (toAddress == null || toAddress.length() <= 0) {
          allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "To"));
        }
        if (toAddress != null) {
          if (! CVUtility.isEmailAddressValid(toAddress)) {
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.email.invalidAddress", "To"));
          }
        }
      }

      if (requiredFromAddress) {
        if (fromAddress == null || fromAddress.length() <= 0) {
          allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "From"));
        }
        if (fromAddress != null) {
          if (! CVUtility.isEmailAddressValid(fromAddress)){
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.email.invalidAddress", "From"));
          }
        }
      }
     
      if (requiredSubject) {
        if (subject == null || subject.length() <= 0) {
          allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Subject"));
        }
      }
     
      if (requiredBody) {
        if (body == null || body.length() <= 0) {
          allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Body"));
        }
      }
     
      if (! allErrors.isEmpty()) {
        saveErrors(request, allErrors);
        return(mapping.findForward(FORWARD_error));
      }
     
      EmailSettings emailSettingsRemote = (EmailSettings) emailSettingsHome.create();
      emailSettingsRemote.setDataSource(dataSource);
      emailSettingsRemote.updateEmailTemplate(emailTemplateForm);
     
      FORWARD_final = FORWARD_save;
    } catch (Exception e) {
View Full Code Here

  public ActionForward execute(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    EmailSettingsHome emailSettingHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
    try {
      HttpSession session = request.getSession();

      EmailSettings emailSettingRemote = (EmailSettings)emailSettingHome.create();
      emailSettingRemote.setDataSource(dataSource);

      String tempTemplateID = request.getParameter("templateID");
      if (tempTemplateID != null && !tempTemplateID.equals("")) {
        int templateID = Integer.parseInt(tempTemplateID);
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    EmailSettingsHome emailSettingsHome = (EmailSettingsHome) CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
   
    try {
      DynaActionForm dynaForm = (DynaActionForm) form;
      EmailSettings emailSettingsRemote = (EmailSettings) emailSettingsHome.create();
      emailSettingsRemote.setDataSource(dataSource);
     
      EmailSettingsVOX emailSettingsVOX = new EmailSettingsVOX(dynaForm);
      EmailSettingsVO emailSettingVO = emailSettingsVOX.getVO();
View Full Code Here

  public ActionForward execute(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    EmailSettingsHome emailSettingHome = (EmailSettingsHome)CVUtility.getHomeObject("com.centraview.administration.emailsettings.EmailSettingsHome","EmailSettings");
   
    try {
      DynaActionForm dynaForm = (DynaActionForm)form;

      EmailSettings emailSettingRemote = (EmailSettings)emailSettingHome.create();
      emailSettingRemote.setDataSource(dataSource);

      EmailSettingsVO emailSettingVO = emailSettingRemote.getEmailSettings();

      dynaForm = setForm(dynaForm,emailSettingVO);
View Full Code Here

TOP

Related Classes of com.centraview.administration.emailsettings.EmailSettingsHome

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.