Name

global.ActivitySubscriptionContextImpl

Description

Gets installed as part of com.snc.activity_subscriptions plugin Activity Subscriptions Framework. An implementation class to get access to service layer components for Activity Subscriptions.

Script

var ActivitySubscriptionContextImpl = Class.create();
ActivitySubscriptionContextImpl.prototype = {
  initialize: function() {
  	this.isCommunityPluginActive = pm.isActive('com.sn_communities');
  	this.subscriptionDAO = new SubscriptionDAO(this);
  	this.activityDAO = new ActivityDAO(this);
  	this.activityContextDao = new ActivityContextDao(this);
  	this.isCommunityPluginActive = pm.isActive('com.sn_communities');
  },
  isPluginEnabled: function() {
  	var disableProperty = gs.getProperty('com.snc.actsub.core.disable_plugin', false);
  	if (disableProperty === 'false')
  		return true;
  },

  getSubscriptionService: function() {
  	return this.getService(ActivityConstants.SUBSCRIPTION_SERVICE);
  },

  getActivityService: function() {
  	return this.getService(ActivityConstants.ACTIVITY_SERVICE);
  },

  getSubscriptionDAO: function() {
  	return this.subscriptionDAO;
  },

  getActivityDAO: function() {
  	return this.activityDAO;
  },
  
  getActivityContextDao: function() {
  	return this.activityContextDao;
  },

  getService: function(resourceName) {
  	//inject context into the services
  	switch (resourceName + "") {
  		case ActivityConstants.ACTIVITY_FACET_SERVCE:
  			return new ActivityFacetService(this);
  		case ActivityConstants.ACTIVITY_SERVICE:
  			return new ActivityService(this);
  		case ActivityConstants.SUBSCRIPTION_SERVICE:
  			return new SubscriptionService(this);
  		case ActivityConstants.ACTIVITY_CONTEXT_SERVICE:
  			return new ActivityContextService(this);
  		case ActivityConstants.DEFLECTION_CONTEXT_SERVICE:
  			return new sn_ssa_core.DeflectionContextService(this);
  		case ActivityConstants.ACTIVITY_STREAM_PULL_SERVICE:
  			return new ActivityStreamPullService(this);
  	}
  },

  type: 'ActivitySubscriptionContextImpl'
};

Sys ID

67c3d6c3db003200fa9b32d8f0b8f585

Offical Documentation

Official Docs: