private String getFirstSync(AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { EventChanges ret = binding.getFirstSync( at, getCalendar(request), DateHelper.asDate(request.getParameter("lastSync"))); return responder.sendCalendarChanges(ret); }
private String getAllEvents(AccessToken at, Request request, XmlResponder responder) throws ServerFault { List<Event> e = binding.getAllEvents( at, getCalendar(request), EventType.valueOf(request.getParameter("eventType"))); return responder.sendListEvent(e); }
private String changeParticipationState(AccessToken at, Request request, XmlResponder responder) throws ServerFault, ParseException, EventNotFoundException, NotAllowedException { boolean recursive = getRecursive(request); boolean success = false; if (recursive) { success = binding.changeParticipationState( at, getCalendar(request), getExtId(request, "extId"), getParticipation(request), i(request, "sequence", 0), getNotificationOption(request)); } else { success = binding.changeParticipationState( at, getCalendar(request), getExtId(request, "extId"), getRecurrenceId(request), getParticipation(request), i(request, "sequence", 0), getNotificationOption(request)); } return responder.sendBoolean(success); }
private String getRefusedKeys(AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { KeyList ret = binding.getRefusedKeys( at, getCalendar(request), DateHelper.asDate(request.getParameter("since"))); return responder.sendKeyList(ret); }
private String getFreeBusy(AccessToken at, Request request, XmlResponder responder) throws SAXException, IOException, FactoryConfigurationError, ServerFault { String fbAsString = request.getParameter("freebusyrequest"); Document doc = DOMUtils.parse(fbAsString); FreeBusyRequest fb = cip.parseFreeBusyRequest(doc.getDocumentElement()); List<FreeBusy> ev = binding.getFreeBusy(at, fb); return responder.sendListFreeBusy(ev); }
private String parseFreeBusyToICS(AccessToken at, Request request, XmlResponder responder) throws SAXException, IOException, FactoryConfigurationError, ServerFault { String fbAsString = request.getParameter("freebusy"); Document doc = DOMUtils.parse(fbAsString); FreeBusy fb = cip.parseFreeBusy(doc.getDocumentElement()); String ics = binding.parseFreeBusyToICS(at, fb); return responder.sendString(ics); }
private String getEventObmIdFromExtId(AccessToken at, Request request, XmlResponder responder) throws ServerFault, EventNotFoundException, NotAllowedException { EventObmId id = binding.getEventObmIdFromExtId(at, getCalendar(request), getExtId(request, "extId")); if (id != null) { return responder.sendInt(id.getObmId()); } return responder.sendError("not found"); }
private String removeEventByExtId(AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { Event ev = binding.removeEventByExtId( at, getCalendar(request), getExtId(request, "extId"), i(request, "sequence", 0), getNotificationOption(request)); if (ev != null) { return responder.sendEvent(ev); } return responder.sendError("Event did not exist."); }
private String modifyEvent(AccessToken at, Request request, XmlResponder responder) throws ServerFault, SAXException, IOException, FactoryConfigurationError, NotAllowedException, PermissionException { Event ev = binding.modifyEvent( at, getCalendar(request), getEvent(request), Boolean.valueOf(request.getParameter("updateAttendees")), getNotificationOption(request)); if (ev != null) { return responder.sendEvent(ev); } return responder.sendError("Event did not exist."); }
private String removeEvent(AccessToken at, Request request, XmlResponder responder) throws ServerFault, EventNotFoundException, NotAllowedException { String calendar = getCalendar(request); EventObmId obmId = getObmId(request, "id"); int sequence = i(request, "sequence", 0); binding.removeEventById(at, calendar, obmId, sequence, getNotificationOption(request)); return responder.sendBoolean(true); }
private String importICalendar( final AccessToken token, final Request request, XmlResponder responder, String clientId) throws ImportICalendarException, ServerFault, NotAllowedException { final String calendar = request.getParameter("calendar"); final String ics = request.getParameter("ics"); int countEvent = binding.importICalendar(token, calendar, ics, clientId); return responder.sendInt(countEvent); }
private String getListEventsFromIntervalDate( AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { List<Event> e = binding.getListEventsFromIntervalDate( at, getCalendar(request), DateHelper.asDate(request.getParameter("start")), DateHelper.asDate(request.getParameter("end"))); return responder.sendListEvent(e); }
private String createEvent(AccessToken at, Request request, XmlResponder responder) throws ServerFault, SAXException, IOException, FactoryConfigurationError, EventAlreadyExistException, NotAllowedException, PermissionException { EventObmId ev = binding.createEvent( at, getCalendar(request), getEvent(request), getNotificationOption(request), getClientId(request)); return responder.sendInt(ev.getObmId()); }
private String storeEvent(AccessToken at, Request request, XmlResponder responder) throws ServerFault, SAXException, IOException, FactoryConfigurationError, NotAllowedException, PermissionException { Event event = binding.storeEvent( at, getCalendar(request), getEvent(request), getNotificationOption(request), getClientId(request)); return responder.sendEvent(event); }
private String getSyncInRange(AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { final Date after = DateHelper.asDate(request.getParameter("syncRangeAfter")); final Date before = DateHelper.asDate(request.getParameter("syncRangeBefore")); SyncRange syncRange = null; if (after != null || before != null) { syncRange = new SyncRange(before, after); } EventChanges ret = binding.getSyncInRange( at, getCalendar(request), DateHelper.asDate(request.getParameter("lastSync")), syncRange); return responder.sendCalendarChanges(ret); }
private String parseICSFreeBusy(AccessToken at, Request request, XmlResponder responder) throws ServerFault { String ics = request.getParameter("ics"); FreeBusyRequest freeBusy = binding.parseICSFreeBusy(at, ics); return responder.sendFreeBusyRequest(freeBusy); }
private String isWritableCalendar(AccessToken at, Request request, XmlResponder responder) throws ServerFault { boolean ret = binding.isWritableCalendar(at, getCalendar(request)); logger.info("isWritable(" + at.getUserEmail() + ", " + getCalendar(request) + ") => " + ret); return responder.sendBoolean(ret); }
private String getLastUpdate(AccessToken at, Request request, XmlResponder responder) throws ServerFault, NotAllowedException { Date d = binding.getLastUpdate(at, getCalendar(request)); return responder.sendLong(d.getTime()); }
private String parseICS(AccessToken at, Request request, XmlResponder responder) throws ServerFault, Exception { String ics = request.getParameter("ics"); List<Event> events = binding.parseICS(at, ics); return responder.sendListEvent(events); }
private String parseEvent(AccessToken at, Request request, XmlResponder responder) throws SAXException, IOException, FactoryConfigurationError, ServerFault { Event event = getEvent(request); String ics = binding.parseEvent(at, event); return responder.sendString(ics); }
private String getEventFromId(AccessToken at, Request request, XmlResponder responder) throws ServerFault, EventNotFoundException, NotAllowedException { Event e = binding.getEventFromId(at, getCalendar(request), getObmId(request, "id")); return responder.sendEvent(e); }
private String listResources(AccessToken at, Request req, XmlResponder responder) throws ServerFault { return responder.sendResourceInformation( binding.listResources(at, getLimit(req), getOffset(req), getPattern(req))); }
private String getResourceMetadata(AccessToken at, Request request, XmlResponder responder) throws ServerFault { return responder.sendResourceInformation( binding.getResourceMetadata(at, request.getParameterValues("resource"))); }
private String purge(final AccessToken at, final Request request, final XmlResponder responder) throws ServerFault, NotAllowedException { binding.purge(at, getCalendar(request)); return responder.sendBoolean(true); }
private String listCategories(AccessToken at, XmlResponder responder) throws ServerFault { List<Category> ret = binding.listCategories(at); return responder.sendCategories(ret); }
private String getUserEmail(AccessToken at, XmlResponder responder) throws ServerFault { String ue = binding.getUserEmail(at); return responder.sendString(ue); }
private String getEventTwinKeys(AccessToken at, Request request, XmlResponder responder) throws ServerFault, SAXException, IOException, FactoryConfigurationError, NotAllowedException { KeyList kl = binding.getEventTwinKeys(at, getCalendar(request), getEvent(request)); return responder.sendKeyList(kl); }
private String getCalendarMetadata(AccessToken at, Request request, XmlResponder responder) throws ServerFault { return responder.sendCalendarInformations( binding.getCalendarMetadata(at, request.getParameterValues("calendar"))); }