示例#1
0
 private void handleMapClick(String id) {
   clientFactory.getGA().trackEvent("Map", "Select Room", id);
   CalendarListResource c = clientFactory.getModelDao().getRoomByD3id(id);
   if (c == null) {
     Dialogs.alert("Sorry", id + " is not a BrightRoom.", null);
     return;
   }
   clientFactory.getPlaceController().goTo(new RoomPlace(c.getId()));
 }
示例#2
0
  private void handleBatchResponse(JSOModel resp) {
    // Early exit if this activity has already been canceled.
    if (eventBus == null) {
      return;
    }

    // TODO: wow, this is some sloppy sh!t
    Office office = clientFactory.getModelDao().getOfficeById(officeId);
    JsArray<CalendarListResource> list = clientFactory.getModelDao().getRooms(office);
    for (int i = 0; i < list.length(); i++) {
      CalendarListResource room = list.get(i);
      JSOModel foo = resp.getObject(room.getId());
      if (foo != null) {
        JSOModel result = foo.getObject("result");
        JSOModel event = clientFactory.getModelDao().findCurrentEvent(result.getArray("items"));
        boolean isBusy = result.getArray("items") != null && event != null;
        // Window.alert(result.get("summary") + " : " + isBusy);
        updateColor(room.getD3id(), isBusy);
      }
    }
  }