Package org.apache.struts.action

Examples of org.apache.struts.action.DynaActionForm


    UserObject userObject = (UserObject)session.getAttribute("userobject");

    int individualIDsession = userObject.getIndividualID();    // logged in user

    // "sycnContactForm", defined in struts-config-sync.xml
    DynaActionForm contactForm = (DynaActionForm)form;
    SyncUtils syncUtils = new SyncUtils();

    try
    {
      // check to see if CompanionLink Agent has signed in
View Full Code Here


    {
        String nextURL = "addadhocreport";
        try
        {
            HttpSession session = request.getSession();
            DynaActionForm reportForm = null;
            ReportVO reportVO = null;

            UserObject userObject = (UserObject)session.getAttribute("userobject");
            int individualId = userObject.getIndividualID();

            String rowId[] = null;
            if(request.getParameterValues("rowId") != null)
            {
                rowId = request.getParameterValues("rowId");
            }

            ReportFacade remote = getReportFacade();
            reportVO = remote.getAdHocReport(individualId, Integer.parseInt(rowId[0]));
            reportForm = (DynaActionForm)getAdHocReportFormFromReportVO( reportVO, form, request );
            reportForm.set("copy", new Boolean(true));

            request.setAttribute("adhocreportform", reportForm);
            request.setAttribute("pagedata", reportVO);

            request.setAttribute("reportType", String.valueOf(ReportConstants.ADHOC_REPORT_CODE));
View Full Code Here

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

    try {
      DynaActionForm dynaform = (DynaActionForm)form;

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

      String mergeType = (String)session.getAttribute("mergeType");
      ArrayList ptContent = (ArrayList)dynaform.get("toPrint");
      String ptfrom = (String)dynaform.get("templatefrom");
      ArrayList emailList = (ArrayList)dynaform.get("emailList");
      String ptSubject = (String)dynaform.get("templatesubject");

      String Message[] = new String[3];
      if (ptContent != null && ptContent.size() != 0) {
        if (mergeType.equals("EMAIL")) {
          // Populate the Attachments In-Case. If we face any problem while
          // sending email.
          // Populating the ArrayList with the DDNameValue.
          ArrayList attachmentFileIDs = new ArrayList();
          ArrayList tempAttachmentMap = (ArrayList)dynaform.get("attachmentList");
          if (tempAttachmentMap != null && tempAttachmentMap.size() > 0) {
            for (int i = 0; i < tempAttachmentMap.size(); i++) {
              DDNameValue fileKeyInfo = (DDNameValue)tempAttachmentMap.get(i);
              String fileKeyName = fileKeyInfo.getStrid();
View Full Code Here

      HttpSession session = request.getSession();
      UserObject userObject = (UserObject)session.getAttribute("userobject");

      int individualID = userObject.getIndividualID(); // logged in user
      String forward = "emailList";
      DynaActionForm emailListForm = (DynaActionForm)form;
      Integer folderID = (Integer)emailListForm.get("folderID");
      if (CVUtility.empty(folderID)) {
        try {
          folderID = new Integer(request.getParameter("folderID"));
        } catch (NumberFormatException nfe) {}
      }
View Full Code Here

      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");

      ContactFacade remote = aa.create();
      remote.setDataSource(dataSource);
      DynaActionForm dynaForm = (DynaActionForm)form;
      String recordType = "";
      if (isEntity) {
        recordType = "Entity";
        EntityVO entityVO = remote.getEntity(Integer.parseInt(rowID));
        contactObject = entityVO;
        dynaForm.set("name", entityVO.getName());
        request.setAttribute("name", entityVO.getName());
      } else {
        recordType = "Individual";
        IndividualVO individualVO = remote.getIndividual(Integer.parseInt(rowID));
        contactObject = individualVO;
        dynaForm.set("name", individualVO.getFirstName() + " " + individualVO.getLastName());
        request
            .setAttribute("name", individualVO.getFirstName() + " " + individualVO.getLastName());
      }

      dynaForm.set("ContactID", Integer.toString(contactObject.getContactID()));
      dynaForm.set("EntityType", Boolean.toString(isEntity));

      request.setAttribute("EntityType", Boolean.toString(isEntity));
      request.setAttribute("closeWindow", request.getAttribute("closeWindow"));
      request.setAttribute("refreshWindow", request.getAttribute("refreshWindow"));

      Iterator mocIterator = contactObject.getMOC().iterator();
      ArrayList phoneNumbers = new ArrayList();
      ArrayList emailAddresses = new ArrayList();
      String primaryEmailAddress = new String();
      while (mocIterator.hasNext()) {
        MethodOfContactVO methodOfContact = (MethodOfContactVO)mocIterator.next();
        if (methodOfContact.getMocType() == 1) // this is for email
        {
          // If the email address is a default email address,
          // add it at the begining of the list.
          if ((methodOfContact.getIsPrimary()).equalsIgnoreCase("YES")) {
            emailAddresses.add(0, methodOfContact);
            primaryEmailAddress = methodOfContact.getContent();
          } else {
            emailAddresses.add(methodOfContact);
          }
        } else {// phone number
          if (methodOfContact.getMocOrder() != null
              && phoneNumbers.size() >= Integer.parseInt(methodOfContact.getMocOrder())) {
            phoneNumbers.add(Integer.parseInt(methodOfContact.getMocOrder()), methodOfContact);
          } else {
            phoneNumbers.add(methodOfContact);
          }
        }
      }

      dynaForm.set("phoneMOCOrder", phoneNumbers);
      dynaForm.set("emailMOCOrder", emailAddresses);
      dynaForm.set("primaryEmailAddress", new String[] { primaryEmailAddress });
      returnStatus = ".view.contact.change_moc";
      request.setAttribute("recordType", recordType);
      request.setAttribute("recordName", request.getParameter("recordName"));
      request.setAttribute("recordId", rowID);
      request.setAttribute("dynamicTitle", request.getParameter("recordName"));
View Full Code Here

    ActionErrors allErrors = new ActionErrors();
    String forward = "showRulesList";

    // "rulesListForm", defined in struts-config-email.xml
    DynaActionForm emailForm = (DynaActionForm)form;

  // After performing the logic in the DeleteHanlder, we are generat a new request for the list
  // So we will not be carrying the old error. So that we will try to collect the error from the Session variable
  // Then destory it after getting the Session value
  if (session.getAttribute("listErrorMessage") != null)
  {
    allErrors = (ActionErrors) session.getAttribute("listErrorMessage");
    saveErrors(request, allErrors);
    session.removeAttribute("listErrorMessage");
  }//end of if (session.getAttribute("listErrorMessage") != null)
 
    try
    {
      // get rid of any existing filled-out rulesForm objects
      // that might still be on the session
      session.setAttribute("ruleForm", null);
      // get the account ID from the form bean
      Integer accountID = (Integer)emailForm.get("accountID");

      // now, check the account ID on the form...
      if (accountID == null || accountID.intValue() <= 0 )
      {
        // if accountID was not passed on the form, then
View Full Code Here

      return mapping.findForward(FORWARD_final);
    }
    HttpSession session = request.getSession();
    UserObject userObject = (UserObject) session.getAttribute("userobject");
    int individualID = userObject.getIndividualID();
    DynaActionForm faqForm = (DynaActionForm) form;
    FaqVO faqVO = new FaqVO();
    faqVO.setTitle((String) faqForm.get("title"));
    faqVO.setStatus((String) faqForm.get("status"));
    if (faqForm.get("publishToCustomerView") != null)
    {
      faqVO.setPublishToCustomerView((String) faqForm.get("publishToCustomerView"));
    }
    String faqIdStr = ((String) faqForm.get("faqid")).trim();

    if (!faqIdStr.equals(""))
    {
      faqVO.setFaqId(Integer.parseInt(faqIdStr));
    }
View Full Code Here

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    String returnStatus = "";
    String button = request.getParameter("save_close");
    String button1 = request.getParameter("save");

    DynaActionForm dynaForm = (DynaActionForm) form;
    HttpSession session = request.getSession(false);
    UserObject userobjectd = (UserObject) session.getAttribute("userobject");
    int individualID = userobjectd.getIndividualID();

    if (button != null)
    {
      returnStatus = ".view.marketing.listmanager";
    }
    else
    {
      returnStatus = ".view.marketing.editlistmanager";
    }

    this.updateList(form, individualID);

    ListGenerator lg = ListGenerator.getListGenerator(dataSource);
    lg.makeListDirty("Marketing");
    dynaForm.initialize(mapping);

    return (mapping.findForward(returnStatus));
  }
View Full Code Here

    return (mapping.findForward(returnStatus));
  }

  public void updateList(ActionForm form, int individualID) throws CommunicationException, NamingException
  {
    DynaActionForm dynaform = (DynaActionForm) form;
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
  MarketingFacadeHome aa = (MarketingFacadeHome) CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");   
  try
    {

      MarketingFacade remote = (MarketingFacade) aa.create();
      remote.setDataSource(dataSource);
      ListVO listVO = new ListVO();
      listVO.setTitle((String)dynaform.get("listname").toString());
      listVO.setDescription((String)dynaform.get("listdescription").toString());
      if(dynaform.get("listid") != null)
      {
    int listID = Integer.parseInt((String) dynaform.get("listid").toString());
    listVO.setListID(listID);
      }
      remote.updateList(individualID, listVO);
    }
    catch (Exception e)
View Full Code Here

    try
    {
      HttpSession session = request.getSession();
      UserObject userObject = (UserObject) session.getAttribute("userobject");
      int individualID = userObject.getIndividualID();
      DynaActionForm faqForm = (DynaActionForm) form;
      QuestionVO qVO = new QuestionVO();
      qVO.setQuestion((String) faqForm.get("title"));
      qVO.setAnswer((String) faqForm.get("answer"));

      SupportFacadeHome sfh = (SupportFacadeHome) CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome",
          "SupportFacade");
      SupportFacade remote = (SupportFacade) sfh.create();
      remote.setDataSource(dataSource);
      String typeOfOp = request.getParameter(Constants.TYPEOFOPERATION);

      if (typeOfOp != null) {
        if (typeOfOp.equals(SupportConstantKeys.ADD)) {
          qVO.setFaqId(Integer.parseInt((String) faqForm.get("faqid")));
          int questionID = remote.addQuestion(individualID, qVO);
        } else {
          qVO.setFaqId(Integer.parseInt((String) faqForm.get("faqid")));
          qVO.setQuestionId(Integer.parseInt((String)request.getParameter("questionid")));
          remote.updateQuestion(individualID, qVO);
        }
      }

      String closeornew = (String) request.getParameter("closeornew");
      String saveandclose = null;
      String saveandnew = null;

      if (closeornew != null)
      {
        if (closeornew.equals("close"))
        {
          saveandclose = "saveandclose";
        }
        else if (closeornew.equals("new"))
        {
          saveandnew = "saveandnew";
          faqForm.set("title", "");
          faqForm.set("answer", "");
        }
      }

      if (saveandclose != null)
      {
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.