Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

58986: ALF-13291 - Transfer target is still displayed in replication job despite of target was deleted


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 00:31:33 +00:00
parent da4170e6f2
commit bb1be40563
3 changed files with 32 additions and 1 deletions

View File

@@ -60,6 +60,7 @@
<!-- Replication Service base bean -->
<bean id="replicationService" class="org.alfresco.repo.replication.ReplicationServiceImpl" >
<property name="actionService" ref="ActionService"/>
<property name="transferService" ref="TransferService"/>
<property name="scheduledPersistedActionService" ref="scheduledPersistedActionService" />
<property name="replicationDefinitionPersister" ref="replicationDefinitionPersister" />
</bean>

View File

@@ -179,6 +179,9 @@
</property>
<property name="transactionAttributes">
<props>
<prop key="targetExists">${server.transaction.mode.readOnly}</prop>
<prop key="get*">${server.transaction.mode.readOnly}</prop>
<prop key="has*">${server.transaction.mode.readOnly}</prop>
<prop key="*">${server.transaction.mode.default}</prop>
</props>
</property>

View File

@@ -26,6 +26,8 @@ import org.alfresco.service.cmr.action.scheduled.ScheduledPersistedActionService
import org.alfresco.service.cmr.replication.ReplicationDefinition;
import org.alfresco.service.cmr.replication.ReplicationService;
import org.alfresco.service.cmr.replication.ReplicationServiceException;
import org.alfresco.service.cmr.transfer.TransferService;
import org.alfresco.service.cmr.transfer.TransferService2;
import org.alfresco.util.GUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -41,6 +43,7 @@ public class ReplicationServiceImpl implements ReplicationService, ReplicationDe
private ScheduledPersistedActionService scheduledPersistedActionService;
private ReplicationParams replicationParams;
private ReplicationDefinitionPersisterImpl replicationDefinitionPersister;
private TransferService transferService;
/**
* Injects the ReplicationDefinitionPersister bean.
@@ -96,7 +99,21 @@ public class ReplicationServiceImpl implements ReplicationService, ReplicationDe
public ReplicationDefinition loadReplicationDefinition(String replicationDefinitionName) {
ReplicationDefinitionImpl rd = (ReplicationDefinitionImpl)
replicationDefinitionPersister.loadReplicationDefinition(replicationDefinitionName);
if(rd != null) {
if(rd != null)
{
// check here whether the target still exists and blank if not
// TODO we should rework relationship between action and target
String targetName = rd.getTargetName();
if(targetName != null)
{
if(!getTransferService().targetExists(targetName))
{
rd.setTargetName(null);
}
}
rd.setSchedule(
scheduledPersistedActionService.getSchedule(rd)
);
@@ -243,4 +260,14 @@ public class ReplicationServiceImpl implements ReplicationService, ReplicationDe
{
this.replicationParams = replicationParams;
}
public TransferService getTransferService()
{
return transferService;
}
public void setTransferService(TransferService transferService)
{
this.transferService = transferService;
}
}