Package org.apache.struts.util

Examples of org.apache.struts.util.LabelValueBean


      }
      request.setAttribute("emailDisableFlag", new Boolean(emailFlag));

      // Get Saved searches from the EJB
      ArrayList entitySearchList = AdvancedSearchUtil.getSavedSearchList(individualID, 14, dataSource);
      entitySearchList.add(0, new LabelValueBean("Select", ""));
      ArrayList individualSearchList = AdvancedSearchUtil.getSavedSearchList(individualID, 15, dataSource);
      individualSearchList.add(0, new LabelValueBean("Select", ""));

      request.setAttribute("entitySearchList", entitySearchList);
      request.setAttribute("individualSearchList", individualSearchList);

      request.setAttribute("typeofoperation", "Edit");
View Full Code Here


    // and the value is the listType value.
    // DO NOT NAME THE "value" PARAMETER AS A PLURAL WORD!
    ArrayList relatedInfoList = new ArrayList();

    if (listFor.equals("Entity")) {
      relatedInfoList.add(new LabelValueBean("Individuals", "Individual"));
      relatedInfoList.add(new LabelValueBean("Addresses", "Address"));
      relatedInfoList.add(new LabelValueBean("Contact Methods", "ContactMethod"));
      relatedInfoList.add(new LabelValueBean("Custom Fields", "CustomField"));
      relatedInfoList.add(new LabelValueBean("Pending Activities", "Activity"));
      relatedInfoList.add(new LabelValueBean("Notes", "Note"));
      relatedInfoList.add(new LabelValueBean("Tickets", "Ticket"));
      relatedInfoList.add(new LabelValueBean("Proposals", "Proposal"));
      relatedInfoList.add(new LabelValueBean("Opportunities", "Opportunity"));
      relatedInfoList.add(new LabelValueBean("Projects", "Project"));
      relatedInfoList.add(new LabelValueBean("History", "History"));
      relatedInfoList.add(new LabelValueBean("Files", "File"));
      relatedInfoList.add(new LabelValueBean("Orders", "Order"));
      relatedInfoList.add(new LabelValueBean("Invoices", "Invoice"));
      relatedInfoList.add(new LabelValueBean("Payments", "Payment"));
      relatedInfoList.add(new LabelValueBean("Completed Activities", "CompletedActivity"));
      relatedInfoList.add(new LabelValueBean("Email History", "EmailHistory"));
    } else if (listFor.equals("Individual")) {
      relatedInfoList.add(new LabelValueBean("Addresses", "Address"));
      relatedInfoList.add(new LabelValueBean("Contact Methods", "ContactMethod"));
      relatedInfoList.add(new LabelValueBean("Custom Fields", "CustomField"));
      relatedInfoList.add(new LabelValueBean("Pending Activities", "Activity"));
      relatedInfoList.add(new LabelValueBean("Notes", "Note"));
      relatedInfoList.add(new LabelValueBean("Tickets", "Ticket"));
      relatedInfoList.add(new LabelValueBean("Projects", "Project"));
      relatedInfoList.add(new LabelValueBean("Opportunities", "Opportunity"));
      relatedInfoList.add(new LabelValueBean("Proposals", "Proposal"));
      relatedInfoList.add(new LabelValueBean("History", "History"));
      relatedInfoList.add(new LabelValueBean("Files", "File"));
      relatedInfoList.add(new LabelValueBean("Completed Activities", "CompletedActivity"));
      relatedInfoList.add(new LabelValueBean("Email History", "EmailHistory"));
    } else if (listFor.equals("Opportunity")) {
      relatedInfoList.add(new LabelValueBean("Proposals", "Proposal"));
      relatedInfoList.add(new LabelValueBean("Pending Activities", "Activity"));
      relatedInfoList.add(new LabelValueBean("Completed Activities", "CompletedActivity"));
      relatedInfoList.add(new LabelValueBean("Notes", "Note"));
      relatedInfoList.add(new LabelValueBean("Individuals", "Individual"));
      relatedInfoList.add(new LabelValueBean("Expenses", "Expenses")); // The instructions said NOT to name the value as a plural word!!!!!
      relatedInfoList.add(new LabelValueBean("Custom Fields", "CustomField"));
      relatedInfoList.add(new LabelValueBean("Account Team", "GroupMember"));
    } else if (listFor.equals("Project")) {
      relatedInfoList.add(new LabelValueBean("Contacts", "Contact"));
      relatedInfoList.add(new LabelValueBean("Custom Fields", "CustomField"));
      relatedInfoList.add(new LabelValueBean("Expenses", "Expenses")); // The instructions said NOT to name the value as a plural word!!!!!
      relatedInfoList.add(new LabelValueBean("Files", "File"));
      relatedInfoList.add(new LabelValueBean("Completed Activities", "CompletedActivity"));
      relatedInfoList.add(new LabelValueBean("History", "History"));
      relatedInfoList.add(new LabelValueBean("Invoices", "Invoice"));
      relatedInfoList.add(new LabelValueBean("Notes", "Note"));
      relatedInfoList.add(new LabelValueBean("Orders", "Order"));
      relatedInfoList.add(new LabelValueBean("Scheduled Activities", "Activity"));
      relatedInfoList.add(new LabelValueBean("Timeslips", "Timeslip"));
      relatedInfoList.add(new LabelValueBean("Tasks", "Task"));
    }
    return (relatedInfoList);
  } // end getDropdownMap() method
View Full Code Here

          Iterator iter = accountIDList.iterator();
          while (iter.hasNext()) {
            Number accountID = (Number) iter.next();
            MailAccountVO accountVO = mailRemote.getMailAccountVO(accountID.intValue());
            InternetAddress address = new InternetAddress(accountVO.getEmailAddress(), accountVO.getAccountName());
            LabelValueBean accountDetails = new LabelValueBean(address.toString(), accountID.toString());
            accountList.add(accountDetails);
          }
        }
        dynaform.set("accountList", accountList);
      } // if (mergeType.equals("EMAIL"))
View Full Code Here

  {
    ArrayList optionList = new ArrayList();
    TreeSet keySet = new TreeSet(map.keySet());
    Iterator keyIterator = keySet.iterator();
    // prepend an empty 0 label to the top of each OptionList
    optionList.add(new LabelValueBean("-- Select --", "0"));
    while(keyIterator.hasNext())
    {
      Number key = (Number)keyIterator.next();
      String value = (String)map.get(key);
      LabelValueBean option = new LabelValueBean(value, key.toString());
      optionList.add(option);
    }
    return optionList;
  } // end buildSelectOptionList(HashMap map)
View Full Code Here

    throw new ServletException(e);
  }
  for(int i = 0; i < rawMarketingList.size(); i++)
  {
    HashMap currentList = (HashMap)rawMarketingList.get(i);
    marketingListCollection.add(new LabelValueBean((String)currentList.get("title"), ((Number)currentList.get("listid")).toString()));
  }

    for (int i = 0; i < individualVOs.size(); i++)
    {
      // build up the collections with the unique values from each VO.
      IndividualVO individual = (IndividualVO)individualVOs.get(i);
      String middleName = individual.getMiddleName();
      if(middleName != null && !middleName.equals("")){
        middleName += middleName + ". ";
      }
      else{
        middleName = "";
      }
      String individualName = individual.getFirstName() + " " + middleName + individual.getLastName();
      LabelValueBean currentName = new LabelValueBean(individualName, String.valueOf(i));
      boolean flag = false;
      for (int j = 0; !flag && (j < nameCollection.size()); j++)
      {
        if(((LabelValueBean)nameCollection.get(j)).getLabel().equals(currentName.getLabel()))
        {
          flag = true;
        }
      }
      if (!flag)
      {
        nameCollection.add(currentName);
      }

      LabelValueBean currentId = new LabelValueBean(String.valueOf(individual.getContactID()), String.valueOf(individual.getContactID()));
      idCollection.add(currentId);

      String currentId2String = individual.getExternalID();
      LabelValueBean currentId2 = new LabelValueBean(currentId2String, String.valueOf(i));
      boolean flag2 = false;
      for (int j = 0; !flag2 && (j < id2Collection.size()); j++)
      {
        String id2CollectionLabel = ((LabelValueBean)id2Collection.get(j)).getLabel();
        if((currentId2String == null) || // if string is null for some reason
           (currentId2String.length() == 0) || // if the length == 0
           (id2CollectionLabel.equals(currentId2String))) // if it is equal to an existing one
        {
          flag2 = true; // Don't add it.
        } // end if
      } // end for (int j = 0; j < id2Collection.size(); j++)
      if (!flag2)
      {
        id2Collection.add(currentId2);
      }

      LabelValueBean currentSource = new LabelValueBean(individual.getSourceName(), String.valueOf(individual.getSource()));
      if(!sourceCollection.contains(currentSource) &&
          !(currentSource.getValue().equals("") || currentSource.getLabel().equals("")))
      {
        sourceCollection.add(currentSource);
      }
    } // end for(int i = 0; i < entityVOs.size(); i++)

    // populate bean from AddressVO
    for (int i=0; i < addressVOs.size(); i++)
    {
      AddressVO address = (AddressVO)addressVOs.get(i);
      StringBuffer addressLabel = new StringBuffer();
      // I know, bad programmer, HTML stuff shouldn't be here.
      // I blame the guy who designed the prototype.
      // Anyway its only two little <br> tags, it won't hurt anyone.
      // Plus it will make the other screen look "nice."
      addressLabel.append(address.getStreet1()+"<br>");
      addressLabel.append(address.getStreet2()+"<br>");
      addressLabel.append(address.getCity()+", ");
      addressLabel.append(address.getStateName()+", ");
      addressLabel.append(address.getZip()+", ");
      addressLabel.append(address.getCountryName());
      LabelValueBean currentAddress = new LabelValueBean(addressLabel.toString(), String.valueOf(address.getAddressID()));
      addressCollection.add(currentAddress);
    } // end for (int i=0; i < addressVOs.size(); i++)

    // populate bean with all MOC vos
    for (int i = 0; i < methodOfContactVOs.size(); i++)
    {
      MethodOfContactVO moc = (MethodOfContactVO)methodOfContactVOs.get(i);
      StringBuffer mocLabel = new StringBuffer();
      mocLabel.append(moc.getMocTypeName());
      mocLabel.append(":&nbsp;");
      mocLabel.append(moc.getContent());
      LabelValueBean currentMOC = new LabelValueBean(mocLabel.toString(), String.valueOf(moc.getMocID()));
      methodOfContactCollection.add(currentMOC);
    } // end for (int i = 0; i < methodOfContactVOs.size(); i++)

    for (int i = 0; i < entityVOs.size(); i++)
    {
      // Add the Entity Id onto the end of the Label so users can have that
      // information available to guide their choices.
      EntityVO current = (EntityVO)entityVOs.get(i);
      String entityName = current.getName() + " ID: " +current.getContactID();
      LabelValueBean entityLabel = new LabelValueBean(entityName, String.valueOf(current.getContactID()));
      entityNameCollection.add(entityLabel);
    }

    mergeIndividualDetails.set("nameCollection", nameCollection);
    mergeIndividualDetails.set("idCollection", idCollection);
View Full Code Here

      throw new ServletException(e);
    }

    for (int i = 0; i < rawMarketingList.size(); i++) {
      HashMap currentList = (HashMap)rawMarketingList.get(i);
      marketingListCollection.add(new LabelValueBean((String)currentList.get("title"), ((Number)currentList.get("listid")).toString()));
    }
   
    for (int i = 0; i < entityVOs.size(); i++) {
      // build up the collections with the unique values from each VO.
      EntityVO entity = (EntityVO)entityVOs.get(i);
      LabelValueBean currentName = new LabelValueBean(entity.getName(), String.valueOf(i));
      boolean flag = false;
      for (int j = 0; !flag && (j < nameCollection.size()); j++) {
        if (((LabelValueBean)nameCollection.get(j)).getLabel().equals(currentName.getLabel())) {
          flag = true;
        }
      }

      if (!flag) {
        nameCollection.add(currentName);
      }

      LabelValueBean currentId = new LabelValueBean(String.valueOf(entity.getContactID()), String.valueOf(entity.getContactID()));
      idCollection.add(currentId);

      String currentId2String = entity.getExternalID();
      LabelValueBean currentId2 = new LabelValueBean(currentId2String, String.valueOf(i));
      boolean flag2 = false;
      for (int j = 0; !flag2 && (j < id2Collection.size()); j++) {
        String id2CollectionLabel = ((LabelValueBean)id2Collection.get(j)).getLabel();
        if ((currentId2String == null) || // if string is null for some reason
           (currentId2String.length() == 0) || // if the length == 0
           (id2CollectionLabel.equals(currentId2String))) // if it is equal to an existing one
        {
          flag2 = true; // Don't add it.
        }
      }

      if (!flag2) {
        id2Collection.add(currentId2);
      }
     
      LabelValueBean currentAccountManager = new LabelValueBean(entity.getAcctMgrName(), String.valueOf(entity.getAccManager()));
      if (!accountManagerCollection.contains(currentAccountManager) &&
          !(currentAccountManager.getValue().equals("0") || currentAccountManager.getLabel().equals(""))) {
        accountManagerCollection.add(currentAccountManager);
      }
     
      LabelValueBean currentAccountTeam = new LabelValueBean(entity.getAcctTeamName(), String.valueOf(entity.getAccTeam()));
      if (!accountTeamCollection.contains(currentAccountTeam) &&
          !(currentAccountTeam.getValue().equals("0") || currentAccountTeam.getLabel().equals(""))) {
        accountTeamCollection.add(currentAccountTeam);
      }
     
      LabelValueBean currentSource = new LabelValueBean(entity.getSourceName(), String.valueOf(entity.getSource()));
      if (!sourceCollection.contains(currentSource) &&
          !(currentSource.getValue().equals("") || currentSource.getLabel().equals(""))) {
        sourceCollection.add(currentSource);
      }
    } // end for(int i = 0; i < entityVOs.size(); i++)

    // populate bean from AddressVO
    for (int i=0; i < addressVOs.size(); i++) {
      AddressVO address = (AddressVO)addressVOs.get(i);
      StringBuffer addressLabel = new StringBuffer();
      // I know, bad programmer, HTML stuff shouldn't be here.
      // I blame the guy who designed the prototype.
      // Anyway its only two little <br> tags, it won't hurt anyone.
      // Plus it will make the other screen look "nice."
      addressLabel.append(address.getStreet1()+"<br>");
      addressLabel.append(address.getStreet2()+"<br>");
      addressLabel.append(address.getCity()+", ");
      addressLabel.append(address.getStateName()+", ");
      addressLabel.append(address.getZip()+", ");
      addressLabel.append(address.getCountryName());
      LabelValueBean currentAddress = new LabelValueBean(addressLabel.toString(), String.valueOf(address.getAddressID()));
      addressCollection.add(currentAddress);
    } // end for (int i=0; i < addressVOs.size(); i++)
   
    // populate bean with all MOC vos
    for (int i = 0; i < methodOfContactVOs.size(); i++) {
      MethodOfContactVO moc = (MethodOfContactVO)methodOfContactVOs.get(i);
      StringBuffer mocLabel = new StringBuffer();
      mocLabel.append(moc.getMocTypeName());
      mocLabel.append(":&nbsp;");
      mocLabel.append(moc.getContent());
      LabelValueBean currentMOC = new LabelValueBean(mocLabel.toString(), String.valueOf(moc.getMocID()));
      methodOfContactCollection.add(currentMOC);
    } // end for (int i = 0; i < methodOfContactVOs.size(); i++)

    // populate bean with all related Individual vos
    for (int i = 0; i < individualVOs.size(); i++) {
      IndividualVO individual = (IndividualVO)individualVOs.get(i);
      StringBuffer individualLabel = new StringBuffer();
      individualLabel.append(individual.getFirstName());
      individualLabel.append(" ");
      individualLabel.append(individual.getLastName());
      LabelValueBean currentIndividual = new LabelValueBean(individualLabel.toString(), String.valueOf(individual.getContactID()));
      individualNameCollection.add(currentIndividual);
    } // end for (int i = 0; i < individualVOs.size(); i++)

    mergeEntityDetails.set("nameCollection", nameCollection);
    mergeEntityDetails.set("idCollection", idCollection);
View Full Code Here

  {
    String label = null;
    Iterator iter = collection.iterator();
    while(iter.hasNext())
    {
      LabelValueBean item = (LabelValueBean)iter.next();
      if (item.getValue().equals(value))
      {
        return item.getLabel();
      }
    } // end for (int i = 0; (label != null) && (i < collection.size()); i++)
    return label;
  } // end getCollectionLabel
View Full Code Here

    Set keys = searchListDb.keySet();
    Iterator keyIter = keys.iterator();
    while (keyIter.hasNext()) {
      Number key = (Number)keyIter.next();
      String value = (String)searchListDb.get(key);
      LabelValueBean searchPair = new LabelValueBean(value, String.valueOf(key));
      searchList.add(searchPair);
    }

    viewForm.set("searchList", searchList);
View Full Code Here

    Set savedSearchIds = savedSearches.keySet();
    Iterator idIterator = savedSearchIds.iterator();
    while (idIterator.hasNext()) {
      Number searchId = (Number) idIterator.next();
      String searchName = (String) savedSearches.get(searchId);
      searchList.add(new LabelValueBean(searchName, searchId.toString()));
    }
    return searchList;
  } // getSavedSearchList(int individualId, int moduleId)
View Full Code Here

  {
    ArrayList optionList = new ArrayList();
    TreeSet keySet = new TreeSet(map.keySet());
    Iterator keyIterator = keySet.iterator();
    // prepend an empty 0 label to the top of each OptionList
    optionList.add(new LabelValueBean("-- Select --", "0"));
    while (keyIterator.hasNext()) {
      Number key = (Number) keyIterator.next();
      String value = (String) map.get(key);
      LabelValueBean option = new LabelValueBean(value, key.toString());
      optionList.add(option);
    }
    return optionList;
  } // end buildSelectOptionList(HashMap map)
View Full Code Here

TOP

Related Classes of org.apache.struts.util.LabelValueBean

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.