Package org.apache.struts.action

Examples of org.apache.struts.action.DynaActionForm


    int entityID = userObject.getEntityId();    // entityID of the logged-in user's entity
   
    ActionErrors allErrors = new ActionErrors();

    // "customerFaqForm", defined in cv-struts-config.xml
    DynaActionForm faqForm = (DynaActionForm)form;

    try {
      // get the event ID from the form bean
      Integer formFaqID = (Integer)faqForm.get("faqID");
      // create an int to hold the faq ID value
      int faqID = 0;

      // now, check the faq ID on the form...
      if (formFaqID == null) {
        // if faq ID is not set on the form, then there is
        // no point in continuing forward. Show the user an
        // error and quit.
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "FAQ ID"));
        return(mapping.findForward(forward));
      }else{
        // if faq ID is set on the form properly, then set
        // the int representation for use in the code below
        faqID = formFaqID.intValue();
      }
     
      FaqHome home = (FaqHome)CVUtility.getHomeObject("com.centraview.support.faq.FaqHome", "Faq");
      Faq remote = home.create();
      remote.setDataSource(dataSource);
     
      FaqVO faqDetail = remote.getFaq(individualID, faqID);

      faqForm.set("title", faqDetail.getTitle());
     
      SupportFacadeHome supFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade supRemote = supFacade.create();
      supRemote.setDataSource(dataSource);
     
      QuestionList questionList = supRemote.getQuestionList(individualID, faqID);

      ArrayList qList = new ArrayList();
     
      Set listkey = questionList.keySet();
      Iterator iter = listkey.iterator();
      while (iter.hasNext()) {
        String key = (String)iter.next();
        ListElement row = (ListElement)questionList.get(key);

        HashMap questionInfo = new HashMap();
       
        StringMember questionField = (StringMember)row.get("Question");
        StringMember answerField = (StringMember)row.get("Answer");
       
        questionInfo.put("questionID", new Integer(row.getElementID()));
        questionInfo.put("question", (String)questionField.getMemberValue());
        questionInfo.put("answer", (String)answerField.getMemberValue());
        qList.add(questionInfo);
      }

      faqForm.set("questionList", qList);

    }catch(Exception e){
      System.out.println("[Exception][CV ViewEventHandler] Exception thrown in execute(): " + e);
    }
    return(mapping.findForward(forward));
View Full Code Here


  {
    HttpSession session            = request.getSession(true);
    UserObject userobjectd         = (UserObject) session.getAttribute("userobject");
    int individualID = userobjectd.getIndividualID();
   
    DynaActionForm dynaForm        = (DynaActionForm) form;
    eventid = (String)dynaForm.get("eventid");
    String strAction = request.getParameter("action");     
   
    if(strAction !=null && !strAction.equalsIgnoreCase("cancel"))
    {
    MailMessage mailmessage  = new MailMessage();
    HashMap hm               = new HashMap();
      String mailTo = (String)dynaForm.get("composeTo");
      String mailFrom = (String)dynaForm.get("composeFrom");
      String subject = (String)dynaForm.get("composeSubject");
      String body = (String)dynaForm.get("composeMessage");
      String replyTo = (String)dynaForm.get("composeReplyTo");

      mailmessage.setMailFrom(mailFrom);
      mailmessage.setSubject(subject);
      mailmessage.setBody(body);
      mailmessage.setReplyTo(replyTo);
 
      String accountid               = (String) dynaForm.get("accountID");
      mailmessage.setAccountID(Integer.parseInt(accountid));
 
      FolderList fl                  = (FolderList) session.getAttribute("folderlist");
      Set listkey                    = fl.keySet();
      Iterator it                    = listkey.iterator();
View Full Code Here

    int individualID = userObject.getIndividualID();    // logged in user
    int entityID = userObject.getIndividualID();    // logged in user's entityID

    // "customerKBListForm" defined in cv-struts-config.xml
    DynaActionForm kbForm = (DynaActionForm)form;

    ActionErrors allErrors = new ActionErrors();

    try
    {
      Integer formCategoryID = (Integer)kbForm.get("categoryID");
      int categoryID = 0;

      if (formCategoryID == null)
      {
        categoryID = 1;
View Full Code Here

    int entityID = userObject.getEntityId();    // entityID of the logged-in user's entity

    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();
      String fromAddress = custProfileTemplateForm.getFromAddress();
      String replyTo = custProfileTemplateForm.getReplyTo();
      String emailSubject = custProfileTemplateForm.getSubject();
      String emailBody = custProfileTemplateForm.getBody();
     
      MailMessageVO mailMessage = new MailMessageVO();
      ArrayList toList = new ArrayList();
      toList.add(toAddress);
      mailMessage.setToList(toList);
      mailMessage.setHeaders("Change Of Profile Information");
      mailMessage.setContentType("text/plain");
      mailMessage.setFromAddress(fromAddress);
      mailMessage.setReplyTo(replyTo);
      mailMessage.setSubject(emailSubject);
     
      StringBuffer body = new StringBuffer("");
      body.append(emailBody);
      body.append("\n\nCustomer Profile Change Request:\n\n");
     
      DynaActionForm dynaForm = (DynaActionForm)form;
     
      String entityName = (String)dynaForm.get("entityName");
      body.append("Entity Name: " + entityName + "\n");
     
      String website = (String)dynaForm.get("website");
      body.append("Website: " + website + "\n");
     
      String street1 = (String)dynaForm.get("street1");
      body.append("Street1: " + street1 + "\n");
     
      String street2 = (String)dynaForm.get("street2");
      body.append("Street2: " + street2 + "\n");
     
      String city = (String)dynaForm.get("city");
      body.append("City: " + city + "\n");
     
      String state = (String)dynaForm.get("state");
      body.append("State: " + state + "\n");
     
      String zipCode = (String)dynaForm.get("zipCode");
      body.append("Zip Code: " + zipCode + "\n");
     
      String country = (String)dynaForm.get("country");
      body.append("Country: " + country + "\n");
     
      String mocContent = "";
      String mocTypeName = "";
      if (dynaForm.get("email") != null) {
        mocContent = (dynaForm.get("email") == null) ? "" : (String)dynaForm.get("email");
        body.append("Email: " + mocContent + "\n");
      }
     
      for (int i = 1; i < 4; i++) {
        mocContent = CVUtility.getMOCContent(dynaForm, i + "");
        int mocType = Integer.parseInt((String)dynaForm.get("mocType" + i));
        mocTypeName = CVUtility.getSyncAs(mocType);
        body.append(mocTypeName + ": " + mocContent + "\n");
      }
     
      body.append("\n\nEnd CentraView Web Request\n");
View Full Code Here

   
    ActionErrors allErrors = new ActionErrors();
    String forward = ".view.email.editfolder";
   
    // "mailFolderForm", defined in struts-config-email.xml
    DynaActionForm folderForm = (DynaActionForm)form;

    try
    {
      // get the folder ID from the form bean
      Integer folderID = (Integer)folderForm.get("folderID");
     
      // now, check the folder ID on the form...
      if (folderID == null || folderID.intValue() <= 0 )
      {
        // if folder ID is not set on the form, then there is
        // no point in continuing forward. Show user the door. :-)
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Folder ID"));
        return(mapping.findForward(forward));
      }
     
      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
      remote.setDataSource(dataSource);

      MailFolderVO folderVO = remote.getEmailFolder(folderID.intValue());

      folderForm.set("folderName", folderVO.getFolderName());
      folderForm.set("folderType", folderVO.getFolderType());
      folderForm.set("totalMessages", folderVO.getTotalMessage());
      folderForm.set("hasSubFolders", new Boolean(folderVO.hasSubFolders()));

      int parentID = folderVO.getParentID();
     
      // get the parentID from the request. If it is set, that means
      // that the user has selected a new parent folder, and the page
      // has been refreshed. So we need to generate the full path based
      // on the given parentID, and not the parentID from the database.
      Integer formParentID = (Integer)folderForm.get("parentID");
     
      if (formParentID != null && formParentID.intValue() > 0)
      {
        parentID = formParentID.intValue();
      }
     
      // generate the fullPath to the parent folder
      ArrayList fullPathList = (ArrayList)remote.getFolderFullPath(parentID);
      StringBuffer fullPath = new StringBuffer("");
      if (fullPathList != null)
      {
        Iterator pathIter = fullPathList.iterator();
        while (pathIter.hasNext())
        {
          HashMap folderInfo = (HashMap)pathIter.next();
          fullPath.append("/" + (String)folderInfo.get("name"));
        }
      }
      folderForm.set("fullPath", fullPath.toString());
      folderForm.set("parentID", new Integer(parentID));

    }catch(Exception e){
      System.out.println("[Exception][ViewFolderHandler] Exception thrown in execute(): " + e);
      e.printStackTrace();
    }
View Full Code Here

     
     
     
     
     
      DynaActionForm dynaform = (DynaActionForm)form;
      System.out.println("block::"+request.getParameter("Block"));
      System.out.println("dynaform "+dynaform );   
     
      if ( (request.getParameter("Block") != null) && (request.getParameter("Block").equals("true") ) )
      {
View Full Code Here

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    String returnStatus = "";

    try {
      DynaActionForm dynaForm = (DynaActionForm)form;
      HttpSession session = request.getSession(true);
      session.setAttribute("highlightmodule", "preferences");

      int individualID = 0;
      UserObject userObject = (UserObject)session.getAttribute("userobject");

      if (userObject != null) {
        // get current user's individualID
        individualID = userObject.getIndividualID();
      }
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = prefHome.create();
      prefRemote.setDataSource(dataSource);
      UserPrefererences up = prefRemote.getUserPreferences(individualID);

      //UserPrefererences up  = userObject.getUserPref();
      dynaForm.set("minutes", up.getCalendarRefreshMin());
      dynaForm.set("seconds", up.getCalendarRefreshSec());
      dynaForm.set("radio", up.getCalendarDefaultView());

      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "CALENDAR");
      FORWARD_final = FORWARD_calendarpage;
    } catch (Exception e) {
      System.out.println("[Exception][DisplayCalendarHandler.execute] Exception Thrown: " + e);
View Full Code Here

      if (userObject != null) {
        individualID = userObject.getIndividualID();
      }
     
      DynaActionForm composeForm = (DynaActionForm)form;

      UserPrefererences userPref = prefRemote.getUserPreferences(individualID);
      request.setAttribute("emailComposition", userPref.getContentType());

      composeForm.set("composeType", userPref.getContentType());

      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "EMAILCOMPOSITION");
      FORWARD_final = FORWARD_emailcompositionpage;
    } catch (Exception e) {
      System.out.println("[Exception][DisplayEmailComposition.execute] Exception Thrown: " + e);
View Full Code Here

      HttpSession session = request.getSession(true);
      UserObject userobjectd = (UserObject)session.getAttribute("userobject");
      int individualID = userobjectd.getIndividualID();

      String messageBody = (String)session.getAttribute("emailmessage");
      DynaActionForm dynaForm = (DynaActionForm)form;

      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);

      StringTokenizer st = new StringTokenizer(messageBody, Constants.EH_HEADER_DELIMETER);

      while (st.hasMoreTokens())
      {
        String fullHeader = st.nextToken();

        String strhead = (fullHeader.substring(0, fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER))).trim();
        String strValue = (fullHeader.substring(fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER) + 1)).trim();

        if (strhead.equals("street1"))
          dynaForm.set("street1", strValue);
        else if (strhead.equals("street2"))
          dynaForm.set("street2", strValue);
        else if (strhead.equals("city"))
          dynaForm.set("city", strValue);
        else if (strhead.equals("state"))
        {
          Collection stateCol = (Collection)gml.get("States");

          Iterator stateIter = stateCol.iterator();
          while (stateIter.hasNext())
          {
            DDNameValue ddname = (DDNameValue)stateIter.next();

            if ((ddname.getName()).equals(strValue))
            {
              dynaForm.set("state", (new Integer(ddname.getId())).toString());
              break;
            }
          }
        } else if (strhead.equals("zip"))
          dynaForm.set("zip", strValue);
        else if (strhead.equals("country"))
        {
          Collection countryCol = (Collection)gml.get("Country");

          Iterator stateIter = countryCol.iterator();
          while (stateIter.hasNext())
          {
            DDNameValue ddname = (DDNameValue)stateIter.next();

            if ((ddname.getName()).equals(strValue))
              dynaForm.set("country", (new Integer(ddname.getId())).toString());

          }
        } else if (strhead.equals("title"))
          dynaForm.set("title", strValue);
        else if (strhead.equals("source"))
          dynaForm.set("source", strValue);
        else if (strhead.equals("firstname"))
          dynaForm.set("firstname", strValue);
        else if (strhead.equals("lastname"))
          dynaForm.set("lastname", strValue);
        else if (strhead.equals("middlename"))
          dynaForm.set("middlename", strValue);
        else if (strhead.equals("entity"))
          dynaForm.set("entity", strValue);
        else if (strhead.equals("entity1"))
          dynaForm.set("entity1", strValue);
        else if (strhead.equals("Fax"))
        {
          Collection mocFax = (Collection)gml.get("MOC");

          Iterator mocFaxIter = mocFax.iterator();
          while (mocFaxIter.hasNext())
          {
            DDNameValue ddnameFax = (DDNameValue)mocFaxIter.next();

            if ((ddnameFax.getName()).equals(strhead))
            {
              dynaForm.set("mocType1", (new Integer(ddnameFax.getId())).toString());
              dynaForm.set("moc1", strValue);
            }
          }

        } else if (strhead.equals("Phone")) {
          Collection mocPhone = (Collection)gml.get("MOC");

          Iterator mocPhoneIter = mocPhone.iterator();
          while (mocPhoneIter.hasNext())
          {
            DDNameValue ddnamePhone = (DDNameValue)mocPhoneIter.next();

            if ((ddnamePhone.getName()).equals(strhead))
            {
              dynaForm.set("mocType2", (new Integer(ddnamePhone.getId())).toString());
              dynaForm.set("moc2", strValue);
            }
          }
        } else if (strhead.equals("Mobile"))
        {
          Collection mocMobile = (Collection)gml.get("MOC");

          Iterator mocMobileIter = mocMobile.iterator();
          while (mocMobileIter.hasNext())
          {
            DDNameValue ddnameMobile = (DDNameValue)mocMobileIter.next();

            if ((ddnameMobile.getName()).equals(strhead))
            {
              dynaForm.set("mocType3", (new Integer(ddnameMobile.getId())).toString());
              dynaForm.set("moc3", strValue);
            }
          }
        }
      }
View Full Code Here

      if(request.getParameter(MarketingConstantKeys.TYPEOFOPERATION)!= null
         && (request.getParameter(MarketingConstantKeys.TYPEOFOPERATION)).equals("DUPLICATE")){
           duplicateEvent = true;
      }
     
      DynaActionForm dynaForm = (DynaActionForm)form;

      String eventID = (String)dynaForm.get("eventid");
      if (eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      }
      eventID = (String)request.getParameter("eventid");
      if (eventid == 0 &&  eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      } //end of if statement  (eventid == 0)
      eventID = (String)request.getAttribute("eventid");
      if (eventid == 0 &&  eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      }
      request.setAttribute("eventid",eventid+"");

      eventDetails = remote.getEventDetails(individualId, eventid);
      eventDetails.setEventid(eventid);
      dynaForm.set("eventid", "" + eventid);
      dynaForm.set("name", eventDetails.getName());
      dynaForm.set("description", eventDetails.getDetail());
      dynaForm.set("whoshouldattend", eventDetails.getWhoshouldattend());
      dynaForm.set("maxattendees", "" + eventDetails.getMaxattendees());
      dynaForm.set("moderatorid", "" + eventDetails.getModeratorid());
      dynaForm.set("moderatorname", eventDetails.getModeratorname());

      Calendar calendar = new GregorianCalendar();

      if (eventDetails.getStartdate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getStartdate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("startmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("startday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("startyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("starttime", strTime);
      }

      if (eventDetails.getEnddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getEnddate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("endmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("endday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("endyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("endtime", strTime);
      }

      if (eventDetails.getCreateddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getCreateddate();
        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("createddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }

      if (eventDetails.getModifieddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getModifieddate();

        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("modifieddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }

          if (!duplicateEvent)
          {
        try
        {
          boolean accepted = remote.hasUserAcceptedEvent(eventid, individualId);
          request.setAttribute("showRegisterButton", new Boolean(true));
          request.setAttribute("hasAccepted", new Boolean(accepted));
        }
        catch (IndividualNotInvitedException inie)
        {
          request.setAttribute("showRegisterButton", new Boolean(false));
          request.setAttribute("hasAccepted", new Boolean(false));
        }
        this.buildSubList(eventDetails.getEventid(), userObject, request, session, dataSource);
      }
      //End of Get whether this user is registered or not

      if (duplicateEvent)
      {
        dynaForm.set("eventid", "");
        returnStatus = ".view.marketing.new.event";
        EventAtendeesList dl = new EventAtendeesList();
        dl.setStartAT(1);
        dl.setEndAT(100);
        dl.setSortType('A');
View Full Code Here

TOP

Related Classes of org.apache.struts.action.DynaActionForm

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.