mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -348,7 +348,7 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
else
|
||||
{
|
||||
File newdir = new File(extractDir + entry.getName());
|
||||
newdir.mkdir();
|
||||
newdir.mkdirs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -335,6 +335,12 @@ public abstract class AbstractPatch implements Patch
|
||||
// execute in a transaction
|
||||
try
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("\n" +
|
||||
"Patch will be applied: \n" +
|
||||
" patch: " + this);
|
||||
}
|
||||
AuthenticationUtil.RunAsWork<String> authorisedPathWork = new AuthenticationUtil.RunAsWork<String>()
|
||||
{
|
||||
public String doWork() throws Exception
|
||||
@@ -361,7 +367,8 @@ public abstract class AbstractPatch implements Patch
|
||||
// done
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Patch successfully applied: \n" +
|
||||
logger.debug("\n" +
|
||||
"Patch successfully applied: \n" +
|
||||
" patch: " + this + "\n" +
|
||||
" report: " + report);
|
||||
}
|
||||
|
@@ -34,10 +34,12 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
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.rule.RuleService;
|
||||
import org.alfresco.service.descriptor.Descriptor;
|
||||
import org.alfresco.service.descriptor.DescriptorService;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -61,6 +63,7 @@ public class PatchServiceImpl implements PatchService
|
||||
private static Log logger = LogFactory.getLog(PatchServiceImpl.class);
|
||||
|
||||
private DescriptorService descriptorService;
|
||||
private TransactionService transactionService;
|
||||
private RuleService ruleService;
|
||||
private PatchDaoService patchDaoService;
|
||||
private List<Patch> patches;
|
||||
@@ -75,6 +78,11 @@ public class PatchServiceImpl implements PatchService
|
||||
this.descriptorService = descriptorService;
|
||||
}
|
||||
|
||||
public void setTransactionService(TransactionService transactionService)
|
||||
{
|
||||
this.transactionService = transactionService;
|
||||
}
|
||||
|
||||
public void setPatchDaoService(PatchDaoService patchDaoService)
|
||||
{
|
||||
this.patchDaoService = patchDaoService;
|
||||
@@ -156,7 +164,7 @@ public class PatchServiceImpl implements PatchService
|
||||
* @param appliedPatchesById already applied patches keyed by their ID
|
||||
* @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();
|
||||
// check if it has already been done
|
||||
@@ -183,7 +191,14 @@ public class PatchServiceImpl implements PatchService
|
||||
}
|
||||
}
|
||||
// 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())
|
||||
{
|
||||
// this was a failure
|
||||
|
Reference in New Issue
Block a user