Merged V2.1 to HEAD

6938: Fix for WCM-864 (bulk import of ZIP containing only directories and no files)
   6939: Fix for AWC-1602. Workaround for MSIE7 DOM access methods in Javascript.
   6942: Fixed bug in transaction demarcation around the patch service.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7349 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-11-12 14:40:12 +00:00
parent dc98a19382
commit bfcb186478
4 changed files with 30 additions and 4 deletions

View File

@@ -21,6 +21,7 @@
</property> </property>
<property name="transactionAttributes"> <property name="transactionAttributes">
<props> <props>
<prop key="apply*">PROPAGATION_NOT_SUPPORTED</prop>
<prop key="get*">${server.transaction.mode.readOnly}</prop> <prop key="get*">${server.transaction.mode.readOnly}</prop>
<prop key="*">${server.transaction.mode.default}</prop> <prop key="*">${server.transaction.mode.default}</prop>
</props> </props>
@@ -37,6 +38,9 @@
<property name="descriptorService"> <property name="descriptorService">
<ref bean="descriptorComponent" /> <ref bean="descriptorComponent" />
</property> </property>
<property name="transactionService">
<ref bean="transactionService" />
</property>
<property name="ruleService"> <property name="ruleService">
<ref bean="ruleService" /> <ref bean="ruleService" />
</property> </property>

View File

@@ -348,7 +348,7 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
else else
{ {
File newdir = new File(extractDir + entry.getName()); File newdir = new File(extractDir + entry.getName());
newdir.mkdir(); newdir.mkdirs();
} }
} }
} }

View File

@@ -335,6 +335,12 @@ public abstract class AbstractPatch implements Patch
// execute in a transaction // execute in a transaction
try try
{ {
if (logger.isDebugEnabled())
{
logger.debug("\n" +
"Patch will be applied: \n" +
" patch: " + this);
}
AuthenticationUtil.RunAsWork<String> authorisedPathWork = new AuthenticationUtil.RunAsWork<String>() AuthenticationUtil.RunAsWork<String> authorisedPathWork = new AuthenticationUtil.RunAsWork<String>()
{ {
public String doWork() throws Exception public String doWork() throws Exception
@@ -361,7 +367,8 @@ public abstract class AbstractPatch implements Patch
// done // done
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
logger.debug("Patch successfully applied: \n" + logger.debug("\n" +
"Patch successfully applied: \n" +
" patch: " + this + "\n" + " patch: " + this + "\n" +
" report: " + report); " report: " + report);
} }

View File

@@ -34,10 +34,12 @@ import java.util.Map;
import org.alfresco.i18n.I18NUtil; import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.domain.AppliedPatch; import org.alfresco.repo.domain.AppliedPatch;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.admin.PatchException; import org.alfresco.service.cmr.admin.PatchException;
import org.alfresco.service.cmr.rule.RuleService; import org.alfresco.service.cmr.rule.RuleService;
import org.alfresco.service.descriptor.Descriptor; import org.alfresco.service.descriptor.Descriptor;
import org.alfresco.service.descriptor.DescriptorService; import org.alfresco.service.descriptor.DescriptorService;
import org.alfresco.service.transaction.TransactionService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -61,6 +63,7 @@ public class PatchServiceImpl implements PatchService
private static Log logger = LogFactory.getLog(PatchServiceImpl.class); private static Log logger = LogFactory.getLog(PatchServiceImpl.class);
private DescriptorService descriptorService; private DescriptorService descriptorService;
private TransactionService transactionService;
private RuleService ruleService; private RuleService ruleService;
private PatchDaoService patchDaoService; private PatchDaoService patchDaoService;
private List<Patch> patches; private List<Patch> patches;
@@ -75,6 +78,11 @@ public class PatchServiceImpl implements PatchService
this.descriptorService = descriptorService; this.descriptorService = descriptorService;
} }
public void setTransactionService(TransactionService transactionService)
{
this.transactionService = transactionService;
}
public void setPatchDaoService(PatchDaoService patchDaoService) public void setPatchDaoService(PatchDaoService patchDaoService)
{ {
this.patchDaoService = patchDaoService; this.patchDaoService = patchDaoService;
@@ -156,7 +164,7 @@ public class PatchServiceImpl implements PatchService
* @param appliedPatchesById already applied patches keyed by their ID * @param appliedPatchesById already applied patches keyed by their ID
* @return Returns true if the patch and all its dependencies were successfully applied. * @return Returns true if the patch and all its dependencies were successfully applied.
*/ */
private boolean applyPatchAndDependencies(Patch patch, Map<String, AppliedPatch> appliedPatchesById) private boolean applyPatchAndDependencies(final Patch patch, Map<String, AppliedPatch> appliedPatchesById)
{ {
String id = patch.getId(); String id = patch.getId();
// check if it has already been done // check if it has already been done
@@ -183,7 +191,14 @@ public class PatchServiceImpl implements PatchService
} }
} }
// all the dependencies were successful // all the dependencies were successful
appliedPatch = applyPatch(patch); RetryingTransactionCallback<AppliedPatch> callback = new RetryingTransactionCallback<AppliedPatch>()
{
public AppliedPatch execute() throws Throwable
{
return applyPatch(patch);
}
};
appliedPatch = transactionService.getRetryingTransactionHelper().doInTransaction(callback, false, true);
if (!appliedPatch.getSucceeded()) if (!appliedPatch.getSucceeded())
{ {
// this was a failure // this was a failure