AnsweredAssumed Answered

Simple script to get Calendar events.[Solved]

Question asked by michaelc on Nov 15, 2012
Latest reply on Dec 4, 2012 by michaelc
This is in WCMQS but it's the same as the share elements.

Requirement: On a page show all up coming events with a given site.
Seems simple the following URL will give me that result.
   http://localhost:8080/share/proxy/alfresco-feed/calendar/eventList?site=content&format=json

  So I expected the following would work.

    var connector = remote.connect("alfresco");
   var result = connector.get("/alfresco-feed/calendar/eventList?site=content&format=json")

   //             Also tried
  //    var result = remote.call("/alfresco/service/calendar/getCalendarEvent");

   if (result.status == 200 && result != "{}")
   {
      prefs = eval('(' + result + ')');
     
      // get the dates
      for (var i = 0; i < prefs.properties.length; i++) {
           objArray = prefs.properties[i].value;
           for (var i2 = 0; i2 < objArray.length; i2++) {
                 resultArray.push(objArray[i2].uri)
           }

      }
      model.result = resultArray;

   }
   model.status = result.status
  

The result is not authorized or not found.
  I just don't understand how - seems simple but I seem to have missed something.

Outcomes