Exemple #1
0
 public FDJson editGoogleEvent(FDEvent event, FDCalendar cal) throws Exception {
   Map<String, String> params = new HashMap<String, String>();
   //		params.put("cid", cid);
   //		params.put("type", "2");
   //		params.put("eid", event.getId());
   //		JSONObject obj = event.toJsonObjByGoogle();
   //		params.put("text", obj.toString());
   params.put("method", "updateEvent");
   params.put("accountId", cal.getGoogleAccountId());
   params.put("calendarId", cal.getId());
   params.put("eventId", event.getId());
   JSONObject obj = event.toJsonObjByGoogle();
   params.put("params", obj.toString());
   FDPrintln.print(" edit Google Event params : " + obj.toString());
   FDJson json = sendPOSTRequestByJson("user/Google", params);
   return json;
 }
Exemple #2
0
 /**
  * 修改Go2 服务器事件
  *
  * @param event
  * @return
  * @throws Exception
  */
 public FDEvent editGo2Event(FDEvent event) throws Exception {
   Map<String, String> params = new HashMap<String, String>();
   params.put("method", "update");
   params.put("id", event.getId());
   params.put("title", event.getTitle());
   params.put("description", event.getNote());
   params.put("start", FDTimeFormatUtil.sdfAllDate.format(event.getFromDateByTimeZone()));
   params.put("timezone", event.getTimezone());
   params.put("end", FDTimeFormatUtil.sdfAllDate.format(event.getToDateByTimeZone()));
   params.put("isAllDay", event.isAllDay() ? "1" : "0");
   params.put("location", event.getLocation());
   params.put("cid", event.getCalendarId());
   params.put("recurrence", event.getRecurrence());
   params.put("recurringEventId", event.getRecurringEventId());
   params.put("status", event.getStatus() + "");
   params.put("originalStartTime", event.getOriginalStartTime());
   FDJson json = sendPOSTRequestByJson("user/privateEvent", params);
   if (json != null) {
     if (json.getStatusCode() != 1) {
       return null;
     }
   }
   return event;
 }