mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged V4.1-BUG-FIX to HEAD
40690: Removed 'repository-bm' project, which is no longer distributed, referenced or supported - Part of ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file - Also: ALF-15588 40692: Removed 'repository-bm' project, which is no longer distributed, referenced or supported - Part of ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file 40695: Fixed ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file - Removed all related code as well 40700: Remove XAM Connector. Now built as a standalone project 40707: ALF-14399 Share Calendar changes dates when "All Day" is selected. Event comparator now checks if date strings contain a time zone, previously was failing because we strip time zones from all day events. 40708: Complete - task : ALF-14399 Share Calendar changes dates when "All Day" is selected. Added the time zone in which the recurrence rule was parsed to the recurrence rule string. 40711: Merged V3.4-BUG-FIX to V4.1-BUG-FIX 40700: (RECORD ONLY) Remove XAM Connector. Now built as a standalone project 40701: (RECORD ONLY) Remove Kofax. Now built as a standalone integration. 40703: (RECORD ONLY) Revert Kofax removal. 40704: (RECORD ONLY) Revert XAM Connector removal for V3.4. 40709: (RECORD ONLY) ALF-14752 - Collapse Links part at the WCM details page lead to error 40710: ALF-15592: Merged PATCHES/V3.4.8 to V3.4-BUG-FIX 40543: ALF-15507: Orphan content URLs when you overwrite a file with identical content in CIFS - Removed diffing behaviour that was leaking content URLs git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40712 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,6 +30,10 @@ import java.util.Map;
|
||||
import org.alfresco.service.cmr.calendar.CalendarEntry;
|
||||
import org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper;
|
||||
import org.alfresco.util.ISO8601DateFormat;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
import org.joda.time.format.ISODateTimeFormat;
|
||||
|
||||
/**
|
||||
* This class provides functionality common across the webscripts
|
||||
@@ -57,15 +61,26 @@ public abstract class AbstractCalendarListingWebScript extends AbstractCalendarW
|
||||
public int compare(Map<String, Object> resultA,
|
||||
Map<String, Object> resultB)
|
||||
{
|
||||
Date startA = ISO8601DateFormat.parse((String)resultA.get(RESULT_START));
|
||||
Date startB = ISO8601DateFormat.parse((String)resultB.get(RESULT_START));
|
||||
DateTimeFormatter fmtNoTz = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||
DateTimeFormatter fmtTz = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
|
||||
|
||||
String startA = (String)resultA.get(RESULT_START);
|
||||
String startB = (String)resultB.get(RESULT_START);
|
||||
|
||||
//check and parse iso8601 date without time zone (All day events are stripped of time zone)
|
||||
DateTime sa = startA.length()>23?fmtTz.parseDateTime(startA):fmtNoTz.parseDateTime(startA);
|
||||
DateTime sb = startB.length()>23?fmtTz.parseDateTime(startB):fmtNoTz.parseDateTime(startB);
|
||||
|
||||
int cmp = startA.compareTo(startB);
|
||||
int cmp = sa.compareTo(sb);
|
||||
if (cmp == 0)
|
||||
{
|
||||
Date endA = ISO8601DateFormat.parse((String)resultA.get(RESULT_END));
|
||||
Date endB = ISO8601DateFormat.parse((String)resultB.get(RESULT_END));
|
||||
cmp = endA.compareTo(endB);
|
||||
String endA = (String)resultA.get(RESULT_END);
|
||||
String endB = (String)resultB.get(RESULT_END);
|
||||
|
||||
DateTime ea = endA.length()>23?fmtTz.parseDateTime(endA):fmtNoTz.parseDateTime(endA);
|
||||
DateTime eb = endB.length()>23?fmtTz.parseDateTime(endB):fmtNoTz.parseDateTime(endB);
|
||||
|
||||
cmp = ea.compareTo(eb);
|
||||
if (cmp == 0)
|
||||
{
|
||||
String nameA = (String)resultA.get(RESULT_NAME);
|
||||
|
@@ -21,9 +21,11 @@ package org.alfresco.repo.web.scripts.calendar;
|
||||
import java.text.DateFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.alfresco.service.cmr.calendar.CalendarEntry;
|
||||
import org.alfresco.service.cmr.calendar.CalendarEntryDTO;
|
||||
@@ -234,6 +236,13 @@ public class CalendarEntryGet extends AbstractCalendarWebScript
|
||||
text.append(" from " + tFormat.format(event.getStart()));
|
||||
text.append(" to " + tFormat.format(event.getEnd()));
|
||||
|
||||
// Add timezone in which recurrence rule was parsed
|
||||
TimeZone timeZone = TimeZone.getDefault();
|
||||
boolean daylight = timeZone.inDaylightTime(new Date());
|
||||
String tzDisplayName = timeZone.getDisplayName(daylight, TimeZone.SHORT);
|
||||
|
||||
text.append(" ("+tzDisplayName+")");
|
||||
|
||||
// All done
|
||||
return text.toString();
|
||||
}
|
||||
|
@@ -581,7 +581,7 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
||||
assertEquals("false", entry.getString("allday"));
|
||||
assertEquals(
|
||||
"Occurs every 2 weeks on Wednesday, Friday, effective " +
|
||||
"28-Jun-2011 until 11-Sep-2011 from 11:30 to 13:30",
|
||||
"28-Jun-2011 until 11-Sep-2011 from 11:30 to 13:30 (BST)",
|
||||
entry.getString("recurrence"));
|
||||
|
||||
// Delete
|
||||
@@ -1048,6 +1048,9 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
||||
assertEquals(EVENT_TITLE_ONE, entries.getJSONObject(0).getString("name"));
|
||||
assertEquals(EVENT_TITLE_TWO, entries.getJSONObject(1).getString("name"));
|
||||
|
||||
//Check the dates
|
||||
assertEquals("2011-06-29T12:00:00.000+01:00", entries.getJSONObject(0).getJSONObject("startAt").getString("iso8601"));
|
||||
assertEquals("2011-06-29T13:00:00.000+01:00", entries.getJSONObject(0).getJSONObject("endAt").getString("iso8601"));
|
||||
|
||||
// Add a third, on the next day
|
||||
JSONObject entry = createEntry(EVENT_TITLE_THREE, "Where3", "Thing 3", Status.STATUS_OK);
|
||||
|
Reference in New Issue
Block a user