mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -576,6 +576,52 @@ public class CalendarHelpersTest
|
||||
assertEquals("2011-08-02", dateFmt.format(dates.get(0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test recurrence rules that occur monthly or yearly
|
||||
* on the last day within the month
|
||||
*/
|
||||
@Test public void reccurenceByLastDay(){
|
||||
List<Date> dates = new ArrayList<Date>();
|
||||
Calendar currentDate = Calendar.getInstance();
|
||||
currentDate.set(2012,7-1,15,10,30);
|
||||
|
||||
//Recur Monthly on the last Monday
|
||||
Map<String,String> params = new HashMap<String, String>();
|
||||
params.put("FREQ", "MONTHLY");
|
||||
params.put("BYDAY", "MO");
|
||||
params.put("INTERVAL", "1");
|
||||
params.put("BYSETPOS", "-1");
|
||||
|
||||
dates.clear();
|
||||
|
||||
RecurrenceHelper.buildMonthlyRecurrences(
|
||||
currentDate, dates, params,
|
||||
date(2012,7,1), date(2012,9,30),
|
||||
false, 1);
|
||||
assertEquals(3, dates.size());
|
||||
assertEquals("2012-07-30", dateFmt.format(dates.get(0)));
|
||||
assertEquals("2012-08-27", dateFmt.format(dates.get(1)));
|
||||
assertEquals("2012-09-24", dateFmt.format(dates.get(2)));
|
||||
|
||||
//Recur yearly on the last Monday in July
|
||||
params = new HashMap<String, String>();
|
||||
params.put("BYMONTH", "7");
|
||||
params.put("BYDAY", "MO");
|
||||
params.put("BYSETPOS", "-1");
|
||||
|
||||
dates.clear();
|
||||
|
||||
RecurrenceHelper.buildYearlyRecurrences(
|
||||
currentDate, dates, params,
|
||||
date(2012,7,1), date(2015,10,1),
|
||||
false, 1);
|
||||
assertEquals(3, dates.size());
|
||||
assertEquals("2013-07-29", dateFmt.format(dates.get(0)));
|
||||
assertEquals("2014-07-28", dateFmt.format(dates.get(1)));
|
||||
assertEquals("2015-07-27", dateFmt.format(dates.get(2)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* on the 1st Tuesday of the month
|
||||
*/
|
||||
|
@@ -311,6 +311,8 @@ public class SOLRAdminClient implements ApplicationEventPublisherAware
|
||||
properties.setProperty("org.quartz.scheduler.instanceName", "SolrWatcherScheduler");
|
||||
properties.setProperty("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
properties.setProperty("org.quartz.threadPool.threadCount", "3");
|
||||
properties.setProperty("org.quartz.threadPool.makeThreadsDaemons", "true");
|
||||
properties.setProperty("org.quartz.scheduler.makeSchedulerThreadDaemon", "true");
|
||||
properties.setProperty("org.quartz.jobStore.class", "org.quartz.simpl.RAMJobStore");
|
||||
factory.initialize(properties);
|
||||
scheduler = factory.getScheduler();
|
||||
|
@@ -82,6 +82,26 @@ public class CalendarRecurrenceHelper
|
||||
return days;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
protected final static Map<Integer,String> WEEK_NUMBER_TO_WEEK_NAME =
|
||||
Collections.unmodifiableMap(new HashMap<Integer, String>() {{
|
||||
put(1, "first");
|
||||
put(2, "second");
|
||||
put(3, "third");
|
||||
put(4, "fourth");
|
||||
put(-1, "last");
|
||||
}});
|
||||
|
||||
|
||||
/**
|
||||
* The lookup from the week in month number to week
|
||||
* in month name in the specified locale
|
||||
*/
|
||||
public static Map<Integer, String> buildLocalRecurrenceWeekNames(Locale locale){
|
||||
return WEEK_NUMBER_TO_WEEK_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parsed calendar recurrence rule
|
||||
* WARNING - Alfresco use only. Return type will likely shift to
|
||||
@@ -664,22 +684,11 @@ public class CalendarRecurrenceHelper
|
||||
*/
|
||||
private static void toDayOfWeekInMonth(Calendar c, int dayOfWeek, int weekInMonth)
|
||||
{
|
||||
// First up, move to the start of the month
|
||||
c.set(Calendar.DATE, 1);
|
||||
|
||||
// Now, move to the 1st instance of the day of the week
|
||||
Date t = c.getTime();
|
||||
c.set(Calendar.DAY_OF_WEEK, dayOfWeek);
|
||||
// If we went back, go forward a week
|
||||
if (c.getTime().before(t))
|
||||
{
|
||||
c.add(Calendar.DATE, 7);
|
||||
}
|
||||
|
||||
// Now move to the required week
|
||||
if (weekInMonth > 1)
|
||||
{
|
||||
c.add(Calendar.DATE, 7 * (weekInMonth-1));
|
||||
}
|
||||
//set it to the first day
|
||||
c.set(Calendar.DATE, 1);
|
||||
//move to the day we need
|
||||
c.set(Calendar.DAY_OF_WEEK, dayOfWeek);
|
||||
//and then to the month
|
||||
c.set(Calendar.DAY_OF_WEEK_IN_MONTH, weekInMonth);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user