mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Turned subscription service into a subsystem
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28919 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
<import resource="classpath:alfresco/preference-service-context.xml"/>
|
<import resource="classpath:alfresco/preference-service-context.xml"/>
|
||||||
<import resource="classpath:alfresco/swf-transform-context.xml"/>
|
<import resource="classpath:alfresco/swf-transform-context.xml"/>
|
||||||
<import resource="classpath:alfresco/form-services-context.xml"/>
|
<import resource="classpath:alfresco/form-services-context.xml"/>
|
||||||
<import resource="classpath:alfresco/subscription-service-context.xml" />
|
|
||||||
<import resource="classpath:alfresco/cmis-api-context.xml" />
|
<import resource="classpath:alfresco/cmis-api-context.xml" />
|
||||||
<import resource="classpath:alfresco/opencmis-context.xml" />
|
<import resource="classpath:alfresco/opencmis-context.xml" />
|
||||||
<import resource="classpath:alfresco/period-type-context.xml" />
|
<import resource="classpath:alfresco/period-type-context.xml" />
|
||||||
|
@@ -615,6 +615,30 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- Subscription Service subsystem -->
|
||||||
|
<bean id="subscriptions" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
|
||||||
|
<property name="category">
|
||||||
|
<value>Subscriptions</value>
|
||||||
|
</property>
|
||||||
|
<property name="autoStart">
|
||||||
|
<value>true</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="SubscriptionService" class="org.alfresco.repo.management.subsystems.SubsystemProxyFactory">
|
||||||
|
<property name="sourceApplicationContextFactory">
|
||||||
|
<ref bean="subscriptions" />
|
||||||
|
</property>
|
||||||
|
<property name="sourceBeanName">
|
||||||
|
<value>SubscriptionServiceImpl</value>
|
||||||
|
</property>
|
||||||
|
<property name="interfaces">
|
||||||
|
<list>
|
||||||
|
<value>org.alfresco.service.cmr.subscriptions.SubscriptionService</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- Start the quartz scheduler -->
|
<!-- Start the quartz scheduler -->
|
||||||
|
|
||||||
<bean id="schedulerStarter" class="org.alfresco.util.SchedulerStarterBean" >
|
<bean id="schedulerStarter" class="org.alfresco.util.SchedulerStarterBean" >
|
||||||
|
@@ -2,8 +2,9 @@
|
|||||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
<beans>
|
<beans>
|
||||||
|
|
||||||
<!-- Subscription service bean -->
|
<!-- Subscription service bean -->
|
||||||
<bean id="SubscriptionService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="SubscriptionServiceImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
<property name="proxyInterfaces">
|
<property name="proxyInterfaces">
|
||||||
<value>org.alfresco.service.cmr.subscriptions.SubscriptionService</value>
|
<value>org.alfresco.service.cmr.subscriptions.SubscriptionService</value>
|
||||||
</property>
|
</property>
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
<property name="searchService" ref="SearchService" />
|
<property name="searchService" ref="SearchService" />
|
||||||
<property name="namespaceService" ref="NamespaceService" />
|
<property name="namespaceService" ref="NamespaceService" />
|
||||||
<property name="fileFolderService" ref="FileFolderService" />
|
<property name="fileFolderService" ref="FileFolderService" />
|
||||||
|
<property name="active" value="${subscriptions.enabled}" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
@@ -0,0 +1,2 @@
|
|||||||
|
# Enables the subscription service
|
||||||
|
subscriptions.enabled=true
|
@@ -451,7 +451,7 @@ public class LocalFeedTaskProcessor extends FeedTaskProcessor implements Applica
|
|||||||
{
|
{
|
||||||
Set<String> result = new HashSet<String>();
|
Set<String> result = new HashSet<String>();
|
||||||
|
|
||||||
if (subscriptionService.subscriptionsEnabled())
|
if (subscriptionService.isActive())
|
||||||
{
|
{
|
||||||
PagingFollowingResults fr = subscriptionService.getFollowers(userId, new PagingRequest(1000000, null));
|
PagingFollowingResults fr = subscriptionService.getFollowers(userId, new PagingRequest(1000000, null));
|
||||||
|
|
||||||
|
@@ -89,6 +89,8 @@ public class SubscriptionServiceImpl implements SubscriptionService
|
|||||||
protected NamespaceService namespaceService;
|
protected NamespaceService namespaceService;
|
||||||
protected FileFolderService fileFolderService;
|
protected FileFolderService fileFolderService;
|
||||||
|
|
||||||
|
protected boolean active;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the subscriptions DAO.
|
* Sets the subscriptions DAO.
|
||||||
*/
|
*/
|
||||||
@@ -161,6 +163,11 @@ public class SubscriptionServiceImpl implements SubscriptionService
|
|||||||
this.fileFolderService = fileFolderService;
|
this.fileFolderService = fileFolderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void setActive(boolean active)
|
||||||
|
{
|
||||||
|
this.active = active;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type,
|
public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type,
|
||||||
PagingRequest pagingRequest)
|
PagingRequest pagingRequest)
|
||||||
@@ -352,9 +359,9 @@ public class SubscriptionServiceImpl implements SubscriptionService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean subscriptionsEnabled()
|
public boolean isActive()
|
||||||
{
|
{
|
||||||
return true;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -362,7 +369,7 @@ public class SubscriptionServiceImpl implements SubscriptionService
|
|||||||
*/
|
*/
|
||||||
protected void checkEnabled()
|
protected void checkEnabled()
|
||||||
{
|
{
|
||||||
if (!subscriptionsEnabled())
|
if (!isActive())
|
||||||
{
|
{
|
||||||
throw new SubscriptionsDisabledException("subscription_service.err.disabled");
|
throw new SubscriptionsDisabledException("subscription_service.err.disabled");
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
package org.alfresco.service.cmr.subscriptions;
|
package org.alfresco.service.cmr.subscriptions;
|
||||||
|
|
||||||
import org.alfresco.query.PagingRequest;
|
import org.alfresco.query.PagingRequest;
|
||||||
|
import org.alfresco.repo.management.subsystems.ActivateableBean;
|
||||||
import org.alfresco.service.Auditable;
|
import org.alfresco.service.Auditable;
|
||||||
import org.alfresco.service.NotAuditable;
|
import org.alfresco.service.NotAuditable;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -29,7 +30,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
* @author Florian Mueller
|
* @author Florian Mueller
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public interface SubscriptionService
|
public interface SubscriptionService extends ActivateableBean
|
||||||
{
|
{
|
||||||
// --- subscription ---
|
// --- subscription ---
|
||||||
|
|
||||||
@@ -204,5 +205,5 @@ public interface SubscriptionService
|
|||||||
* Returns if subscription are enabled for this system.
|
* Returns if subscription are enabled for this system.
|
||||||
*/
|
*/
|
||||||
@NotAuditable
|
@NotAuditable
|
||||||
boolean subscriptionsEnabled();
|
boolean isActive();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user