Merged V4.1-BUG-FIX to HEAD

40347: GERMAN: Translation update based on EN 40202
   40348: SPANISH: Translation update based on EN 40202, fixes: ALF-15360 and ALF-15361
   40353: RUSSIAN: Adds official support for Russian (locale: ru) to Alfresco. Initial translation based on EN r38926.
   40361: ALF-15453: Incorrect manage permissions working for a file/folder
   40362: CHINESE: renames an incorrectly named file.
   40382: Fix for ALF-15491 SOLR is generating queries for lucene style cross-language support
   40389: ALF-14399 : Added method removeTimeZoneIfIsAllDay to AbstractCalendarWebScript. Used to strip time zone information from all day events, was forced to handle date patterns in the same method due to legacy date format requirements. java.util.Date has been replaced with iso8061 date String in the FTL model to ensure local server time zone is not added when we have explicitly removed it.
   40401: Part for for ALF-15406 Index Tracker seems not to gracefully stop upon shutdown keeping all other threads in waiting
   40406: A slash was missing (the sites in the folder picker couldn't be shown)
   40410: ALF-13190 and ALF-13287: both bugs related to the iCal SETPOS attribute. SETPOS (for outlook) specifies the week number with in a month. Possible values are -1 to 4. The positive values count forward while negative count backwards, -1 should represent the last week in a month. The method toDayOfWeekInMonth within CalendarReccurenceHelper was not setup to handle -1, this has been corrected. buildRecurrenceString within CalendarEntryGet was incorrectly using SETPOS to lookup day name.
   40412: GERMAN: Translation updates based on EN r40357
   40413: SPANISH: Translation updates based on EN r40357
   40414: FRENCH: Translation updates based on EN r40357
   40415: ITALIAN: Translation updates based on EN r40357
   40416: JAPANESE: Translation updates based on EN r40357
   40417: DUTCH: Translation updates based on EN r40357
   40418: CHINESE: Translation updates based on EN r40357
   40420: First half of fix for ALF-12803 - No user feedback: Cannot transformed content with password. (Failure of synchronous rule causes upload to fail with unhelpful message)
    - reporting error information inline when DnD upload is used
    - TODO: push JSON error response through the Flash Adaptor uploader component (requires swf uploader modifications)
   40428: Merged V4.1 to V4.1-BUG-FIX
      40349: CloudSync: fix move out (=> target delete) - add unit tests ( ALF-14655 / ALF-15011 )
      40364: Testcase for ALF-15178, which is not reproduced.
      40381: ALF-15295: Cannot access folders beyond first page of document library
      40393: BDE-93 cleanup notice file, especially updating outdated URLs
      40419: Fix for the MLText parts of ALF-15502.
      40427: Merged DEV/COMMUNITY-4.0-BUGFIX to V4.1
         40425: ALF-15470: Solr distribution changes
         - Added scripts for regenerating keystores to repository keystore directory
         - Included this directory in the solr distribution zip under alf_data/keystore for easier installation to tomcat


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40429 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-08-14 19:17:45 +00:00
parent 4fa1bb198a
commit 45514f13e2
37 changed files with 419 additions and 69 deletions

View File

@@ -0,0 +1,7 @@
# Audit Control Web Script I18N
audit.err.app.notProvided=Application name not supplied.
audit.err.app.notFound=Application not found: {0}
audit.err.path.notProvided=No path was supplied after the application name.
audit.err.action.invalid=Parameter 'action' must be either 'enable' or 'disable'
audit.err.value.classNotFound=''valueType'' not recognised: {0}
audit.err.value.convertFailed=Unable to convert ''{0}'' to type ''{1}''

View File

@@ -0,0 +1 @@
blog-post.msg.deleted=Blog {0} gel\u00f6scht

View File

@@ -0,0 +1 @@
blog-post.msg.deleted=Blog {0} eliminado

View File

@@ -0,0 +1,2 @@
forum-post.msg.deleted=Node {0} gel\u00f6scht
forum-post.msg.marked.removed=Node {0} als entfernt gekennzeichnet

View File

@@ -0,0 +1,2 @@
forum-post.msg.deleted=Nodo {0} eliminado
forum-post.msg.marked.removed=Nodo {0} marcado como eliminado

View File

@@ -0,0 +1,3 @@
links-delete.err.not.found=Keine g\u00fcltigen Link-Namen angegeben
links-delete.access.denied=Sie sind nicht berechtigt, den Link mit dem Namen '{0}' zu l\u00f6schen
links-delete.msg.deleted=Node {0} gel\u00f6scht

View File

@@ -0,0 +1,3 @@
links-delete.err.not.found=No se han proporcionado nombres de enlaces v\u00e1lidos
links-delete.access.denied=No tiene permisos para eliminar el enlace con el nombre '{0}'
links-delete.msg.deleted=Nodo {0} eliminado

View File

@@ -0,0 +1,2 @@
links.err.access.denied=Sie sind nicht berechtigt, einen Link zu erstellen
links.err.not.found=Es wurde kein Link mit diesem Namen gefunden

View File

@@ -0,0 +1,2 @@
links.err.access.denied=No tiene permisos para crear un enlace
links.err.not.found=No se ha encontrado ning\u00fan enlace con ese nombre

View File

@@ -0,0 +1,2 @@
links.err.access.denied=Sie sind nicht berechtigt, einen Link zu erstellen
links.err.not.found=Es wurde kein Link mit diesem Namen gefunden

View File

@@ -0,0 +1,2 @@
links.err.access.denied=No tiene permisos para crear un enlace
links.err.not.found=No se ha encontrado ning\u00fan enlace con ese nombre

View File

@@ -0,0 +1,11 @@
# User CSV Upload Web Script I18N
person.err.userCSV.invalidForm=\u0414\u0430\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u043a\u0430\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u0430\u044f
person.err.userCSV.noFile=\u0424\u0430\u0439\u043b\u044b \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b
person.err.userCSV.corruptFile=\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u044b\u043b \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d \u0438\u043b\u0438 \u0443\u0441\u0435\u0447\u0435\u043d
person.err.userCSV.general=\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430
person.err.userCSV.generalArgs=\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: {0}
person.err.userCSV.blankColumn=\u0421\u0442\u043e\u043b\u0431\u0435\u0446 {0} (\u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 {1}) \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442, \u043d\u043e \u0431\u044b\u043b \u043f\u0443\u0441\u0442\u044b\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {2}
person.msg.userCSV.created=\u0421\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f {0}
person.msg.userCSV.existing=\u0423\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442

View File

@@ -0,0 +1,6 @@
authForm.title=Alfresco » \u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u0430\u043d\u0430\u043b\u043e\u0432
authForm.heading=\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u0430\u043d\u0430\u043b\u043e\u0432
authForm.directions=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f {0}
authForm.user=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:
authForm.password=\u041f\u0430\u0440\u043e\u043b\u044c:
authForm.login=\u0412\u043e\u0439\u0442\u0438

View File

@@ -9,14 +9,14 @@
"location": "${result.location}", "location": "${result.location}",
"tags": [<#list result.tags as tag>"${tag}"<#if tag_has_next>,</#if></#list>], "tags": [<#list result.tags as tag>"${tag}"<#if tag_has_next>,</#if></#list>],
"startAt": { "startAt": {
"iso8601": "${xmldate(result.from)}", "iso8601": "${result.from}",
"legacyDate": "${result.from?string("M/d/yyyy")}", "legacyDate": "${result.legacyDateFrom}",
"legacyTime": "${result.from?string("HH:mm")}" "legacyTime": "${result.legacyTimeFrom}"
}, },
"endAt": { "endAt": {
"iso8601": "${xmldate(result.to)}", "iso8601": "${result.to}",
"legacyDate": "${result.to?string("M/d/yyyy")}", "legacyDate": "${result.legacyDateTo}",
"legacyTime": "${result.to?string("HH:mm")}" "legacyTime": "${result.legacyTimeTo}"
}, },
"allday": "${result.allday?string}", "allday": "${result.allday?string}",

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=Ereignis nicht gefunden: {0}
calendar.err.invalid.json=JSON ung\u00fcltig: {0}

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=No se ha podido encontrar evento: {0}
calendar.err.invalid.json=JSON no v\u00e1lido: {0}

View File

@@ -10,14 +10,14 @@
"desc": "${result.desc?html}", "desc": "${result.desc?html}",
"where": "${result.where?html}", "where": "${result.where?html}",
"startAt": { "startAt": {
"iso8601": "${xmldate(result.from)}", "iso8601": "${result.from}",
"legacyDate": "${result.from?string("yyyy-MM-dd")}", "legacyDate": "${result.legacyDateFrom}",
"legacyTime": "${result.from?string("HH:mm")}" "legacyTime": "${result.legacyTimeFrom}"
}, },
"endAt": { "endAt": {
"iso8601": "${xmldate(result.to)}", "iso8601": "${result.to}",
"legacyDate": "${result.to?string("yyyy-MM-dd")}", "legacyDate": "${result.legacyDateTo}",
"legacyTime": "${result.to?string("HH:mm")}" "legacyTime": "${result.legacyTimeTo}"
}, },
"allday": "${result.allday?string}", "allday": "${result.allday?string}",

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=Ereignis nicht gefunden: {0}
calendar.err.invalid.json=JSON ung\u00fcltig: {0}

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=No se ha podido encontrar evento: {0}
calendar.err.invalid.json=JSON no v\u00e1lido: {0}

View File

@@ -10,17 +10,17 @@
"description" : "${result.description?js_string}", "description" : "${result.description?js_string}",
"startAt": "startAt":
{ {
"iso8601": "${xmldate(result.dtstart)}", "iso8601": "${result.dtstart}",
"legacyDateTime": "${result.dtstart?string("yyyy-MM-dd")}T${result.dtstart?string("HH:mm")}", "legacyDateTime": "${result.legacyDateFrom}T${result.legacyTimeFrom}",
"legacyDate": "${result.dtstart?string("yyyy-MM-dd")}", "legacyDate": "${result.legacyDateFrom}",
"legacyTime": "${result.dtstart?string("HH:mm")}" "legacyTime": "${result.legacyTimeFrom}"
}, },
"endAt": "endAt":
{ {
"iso8601": "${xmldate(result.dtend)}", "iso8601": "${result.dtend}",
"legacyDateTime": "${result.dtend?string("yyyy-MM-dd")}T${result.dtend?string("HH:mm")}", "legacyDateTime": "${result.legacyDateTo}T${result.legacyTimeTo}",
"legacyDate": "${result.dtend?string("yyyy-MM-dd")}", "legacyDate": "${result.legacyDateTo}",
"legacyTime": "${result.dtend?string("HH:mm")}" "legacyTime": "${result.legacyTimeTo}"
}, },
"uri" : "${result.uri}", "uri" : "${result.uri}",
"allday" : "${result.allday?string}", "allday" : "${result.allday?string}",

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=Ereignis nicht gefunden: {0}
calendar.err.invalid.json=JSON ung\u00fcltig: {0}

View File

@@ -0,0 +1,2 @@
calendar.err.event.not.found=No se ha podido encontrar evento: {0}
calendar.err.invalid.json=JSON no v\u00e1lido: {0}

View File

@@ -6,7 +6,7 @@
<#assign prev = ""> <#assign prev = "">
<#list events as item> <#list events as item>
<#-- Note - use item not event start for repeating events expansion --> <#-- Note - use item not event start for repeating events expansion -->
<#assign date = item.start?string("M/d/yyyy")> <#assign date = item.legacyDateFrom>
<#assign event = item.event> <#assign event = item.event>
<#if date != prev> <#if date != prev>
<#assign counter = 0> <#assign counter = 0>
@@ -18,14 +18,14 @@
"name": "${item.title}", "name": "${item.title}",
"uri": "calendar/event/${siteId}/${event.systemName}", "uri": "calendar/event/${siteId}/${event.systemName}",
"startAt": { "startAt": {
"iso8601": "${xmldate(item.start)}", "iso8601": "$(item.start}",
"legacyDate": "${item.start?string("M/d/yyyy")}", "legacyDate": "${item.legacyDateFrom}",
"legacyTime": "${item.start?string("HH:mm")}" "legacyTime": "${item.legacyTimeFrom}"
}, },
"endAt": { "endAt": {
"iso8601": "${xmldate(item.end)}", "iso8601": "${item.end}",
"legacyDate": "${item.end?string("M/d/yyyy")}", "legacyDate": "${item.legacyDateTo}",
"legacyTime": "${item.end?string("HH:mm")}" "legacyTime": "${item.legacyTimeTo}"
}, },
"tags": [<#list item.tags as tag>"${tag}"<#if tag_has_next>,</#if></#list>], "tags": [<#list item.tags as tag>"${tag}"<#if tag_has_next>,</#if></#list>],

View File

@@ -10,15 +10,15 @@
"title": "${event.title}", "title": "${event.title}",
"where": "${event.where}", "where": "${event.where}",
"description": "${event.description}", "description": "${event.description}",
"url": "page/site/${event.siteName}/calendar?date=${event.start?string("yyyy-MM-dd")}", "url": "page/site/${event.siteName}/calendar?date=${event.legacyDateFrom}",
"startAt": { "startAt": {
"iso8601": "${xmldate(event.start)}", "iso8601": "${event.start}",
"legacyTime": "${event.start?string("HH:mm")}" "legacyTime": "${event.legacyTimeFrom}"
}, },
"endAt": { "endAt": {
"iso8601": "${xmldate(event.end)}", "iso8601": "${event.end}",
"legacyTime": "${event.end?string("HH:mm")}" "legacyTime": "${event.legacyTimeTo}"
}, },
"site": "${event.siteName}", "site": "${event.siteName}",

View File

@@ -1,2 +1,3 @@
page-moved=Diese Seite wurde verschoben nach page-moved=Diese Seite wurde verschoben nach
page-moved-here=hier. page-moved-here=hier.
page-not-found=Die Wiki-Seite wurde nicht gefunden

View File

@@ -1,2 +1,3 @@
page-moved=La p\u00e1gina se ha movido a page-moved=La p\u00e1gina se ha movido a
page-moved-here=aqu\u00ed page-moved-here=aqu\u00ed
page-not-found=La p\u00e1gina Wiki no se ha podido encontrar

View File

@@ -0,0 +1,2 @@
page-moved=\u042d\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0430
page-moved-here=\u0441\u044e\u0434\u0430

View File

@@ -0,0 +1 @@
page-not-found=Die Wiki-Seite wurde nicht gefunden

View File

@@ -0,0 +1 @@
page-not-found=La p\u00e1gina Wiki no se ha podido encontrar

View File

@@ -18,6 +18,7 @@
*/ */
package org.alfresco.repo.web.scripts.calendar; package org.alfresco.repo.web.scripts.calendar;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Comparator; import java.util.Comparator;
@@ -28,6 +29,7 @@ import java.util.Map;
import org.alfresco.service.cmr.calendar.CalendarEntry; import org.alfresco.service.cmr.calendar.CalendarEntry;
import org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper; import org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper;
import org.alfresco.util.ISO8601DateFormat;
/** /**
* This class provides functionality common across the webscripts * This class provides functionality common across the webscripts
@@ -55,14 +57,14 @@ public abstract class AbstractCalendarListingWebScript extends AbstractCalendarW
public int compare(Map<String, Object> resultA, public int compare(Map<String, Object> resultA,
Map<String, Object> resultB) Map<String, Object> resultB)
{ {
Date startA = (Date)resultA.get(RESULT_START); Date startA = ISO8601DateFormat.parse((String)resultA.get(RESULT_START));
Date startB = (Date)resultB.get(RESULT_START); Date startB = ISO8601DateFormat.parse((String)resultB.get(RESULT_START));
int cmp = startA.compareTo(startB); int cmp = startA.compareTo(startB);
if (cmp == 0) if (cmp == 0)
{ {
Date endA = (Date)resultA.get(RESULT_END); Date endA = ISO8601DateFormat.parse((String)resultA.get(RESULT_END));
Date endB = (Date)resultB.get(RESULT_END); Date endB = ISO8601DateFormat.parse((String)resultB.get(RESULT_END));
cmp = endA.compareTo(endB); cmp = endA.compareTo(endB);
if (cmp == 0) if (cmp == 0)
{ {
@@ -173,7 +175,15 @@ public abstract class AbstractCalendarListingWebScript extends AbstractCalendarW
private void updateRepeatingStartEnd(Date newStart, long duration, Map<String, Object> result) private void updateRepeatingStartEnd(Date newStart, long duration, Map<String, Object> result)
{ {
Date newEnd = new Date(newStart.getTime() + duration); Date newEnd = new Date(newStart.getTime() + duration);
result.put(RESULT_START, newStart); result.put(RESULT_START, ISO8601DateFormat.format(newStart));
result.put(RESULT_END, newEnd); result.put(RESULT_END, ISO8601DateFormat.format(newEnd));
String legacyDateFormat = "M/d/yyyy";
SimpleDateFormat ldf = new SimpleDateFormat(legacyDateFormat);
String legacyTimeFormat ="HH:mm";
SimpleDateFormat ltf = new SimpleDateFormat(legacyTimeFormat);
result.put("legacyDateFrom", ldf.format(newStart));
result.put("legacyTimeFrom", ltf.format(newStart));
result.put("legacyDateTo", ldf.format(newEnd));
result.put("legacyTimeTo", ltf.format(newEnd));
} }
} }

View File

@@ -34,6 +34,7 @@ import org.alfresco.repo.calendar.CalendarModel;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.activities.ActivityService; import org.alfresco.service.cmr.activities.ActivityService;
import org.alfresco.service.cmr.calendar.CalendarEntry; import org.alfresco.service.cmr.calendar.CalendarEntry;
import org.alfresco.service.cmr.calendar.CalendarEntryDTO;
import org.alfresco.service.cmr.calendar.CalendarService; import org.alfresco.service.cmr.calendar.CalendarService;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
@@ -45,6 +46,11 @@ import org.alfresco.util.ISO8601DateFormat;
import org.alfresco.util.ScriptPagingDetails; import org.alfresco.util.ScriptPagingDetails;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.json.JSONException; import org.json.JSONException;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser; import org.json.simple.parser.JSONParser;
@@ -258,8 +264,19 @@ public abstract class AbstractCalendarWebScript extends DeclarativeWebScript
else if (json.containsKey("allday")) else if (json.containsKey("allday"))
{ {
// Old style all-day event // Old style all-day event
entry.setStart(parseDate(getOrNull(json, "from"))); Date start = parseDate(getOrNull(json, "from"));
entry.setEnd(parseDate(getOrNull(json, "to"))); Date end = parseDate(getOrNull(json, "to"));
// Store it as UTC midnight to midnight
// Reset the time part to ensure that
String isoStartAt = ISO8601DateFormat.format(start);
String isoEndAt = ISO8601DateFormat.format(end);
String utcMidnight = "T00:00:00Z";
isoStartAt = isoStartAt.substring(0, 10) + utcMidnight;
isoEndAt = isoEndAt.substring(0, 10) + utcMidnight;
entry.setStart(ISO8601DateFormat.parse(isoStartAt));
entry.setEnd(ISO8601DateFormat.parse(isoEndAt));
} }
else else
{ {
@@ -484,6 +501,45 @@ public abstract class AbstractCalendarWebScript extends DeclarativeWebScript
return executeImpl(site, eventName, req, json, status, cache); return executeImpl(site, eventName, req, json, status, cache);
} }
/**
* Remove the time zone for a given date if the
* Calendar Entry is an all day event
* @return ISO 8601 formatted date String
*/
protected String removeTimeZoneIfIsAllDay(Date date, Boolean isAllDay){
return removeTimeZoneIfIsAllDay(date, isAllDay, null);
}
/**
* Remove the time zone for a given date if the
* Calendar Entry is an all day event
* @return ISO 8601 formatted date String if datePattern is null
*/
protected String removeTimeZoneIfIsAllDay(Date date, Boolean isAllDay, String datePattern){
DateTime dt;
if(isAllDay){
dt= new DateTime(date, DateTimeZone.UTC);
}else{
dt = new DateTime(date);
}
DateTimeFormatter fmt;
if(datePattern==null){
if(isAllDay){
fmt = DateTimeFormat.forPattern("yyyy-MM-dd'T00:00:00.000'");
}else{
fmt = ISODateTimeFormat.dateTime();
}
}else{
//For Legacy Dates and Times.
fmt = DateTimeFormat.forPattern(datePattern);
}
return dt.toString(fmt);
}
protected abstract Map<String, Object> executeImpl(SiteInfo site, protected abstract Map<String, Object> executeImpl(SiteInfo site,
String eventName, WebScriptRequest req, JSONObject json, String eventName, WebScriptRequest req, JSONObject json,
Status status, Cache cache); Status status, Cache cache);

View File

@@ -31,6 +31,7 @@ import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults; import org.alfresco.query.PagingResults;
import org.alfresco.repo.calendar.CalendarModel; import org.alfresco.repo.calendar.CalendarModel;
import org.alfresco.service.cmr.calendar.CalendarEntry; import org.alfresco.service.cmr.calendar.CalendarEntry;
import org.alfresco.service.cmr.calendar.CalendarEntryDTO;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteInfo;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@@ -87,8 +88,17 @@ public class CalendarEntriesListGet extends AbstractCalendarListingWebScript
result.put(RESULT_EVENT, entry); result.put(RESULT_EVENT, entry);
result.put(RESULT_NAME, entry.getSystemName()); result.put(RESULT_NAME, entry.getSystemName());
result.put(RESULT_TITLE, entry.getTitle()); result.put(RESULT_TITLE, entry.getTitle());
result.put(RESULT_START, entry.getStart()); boolean isAllDay = CalendarEntryDTO.isAllDay(entry);
result.put(RESULT_END, entry.getEnd()); result.put(RESULT_START, removeTimeZoneIfIsAllDay(entry.getStart(),isAllDay));
result.put(RESULT_END, removeTimeZoneIfIsAllDay(entry.getEnd(),isAllDay));
String legacyDateFormat = "M/d/yyyy";
String legacyTimeFormat ="HH:mm";
result.put("legacyDateFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyDateFormat));
result.put("legacyTimeFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyTimeFormat));
result.put("legacyDateTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyDateFormat));
result.put("legacyTimeTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyTimeFormat));
result.put("fromDate", entry.getStart()); result.put("fromDate", entry.getStart());
result.put("tags", entry.getTags()); result.put("tags", entry.getTags());

View File

@@ -71,12 +71,21 @@ public class CalendarEntryGet extends AbstractCalendarWebScript
result.put("what", entry.getTitle()); result.put("what", entry.getTitle());
result.put("description", entry.getDescription()); result.put("description", entry.getDescription());
result.put("location", entry.getLocation()); result.put("location", entry.getLocation());
result.put("from", entry.getStart()); boolean isAllDay = CalendarEntryDTO.isAllDay(entry);
result.put("to", entry.getEnd()); result.put("from", removeTimeZoneIfIsAllDay(entry.getStart(),isAllDay));
result.put("to", removeTimeZoneIfIsAllDay(entry.getEnd(),isAllDay));
String legacyDateFormat = "M/d/yyyy";
String legacyTimeFormat ="HH:mm";
result.put("legacyDateFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyDateFormat));
result.put("legacyTimeFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyTimeFormat));
result.put("legacyDateTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyDateFormat));
result.put("legacyTimeTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyTimeFormat));
result.put("tags", entry.getTags()); result.put("tags", entry.getTags());
result.put("isoutlook", entry.isOutlook()); result.put("isoutlook", entry.isOutlook());
result.put("outlookuid", entry.getOutlookUID()); result.put("outlookuid", entry.getOutlookUID());
result.put("allday", CalendarEntryDTO.isAllDay(entry)); result.put("allday", isAllDay);
result.put("docfolder", entry.getSharePointDocFolder()); result.put("docfolder", entry.getSharePointDocFolder());
result.put("recurrence", buildRecurrenceString(entry)); result.put("recurrence", buildRecurrenceString(entry));
@@ -121,6 +130,10 @@ public class CalendarEntryGet extends AbstractCalendarWebScript
Map<String,String> days = Map<String,String> days =
CalendarRecurrenceHelper.buildLocalRecurrenceDaysOfTheWeek(I18NUtil.getLocale()); CalendarRecurrenceHelper.buildLocalRecurrenceDaysOfTheWeek(I18NUtil.getLocale());
// Get our weeks names, in the current locale
Map<Integer, String> weeks =
CalendarRecurrenceHelper.buildLocalRecurrenceWeekNames(I18NUtil.getLocale());
// Turn the string into a useful map // Turn the string into a useful map
Map<String,String> params = CalendarRecurrenceHelper.extractRecurrenceRule(event); Map<String,String> params = CalendarRecurrenceHelper.extractRecurrenceRule(event);
@@ -173,8 +186,8 @@ public class CalendarEntryGet extends AbstractCalendarWebScript
} }
else if (params.get("BYSETPOS") != null) else if (params.get("BYSETPOS") != null)
{ {
text.append("Occurs the "); text.append(weeks.get((Integer.parseInt(params.get("BYSETPOS")))) + " ");
text.append(days.get(params.get("BYSETPOS"))); text.append(days.get(params.get("BYDAY")));
} }
text.append(" of every " + interval + " month(s) "); text.append(" of every " + interval + " month(s) ");
} }
@@ -188,7 +201,8 @@ public class CalendarEntryGet extends AbstractCalendarWebScript
else else
{ {
text.append("Occurs the "); text.append("Occurs the ");
text.append(days.get(params.get("BYSETPOS"))); text.append(weeks.get((Integer.parseInt(params.get("BYSETPOS")))) + " ");
text.append(days.get(params.get("BYDAY")) + " ");
text.append(" of " + params.get("BYMONTH") + " month "); text.append(" of " + params.get("BYMONTH") + " month ");
} }
} }

View File

@@ -19,6 +19,7 @@
package org.alfresco.repo.web.scripts.calendar; package org.alfresco.repo.web.scripts.calendar;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@@ -91,8 +92,17 @@ public class CalendarEntryPost extends AbstractCalendarWebScript
result.put("name", entry.getTitle()); result.put("name", entry.getTitle());
result.put("desc", entry.getDescription()); result.put("desc", entry.getDescription());
result.put("where", entry.getLocation()); result.put("where", entry.getLocation());
result.put("from", entry.getStart());
result.put("to", entry.getEnd()); result.put("from", removeTimeZoneIfIsAllDay(entry.getStart(),isAllDay));
result.put("to", removeTimeZoneIfIsAllDay(entry.getEnd(),isAllDay));
String legacyDateFormat = "yyyy-MM-dd";
String legacyTimeFormat ="HH:mm";
result.put("legacyDateFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyDateFormat));
result.put("legacyTimeFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyTimeFormat));
result.put("legacyDateTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyDateFormat));
result.put("legacyTimeTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyTimeFormat));
result.put("uri", "calendar/event/" + site.getShortName() + "/" + result.put("uri", "calendar/event/" + site.getShortName() + "/" +
entry.getSystemName() + dateOpt); entry.getSystemName() + dateOpt);

View File

@@ -159,8 +159,16 @@ public class CalendarEntryPut extends AbstractCalendarWebScript
result.put("summary", entry.getTitle()); result.put("summary", entry.getTitle());
result.put("description", entry.getDescription()); result.put("description", entry.getDescription());
result.put("location", entry.getLocation()); result.put("location", entry.getLocation());
result.put("dtstart", entry.getStart()); result.put("dtstart", removeTimeZoneIfIsAllDay(entry.getStart(),isAllDay));
result.put("dtend", entry.getEnd()); result.put("dtend", removeTimeZoneIfIsAllDay(entry.getEnd(),isAllDay));
String legacyDateFormat = "yyyy-MM-dd";
String legacyTimeFormat ="HH:mm";
result.put("legacyDateFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyDateFormat));
result.put("legacyTimeFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyTimeFormat));
result.put("legacyDateTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyDateFormat));
result.put("legacyTimeTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyTimeFormat));
result.put("uri", "calendar/event/" + site.getShortName() + "/" + result.put("uri", "calendar/event/" + site.getShortName() + "/" +
entry.getSystemName() + dateOpt); entry.getSystemName() + dateOpt);

View File

@@ -251,6 +251,57 @@ public class CalendarRestApiTest extends BaseWebScriptTest
return createEntry(name, where, description, json, expectedStatus); return createEntry(name, where, description, json, expectedStatus);
} }
/**
* Creates an all day event for the 29th in a +1hr time zone
*/
private JSONObject createAllDayEntryDifferentTimeZone(String name, String where, String description,
int expectedStatus) throws Exception
{
String date = "2011-06-29"; // A wednesday
String start = "00:00";
String end = "00:00";
JSONObject json = new JSONObject();
json.put("startAt", date + "T" + start + ":00+04:00");
json.put("endAt", date + "T" + end + ":00+04:00");
json.put("allday", Boolean.TRUE);
return createEntry(name, where, description, json, expectedStatus);
}
/**
* Creates an all day event for the 29th
*/
private JSONObject createAllDayEntry(String name, String where, String description,
int expectedStatus) throws Exception
{
String date = "2011-06-29"; // A wednesday
String start = "00:00";
String end = "00:00";
JSONObject json = new JSONObject();
json.put("startAt", date + "T" + start + ":00+01:00");
json.put("endAt", date + "T" + end + ":00+01:00");
json.put("allday", Boolean.TRUE);
return createEntry(name, where, description, json, expectedStatus);
}
/**
* Creates an all day event that starts on the 27th and ends on the 29th
*/
private JSONObject createMultiAllDayEntry(String name, String where, String description,
int expectedStatus) throws Exception
{
String startDate = "2011-06-27"; // A wednesday
String endDate = "2011-06-29";
String time = "00:00";
JSONObject json = new JSONObject();
json.put("startAt", startDate + "T" + time + ":00+00:00");
json.put("endAt", endDate + "T" + time + ":00+00:00");
json.put("allday", Boolean.TRUE);
return createEntry(name, where, description, json, expectedStatus);
}
/** /**
* Creates an event, with the date properties manually set * Creates an event, with the date properties manually set
*/ */
@@ -550,6 +601,135 @@ public class CalendarRestApiTest extends BaseWebScriptTest
assertEquals(true, entry.has("error")); assertEquals(true, entry.has("error"));
} }
/**
* Creating, editing, fetching and deleting an entry
*/
public void testCreateAllDayEntry() throws Exception
{
JSONObject entry;
String name;
// Won't be there to start with
entry = getEntry(EVENT_TITLE_ONE, Status.STATUS_OK);
assertEquals(true, entry.has("error"));
// Create all day event
entry = createAllDayEntry(EVENT_TITLE_ONE, "Where", "Thing", Status.STATUS_OK);
name = getNameFromEntry(entry);
assertEquals(EVENT_TITLE_ONE, entry.getString("name"));
assertEquals("Where", entry.getString("where"));
assertEquals("Thing", entry.getString("desc"));
assertEquals("2011-06-29", entry.getJSONObject("startAt").getString("legacyDate")); // Different format!
assertEquals("2011-06-29", entry.getJSONObject("endAt").getString("legacyDate")); // Different format!
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// No isoutlook on create/edit
// Fetch
entry = getEntry(name, Status.STATUS_OK);
assertEquals("Error found " + entry.toString(), false, entry.has("error"));
assertEquals(EVENT_TITLE_ONE, entry.getString("what"));
assertEquals(name, entry.getString("name"));
assertEquals("Where", entry.getString("location")); // Not where...
assertEquals("Thing", entry.getString("description")); // Not desc...
assertEquals("false", entry.getString("isoutlook"));
assertEquals("6/29/2011", entry.getJSONObject("startAt").getString("legacyDate"));
assertEquals("6/29/2011", entry.getJSONObject("endAt").getString("legacyDate"));
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// Check the new style dates too,
assertEquals("2011-06-29T00:00:00.000", entry.getJSONObject("startAt").get("iso8601"));
assertEquals("2011-06-29T00:00:00.000", entry.getJSONObject("endAt").get("iso8601"));
// Create all day event in different time zone
entry = createAllDayEntryDifferentTimeZone(EVENT_TITLE_ONE, "Where", "Thing", Status.STATUS_OK);
name = getNameFromEntry(entry);
assertEquals(EVENT_TITLE_ONE, entry.getString("name"));
assertEquals("Where", entry.getString("where"));
assertEquals("Thing", entry.getString("desc"));
assertEquals("2011-06-29", entry.getJSONObject("startAt").getString("legacyDate")); // Different format!
assertEquals("2011-06-29", entry.getJSONObject("endAt").getString("legacyDate")); // Different format!
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// No isoutlook on create/edit
// Fetch
entry = getEntry(name, Status.STATUS_OK);
assertEquals("Error found " + entry.toString(), false, entry.has("error"));
assertEquals(EVENT_TITLE_ONE, entry.getString("what"));
assertEquals(name, entry.getString("name"));
assertEquals("Where", entry.getString("location")); // Not where...
assertEquals("Thing", entry.getString("description")); // Not desc...
assertEquals("false", entry.getString("isoutlook"));
assertEquals("6/29/2011", entry.getJSONObject("startAt").getString("legacyDate"));
assertEquals("6/29/2011", entry.getJSONObject("endAt").getString("legacyDate"));
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// Check the new style dates too
assertEquals("2011-06-29T00:00:00.000", entry.getJSONObject("startAt").get("iso8601"));
assertEquals("2011-06-29T00:00:00.000", entry.getJSONObject("endAt").get("iso8601"));
// Create Multi all day event
entry = createMultiAllDayEntry(EVENT_TITLE_ONE, "Where", "Thing", Status.STATUS_OK);
name = getNameFromEntry(entry);
assertEquals(EVENT_TITLE_ONE, entry.getString("name"));
assertEquals("Where", entry.getString("where"));
assertEquals("Thing", entry.getString("desc"));
assertEquals("2011-06-27", entry.getJSONObject("startAt").getString("legacyDate")); // Different format!
assertEquals("2011-06-29", entry.getJSONObject("endAt").getString("legacyDate")); // Different format!
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// No isoutlook on create/edit
// Fetch
entry = getEntry(name, Status.STATUS_OK);
assertEquals("Error found " + entry.toString(), false, entry.has("error"));
assertEquals(EVENT_TITLE_ONE, entry.getString("what"));
assertEquals(name, entry.getString("name"));
assertEquals("Where", entry.getString("location")); // Not where...
assertEquals("Thing", entry.getString("description")); // Not desc...
assertEquals("false", entry.getString("isoutlook"));
assertEquals("6/27/2011", entry.getJSONObject("startAt").getString("legacyDate"));
assertEquals("6/29/2011", entry.getJSONObject("endAt").getString("legacyDate"));
assertEquals("00:00", entry.getJSONObject("startAt").getString("legacyTime"));
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday"));
// Check the new style dates too
assertEquals("2011-06-27T00:00:00.000", entry.getJSONObject("startAt").get("iso8601"));
assertEquals("2011-06-29T00:00:00.000", entry.getJSONObject("endAt").get("iso8601"));
}
/** /**
* When fetching an event, we get permission details. * When fetching an event, we get permission details.
* This test ensures they are correct * This test ensures they are correct
@@ -826,18 +1006,6 @@ public class CalendarRestApiTest extends BaseWebScriptTest
assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime")); assertEquals("00:00", entry.getJSONObject("endAt").getString("legacyTime"));
assertEquals("true", entry.getString("allday")); assertEquals("true", entry.getString("allday"));
// All-day ISO8601 with offset
json = new JSONObject();
json.put("startAt", "2011-06-21T00:00:00+01:00");
json.put("endAt", "2011-06-21T00:00:00+01:00");
json.put("allday", Boolean.TRUE);
assertEquals("2011-06-21", entry.getJSONObject("startAt").getString("legacyDate"));
assertEquals("2011-06-21", entry.getJSONObject("endAt").getString("legacyDate"));
assertEquals("true", entry.getString("allday"));
// All-day ISO8601 with timezone // All-day ISO8601 with timezone
json = new JSONObject(); json = new JSONObject();
json.put("startAt", "2011-06-22T00:00:00"); json.put("startAt", "2011-06-22T00:00:00");

View File

@@ -18,6 +18,7 @@
*/ */
package org.alfresco.repo.web.scripts.calendar; package org.alfresco.repo.web.scripts.calendar;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
@@ -158,13 +159,24 @@ public class UserCalendarEntriesGet extends AbstractCalendarListingWebScript
{ {
// Build the object // Build the object
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
boolean isAllDay = CalendarEntryDTO.isAllDay(entry);
result.put(RESULT_EVENT, entry); result.put(RESULT_EVENT, entry);
result.put(RESULT_NAME, entry.getSystemName()); result.put(RESULT_NAME, entry.getSystemName());
result.put(RESULT_TITLE, entry.getTitle()); result.put(RESULT_TITLE, entry.getTitle());
result.put("description", entry.getDescription()); result.put("description", entry.getDescription());
result.put("where", entry.getLocation()); result.put("where", entry.getLocation());
result.put(RESULT_START, entry.getStart()); result.put(RESULT_START, removeTimeZoneIfIsAllDay(entry.getStart(),isAllDay));
result.put(RESULT_END, entry.getEnd()); result.put(RESULT_END, removeTimeZoneIfIsAllDay(entry.getEnd(),isAllDay));
String legacyDateFormat = "yyyy-MM-dd";
String legacyTimeFormat ="HH:mm";
result.put("legacyDateFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyDateFormat));
result.put("legacyTimeFrom", removeTimeZoneIfIsAllDay(entry.getStart(), isAllDay, legacyTimeFormat));
result.put("legacyDateTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyDateFormat));
result.put("legacyTimeTo", removeTimeZoneIfIsAllDay(entry.getEnd(), isAllDay, legacyTimeFormat));
result.put("duration", buildDuration(entry)); result.put("duration", buildDuration(entry));
result.put("tags", entry.getTags()); result.put("tags", entry.getTags());
result.put("isoutlook", entry.isOutlook()); result.put("isoutlook", entry.isOutlook());