Package org.apache.struts.util

Examples of org.apache.struts.util.LabelValueBean


         "order    by customerClass.custClassName ";  
    Query query = em.createQuery(sql);
    query.setParameter("siteId", item.getSite().getSiteId());
    Iterator<?> iterator = query.getResultList().iterator();
    Vector<LabelValueBean> custClassList = new Vector<LabelValueBean>();
    custClassList.add(new LabelValueBean("", ""));
    while (iterator.hasNext()) {
      CustomerClass customerClass = (CustomerClass) iterator.next();
      LabelValueBean bean = new LabelValueBean(customerClass.getCustClassName(), customerClass.getCustClassId().toString());;
      custClassList.add(bean);
    }
    LabelValueBean custClasses[] = new LabelValueBean[custClassList.size()];
    custClassList.copyInto(custClasses);
    form.setCustClasses(custClasses);

    Vector<ItemAttributeDetailDisplayForm> itemAttributeDetails = new Vector<ItemAttributeDetailDisplayForm>();
    if (item.getCustomAttributeGroup() != null) {
View Full Code Here


    return mapping.findForward("success");
  }
 
  private void initForm(PaymentGatewayMaintActionForm form, Site site) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    LabelValueBean paymentGateways[] = {new LabelValueBean("", ""),
        new LabelValueBean("Authorize.Net", AuthorizeNetEngine.class.getSimpleName()),
        new LabelValueBean("eWAY Australia CVN", EWayCVNAustraliaEngine.class.getSimpleName()),
        new LabelValueBean("PsiGate", PsiGateEngine.class.getSimpleName()),
        new LabelValueBean("PayPal", PayPalEngine.class.getSimpleName()),
        new LabelValueBean("PayPal Payflow", PayPalPayFlowEngine.class.getSimpleName()),
        new LabelValueBean("PayPal Website Payment Pro", PayPalWebsitePaymentProEngine.class.getSimpleName()),
        new LabelValueBean("Payment Express", PaymentExpressEngine.class.getSimpleName())
    };
    form.setPaymentGateways(paymentGateways);
   
       
        Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
        Query query = em.createQuery("from CustomerClass where siteId = :siteId order by custClassId");
        query.setParameter("siteId", site.getSiteId());
        Iterator<?> iterator = query.getResultList().iterator();
        vector.add(new LabelValueBean("", ""));
        while (iterator.hasNext()) {
          CustomerClass customerClass = (CustomerClass) iterator.next();
          LabelValueBean bean = new LabelValueBean();
          bean.setLabel(customerClass.getCustClassName());
          bean.setValue(customerClass.getCustClassId().toString());
          vector.add(bean);
        }
        LabelValueBean customerClasses[] = new LabelValueBean[vector.size()];
        vector.copyInto(customerClasses);
        form.setCustomerClasses(customerClasses);
  }
View Full Code Here

      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);

       String sql = "";
       sql = "from    State state " +
           "where    state.country.siteId = :siteId " +
           "order  by state.country.countryId, state.stateName";
       query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
    }
View Full Code Here

      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
      
    Country custCountry = CountryDAO.loadByCountryCode(siteId, form.getCustCountryCode());
    Vector<LabelValueBean> stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
         form.setCustStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setCustStates(states);
    }
   
    custCountry = CountryDAO.loadByCountryCode(siteId, form.getBillingCustCountryCode());
    stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
         form.setBillingCustStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setBillingCustStates(states);
    }
   
    custCountry = CountryDAO.loadByCountryCode(siteId, form.getShippingCustCountryCode());
    stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
         form.setShippingCustStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setShippingCustStates(states);
    }
    }
View Full Code Here

      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         CreditCard creditCard = (CreditCard) iterator.next();
         LabelValueBean bean = new LabelValueBean(creditCard.getCreditCardDesc(), creditCard.getCreditCardId().toString());
         vector.add(bean);
       }
       LabelValueBean creditCards[] = new LabelValueBean[vector.size()];
       vector.copyInto(creditCards);
       form.setCreditCards(creditCards);

      LabelValueBean expiryMonths[] = {new LabelValueBean("01", "01"),
                       new LabelValueBean("02", "02"),
                       new LabelValueBean("03", "03"),
                       new LabelValueBean("04", "04"),
                       new LabelValueBean("05", "05"),
                       new LabelValueBean("06", "06"),
                       new LabelValueBean("07", "07"),
                       new LabelValueBean("08", "08"),
                       new LabelValueBean("09", "09"),
                       new LabelValueBean("10", "10"),
                       new LabelValueBean("11", "11"),
                       new LabelValueBean("12", "12")};
    LabelValueBean expiryYears[] = {new LabelValueBean("2010", "2010"),
                      new LabelValueBean("2011", "2011"),
                      new LabelValueBean("2012", "2012"),
                      new LabelValueBean("2013", "2013"),
                      new LabelValueBean("2014", "2014"),
                      new LabelValueBean("2015", "2015"),
                      new LabelValueBean("2016", "2016"),
                      new LabelValueBean("2017", "2017"),
                      new LabelValueBean("2018", "2018"),
                      new LabelValueBean("2019", "2019"),
                      new LabelValueBean("2020", "2020"),
                      new LabelValueBean("2021", "2021"),
                      new LabelValueBean("2022", "2022"),
                      new LabelValueBean("2023", "2023"),
                      new LabelValueBean("2024", "2024"),
                      new LabelValueBean("2025", "2025"),
                      new LabelValueBean("2026", "2026"),
                      new LabelValueBean("2027", "2027"),
                      new LabelValueBean("2028", "2028"),
                      new LabelValueBean("2029", "2029"),
                      };

      form.setExpiryMonths(expiryMonths);
      form.setExpiryYears(expiryYears);
    }
View Full Code Here

  static String STATISTICS_SERVER_FREE_MEMORY = "statistics.server.free.memory";
  static String STATISTICS_THREAD_COUNT = "statistics.thread.count";
  static long uptime = System.currentTimeMillis();
 
  public LabelValueBean[] getServerStats() {
    LabelValueBean table[] = new LabelValueBean[3];
    table[0] = new LabelValueBean(STATISTICS_SERVER_UPTIME, Format.getFullDatetime(new Date(uptime)));
    table[1] = new LabelValueBean(STATISTICS_SERVER_TOTAL_MEMORY, Format.getLong(Runtime.getRuntime().totalMemory()) + " bytes");
    table[2] = new LabelValueBean(STATISTICS_SERVER_FREE_MEMORY, Format.getLong(Runtime.getRuntime().freeMemory()) + " bytes");
    return table;
  }
View Full Code Here

    table[2] = new LabelValueBean(STATISTICS_SERVER_FREE_MEMORY, Format.getLong(Runtime.getRuntime().freeMemory()) + " bytes");
    return table;
  }
 
  public LabelValueBean[] getThreadStats() {
    LabelValueBean table[] = new LabelValueBean[Thread.activeCount() + 1];
    table[0] = new LabelValueBean(STATISTICS_THREAD_COUNT, Format.getInt(Thread.activeCount()));
    Thread thread[] = new Thread[Thread.activeCount()];
    Thread.enumerate(thread);
    for (int i = 0; i < thread.length; i++) {
      table[i + 1] = new LabelValueBean("Thread [" + i + "]", thread[i].toString());
    }
    return table;
  }
View Full Code Here

    }
    return table;
  }
 
  public LabelValueBean[] getJvmStats() {
    LabelValueBean table[] = new LabelValueBean[System.getProperties().size()];
    Properties properties = System.getProperties();
    Enumeration<?> enumeration = properties.propertyNames();
    int i = 0;
    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();
      String value = (String) properties.getProperty(name);
      table[i++] = new LabelValueBean(name, value);
    }
    return table;
  }
View Full Code Here

      else {
        iterator = user.getSites().iterator();
      }
      while (iterator.hasNext()) {
        Site userSite = (Site) iterator.next();
        vector.add(new LabelValueBean(userSite.getSiteId(), userSite.getSiteId()));
      }
      LabelValueBean siteIds[] = new LabelValueBean[vector.size()];
      vector.copyInto(siteIds);
      form.setSiteIds(siteIds);
     
       String sql = "";
       sql = "from Country country where country.siteId = :siteId order by countryName";
      Query query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);

       sql = "from    State state " +
              "left  join fetch state.country country " +
              "where  country.siteId = :siteId " +
              "order  by country.countryId, state.stateName";
       query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
    }
View Full Code Here

      String value = (String) select.findValue(select.getProperty());
      if (value == null) {
        value = "";
      }
     
      LabelValueBean bean[] = (LabelValueBean[]) findValue(property);
      if (isFieldDisabled() || select.isFieldDisabled()) {
        for (int i = 0; i < bean.length; i++) {
          if (value.equals(bean[i].getValue())) {
            String s = "";
            Select parent = (Select) getParent();
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.