Package com.drighetto.lmb.persistence.model

Examples of com.drighetto.lmb.persistence.model.Parking


      // Case where details of a parking is requested
      if (req.getRequestURI().toLowerCase().endsWith("details.jsp")) {
        // Get the name of the parking request
        String pname = req.getParameter("pname");
        if (lst != null) {
          int pos = Collections.binarySearch(lst, new Parking(pname));
          req.setAttribute("PARKING", lst.get(pos));
        }
      }
    }
View Full Code Here


      XPath xpath = XPathFactory.newInstance().newXPath();
      NodeList items = (NodeList) xpath.evaluate("/rss/channel/item", doc, XPathConstants.NODESET);
      // Extract parking informations
      for (int i = 0; i < items.getLength(); i++) {
        Element item = (Element) items.item(i);
        Parking parking = new Parking();
        // Parking name
        parking.setName(((Element) item.getElementsByTagName("title").item(0)).getTextContent());
        // Parking incoming address
        tmpElt = (Element) item.getElementsByTagName("vdlxml:localisation").item(0);
        tmpElt = (Element) tmpElt.getElementsByTagName("vdlxml:localisationEntree").item(0);
        parking.setAddress(tmpElt.getTextContent());
        // Parking zone in Luxemburg town
        NodeList adrs = item.getElementsByTagName("vdlxml:quartier");
        for (int j = 0; j < adrs.getLength(); j++) {
          tmpElt = (Element) adrs.item(j);
          if (localeUsed.equalsIgnoreCase(tmpElt.getAttribute("lang"))) {
            parking.setZone(tmpElt.getTextContent());
            break;
          }
        }
        // Parking total capacity
        parking.setCapacity(((Element) item.getElementsByTagName("vdlxml:total").item(0)).getTextContent());
        if (StringUtils.isEmpty(parking.getCapacity())) {
          parking.setCapacity("-1");
        }
        // Parking available place
        parking.setAvailable(((Element) item.getElementsByTagName("vdlxml:actuel").item(0)).getTextContent());
        if (StringUtils.isEmpty(parking.getAvailable())) {
          parking.setAvailable("-1");
        }
        // Parking filling status
        parking.setFillingStatus(((Element) item.getElementsByTagName("vdlxml:complet").item(0)).getTextContent());
        if (StringUtils.isEmpty(parking.getFillingStatus())) {
          parking.setFillingStatus("0");
        }
        // Parking filling trend
        parking.setFillingTrend(((Element) item.getElementsByTagName("vdlxml:tendance").item(0)).getTextContent());
        if (StringUtils.isEmpty(parking.getFillingTrend())) {
          parking.setFillingTrend("0");
        }
        // Parking open status
        parking.setOpen(((Element) item.getElementsByTagName("vdlxml:ouvert").item(0)).getTextContent());
        if (StringUtils.isEmpty(parking.getOpen())) {
          parking.setOpen("0");
        }
        // Add parking to list
        parkings.add(parking);
      }
    } catch (Exception e) {
View Full Code Here

      // Case where details of a parking is requested
      if (req.getRequestURI().toLowerCase().endsWith("details.jsp")) {
        // Get the name of the parking request
        String pname = req.getParameter("pname");
        if (lst != null) {
          int pos = Collections.binarySearch(lst, new Parking(pname));
          req.setAttribute("PARKING", lst.get(pos));
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.drighetto.lmb.persistence.model.Parking

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.