fix/MNT-24891-BackPort - Skip actionContext to classify as an adhoc property in add-features action logic

This commit is contained in:
Belal Ansari
2025-04-08 19:55:20 +05:30
parent 6c044ae374
commit 3c565ea928
2 changed files with 10 additions and 11 deletions

View File

@@ -67,7 +67,7 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
* Set the node service * Set the node service
* *
* @param nodeService * @param nodeService
* the node service * the node service
*/ */
public void setNodeService(NodeService nodeService) public void setNodeService(NodeService nodeService)
{ {
@@ -78,7 +78,7 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
* Set the transaction service * Set the transaction service
* *
* @param transactionService * @param transactionService
* the transaction service * the transaction service
*/ */
public void setTransactionService(TransactionService transactionService) public void setTransactionService(TransactionService transactionService)
{ {
@@ -102,8 +102,7 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
if (this.nodeService.exists(actionedUponNodeRef)) if (this.nodeService.exists(actionedUponNodeRef))
{ {
transactionService.getRetryingTransactionHelper().doInTransaction( transactionService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Void>() new RetryingTransactionCallback<Void>() {
{
public Void execute() throws Throwable public Void execute() throws Throwable
{ {
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(); Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
@@ -137,8 +136,7 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
nodeService.addAspect(actionedUponNodeRef, aspectQName, properties); nodeService.addAspect(actionedUponNodeRef, aspectQName, properties);
return null; return null;
} }
} });
);
} }
} }

View File

@@ -28,6 +28,11 @@ package org.alfresco.repo.action.executer;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import org.junit.Before;
import org.junit.Test;
import org.springframework.extensions.surf.util.I18NUtil;
import org.springframework.transaction.annotation.Transactional;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.ActionImpl; import org.alfresco.repo.action.ActionImpl;
import org.alfresco.repo.action.access.ActionAccessRestriction; import org.alfresco.repo.action.access.ActionAccessRestriction;
@@ -40,10 +45,6 @@ import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.BaseSpringTest; import org.alfresco.util.BaseSpringTest;
import org.alfresco.util.GUID; import org.alfresco.util.GUID;
import org.junit.Before;
import org.junit.Test;
import org.springframework.extensions.surf.util.I18NUtil;
import org.springframework.transaction.annotation.Transactional;
/** /**
* Add features action execution test * Add features action execution test
@@ -102,7 +103,7 @@ public class AddFeaturesActionExecuterTest extends BaseSpringTest
QName.createQName("{test}testnode"), QName.createQName("{test}testnode"),
ContentModel.TYPE_CONTENT).getChildRef(); ContentModel.TYPE_CONTENT).getChildRef();
// Get the executer instance // Get the executer instance
this.executer = (AddFeaturesActionExecuter) this.applicationContext.getBean(AddFeaturesActionExecuter.NAME); this.executer = (AddFeaturesActionExecuter) this.applicationContext.getBean(AddFeaturesActionExecuter.NAME);
} }