使用日历服务访问与会者日历时获取StoreException(基于REST)

时间:2015-05-08 13:00:47

标签: lotus-domino lotus

使用日历服务访问与会者的用户日历。

网址:http://<host>/mail/test.nsf/api/calendar/events/4767DFD4B4A6B66488257E3F0043285F-Lotus_Auto_Generated.

如果我使用Notes客户端接受该会议,则会收到以下异常。我可以使用REST服务访问该会议而没有任何错误。

{
  "code": 404,
  "text": "Not Found",
  "cserror": 1031,
  "message": "Error reading event",
  "type": "text",
  "data": "com.ibm.domino.calendar.store.StoreException: Error reading event
           at com.ibm.domino.calendar.dbstore.NotesCalendarStore.getEvent(NotesCalendarStore.java:185)
           at com.ibm.domino.services.calendar.resources.EventResource.getEventInternal(EventResource.java:604)
           at com.ibm.domino.services.calendar.resources.EventResource.getEvent(EventResource.java:137)
           at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
           at java.lang.reflect.Method.invoke(Method.java:611)
           at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
           at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
           at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
           at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
           at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
           at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
           at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
           at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
           at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
           at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleResourceMethod(FindResourceMethodHandler.java:151)
           at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:65)
           at ...

1 个答案:

答案 0 :(得分:1)

GET /{database}/api/calendar/events的回复包括事件和通知。事件是已在日历上预订的条目(约会,会议,提醒等)。通知是一个单独的文档 - 例如邀请或重新安排 - 描述会议的某些内容。从技术上讲,日历上没有预订通知。

以下是JSON格式的通知示例:

{
  "href": "/mail/dlawson.nsf/api/calendar/events/5BB9F2BCE41C33E185257E4200672A32-Lotus_Notes_Generated",
  "id": "5BB9F2BCE41C33E185257E4200672A32-Lotus_Notes_Generated",
  "summary": "Invitation: Quick update",
  "location": "My office",
  "start": {
    "date": "2015-05-15",
    "time": "17:00:00",
    "utc": true
  },
  "end": {
    "date": "2015-05-15",
    "time": "18:00:00",
    "utc": true
  },
  "class": "public",
  "transparency": "transparent",
  "sequence": 0,
  "x-lotus-organizer": {
    "data": "CN=Dean Melnyk/O=Peaks"
  },
  "x-lotus-summarydataonly": {
    "data": "TRUE"
  },
  "x-lotus-noticetype": {
    "data": "I"
  },
  "x-lotus-appttype": {
    "data": "3"
  },
  "x-lotus-unid": {
    "data": "5BB9F2BCE41C33E185257E4200672A32"
  }
}

x-lotus-notice属性表示它是一个通知 - 在这种情况下是一个邀请。

这很微妙,但我认为日历API返回404,因为您正在尝试阅读带有事件URL的通知。正如您所发现的那样,在您接受邀请之前,您无法阅读该活动。