Merged V3.4-BUG-FIX to HEAD

28158: ALF-8925: Merged V3.3 to V3.4-BUG-FIX
      28121: ALF-8878: Prevent authentication errors in SMBSrvSession.cleanupSession()
   28159: Merged HEAD to V3.4-BUG-FIX (RECORD ONLY)
      27951: Fixed merge issue in ContentDiskDriverTest
   28161: ALF-8861: Fix from Bitrock to kill OpenOffice process on uninstallation if all else fails
   28165: ALF-8260: Corrected French translations of 'Library'
   28166: Fix for ALF-8751 - Dates are not localized in Document Lists dashlet
   28167: Fix for ALF-8493
   28169: ALF-5797: Translation corrections to complex strings
   28171: Merged DEV TO V3.4-BUG-FIX 
      ALF-8808 : CLONE - NFS: User with editor role cannot edit content - unit test required
   28181: Fixed ALF-280: Unfriendly message appears when trying to specify non-existent file-store
   28184: Merged BRANCHES/DEV/BELARUS/V3.4-BUG-FIX-2011_04_12 to BRANCHES/DEV/V3.4-BUG-FIX:
      28179: ALF-8754: Cannot preview content on other webapp folder than ROOT (merged w/ trivial clean-up)
   28185: Fixed ALF-8020: Multivalue date in document details causes error in alfresco share   
      NOTE: We do not support any multi-valued fields other than text currently, this fix is therefore to handle the case where a multivalued date or dateTime field is configured in a form. The form will list the dates in view mode but in create and edit modes the control is not displayed at all when there are multiple values, if there is only one value the control continues to function as it has done previously.
   28188: Fix for ALF-731 - in a cluster environment (high availibility), when a node goes down, the users are asked to login


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28208 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2011-06-06 10:57:20 +00:00
parent 02e3d817de
commit a8f0689c1c
5 changed files with 379 additions and 149 deletions

View File

@@ -24,6 +24,7 @@ import static org.alfresco.repo.forms.processor.node.FormFieldConstants.PROP_DAT
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -42,6 +43,7 @@ import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.Period;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ISO8601DateFormat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.StringUtils;
@@ -116,6 +118,26 @@ public class PropertyFieldProcessor extends QNameFieldProcessor<PropertyDefiniti
// a separate field for each value once we have full
// UI support in place.
Collection<?> values = (Collection<?>) value;
// if the non empty collection is a List of Date objects
// we need to convert each date to a ISO8601 format
if (value instanceof List<?> && !values.isEmpty())
{
List<?> list = (List<?>)values;
if (list.get(0) instanceof Date)
{
List<String> isoDates = new ArrayList<String>(list.size());
for (Object date : list)
{
isoDates.add(ISO8601DateFormat.format((Date)date));
}
// return the ISO formatted dates as a comma delimited string
return StringUtils.collectionToCommaDelimitedString(isoDates);
}
}
// return everything else using toString()
return StringUtils.collectionToCommaDelimitedString(values);
}
else if (value instanceof ContentData)