Resolve ALF-4748 Provide config flag to control if replicated content is read-only (locked) on target

- replication-services-context.xml: replicationActionExecutor
   <property name="readOnly" value="true|false" />
- if property not defined, defaults to true

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22524 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-09-14 17:18:01 +00:00
parent 9fdc1ebae8
commit f32a6625f0
2 changed files with 13 additions and 1 deletions

View File

@@ -71,6 +71,7 @@
<property name="actionTrackingService" ref="actionTrackingService" /> <property name="actionTrackingService" ref="actionTrackingService" />
<property name="transactionService" ref="transactionService" /> <property name="transactionService" ref="transactionService" />
<property name="replicationDefinitionPersister" ref="replicationDefinitionPersister" /> <property name="replicationDefinitionPersister" ref="replicationDefinitionPersister" />
<property name="readOnly" value="true" />
</bean> </bean>
<!-- JavaScript API support --> <!-- JavaScript API support -->

View File

@@ -69,6 +69,7 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
private ActionTrackingService actionTrackingService; private ActionTrackingService actionTrackingService;
private TransactionService transactionService; private TransactionService transactionService;
private ReplicationDefinitionPersisterImpl replicationDefinitionPersister; private ReplicationDefinitionPersisterImpl replicationDefinitionPersister;
private Boolean readOnly;
/** /**
* By default, we lock for 30 minutes * By default, we lock for 30 minutes
@@ -134,6 +135,16 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
this.replicationDefinitionPersister = replicationDefinitionPersister; this.replicationDefinitionPersister = replicationDefinitionPersister;
} }
/**
* Sets transfer read only default value
*
* @param readOnly true => mark items in destination repository as read only
*/
public void setReadOnly(Boolean readOnly)
{
this.readOnly = readOnly;
}
@Override @Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) { protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
// Not used - our definitions hold everything on them // Not used - our definitions hold everything on them
@@ -176,7 +187,7 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
new TransferDefinition(); new TransferDefinition();
transferDefinition.setNodes(toTransfer); transferDefinition.setNodes(toTransfer);
transferDefinition.setSync(true); transferDefinition.setSync(true);
transferDefinition.setReadOnly(true); transferDefinition.setReadOnly(readOnly == null ? true : readOnly);
// Exclude aspects from transfer // Exclude aspects from transfer
// NOTE: this list of aspects should be synced up with the NodeCrawler in expandPayload to // NOTE: this list of aspects should be synced up with the NodeCrawler in expandPayload to