03-04-2011 06:08 AM
03-09-2011 04:22 AM
03-09-2011 04:40 AM
03-09-2011 05:26 AM
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/lib/calendar.lib.js">
var timestamp = new Date().getTime();
var random = Math.round(Math.random() * 10000);
var event = qwerty.createNode(timestamp + "-" + random + ".ics", "ia:calendarEvent"); //qwerty is the name of my site
event.properties["ia:whatEvent"] = "Event";
event.properties["ia:whereEvent"] = "Here";
event.properties["ia:descriptionEvent"] = "An event";
var fromDate = "2011-03-09";
var toDate = "2011-03-10";
var from = new Date(fromDate);
event.properties["ia:fromDate"] = from;
var to = new Date(toDate);
event.properties["ia:toDate"] = to;
event.save();
02090119 Failed to execute script 'workspace://SpacesStore/7c6e1b80-ed29-4008-ac30-13e9cfa75dc6': 02090118 ReferenceError: "qwerty" is not defined. (workspace://SpacesStore/7c6e1b80-ed29-4008-ac30-13e9cfa75dc6#25
03-09-2011 05:56 AM
03-09-2011 06:12 AM
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/lib/calendar.lib.js">
var site = siteService.getSite("qwerty");
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-09";
var toDate = "2011-03-10";
var from = new Date(fromDate);
event.properties["ia:fromDate"] = from;
var to = new Date(toDate);
event.properties["ia:toDate"] = to;
event.save();
try
{
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());
var data =
{
title: params["what"],
page: json.get("page") + "?date=" + isoDate
}
activities.postActivity("org.alfresco.calendar.event-created", siteId, "calendar", jsonUtils.toJSONString(data));
}
catch(e)
{
if (logger.isLoggingEnabled())
{
logger.log(e);
}
}
03-09-2011 06:22 AM
03-09-2011 06:48 AM
try
{
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());
var data =
{
title: params["what"],
page: json.get("page") + "?date=" + isoDate
}
activities.postActivity("org.alfresco.calendar.event-created", siteId, "calendar", jsonUtils.toJSONString(data));
}
catch(e)
{
if (logger.isLoggingEnabled())
{
logger.log(e);
}
}
03-09-2011 06:56 AM
03-09-2011 07:11 AM
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.