diff --git a/config/alfresco/content-publishing-context.xml b/config/alfresco/content-publishing-context.xml
index d469324d76..06b8c6771a 100644
--- a/config/alfresco/content-publishing-context.xml
+++ b/config/alfresco/content-publishing-context.xml
@@ -54,7 +54,6 @@
-
diff --git a/source/java/org/alfresco/repo/publishing/AbstractChannelType.java b/source/java/org/alfresco/repo/publishing/AbstractChannelType.java
index 7568de44d6..56f00e2703 100644
--- a/source/java/org/alfresco/repo/publishing/AbstractChannelType.java
+++ b/source/java/org/alfresco/repo/publishing/AbstractChannelType.java
@@ -20,24 +20,14 @@
package org.alfresco.repo.publishing;
import java.io.Serializable;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import org.alfresco.repo.transfer.CompositeNodeFilter;
-import org.alfresco.repo.transfer.CompositeNodeFinder;
-import org.alfresco.repo.transfer.PrimaryParentNodeFinder;
-import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.publishing.channels.ChannelService;
import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
-import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
@@ -45,11 +35,8 @@ import org.springframework.core.io.Resource;
* @author Nick Smith
* @since 4.0
*/
-public abstract class AbstractChannelType implements ChannelType, InitializingBean
+public abstract class AbstractChannelType implements ChannelType
{
- private ServiceRegistry serviceRegistry;
- protected NodeFinder nodeFinder;
- protected NodeFilter nodeFilter;
private ChannelService channelService;
public void setChannelService(ChannelService channelService)
@@ -63,75 +50,6 @@ public abstract class AbstractChannelType implements ChannelType, InitializingBe
return channelService;
}
- /**
- * @param serviceRegistry
- * the serviceRegistry to set
- */
- public void setServiceRegistry(ServiceRegistry serviceRegistry)
- {
- this.serviceRegistry = serviceRegistry;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void afterPropertiesSet() throws Exception
- {
-
- Collection finders = getAllNodeFInders();
- CompositeNodeFinder finder = new CompositeNodeFinder(finders);
- finder.setServiceRegistry(serviceRegistry);
- finder.init();
- this.nodeFinder = finder;
-
- Collection filters = getAllNodeFIlters();
- CompositeNodeFilter filter = new CompositeNodeFilter(filters);
- filter.setServiceRegistry(serviceRegistry);
- finder.init();
- this.nodeFilter = filter;
- }
-
- /**
- * @return a collection of {@link NodeFilter}s to be included in the
- * {@link CompositeNodeFilter} returned by the getNodeFilter()
- * method.
- */
- protected Collection getAllNodeFIlters()
- {
- return Collections.emptyList();
- }
-
- /**
- * @return a collection of {@link NodeFinder}s to be included in the
- * {@link CompositeNodeFinder} returned by the getNodeFinder()
- * method.
- */
- protected Collection getAllNodeFInders()
- {
- // TODO Add dependency node finder.
- NodeFinder parentFinder = new PrimaryParentNodeFinder();
- return Arrays.asList(parentFinder);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NodeFilter getNodeFilter()
- {
- return nodeFilter;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NodeFinder getNodeFinder()
- {
- return nodeFinder;
- }
-
/**
* {@inheritDoc}
*/
diff --git a/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFilter.java b/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFilter.java
deleted file mode 100644
index 07e6498b92..0000000000
--- a/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFilter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-package org.alfresco.repo.publishing;
-
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE;
-
-import org.alfresco.repo.transfer.AbstractNodeFilter;
-import org.alfresco.service.cmr.publishing.channels.ChannelService;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.util.ParameterCheck;
-
-/**
- * @author Nick Smith
- * @since 4.0
- */
-public class ChannelDependancyNodeFilter extends AbstractNodeFilter
-{
- private final ChannelService channelService;
- private NodeService nodeService;
-
- /**
- * @param channelService
- */
- public ChannelDependancyNodeFilter(ChannelService channelService)
- {
- this.channelService = channelService;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init()
- {
- super.init();
- this.nodeService = serviceRegistry.getNodeService();
- ParameterCheck.mandatory("channelService", channelService);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean accept(NodeRef thisNode)
- {
- String typeId = (String) nodeService.getProperty(thisNode, PROP_CHANNEL_TYPE);
- if (typeId !=null)
- {
- ChannelType type = channelService.getChannelType(typeId);
- if (type != null)
- {
- NodeFilter filter = type.getNodeFilter();
- if (filter !=null)
- {
- return filter.accept(thisNode);
- }
- }
- }
- return true;
- }
-}
diff --git a/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFinder.java b/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFinder.java
deleted file mode 100644
index b60cfe81c3..0000000000
--- a/source/java/org/alfresco/repo/publishing/ChannelDependancyNodeFinder.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-package org.alfresco.repo.publishing;
-
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE;
-
-import java.util.Collections;
-import java.util.Set;
-
-import org.alfresco.repo.transfer.AbstractNodeFinder;
-import org.alfresco.service.cmr.publishing.channels.ChannelService;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.transfer.NodeFinder;
-import org.alfresco.util.ParameterCheck;
-
-/**
- * @author Nick Smith
- * @since 4.0
- */
-public class ChannelDependancyNodeFinder extends AbstractNodeFinder
-{
- private final ChannelService channelService;
- private NodeService nodeService;
-
- /**
- * @param channelService
- */
- public ChannelDependancyNodeFinder(ChannelService channelService)
- {
- this.channelService = channelService;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init()
- {
- super.init();
- this.nodeService = serviceRegistry.getNodeService();
- ParameterCheck.mandatory("channelService", channelService);
- }
-
- /**
- * {@inheritDoc}
- */
- public Set findFrom(NodeRef thisNode)
- {
- String typeId = (String) nodeService.getProperty(thisNode, PROP_CHANNEL_TYPE);
- if (typeId !=null)
- {
- ChannelType type = channelService.getChannelType(typeId);
- if (type != null)
- {
- NodeFinder finder = type.getNodeFinder();
- if (finder !=null)
- {
- return finder.findFrom(thisNode);
- }
- }
- }
- return Collections.emptySet();
- }
-}
diff --git a/source/java/org/alfresco/repo/publishing/ChannelServiceImpl.java b/source/java/org/alfresco/repo/publishing/ChannelServiceImpl.java
index 30c8a72c05..e9db7e9db2 100644
--- a/source/java/org/alfresco/repo/publishing/ChannelServiceImpl.java
+++ b/source/java/org/alfresco/repo/publishing/ChannelServiceImpl.java
@@ -37,8 +37,6 @@ import org.alfresco.service.cmr.publishing.channels.ChannelService;
import org.alfresco.service.cmr.publishing.channels.ChannelType;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
@@ -255,22 +253,6 @@ public class ChannelServiceImpl implements ChannelService
return channelTypes.get(id);
}
- /**
- * {@inheritDoc}
- */
- public NodeFinder getChannelDependancyNodeFinder()
- {
- return new ChannelDependancyNodeFinder(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public NodeFilter getChannelDependancyNodeFilter()
- {
- return new ChannelDependancyNodeFilter(this);
- }
-
/**
* {@inheritDoc}
*/
diff --git a/source/java/org/alfresco/repo/publishing/ChannelServiceImplTest.java b/source/java/org/alfresco/repo/publishing/ChannelServiceImplTest.java
index b444222a02..dfb5f3557c 100644
--- a/source/java/org/alfresco/repo/publishing/ChannelServiceImplTest.java
+++ b/source/java/org/alfresco/repo/publishing/ChannelServiceImplTest.java
@@ -19,25 +19,16 @@
package org.alfresco.repo.publishing;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE;
-import static org.mockito.Mockito.when;
import java.util.List;
-import java.util.Set;
import javax.annotation.Resource;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -91,67 +82,4 @@ public class ChannelServiceImplTest
}
}
- @Test
- public void testGetChannelDependancyNodeFinder() throws Exception
- {
- when(serviceRegistry.getNodeService()).thenReturn(nodeService);
- NodeRef node = new NodeRef("test://foo/bar");
- NodeRef parent = new NodeRef("test://foo/barParent");
- ChildAssociationRef assoc = new ChildAssociationRef(null, parent, null, node);
-
- NodeFinder nodeFinder = channelService.getChannelDependancyNodeFinder();
- assertNotNull(nodeFinder);
-
- // Initialize Node Finders
- ChannelDependancyNodeFinder cdnf = (ChannelDependancyNodeFinder) nodeFinder;
- cdnf.setServiceRegistry(serviceRegistry);
- cdnf.init();
-
- // Need to call afterPropertiesSet() again to pick up nodeService.
- mockChannelType.afterPropertiesSet();
-
- // Check no nodes found if NodeRef does not have a channel type.
- Set results = nodeFinder.findFrom(node);
- assertTrue(results.isEmpty());
-
- // Check no nodes found if NodeRef has an unregistered channel type.
- when(nodeService.getProperty(node, PROP_CHANNEL_TYPE))
- .thenReturn("Foo");
- results = nodeFinder.findFrom(node);
- assertTrue(results.isEmpty());
-
- // Check returns parent if MockChannelType found.
- when(nodeService.getProperty(node, PROP_CHANNEL_TYPE))
- .thenReturn(MockChannelType.ID);
- when(nodeService.getPrimaryParent(node))
- .thenReturn(assoc);
- results = nodeFinder.findFrom(node);
- assertEquals(1, results.size());
- assertTrue(results.contains(parent));
- }
-
- @Test
- public void testGetChannelDependancyNodeFilter() throws Exception
- {
- when(serviceRegistry.getNodeService()).thenReturn(nodeService);
- NodeRef node = new NodeRef("test://foo/bar");
-
- NodeFilter nodeFinder = channelService.getChannelDependancyNodeFilter();
- assertNotNull(nodeFinder);
-
- // Initialize Node Finders
- ChannelDependancyNodeFilter cdnf = (ChannelDependancyNodeFilter) nodeFinder;
- cdnf.setServiceRegistry(serviceRegistry);
- cdnf.init();
-
- // Check no nodes filtered if NodeRef does not have a channel type.
- assertTrue(nodeFinder.accept(node));
-
- // Check no nodes filtered if NodeRef has an unregistered channel type.
- when(nodeService.getProperty(node, PROP_CHANNEL_TYPE))
- .thenReturn("Foo");
- assertTrue(nodeFinder.accept(node));
-
- // TODO Test other NodeFilter behaviour when added.
- }
}
diff --git a/source/java/org/alfresco/repo/publishing/PublishServiceImpl.java b/source/java/org/alfresco/repo/publishing/PublishServiceImpl.java
index 9dd8673f44..2b70bbadd0 100644
--- a/source/java/org/alfresco/repo/publishing/PublishServiceImpl.java
+++ b/source/java/org/alfresco/repo/publishing/PublishServiceImpl.java
@@ -69,7 +69,7 @@ public class PublishServiceImpl implements PublishingService
/**
* {@inheritDoc}
*/
- public List getEventsForPublishedNode(NodeRef publishedNode)
+ public List getPublishEventsForNode(NodeRef publishedNode)
{
NodeRef queueNode = rootObject.getPublishingQueue().getNodeRef();
List eventNodes = publishingEventHelper.getEventNodesForPublishedNode(queueNode, publishedNode);
@@ -79,7 +79,7 @@ public class PublishServiceImpl implements PublishingService
/**
* {@inheritDoc}
*/
- public List getEventsForUnpublishedNode(NodeRef unpublishedNode)
+ public List getUnpublishEventsForNode(NodeRef unpublishedNode)
{
NodeRef queueNode = rootObject.getPublishingQueue().getNodeRef();
List eventNodes = publishingEventHelper.getEventNodesForUnpublishedNode(queueNode, unpublishedNode);
diff --git a/source/java/org/alfresco/repo/publishing/flickr/FlickrUnpublishAction.java b/source/java/org/alfresco/repo/publishing/flickr/FlickrUnpublishAction.java
index f2d0d59909..e53583865e 100644
--- a/source/java/org/alfresco/repo/publishing/flickr/FlickrUnpublishAction.java
+++ b/source/java/org/alfresco/repo/publishing/flickr/FlickrUnpublishAction.java
@@ -26,18 +26,14 @@ import org.alfresco.repo.publishing.flickr.springsocial.api.Flickr;
import org.alfresco.repo.publishing.flickr.springsocial.api.MediaOperations;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
-import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.tagging.TaggingService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.social.connect.Connection;
public class FlickrUnpublishAction extends ActionExecuterAbstractBase
{
- private final static Log log = LogFactory.getLog(FlickrUnpublishAction.class);
-
public static final String NAME = "unpublish_flickr";
private NodeService nodeService;
diff --git a/source/java/org/alfresco/repo/publishing/test/TestChannelType1.java b/source/java/org/alfresco/repo/publishing/test/TestChannelType1.java
index f67d832cbd..fd6e1804e7 100644
--- a/source/java/org/alfresco/repo/publishing/test/TestChannelType1.java
+++ b/source/java/org/alfresco/repo/publishing/test/TestChannelType1.java
@@ -27,8 +27,6 @@ import org.alfresco.repo.publishing.AbstractChannelType;
import org.alfresco.repo.publishing.PublishingModel;
import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.QName;
public class TestChannelType1 extends AbstractChannelType
@@ -70,18 +68,6 @@ public class TestChannelType1 extends AbstractChannelType
return 0;
}
- @Override
- public NodeFilter getNodeFilter()
- {
- return null;
- }
-
- @Override
- public NodeFinder getNodeFinder()
- {
- return null;
- }
-
@Override
public String getNodeUrl(NodeRef node)
{
diff --git a/source/java/org/alfresco/repo/publishing/test/TestChannelType2.java b/source/java/org/alfresco/repo/publishing/test/TestChannelType2.java
index 658ff18de2..92941d59ed 100644
--- a/source/java/org/alfresco/repo/publishing/test/TestChannelType2.java
+++ b/source/java/org/alfresco/repo/publishing/test/TestChannelType2.java
@@ -27,8 +27,6 @@ import org.alfresco.repo.publishing.AbstractChannelType;
import org.alfresco.repo.publishing.PublishingModel;
import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.QName;
public class TestChannelType2 extends AbstractChannelType
@@ -70,18 +68,6 @@ public class TestChannelType2 extends AbstractChannelType
return 140;
}
- @Override
- public NodeFilter getNodeFilter()
- {
- return null;
- }
-
- @Override
- public NodeFinder getNodeFinder()
- {
- return null;
- }
-
@Override
public String getNodeUrl(NodeRef node)
{
diff --git a/source/java/org/alfresco/repo/publishing/test/TestChannelType3.java b/source/java/org/alfresco/repo/publishing/test/TestChannelType3.java
index be032eff7a..92099149de 100644
--- a/source/java/org/alfresco/repo/publishing/test/TestChannelType3.java
+++ b/source/java/org/alfresco/repo/publishing/test/TestChannelType3.java
@@ -27,8 +27,6 @@ import org.alfresco.repo.publishing.AbstractChannelType;
import org.alfresco.repo.publishing.PublishingModel;
import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.QName;
public class TestChannelType3 extends AbstractChannelType
@@ -70,18 +68,6 @@ public class TestChannelType3 extends AbstractChannelType
return 200;
}
- @Override
- public NodeFilter getNodeFilter()
- {
- return null;
- }
-
- @Override
- public NodeFinder getNodeFinder()
- {
- return null;
- }
-
@Override
public String getNodeUrl(NodeRef node)
{
diff --git a/source/java/org/alfresco/service/cmr/publishing/PublishingService.java b/source/java/org/alfresco/service/cmr/publishing/PublishingService.java
index 52924d551e..76a9aa2b54 100644
--- a/source/java/org/alfresco/service/cmr/publishing/PublishingService.java
+++ b/source/java/org/alfresco/service/cmr/publishing/PublishingService.java
@@ -18,11 +18,8 @@
*/
package org.alfresco.service.cmr.publishing;
-import java.util.Collection;
import java.util.List;
-import java.util.Map;
-import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.repository.NodeRef;
/**
@@ -46,14 +43,14 @@ public interface PublishingService
* @param publishedNode The node that was published.
* @return A list of {@link PublishingEvent}s.
*/
- List getEventsForPublishedNode(NodeRef publishedNode);
+ List getPublishEventsForNode(NodeRef publishedNode);
/**
* Retrieve a list of publishing events for which the specified node
was unpublished.
* @param unpublishedNode The node that was unpublished.
* @return A list of {@link PublishingEvent}s.
*/
- List getEventsForUnpublishedNode(NodeRef unpublishedNode);
+ List getUnpublishEventsForNode(NodeRef unpublishedNode);
/**
* Request that the specified publishing event be cancelled. This call will
@@ -70,20 +67,4 @@ public interface PublishingService
* @return A PublishingQueue object corresponding tho this environment's publishing queue
*/
PublishingQueue getPublishingQueue();
-
- /**
- * Discover the publishing status of each of the specified nodes
- * @param channelId an identifier indicating which {@link Channel} to check the status for.
- * @param nodes The nodes whose publishing status is being sought
- * @return A map associating a NodePublishStatus object with each of the supplied NodeRef objects
- */
- Map checkPublishStatus(String channelId, Collection nodes);
-
- /**
- * Discover the publishing status of each of the specified nodes
- * @param channelId an identifier indicating which {@link Channel} to check the status for.
- * @param nodes The nodes whose publishing status is being sought
- * @return A map associating a NodePublishStatus object with each of the supplied NodeRef objects
- */
- Map checkPublishStatus(String channelId, NodeRef... nodes);
}
diff --git a/source/java/org/alfresco/service/cmr/publishing/channels/ChannelType.java b/source/java/org/alfresco/service/cmr/publishing/channels/ChannelType.java
index 7fa7eff502..ef945d41a1 100644
--- a/source/java/org/alfresco/service/cmr/publishing/channels/ChannelType.java
+++ b/source/java/org/alfresco/service/cmr/publishing/channels/ChannelType.java
@@ -24,8 +24,6 @@ import java.util.Map;
import java.util.Set;
import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.transfer.NodeFilter;
-import org.alfresco.service.cmr.transfer.NodeFinder;
import org.alfresco.service.namespace.QName;
import org.springframework.core.io.Resource;
@@ -39,8 +37,7 @@ public interface ChannelType
String getId();
QName getChannelNodeType();
- NodeFinder getNodeFinder();
- NodeFilter getNodeFilter();
+
void publish(NodeRef nodeToPublish, Map properties);
void unpublish(NodeRef nodeToUnpublish, Map properties);
void updateStatus(Channel channel, String status, Map properties);