Package org.onebusaway.users.model.properties

Examples of org.onebusaway.users.model.properties.RouteFilter


    v2.setDefaultLocationLon(v1.getDefaultLocationLon());
    v2.setDefaultLocationName(v1.getDefaultLocationName());

    int index = 0;
    for (String stopId : v1.getBookmarkedStopIds()) {
      Bookmark bookmark = new Bookmark(index++,null,Arrays.asList(stopId),new RouteFilter());
      v2.getBookmarks().add(bookmark);
    }

    return v2;
  }
View Full Code Here


    User userA = createUser();

    _service.setLastSelectedStopIds(userA, Arrays.asList("A"));
    _service.setDefaultLocation(userA, "here", 47.0, -122.0);
    _service.addStopBookmark(userA, "bookmark A", Arrays.asList("A", "C"),
        new RouteFilter());

    User userB = createUser();

    _service.mergeProperties(userA, userB);
View Full Code Here

    User userA = createUser();

    _service.setLastSelectedStopIds(userA, Arrays.asList("A"));
    _service.setDefaultLocation(userA, "here", 47.0, -122.0);
    _service.addStopBookmark(userA, "bookmark a", Arrays.asList("A", "C"),
        new RouteFilter());

    User userB = createUser();

    _service.setLastSelectedStopIds(userB, Arrays.asList("B"));
    _service.setDefaultLocation(userB, "there", 48.0, -123.0);
    _service.addStopBookmark(userB, "bookmark b", Arrays.asList("B", "A"),
        new RouteFilter());

    _service.mergeProperties(userA, userB);

    UserPropertiesV1 props = getProperties(userB);
    List<String> bookmarks = props.getBookmarkedStopIds();
View Full Code Here

    v2.setDefaultLocationLat(47.0);
    v2.setDefaultLocationLon(-122.0);
    v2.setDefaultLocationName("Seattle");
    v2.setRememberPreferencesEnabled(true);

    Bookmark b1 = new Bookmark(0,null,Arrays.asList("1_29214"),new RouteFilter());
    Bookmark b2 = new Bookmark(1,null,Arrays.asList("1_75403", "1_75414"), new RouteFilter());
    v2.setBookmarks(Arrays.asList(b1, b2));

    UserPropertiesV2 result = _service.migrate(v2, UserPropertiesV2.class);
    assertTrue(v2 == result);
View Full Code Here

       
        List<String> lastSelectedStopIds = currentUser.getLastSelectedStopIds();
        if (!lastSelectedStopIds.isEmpty()) {
          String name = _bookmarkPresentationService.getNameForStopIds(lastSelectedStopIds);
          _currentUserService.addStopBookmark(name, lastSelectedStopIds,
              new RouteFilter());
        }
       
        logUserInteraction("bookmark","added","stopIds",lastSelectedStopIds);
       
        return "added";
View Full Code Here

  public void testAddStopBookmark() throws BookmarkException {

    User user = createUser();

    _service.addStopBookmark(user, "bookmkark", Arrays.asList("1"),
        new RouteFilter());

    List<String> bookmarks = getProperties(user).getBookmarkedStopIds();
    assertEquals(1, bookmarks.size());
    assertTrue(bookmarks.contains("1"));
  }
View Full Code Here

    User userA = createUser();

    _service.setLastSelectedStopIds(userA, Arrays.asList("A"));
    _service.addStopBookmark(userA, "bookmark a", Arrays.asList("A", "C"),
        new RouteFilter());

    User userB = createUser();

    _service.setDefaultLocation(userB, "here", 47.0, -122.0);
    _service.addStopBookmark(userB, "bookmark b", Arrays.asList("C", "B"),
        new RouteFilter());
    _service.mergeProperties(userA, userB);

    UserPropertiesV1 props = getProperties(userB);
    List<String> bookmarks = props.getBookmarkedStopIds();
    assertEquals(4, bookmarks.size());
View Full Code Here

    if (_stops.isEmpty())
      return INPUT;
    String name = _bookmarkPresentationService.getNameForStops(_stops);
   
    List<String> stopIds = MappingLibrary.map(_stops, "id");
    _currentUserService.addStopBookmark(name, stopIds, new RouteFilter());
   
    logUserInteraction("stopIds",stopIds);
   
    return SUCCESS;
  }
View Full Code Here

   
    if (_stopIds == null || _stopIds.isEmpty())
      return INPUT;
   
    RouteFilter routeFilter = new RouteFilter(_routeIds);
    _currentUserService.updateStopBookmark(_id,_name,_stopIds,routeFilter);

    return SUCCESS;
  }
View Full Code Here

  public String execute() {

    if (_stopIds == null || _stopIds.isEmpty())
      return INPUT;
   
    RouteFilter routeFilter = new RouteFilter(_routeIds);
    _bookmarkId = _currentUserService.addStopBookmark(_name, _stopIds, routeFilter);

    return SUCCESS;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.users.model.properties.RouteFilter

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.