Domino REST POST无法用于约会-找不到注释项 [英] Domino REST POST not working for Appointment - Note Item not found

查看:59
本文介绍了Domino REST POST无法用于约会-找不到注释项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个客户端JS应用程序,并且与Domino服务器的REST接口(带有OSGi扩展的8.5.3版)有一些麻烦,GET部分有效,但POST有问题,请参见下面的代码.当我单击它时,这会在Domino/Notes中创建一个文档,并显示以下消息

I am writing a client side JS app and I am having some trouble with the REST interface to Domino server (version 8.5.3 with OSGi extension), the GET part works but I am having issues with the POST see code below. This creates a document in Domino/Notes when I click on it I get the follow messages

  • 找不到注释项

  • Note Item not found

tmpStartTime_Local:操作员的数据类型错误或预期的@Function时间/日期

tmpStartTime_Local : incorrect data type for operator or @Function Time/Date expected

然后我尝试填写所有"tmp"时间字段,这可以创建一个文档,但也不正确.我也尝试过使用通知"而不是约会表格.

I then tried to fill in all the "tmp" time fields this can create a document but it is not correct either. I also tried to use the "Notice" rather than appointment form again no good.

当我在Notes中打开文档时,它说它是一个议程项目,而不是会议,并且它是重复出现的,而不是会议.它出现在所有文档"中,而不出现在日历或资源保留中.我认为是我没有为约会文档设置正确的值,还是我没有将正确的服务称为正确的服务?

When I open the document in Notes it say it is an Agenda Item but not a meeting and also that it is recurring which it is not. It appears in "all documents" but not in the Calendar or the resource reservation. I think it is either I am not setting the correct values for an appointment document or I am not calling the correct service any ideas how to correct ?

       function postREST()
        {
            var msg=
            {
                "Subject":"TEST C3",
                "Body":"The date/time variant is basically just a floating-point number with the date as the integer part and the time as the fractional part. It can be freely converted back and forth to a Double, without losing information.",

                 "$PublicAccess":"1",
                 "$BusyName":"CN=Administrator/O=acme",
                 "$BusyPriority":"1",
                 "$ApprovalList":"CN=Administrator/O=acme",
                 "$CSFlags":"uw",
                 "$CSCopyItems":["Room"],
                 "$Programmatically": "1",
                 "ExcludeFromView":  ["D","S" ],


                 "MailOptions":"0",
                 "AllowBusyAccess":"",
                 "NoticeType" : "I",
                 "AutoProcessType":"0",
                 "AutoProcessUserList":"Administrator",
                 "Room":"Room2\/ZAC Atalante champeaux@acme",
                 "AppointmentType":"3",   // 0 = Appointment   3 Meeting
                 "Form":"Appointment",
                  "_ViewIcon":158,     // Meeting

                "Repeats":"",       // doesn't appear to do much
                "Chair":"CN=Administrator\/O=acme",
                "Principal":"CN=Administrator\/O=acme",
                "From":"CN=Administrator\/O=acme",
                //"From":"CN=Administrator",
                "AltChair":"CN=Administrator\/O=acme",
                "SequenceNum":1,
                "OrgTable":"C0",        // Calendar entry 0 => first Calendar
                "Logo":"StdNotesLtr25",
                "StartTime":"10:00:00",
                "StartDate":"2014-02-17",
                "EndTime":"11:00:00",
                "EndDate":"2014-02-17",

                "CalendarDateTime":"2014-02-17T09:00:00Z",
                "StartTimeZone":"Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=68$ZN=Romance",
                "EndTimeZone":"Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=68$ZN=Romance",
                "WhiteBoardContent":
                {
                    "type":"multipart",
                    "content":        [
                      {
                       "contentType":"text\/html; charset=US-ASCII",
                        "contentDisposition":"inline",
                        "data":"<html><body>HELLO WORLD<\/body><\/html>\r\n\r\n"
                      }
                    ]
                },
            }

          try {
          var Amsg = JSON.stringify(msg);
            }
          catch (err) {
                 log(": Exception:"+ err); 
               }

          var url = "http://99.99.99.99/mail/administ.nsf/api/data/documents?form=Appointment";

         var username = "admin";
         var password = "pwd";
            try{  

                xhr = new XMLHttpRequest();
                xhr.addEventListener("loadstart", function(evt) { //log("loadstart");log(evt); 
                                                        }, false);
                xhr.addEventListener("progress", function(evt) 
                               { //log("progress");log(evt); 
                               }, false);
                xhr.addEventListener("error", function(evt) { 
            error("xmlhttprequest ERROR");
                      log("ERROR readyState : " + this.readyState + "  status : " + this.status + "  "  + this.statusText);
                   log("ERROR responseText  : " + this.responseText);
                      log("ERROR responseXML  : " + this.responseXML);

          error(evt); }, false);

              xhr.addEventListener("abort", function(evt) { error("abort"); error(evt); }, false);
              xhr.addEventListener("load", function(evt) { //log("load");log(evt); 
                                                  }, false);

              xhr.addEventListener("loadend", function(evt) { 
            log("loadend ANSWER : readyState : " + this.readyState + "  status : " + this.status);
                      postReturn(this.responseText);
          }, false);

             xhr.open("POST", url, true, username, password);
             xhr.setRequestHeader("Content-Type", "application/json");
             xhr.send(msg);
                        }
  catch(err) {
         log(": Exception:"+ err); 
       }

}

推荐答案

对于Domino 8.5.3,数据服务是唯一可用的REST服务.

For Domino 8.5.3, the data service is the only REST service available.

在Domino 9.0中变得更好.这使您可以选择使用OpenNTF的扩展库来安装

It gets better in Domino 9.0. That gives you the option of using the extension library from OpenNTF to install the Domino calendar service. The calendar service is much better suited to your use case. It doesn't require in-depth knowledge of the Notes C&S schema and automatically handles scheduling workflow as you create, update and delete events.

此外,日历服务已内置在Domino 9.0.1中.因此9.0.1甚至不需要安装单独的扩展库.

Also, the calendar service is built into Domino 9.0.1. So 9.0.1 doesn't even require a separate extension library install.

但是,假设您受限于8.5.3和数据服务,我有一个想法是什么导致操作员的数据类型不正确"错误.您的JSON输入将每个数据/时间项定义为纯字符串.这样声明数据类型可能会有更好的结果:

However, assuming you are constrained to 8.5.3 and the data service, I have an idea what is causing the "incorrect data type for operator" error. Your JSON input is defining each data/time item as a plain string. You might have better results declaring the data type like this:

"CalendarDateTime": {
  "data": "2014-02-17T18:00:00Z",
  "type": "datetime"
}

因此,您可以尝试显式声明每个日期/时间项的数据类型,但是我个人从未尝试使用数据服务创建日历事件.即使您克服了这个错误,我也不知道前方是否还会有更多问题.

So you could try explicitly declaring the data type for each date/time item, but I personally have never tried to create a calendar event with the data service. Even if you get past this error, I wonder if there will be more problems ahead.

这篇关于Domino REST POST无法用于约会-找不到注释项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆