03-04-2011 06:08 AM
03-09-2011 07:21 AM
activities.postActivity("org.alfresco.calendar.event-created", "demo", "calendar", '{ title: "Test title",page: "calendar?date=2011-03-09" }');
13:00, Mar 9, 2011
13:27
Test title calendar event created by Administrator
03-09-2011 07:24 AM
03-09-2011 09:58 AM
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/lib/calendar.lib.js">
var siteId = "qwerty";
var site = siteService.getSite(siteId);
var calendar = getCalendarContainer(site);
var timestamp = new Date().getTime();
var random = Math.round(Math.random() * 10000);
var event = calendar.createNode(timestamp + "-" + random + ".ics", "ia:calendarEvent");
event.properties["ia:whatEvent"] = "Event";
event.properties["ia:whereEvent"] = "Here";
event.properties["ia:descriptionEvent"] = "An event";
var fromDate = "2011,03,10,00,00";
var toDate = "2011,03,15,00,00";
var from = new Date(fromDate);
event.properties["ia:fromDate"] = from;
var to = new Date(toDate);
event.properties["ia:toDate"] = to;
event.save();
var pad = function (value, length)
{
value = String(value);
length = parseInt(length) || 2;
while (value.length < length)
{
value = "0" + value;
}
return value;
};
var isoDate = from.getFullYear() + "-" + pad(from.getMonth() + 1) + "-" + pad(from.getDate());
activities.postActivity("org.alfresco.calendar.event-created", siteId, "calendar", '{ title: "Test title", page: "calendar?date=' + isoDate + '" }');
03-09-2011 11:07 AM
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/lib/calendar.lib.js">
var siteId = "qwerty";
var site = siteService.getSite(siteId);
var calendar = getCalendarContainer(site);
var timestamp = new Date().getTime();
var random = Math.round(Math.random() * 10000);
var event = calendar.createNode(timestamp + "-" + random + ".ics", "ia:calendarEvent");
event.properties["ia:whatEvent"] = "Event";
event.properties["ia:whereEvent"] = "Here";
event.properties["ia:descriptionEvent"] = "An event";
event.properties["ia:docFolder"] = "";
var fromDate = "March 10, 2011 00:00:00";
var toDate = "March 15, 2011 00:00:00";
var from = new Date(fromDate);
event.properties["ia:fromDate"] = from;
var to = new Date(toDate);
event.properties["ia:toDate"] = to;
event.save();
var pad = function (value, length)
{
value = String(value);
length = parseInt(length) || 2;
while (value.length < length)
{
value = "0" + value;
}
return value;
};
var isoDate = from.getFullYear() + "-" + pad(from.getMonth() + 1) + "-" + pad(from.getDate());
activities.postActivity("org.alfresco.calendar.event-created", siteId, "calendar", '{ title: "Test title", page: "calendar?date=' + isoDate + '" }');
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.