Merged V2.9 to HEAD

10586: Merged V2.2 to V2.9
      9883: Fix for https://issues.alfresco.com/jira/browse/ETWOTWO-561
      9893: Gave some more time to wait for the threads to finish (QNameDAOTest)
      9955: Added trace logging of calls that possibly cause failures during session flushing
      9956: Part fix ETWOTWO570: RetryingTransactionAdvice needs to use RetryingTransactionHelper
      9958: Fixed ETWOTWO-570: AVM transaction interceptors fail if methods are incorrectly declared
      9973: More missing transaction declarations for AttributeService
      9977: Fixed unit test to rollback properly after expected txn failure
      9978: Fix for ETWOTWO-440: Error : 500: Failed to execute method NodeInfoBean.sendNodeInfo
      9986: LinkValidationService missing txn declaration for onBootstrap
   10588: Merged V2.2 to V2.9
      9898: Fixed handling of cm:name on root nodes
      9900: Empty property sets are allowed
   10589: Merged V2.2 to V2.9
      9965: Fixed unit test to inject 'nodeService' and not 'NodeService'.
      10311: getWebProjectUserRole - change log level from info to debug
      10329: Fix missing and mis-spelt transaction declarations
      10343: Fix for ETWOTWO-32
      10346: Build Fix
      10358: Fix for ETWOTWO-621
      10362: Fix for ETWOTWO-518
      10371: QNameDAO cache doesn't blow up if cache entry is invalid
      10538: Fix for minor XSS issue identified in ETWOTWO-657 item 3
   10678: Merged V2.2 to V2.9
      10205: Fix for ETWOTWO-48: Cancelled import of war into a Web project and Web Project became unusable
      10206: Fix for ETWOTWO-181: Deletion of checked out document


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10710 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-09-04 01:19:51 +00:00
parent 3227355279
commit 76abcf04d9
23 changed files with 592 additions and 239 deletions

View File

@@ -31,6 +31,9 @@ import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.TransformationOptions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.hssf.record.RecordFormatException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -53,10 +56,16 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
*/
public class PoiHssfContentTransformer extends AbstractContentTransformer2
{
/**
* Error message to delegate to NodeInfoBean
*/
public static final String WRONG_FORMAT_MESSAGE_ID = "transform.err.format_or_password";
/**
* Windows carriage return line feed pair.
*/
private static final String LINE_BREAK = "\r\n";
private static Log logger = LogFactory.getLog(PoiHssfContentTransformer.class);
/**
* Currently the only transformation performed is that of text extraction from XLS documents.
@@ -100,6 +109,14 @@ public class PoiHssfContentTransformer extends AbstractContentTransformer2
PoiHssfContentTransformer.writeString(os, encoding, LINE_BREAK, false);
}
}
catch (RecordFormatException ex)
{
// Catching specific exception to propagate it to NodeInfoBean
// to fix issue https://issues.alfresco.com/jira/browse/ETWOTWO-440
logger.error(ex);
throw new TransformerInfoException(WRONG_FORMAT_MESSAGE_ID, ex);
}
finally
{
if (is != null)

View File

@@ -0,0 +1,30 @@
package org.alfresco.repo.content.transform;
import org.alfresco.error.AlfrescoRuntimeException;
/**
*
* Wraps an exception that could be thrown in any transformer to
* propagate it up to <code>NodeInfoBean.sendNodeInfo</code> method.
* <code>NodeInfoBean</code> can handle this exception to display it in NodeInfo frame
* to avoid error message box with "Exception in Transaction" message.
*
* See {@link org.alfresco.repo.content.transform.PoiHssfContentTransformer} for pattern.
*
* @author Arseny Kovalchuk
*
*/
public class TransformerInfoException extends AlfrescoRuntimeException
{
private static final long serialVersionUID = -4343331677825559617L;
public TransformerInfoException(String msg)
{
super(msg);
}
public TransformerInfoException(String msg, Throwable err)
{
super(msg, err);
}
}