Merged V2.2 to HEAD

10982: Merged V2.1 to V2.2
      10273: Fix for ETWOONE-317: Error from regenerate renditions wizard when templates are updated
   10985: Merged V2.1 to V2.2
      10717: Fix for ETWOONE-14: System Error message appears while clicking 'Manage Task' icon in ...
      10742: Fix for ETWOONE-119: A user created with space characters at the begin and at the end can't login
      10758: Fix for ETWOONE-183: URL addressability of forum spaces and topics
      10760: Fix for ETWOONE-339: URL Addressability to discussions causes display issue
      10761: Fix for ETWOONE-196: Attempt to post to the same forum by two or more users simultaneously leads to error appearance and impossibility to post for some of them
      10772: Fix for ETWOONE-225: Validation.js does not properly handle trailing whitespace
   10986: Added Hibernate src to Eclipse project
   11004: Remove annoying exceptions on shutdown
   11005: Minor javadoc fix
   11012: Fixed ETWOTWO-423: Optionally inject the Open Office document converter instance to the transformer


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11202 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-10-06 11:22:26 +00:00
parent 9ed542fab1
commit dd2ce5da0a
3 changed files with 43 additions and 16 deletions

View File

@@ -26,11 +26,10 @@
*----------------------------------------------------------------------------*/
package org.alfresco.linkvalidation;
import org.alfresco.util.AbstractLifecycleBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationContext;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.repo.avm.util.RawServices;
import org.alfresco.util.AbstractLifecycleBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
/**
* Bootstrap for LinkValidationService
@@ -39,10 +38,6 @@ public class LinkValidationServiceBootstrap extends AbstractLifecycleBean
{
private LinkValidationService linkValidationService_;
/* (non-Javadoc)
* @see org.alfresco.util.AbstractLifecycleBean#onBootstrap(org.springframework.context.ApplicationEvent)
*/
@Override
protected void onBootstrap(ApplicationEvent event)
{
@@ -53,9 +48,6 @@ public class LinkValidationServiceBootstrap extends AbstractLifecycleBean
linkValidationService_.onBootstrap();
}
/* (non-Javadoc)
* @see org.alfresco.util.AbstractLifecycleBean#onShutdown(org.springframework.context.ApplicationEvent)
*/
@Override
protected void onShutdown(ApplicationEvent event)
{

View File

@@ -34,6 +34,7 @@ import net.sf.jooreports.converter.DocumentFormatRegistry;
import net.sf.jooreports.converter.XmlDocumentFormatRegistry;
import net.sf.jooreports.openoffice.connection.OpenOfficeConnection;
import net.sf.jooreports.openoffice.connection.OpenOfficeException;
import net.sf.jooreports.openoffice.converter.AbstractOpenOfficeDocumentConverter;
import net.sf.jooreports.openoffice.converter.OpenOfficeDocumentConverter;
import org.alfresco.error.AlfrescoRuntimeException;
@@ -56,7 +57,7 @@ import org.springframework.core.io.DefaultResourceLoader;
public class OpenOfficeContentTransformer extends AbstractContentTransformer2
{
private OpenOfficeConnection connection;
private OpenOfficeDocumentConverter converter;
private AbstractOpenOfficeDocumentConverter converter;
private String documentFormatsConfiguration;
private DocumentFormatRegistry formatRegistry;
@@ -64,11 +65,27 @@ public class OpenOfficeContentTransformer extends AbstractContentTransformer2
{
}
/**
* @param connection the connection that the converter uses
*/
public void setConnection(OpenOfficeConnection connection)
{
this.connection = connection;
}
/**
* Explicitly set the converter to be used. The converter must use the same connection
* set in {@link #setConnection(OpenOfficeConnection)}.
* <p>
* If not set, then the <code>OpenOfficeDocumentConverter</code> will be used.
*
* @param converter the converter to use.
*/
public void setConverter(AbstractOpenOfficeDocumentConverter converter)
{
this.converter = converter;
}
/**
* Set a non-default location from which to load the document format mappings.
*
@@ -110,7 +127,10 @@ public class OpenOfficeContentTransformer extends AbstractContentTransformer2
}
// set up the converter
converter = new OpenOfficeDocumentConverter(connection);
if (converter == null)
{
converter = new OpenOfficeDocumentConverter(connection);
}
// Register
super.register();

View File

@@ -28,6 +28,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.VmShutdownListener;
import org.alfresco.util.transaction.SpringAwareUserTransaction;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
@@ -41,6 +42,8 @@ import org.springframework.transaction.TransactionDefinition;
*/
public class TransactionServiceImpl implements TransactionService
{
private static VmShutdownListener shutdownListener = new VmShutdownListener("TransactionService");
private PlatformTransactionManager transactionManager;
private int maxRetries = -1;
private int minRetryWaitMs = -1;
@@ -79,8 +82,20 @@ public class TransactionServiceImpl implements TransactionService
public boolean isReadOnly()
{
Boolean allowWrite = (Boolean)sysAdminCache.get(KEY_SYSADMIN_ALLOW_WRITE);
return (allowWrite == null ? false : ! allowWrite);
if (shutdownListener.isVmShuttingDown())
{
return true;
}
try
{
Boolean allowWrite = (Boolean)sysAdminCache.get(KEY_SYSADMIN_ALLOW_WRITE);
return (allowWrite == null ? false : ! allowWrite);
}
catch (IllegalStateException e)
{
// The cache is not working
return true;
}
}
/**