diff --git a/config/alfresco/application-context-highlevel.xml b/config/alfresco/application-context-highlevel.xml index 0359d3d76e..46bc0a679c 100644 --- a/config/alfresco/application-context-highlevel.xml +++ b/config/alfresco/application-context-highlevel.xml @@ -18,7 +18,6 @@ - diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml index 9771e860a2..9be01982b6 100644 --- a/config/alfresco/bootstrap-context.xml +++ b/config/alfresco/bootstrap-context.xml @@ -614,6 +614,30 @@ true + + + + + Subscriptions + + + true + + + + + + + + + SubscriptionServiceImpl + + + + org.alfresco.service.cmr.subscriptions.SubscriptionService + + + diff --git a/config/alfresco/subscription-service-context.xml b/config/alfresco/subsystems/Subscriptions/default/subscription-service-context.xml similarity index 88% rename from config/alfresco/subscription-service-context.xml rename to config/alfresco/subsystems/Subscriptions/default/subscription-service-context.xml index 71f9d3ed58..eb48196228 100644 --- a/config/alfresco/subscription-service-context.xml +++ b/config/alfresco/subsystems/Subscriptions/default/subscription-service-context.xml @@ -2,8 +2,9 @@ + - + org.alfresco.service.cmr.subscriptions.SubscriptionService @@ -29,6 +30,7 @@ + \ No newline at end of file diff --git a/config/alfresco/subsystems/Subscriptions/default/subscription-service.properties b/config/alfresco/subsystems/Subscriptions/default/subscription-service.properties new file mode 100644 index 0000000000..edcf341a5d --- /dev/null +++ b/config/alfresco/subsystems/Subscriptions/default/subscription-service.properties @@ -0,0 +1,2 @@ +# Enables the subscription service +subscriptions.enabled=true \ No newline at end of file diff --git a/source/java/org/alfresco/repo/activities/feed/local/LocalFeedTaskProcessor.java b/source/java/org/alfresco/repo/activities/feed/local/LocalFeedTaskProcessor.java index d9db085995..f42d4a2dbd 100644 --- a/source/java/org/alfresco/repo/activities/feed/local/LocalFeedTaskProcessor.java +++ b/source/java/org/alfresco/repo/activities/feed/local/LocalFeedTaskProcessor.java @@ -451,7 +451,7 @@ public class LocalFeedTaskProcessor extends FeedTaskProcessor implements Applica { Set result = new HashSet(); - if (subscriptionService.subscriptionsEnabled()) + if (subscriptionService.isActive()) { PagingFollowingResults fr = subscriptionService.getFollowers(userId, new PagingRequest(1000000, null)); diff --git a/source/java/org/alfresco/repo/subscriptions/SubscriptionServiceImpl.java b/source/java/org/alfresco/repo/subscriptions/SubscriptionServiceImpl.java index fbd57f2fcc..d1c2973888 100644 --- a/source/java/org/alfresco/repo/subscriptions/SubscriptionServiceImpl.java +++ b/source/java/org/alfresco/repo/subscriptions/SubscriptionServiceImpl.java @@ -89,6 +89,8 @@ public class SubscriptionServiceImpl implements SubscriptionService protected NamespaceService namespaceService; protected FileFolderService fileFolderService; + protected boolean active; + /** * Sets the subscriptions DAO. */ @@ -161,6 +163,11 @@ public class SubscriptionServiceImpl implements SubscriptionService this.fileFolderService = fileFolderService; } + public final void setActive(boolean active) + { + this.active = active; + } + @Override public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type, PagingRequest pagingRequest) @@ -352,9 +359,9 @@ public class SubscriptionServiceImpl implements SubscriptionService } @Override - public boolean subscriptionsEnabled() + public boolean isActive() { - return true; + return active; } /** @@ -362,7 +369,7 @@ public class SubscriptionServiceImpl implements SubscriptionService */ protected void checkEnabled() { - if (!subscriptionsEnabled()) + if (!isActive()) { throw new SubscriptionsDisabledException("subscription_service.err.disabled"); } diff --git a/source/java/org/alfresco/service/cmr/subscriptions/SubscriptionService.java b/source/java/org/alfresco/service/cmr/subscriptions/SubscriptionService.java index b25f093d3d..5418ea12a6 100644 --- a/source/java/org/alfresco/service/cmr/subscriptions/SubscriptionService.java +++ b/source/java/org/alfresco/service/cmr/subscriptions/SubscriptionService.java @@ -19,6 +19,7 @@ package org.alfresco.service.cmr.subscriptions; import org.alfresco.query.PagingRequest; +import org.alfresco.repo.management.subsystems.ActivateableBean; import org.alfresco.service.Auditable; import org.alfresco.service.NotAuditable; import org.alfresco.service.cmr.repository.NodeRef; @@ -29,7 +30,7 @@ import org.alfresco.service.cmr.repository.NodeRef; * @author Florian Mueller * @since 4.0 */ -public interface SubscriptionService +public interface SubscriptionService extends ActivateableBean { // --- subscription --- @@ -204,5 +205,5 @@ public interface SubscriptionService * Returns if subscription are enabled for this system. */ @NotAuditable - boolean subscriptionsEnabled(); + boolean isActive(); }