Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.AgencyBean


    List<AgencyBean> agencies = AgencyPresenter.getAgenciesForArrivalAndDepartures(arrivals);

    if (!agencies.isEmpty()) {
      addMessage(Messages.ARRIVAL_INFO_DATA_PROVIDED_BY);
      for (int i = 0; i < agencies.size(); i++) {
        AgencyBean agency = agencies.get(i);
        if (i == agencies.size() - 1 && agencies.size() > 1)
          addText(Messages.AND);
        addText(agency.getName());
        addText(",");
      }
    }
  }
View Full Code Here


    public void onSuccess(List<AgencyWithCoverageBean> agencies) {

      LatLngBounds bounds = LatLngBounds.newInstance();
      for (AgencyWithCoverageBean agencyWithCoverage : agencies) {

        final AgencyBean agency = agencyWithCoverage.getAgency();
        final LatLng point = LatLng.newInstance(agencyWithCoverage.getLat(),
            agencyWithCoverage.getLon());
        bounds.extend(point);

        Marker marker = new Marker(point);
        marker.addMarkerClickHandler(new MarkerClickHandler() {
          @Override
          public void onClick(MarkerClickEvent event) {
            InfoWindow window = _map.getInfoWindow();
            DivPanel panel = new DivPanel();

            DivPanel rowA = new DivPanel(_css.paragraph());
            panel.add(rowA);
            rowA.add(new Anchor(agency.getName(), agency.getUrl()));

            DivPanel rowB = new DivPanel(_css.paragraph());
            panel.add(rowB);
            rowB.add(new Anchor("jump to map", "index.html#m(location)lat("
                + point.getLatitude() + ")lon(" + point.getLongitude()
View Full Code Here

        _stopFinder.queryRoute(route.getId());
      }
    });
    routeRow.add(anchor);

    AgencyBean agency = route.getAgency();
    String agencyLink = agency.getName();
    if (agency.getUrl() != null)
      agencyLink = "<a href=\"" + agency.getUrl() + "\">" + agency.getName()
          + "</a>";
    resultPanel.add(new DivWidget("Operated by " + agencyLink,
        _css.resultListEntryDescription()));
  }
View Full Code Here

  }

  @Override
  public String execute() {

    AgencyBean agency = _transitDataService.getAgency(_agencyId);

    if (agency == null)
      return INPUT;

    Calendar c = Calendar.getInstance();
    long timeTo = c.getTimeInMillis();
    c.add(Calendar.DAY_OF_WEEK, -_days);
    long timeFrom = c.getTimeInMillis();

    TripProblemReportQueryBean query = new TripProblemReportQueryBean();
    query.setAgencyId(_agencyId);
    query.setTimeFrom(timeFrom);
    query.setTimeTo(timeTo);
    if (_status != null)
      query.setStatus(EProblemReportStatus.valueOf(_status));
    query.setLabel(_label);

    ListBean<TripProblemReportBean> result = _transitDataService.getTripProblemReports(query);
    List<TripProblemReportBean> reports = result.getList();

    _feed = new SyndFeedImpl();

    StringBuilder title = new StringBuilder();
    title.append(getText("rss.OneBusAwayTripProblemReports"));
    title.append(" - ");
    title.append(agency.getName());
    title.append(" - ");
    title.append(getText("rss.LastXDays", Arrays.asList((Object) _days)));

    HttpServletRequest request = ServletActionContext.getRequest();

    StringBuilder b = new StringBuilder();
    b.append("http://");
    b.append(request.getServerName());
    if (request.getServerPort() != 80)
      b.append(":").append(request.getServerPort());
    if (request.getContextPath() != null)
      b.append(request.getContextPath());
    String baseUrl = b.toString();

    _feed.setTitle(title.toString());
    _feed.setLink(baseUrl);
    _feed.setDescription(getText("rss.UserSubmittedTripProblemReports",
        Arrays.asList((Object) agency.getName(), _days)));

    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    _feed.setEntries(entries);

    for (TripProblemReportBean report : reports) {
View Full Code Here

  }

  @Override
  public String execute() {

    AgencyBean agency = _transitDataService.getAgency(_agencyId);

    if (agency == null)
      return INPUT;

    Calendar c = Calendar.getInstance();
    long timeTo = c.getTimeInMillis();
    c.add(Calendar.DAY_OF_WEEK, -_days);
    long timeFrom = c.getTimeInMillis();

    StopProblemReportQueryBean query = new StopProblemReportQueryBean();
    query.setAgencyId(_agencyId);
    query.setTimeFrom(timeFrom);
    query.setTimeTo(timeTo);
    if (_status != null)
      query.setStatus(EProblemReportStatus.valueOf(_status));

    ListBean<StopProblemReportBean> result = _transitDataService.getStopProblemReports(query);
    List<StopProblemReportBean> reports = result.getList();

    _feed = new SyndFeedImpl();

    StringBuilder title = new StringBuilder();
    title.append(getText("rss.OneBusAwayStopProblemReports"));
    title.append(" - ");
    title.append(agency.getName());
    title.append(" - ");
    title.append(getText("rss.LastXDays", Arrays.asList((Object) _days)));

    HttpServletRequest request = ServletActionContext.getRequest();

    StringBuilder b = new StringBuilder();
    b.append("http://");
    b.append(request.getServerName());
    if (request.getServerPort() != 80)
      b.append(":").append(request.getServerPort());
    if (request.getContextPath() != null)
      b.append(request.getContextPath());
    String baseUrl = b.toString();

    _feed.setTitle(title.toString());
    _feed.setLink(baseUrl);
    _feed.setDescription(getText("rss.UserSubmittedStopProblemReports",
        Arrays.asList((Object) agency.getName(), _days)));

    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    _feed.setEntries(entries);

    for (StopProblemReportBean report : reports) {
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.AgencyBean

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.