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
43905: Fixed ALF-16166 "Breadcrumb not refreshing after Move action is used." 43909: Merged V3.4-BUF-GIX (3.4.12) to V4.1-BUG-FIX (4.1.3) 43908: Minor changes to TransformerDebug to make output more readable when there are exceptions. 43912: Fix for ALF-16578. Now guesses the mimetype correctly - (actually uses the existing type). 43915: Merged BRANCHES/DEV/BELARUS/V4.1-BUG-FIX-2012_11_12 to BRANCHES/DEV/V4.1-BUG-FIX: 43853: ALF-15984: "Concurrent Editing" problem with Edit Online functionality with Office 2010 43916: Fixed ALF-16906: MySQL: Add support for persisting special numeric property values - Double and Float special values ("NaN", "-Infinity" and "Infinity") are persisted in alf_node_properties in their string form. - Checks included to ensure that conversions to and from Double and Float are covered correctly 43926: ALF-16909: Discussion topics are sorted in ascending order (oldest first and newest last) when selecting 'All topics' - Fixed unit test to expect newest first, as re-introduced into 3.4.12 43927: ALF-12711: Fixed 'test mode' behaviour of MailActionExecuter 43928: Merged V4.1 to V4.1-BUG-FIX 43906: ALF-15993: Installation folder is not empty after uninstall - Added webquickstart log removal 43917: ALF-16886: SubscriptionServiceActivitiesTest and SiteServiceTest failing on Oracle - Fix by Dmitry 43920: ALF-16753: RU: Incorrect date format in Alfresco Explorer git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43929 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -302,7 +302,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
MimeMessageHelper message = null;
|
||||
if (!testMode && validNodeRefIfPresent(actionedUponNodeRef))
|
||||
if (validNodeRefIfPresent(actionedUponNodeRef))
|
||||
{
|
||||
message = prepareEmail(ruleAction, actionedUponNodeRef);
|
||||
}
|
||||
@@ -625,19 +625,16 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
try
|
||||
{
|
||||
// Send the message unless we are in "testMode"
|
||||
if(!testMode && preparedMessage != null)
|
||||
if (preparedMessage != null)
|
||||
{
|
||||
javaMailSender.send(preparedMessage.getMimeMessage());
|
||||
}
|
||||
else if (validNodeRefIfPresent(actionedUponNodeRef))
|
||||
{
|
||||
try {
|
||||
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
||||
prepareEmail(ruleAction, actionedUponNodeRef);
|
||||
lastTestMessage = mimeMessage;
|
||||
} catch(Exception e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
if (!testMode)
|
||||
{
|
||||
javaMailSender.send(preparedMessage.getMimeMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
lastTestMessage = preparedMessage.getMimeMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MailException e)
|
||||
|
@@ -446,7 +446,7 @@ public abstract class FeedTaskProcessor
|
||||
Set<String> recipients = new HashSet<String>();
|
||||
|
||||
// Add site members to recipient list
|
||||
if (siteId.length() > 0)
|
||||
if ((null != siteId) && (siteId.length() > 0))
|
||||
{
|
||||
// Get the members of this site - save hammering the repository by reusing cached site members
|
||||
Set<String> connectedUsers = siteConnectedUsers.get(siteId);
|
||||
@@ -490,7 +490,7 @@ public abstract class FeedTaskProcessor
|
||||
followerConnectedUsers.put(userTenantKey, followerUsers);
|
||||
}
|
||||
|
||||
if (siteId.length() > 0)
|
||||
if ((null != siteId) && (siteId.length() > 0))
|
||||
{
|
||||
for (String followerUser : followerUsers)
|
||||
{
|
||||
|
@@ -268,7 +268,7 @@ public abstract class AbstractContentTransformer2 extends AbstractContentTransfo
|
||||
// Report the error
|
||||
if(differentType == null)
|
||||
{
|
||||
transformerDebug.debug("Failed", e);
|
||||
transformerDebug.debug(" Failed", e);
|
||||
throw new ContentIOException("Content conversion failed: \n" +
|
||||
" reader: " + reader + "\n" +
|
||||
" writer: " + writer + "\n" +
|
||||
@@ -278,7 +278,7 @@ public abstract class AbstractContentTransformer2 extends AbstractContentTransfo
|
||||
}
|
||||
else
|
||||
{
|
||||
transformerDebug.debug("Failed: Mime type was '"+differentType+"'", e);
|
||||
transformerDebug.debug(" Failed: Mime type was '"+differentType+"'", e);
|
||||
throw new ContentIOException("Content conversion failed: \n" +
|
||||
" reader: " + reader + "\n" +
|
||||
" writer: " + writer + "\n" +
|
||||
|
@@ -241,7 +241,7 @@ public class FailoverContentTransformer extends AbstractContentTransformer2 impl
|
||||
// At this point we have tried all transformers in the sequence without apparent success.
|
||||
if (transformationException != null)
|
||||
{
|
||||
transformerDebug.debug("No more transformations to failover to");
|
||||
transformerDebug.debug(" No more transformations to failover to");
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("All transformations were unsuccessful. Throwing latest exception.", transformationException);
|
||||
|
@@ -641,7 +641,15 @@ public class TransformerDebug
|
||||
{
|
||||
if (isEnabled())
|
||||
{
|
||||
log(message + ' ' + t.getMessage());
|
||||
// Trim messages of the form: "Failed... : \n reader:...\n writer:..."
|
||||
String msg = t.getMessage();
|
||||
int i = msg.indexOf(": \n");
|
||||
if (i != -1)
|
||||
{
|
||||
msg = msg.substring(0, i);
|
||||
}
|
||||
|
||||
log(message + ' ' + msg);
|
||||
|
||||
Deque<Frame> ourStack = ThreadInfo.getStack();
|
||||
if (!ourStack.isEmpty())
|
||||
|
@@ -184,6 +184,23 @@ public class NodePropertyValue implements Cloneable, Serializable
|
||||
return Integer.valueOf(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cope with special values (ALF-16906)
|
||||
*/
|
||||
@Override
|
||||
protected ValueType getPersistedType(Serializable value)
|
||||
{
|
||||
if (value instanceof Float)
|
||||
{
|
||||
Float f = (Float) value;
|
||||
if (Float.isInfinite(f) || Float.isNaN(f))
|
||||
{
|
||||
return ValueType.STRING;
|
||||
}
|
||||
}
|
||||
return ValueType.FLOAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
Serializable convert(Serializable value)
|
||||
{
|
||||
@@ -198,6 +215,23 @@ public class NodePropertyValue implements Cloneable, Serializable
|
||||
return Integer.valueOf(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cope with special values (ALF-16906)
|
||||
*/
|
||||
@Override
|
||||
protected ValueType getPersistedType(Serializable value)
|
||||
{
|
||||
if (value instanceof Double)
|
||||
{
|
||||
Double d = (Double) value;
|
||||
if (Double.isInfinite(d) || Double.isNaN(d))
|
||||
{
|
||||
return ValueType.STRING;
|
||||
}
|
||||
}
|
||||
return ValueType.DOUBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
Serializable convert(Serializable value)
|
||||
{
|
||||
|
@@ -1164,7 +1164,8 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
!newExt.equalsIgnoreCase(oldExt))
|
||||
{
|
||||
String targetMimetype = contentData.getMimetype();
|
||||
String newMimetype = mimetypeService.guessMimetype(newName);
|
||||
final ContentReader reader = contentService.getReader(targetNodeRef, ContentModel.PROP_CONTENT);
|
||||
String newMimetype = mimetypeService.guessMimetype(newName, reader);
|
||||
if (!targetMimetype.equalsIgnoreCase(newMimetype))
|
||||
{
|
||||
contentData = ContentData.setMimetype(contentData, newMimetype);
|
||||
|
@@ -32,7 +32,6 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.crypto.SealedObject;
|
||||
import javax.transaction.UserTransaction;
|
||||
@@ -63,7 +62,6 @@ import org.alfresco.service.cmr.repository.DuplicateChildNodeNameException;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.MLText;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef.Status;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -74,7 +72,6 @@ import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.BaseSpringTest;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.TestWithUserUtils;
|
||||
import org.hibernate.dialect.DB2Dialect;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@@ -2057,6 +2054,27 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
Serializable checkProperty = nodeService.getProperty(nodeRef, PROP_QNAME_MULTI_VALUE);
|
||||
assertTrue("Property not converted to a Collection", checkProperty instanceof Collection);
|
||||
assertTrue("Collection doesn't contain value", ((Collection<?>)checkProperty).contains("GHI"));
|
||||
|
||||
// Check special numbers (Double): ALF-16906
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE, Double.NaN);
|
||||
assertEquals("Double.NaN failed", Double.NaN, nodeService.getProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE));
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE, Double.NEGATIVE_INFINITY);
|
||||
assertEquals("Double.NEGATIVE_INFINITY failed", Double.NEGATIVE_INFINITY, nodeService.getProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE));
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE, Double.POSITIVE_INFINITY);
|
||||
assertEquals("Double.POSITIVE_INFINITY failed", Double.POSITIVE_INFINITY, nodeService.getProperty(nodeRef, PROP_QNAME_DOUBLE_VALUE));
|
||||
// Check special numbers (Float): ALF-16906
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_FLOAT_VALUE, Float.NaN);
|
||||
assertEquals("Float.NaN failed", Float.NaN, nodeService.getProperty(nodeRef, PROP_QNAME_FLOAT_VALUE));
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_FLOAT_VALUE, Float.NEGATIVE_INFINITY);
|
||||
assertEquals("Float.NEGATIVE_INFINITY failed", Float.NEGATIVE_INFINITY, nodeService.getProperty(nodeRef, PROP_QNAME_FLOAT_VALUE));
|
||||
nodeService.setProperty(nodeRef, PROP_QNAME_FLOAT_VALUE, Float.POSITIVE_INFINITY);
|
||||
assertEquals("Float.POSITIVE_INFINITY failed", Float.POSITIVE_INFINITY, nodeService.getProperty(nodeRef, PROP_QNAME_FLOAT_VALUE));
|
||||
}
|
||||
|
||||
public void testPropertySpecialNumbers() throws Exception
|
||||
{
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(17);
|
||||
properties.put(PROP_QNAME_DOUBLE_VALUE, Double.NaN);
|
||||
}
|
||||
|
||||
public void testPropertyLocaleBehaviour() throws Exception
|
||||
|
Reference in New Issue
Block a user