Examples of AddressOptions


Examples of com.lbslocal.api.objects.external.AddressOptions

 
  private AddressFinderTest givenADefaultSearchOptions() {
    ResultRange resultRange = new ResultRange();
    resultRange.setPageIndex(0);
    resultRange.setRecordsPerPage(0);
    this.options = new AddressOptions();
    this.options.setUsePhonetic(true);
    this.options.setSearchType("2");
    this.options.setResultRange(resultRange);
    return this;
  }
View Full Code Here

Examples of com.lbslocal.cc.objects.v4.addressFinder.AddressOptions

      if ((address.getCity().getName() == "") || (address.getCity().getState() == ""))
        throw (new Exception(
            "Os atributos address.street, city.name e city.state devem ser informados quando o atributo address.zip nao e informado."));

    try {
      AddressOptions ao = new AddressOptions();
      ao.setUsePhonetic(true);
      ao.setSearchType(2);
      ao.setResultRange(new ResultRange());
      ao.getResultRange().setPageIndex(1);
      ao.getResultRange().setRecordsPerPage(1);

      AddressInfo ai = new AddressInfo();
      ai = findAddress(address, ao, idLicenca);
      if (ai.getRecordCount() > 0) {
        for (int x = 0; x < ai.getRecordCount(); x++) {
View Full Code Here

Examples of com.lbslocal.cc.objects.v4.addressFinder.AddressOptions

        addressOptionsDependencyObjects[0] = cr.new ObjectsHelper();
        addressOptionsDependencyObjects[0].object = new ResultRange();
        addressOptionsDependencyObjects[0].alias = "resultRange";

        Address address = (Address) cr.getObjectFromXML(ph.XMLFile, "address", Address.class, addressDependencyObjects);
        AddressOptions ao = (AddressOptions) cr.getObjectFromXML(ph.XMLFile, "ao", AddressOptions.class, addressOptionsDependencyObjects);

        try {
          ai = cAf.findAddress(address, ao, id_licenca);
        } catch (Exception e) {
          e.printStackTrace();
        }

        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");

        ObjectsHelper[] dependencyObjects = new ObjectsHelper[2];

        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new AddressInfo();
        dependencyObjects[0].alias = "AddressInfo";

        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new AddressLocation();
        dependencyObjects[1].alias = "AddressLocation";

        response.getWriter().write("<?xml version='1.0' encoding='UTF-8'?>\n" + cr.getXMLFromObject(ai, dependencyObjects) + "");
      }

      if (ph.fields[0].equals("findCity")) {
        CityLocationInfo ci = new CityLocationInfo();

        ObjectsHelper[] addressOptionsDependencyObjects = new ObjectsHelper[1];

        addressOptionsDependencyObjects[0] = cr.new ObjectsHelper();
        addressOptionsDependencyObjects[0].object = new ResultRange();
        addressOptionsDependencyObjects[0].alias = "resultRange";

        City city = (City) cr.getObjectFromXML(ph.XMLFile, "cidade", City.class, null);
        AddressOptions ao = (AddressOptions) cr.getObjectFromXML(ph.XMLFile, "ao", AddressOptions.class, addressOptionsDependencyObjects);

        try {
          ci = cAf.findCity(city, ao, id_licenca);
        } catch (Exception e) {
          e.printStackTrace();
View Full Code Here

Examples of com.lbslocal.cc.objects.v4.addressFinder.AddressOptions

      Point point = new Point();

      if (Functions.IsNullOrEmpty(ad.getStreet()) && Functions.IsNullOrEmpty(ad.getHouseNumber()) && Functions.IsNullOrEmpty(ad.getZip())
          && (!Functions.IsNullOrEmpty(ad.getCity().getName()) && !Functions.IsNullOrEmpty(ad.getCity().getState()))) {
        try {
          point = af.findCity(ad.getCity(), new AddressOptions(true, 10, new ResultRange(1, 1)), idLicenca).getCityLocation()[0].getPoint();
        } catch (Exception ex) {
          throw (new Exception("Nao foi possivel geocodificar o endereco."));
        }
      } else {
        point = af.getXY(ad, idLicenca);
View Full Code Here

Examples of com.lbslocal.cc.objects.v4.addressFinder.AddressOptions

      Point point = new Point();

      if (Functions.IsNullOrEmpty(ad.getStreet()) && Functions.IsNullOrEmpty(ad.getHouseNumber()) && Functions.IsNullOrEmpty(ad.getZip())
          && (!Functions.IsNullOrEmpty(ad.getCity().getName()) && !Functions.IsNullOrEmpty(ad.getCity().getState()))) {
        try {
          point = af.findCity(ad.getCity(), new AddressOptions(true, 0, new ResultRange(1, 1)), idLicenca).getCityLocation()[0].getPoint();
        } catch (Exception ex) {
          throw (new Exception("Nao foi possivel geocodificar o endereco."));
        }
      } else {
        point = af.getXY(ad, idLicenca);
View Full Code Here

Examples of com.lbslocal.cc.objects.v4.addressFinder.AddressOptions

      respostaWs = Common.SerializeJSObject(al);
      break;
    case findCitiesByState:
      o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { String.class });
      City city = new City("", (String) o[0]);
      AddressOptions ao = new AddressOptions(false, 1, new ResultRange(0, 1500));

      CityLocationInfo clii = addressFinder.findCity(city, ao, tk.getId());

      StringBuilder sb = new StringBuilder("[");
      for (int i = 0; i < clii.getCityLocation().length; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.