Package com.liferay.faces.demos.dto

Examples of com.liferay.faces.demos.dto.Country


  private List<Country> countries;

  @Override
  public Country findByAbbreviation(String countryAbbreviation) {

    Country country = null;

    getCountries();

    for (Country curCountry : countries) {
View Full Code Here


  public List<Country> getCountries() {

    if (countries == null) {

      countries = new ArrayList<Country>();
      countries.add(new Country(1, "United States", "US"));
      countries.add(new Country(2, "Canada", "CA"));
    }

    return countries;
  }
View Full Code Here

  }

  @PostConstruct
  public void postConstruct() {

    Country unitedStates = countryService.findByAbbreviation("US");
    long countryId = unitedStates.getCountryId();
    provinces.add(new Province(1, countryId, "Alabama", "AL"));
    provinces.add(new Province(2, countryId, "Alaska", "AK"));
    provinces.add(new Province(3, countryId, "Arizona", "AZ"));
    provinces.add(new Province(4, countryId, "Arkansas", "AR"));
    provinces.add(new Province(5, countryId, "California", "CA"));
    provinces.add(new Province(6, countryId, "Colorado", "CO"));
    provinces.add(new Province(7, countryId, "Connecticut", "CT"));
    provinces.add(new Province(8, countryId, "Delaware", "DE"));
    provinces.add(new Province(9, countryId, "District of Columbia", "DC"));
    provinces.add(new Province(10, countryId, "Florida", "FL"));
    provinces.add(new Province(11, countryId, "Georgia", "GA"));
    provinces.add(new Province(12, countryId, "Hawaii", "HI"));
    provinces.add(new Province(13, countryId, "Idaho", "ID"));
    provinces.add(new Province(14, countryId, "Illinois", "IL"));
    provinces.add(new Province(15, countryId, "Indiana", "IN"));
    provinces.add(new Province(16, countryId, "Iowa", "IA"));
    provinces.add(new Province(17, countryId, "Kansas", "KS"));
    provinces.add(new Province(18, countryId, "Kentucky", "KY"));
    provinces.add(new Province(19, countryId, "Louisiana", "LA"));
    provinces.add(new Province(20, countryId, "Maine", "ME"));
    provinces.add(new Province(21, countryId, "Montana", "MT"));
    provinces.add(new Province(22, countryId, "Nebraska", "NE"));
    provinces.add(new Province(23, countryId, "Nevada", "NV"));
    provinces.add(new Province(24, countryId, "New Hampshire", "NH"));
    provinces.add(new Province(25, countryId, "New Jersey", "NJ"));
    provinces.add(new Province(26, countryId, "New Mexico", "NM"));
    provinces.add(new Province(27, countryId, "New York", "NY"));
    provinces.add(new Province(28, countryId, "North Carolina", "NC"));
    provinces.add(new Province(29, countryId, "North Dakota", "ND"));
    provinces.add(new Province(30, countryId, "Ohio", "OH"));
    provinces.add(new Province(31, countryId, "Oklahoma", "OK"));
    provinces.add(new Province(32, countryId, "Oregon", "OR"));
    provinces.add(new Province(33, countryId, "Maryland", "MD"));
    provinces.add(new Province(34, countryId, "Massachusetts", "MA"));
    provinces.add(new Province(35, countryId, "Michigan", "MI"));
    provinces.add(new Province(36, countryId, "Minnesota", "MN"));
    provinces.add(new Province(37, countryId, "Mississippi", "MS"));
    provinces.add(new Province(38, countryId, "Missouri", "MO"));
    provinces.add(new Province(39, countryId, "Pennsylvania", "PA"));
    provinces.add(new Province(40, countryId, "Rhode Island", "RI"));
    provinces.add(new Province(41, countryId, "South Carolina", "SC"));
    provinces.add(new Province(42, countryId, "South Dakota", "SD"));
    provinces.add(new Province(43, countryId, "Tennessee", "TN"));
    provinces.add(new Province(44, countryId, "Texas", "TX"));
    provinces.add(new Province(45, countryId, "Utah", "UT"));
    provinces.add(new Province(46, countryId, "Vermont", "VT"));
    provinces.add(new Province(47, countryId, "Virginia", "VA"));
    provinces.add(new Province(48, countryId, "Washington", "WA"));
    provinces.add(new Province(49, countryId, "West Virginia", "WV"));
    provinces.add(new Province(50, countryId, "Wisconsin", "WI"));
    provinces.add(new Province(51, countryId, "Wyoming", "WY"));

    Country canada = countryService.findByAbbreviation("CA");
    countryId = canada.getCountryId();
    provinces.add(new Province(52, countryId, "Alberta", "AB"));
    provinces.add(new Province(53, countryId, "British Columbia", "BC"));
    provinces.add(new Province(54, countryId, "Manitoba", "MB"));
    provinces.add(new Province(55, countryId, "New Brunswick", "NB"));
    provinces.add(new Province(56, countryId, "Newfoundland and Labrador", "NL"));
View Full Code Here

    flights = null;
  }

  @PostConstruct
  public void postContruct() {
    Country unitedStates = countryService.findByAbbreviation("US");
    customer.setCountryId(unitedStates.getCountryId());
    logger.debug("BookingFlowModelBean initialized!");
    scopeTrackingBean.setBookingFlowModelBeanInScope(true);
  }
View Full Code Here

  private CountryService countryService;

  @PostConstruct
  public void postConstruct() {

    Country unitedStates = countryService.getCountryByCode("US");
    long unitedStatesCountryId = unitedStates.getCountryId();

    Country unitedKingdom = countryService.getCountryByCode("UK");
    long unitedKingdomCountryId = unitedKingdom.getCountryId();

    allCustomers = new ArrayList<Customer>();

    long userId = 0;
View Full Code Here

  @PostConstruct
  public void postConstruct() {
    countryMap = new HashMap<Long, Country>();

    Country country = new Country(1, "CN", "China");
    countryMap.put(country.getCountryId(), country);
    country = new Country(2, "CH", "Switzerland");
    countryMap.put(country.getCountryId(), country);
    country = new Country(3, "US", "United States");
    countryMap.put(country.getCountryId(), country);
    country = new Country(4, "UK", "United Kingdom");
    countryMap.put(country.getCountryId(), country);
    country = new Country(5, "VN", "Vietnam");
    countryMap.put(country.getCountryId(), country);
    countryList = new ArrayList<Country>(countryMap.values());
  }
View Full Code Here

  }

  @Override
  public Country getCountryByCode(String countryCode) {

    Country country = null;

    for (Country curCountry : countryList) {

      if (curCountry.getCountryCode().equals(countryCode)) {
        country = curCountry;
View Full Code Here

  }

  @Override
  public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) {

    Country country = getCountryMap(facesContext).get(value);

    return country.getCountryName();
  }
View Full Code Here

  }

  @Override
  public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) {

    Country country = getCountryMap(facesContext).get(value);

    return "https://www.google.com/maps/place/" + country.getCountryName();
  }
View Full Code Here

TOP

Related Classes of com.liferay.faces.demos.dto.Country

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.