Examples of Agency


Examples of models.transit.Agency

                    notFound();
            }
            else {

                if(agencyId != null) {
                    Agency agency = Agency.findById(agencyId);
                    renderJSON(Api.toJson(Trip.find("pattern.route.agency = ?", agency).fetch(), false));
                }
               
                else if (patternId != null && calendarId != null) {
                    TripPattern pattern = TripPattern.findById(patternId);
View Full Code Here

Examples of models.transit.Agency

            Secure.login();
        }

        if(session.get("agencyId") == null) {
           
          Agency agency = agencies.get(0);

            session.put("agencyId", agency.id);
            session.put("agencyName", agency.name);
            session.put("lat", agency.defaultLat);
            session.put("lon", agency.defaultLon);
View Full Code Here

Examples of models.transit.Agency

    }

    public static void search() {
      
        Long agencyId = Long.parseLong(session.get("agencyId"));
        Agency selectedAgency = Agency.findById(agencyId);
        List<Route> routes = Route.find("agency = ? order by routeShortName", selectedAgency).fetch();
        render(routes);
    }
View Full Code Here

Examples of models.transit.Agency

   
    Application.index();
  }
   
    public static void setAgency(Long agencyId) {
        Agency agency = Agency.findById(agencyId);

        if(agency == null)
            badRequest();

        session.put("agencyId", agencyId);
View Full Code Here

Examples of models.transit.Agency

       
        if(agencySelect != null || agencySelect.size() > 0) {

            for(Long agencyId : agencySelect) {
               
              Agency a = Agency.findById(agencyId);
                if(a != null)
                  agencyObjects.add(a);
           
            }
        }
View Full Code Here

Examples of models.transit.Agency

        params.flash();
        validation.keep();
        agencyForm();
        }
     
      Agency agency = new Agency(gtfsId, name, url, timezone, language, phone);
     
      agency.defaultLat = defaultLat;
      agency.defaultLon = defaultLon;
     
      agency.save();
     
      Bootstrap.index();
    }
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    // GTFS.
    return new AgencyAndId(operatorId, operatorId + "-" + routeId);
  }

  private Agency getAgencyForId(String id) {
    Agency agency = _dao.getAgencyForId(id);
    if (agency == null) {
      agency = new Agency();
      agency.setId(id);
      agency.setTimezone(_agencyTimezone);
      agency.setLang(_agencyLang);

      OperatorElement operator = _operatorsById.get(id);
      if (operator != null) {
        if (!isEmpty(operator.getShortFormName())) {
          agency.setName(operator.getShortFormName());
        }
        if (!isEmpty(operator.getEnquiryPhone())) {
          agency.setPhone(operator.getEnquiryPhone());
        }
      }
      NationalExpressOperatorElement nxOperator = _nxOperatorsById.get(id);
      if (nxOperator != null) {
        if (!isEmpty(nxOperator.getMarketingName())) {
          agency.setName(nxOperator.getMarketingName());
        }
        if (!isEmpty(nxOperator.getUrl())) {
          agency.setUrl(nxOperator.getUrl());
        }
      }

      if (isEmpty(agency.getName())) {
        agency.setName(_agencyName);
      }
      if (isEmpty(agency.getPhone())) {
        agency.setPhone(_agencyPhone);
      }
      if (isEmpty(agency.getUrl())) {
        agency.setUrl(_agencyUrl);
      }
      _dao.saveEntity(agency);
    }
    return agency;
  }
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    private void addTripFields(Leg leg, State[] states) {
        Trip trip = states[states.length - 1].getBackTrip();

        if (trip != null) {
            Route route = trip.getRoute();
            Agency agency = route.getAgency();
            ServiceDay serviceDay = states[states.length - 1].getServiceDay();

            leg.agencyId = agency.getId();
            leg.agencyName = agency.getName();
            leg.agencyUrl = agency.getUrl();
            leg.headsign = states[states.length - 1].getBackDirection();
            leg.route = states[states.length - 1].getBackEdge().getName();
            leg.routeColor = route.getColor();
            leg.routeId = route.getId().getId();
            leg.routeLongName = route.getLongName();
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    @Override
    public Agency unmarshal(AgencyType arg) throws Exception {
        if (arg == null) {
            return null;
        }
        Agency a = new Agency();
        a.setId(arg.id);
        a.setName(arg.name);
        a.setUrl(arg.url);
        a.setTimezone(arg.timezone);
        a.setLang(arg.lang);
        a.setPhone(arg.phone);
        a.setFareUrl(arg.fareUrl);
        return new Agency(a);
    }
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

        secondStops.add(trainStopArrive);
        thirdStops.add(ferryStopDepart);
        thirdStops.add(ferryStopArrive);

        // Agencies for legs 1, 2 and 4, plus initialization
        Agency trainAgency = new Agency();
        Agency ferryAgency = new Agency();

        trainAgency.setId("Train");
        trainAgency.setName("John Train");
        trainAgency.setUrl("http://www.train.org/");
        ferryAgency.setId("Ferry");
        ferryAgency.setName("Brian Ferry");
        ferryAgency.setUrl("http://www.ferry.org/");

        // Routes for legs 1, 2 and 4, plus initialization
        Route firstRoute = new Route();
        Route secondRoute = new Route();
        Route thirdRoute = new Route();
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.