use of org.apereo.portal.fragment.subscribe.dao.IUserFragmentSubscriptionDao in project uPortal by Jasig.
the class UserFragmentSubscriptionDaoLocator method getUserIdentityStore.
public static IUserFragmentSubscriptionDao getUserIdentityStore() {
AbstractBeanLocator<IUserFragmentSubscriptionDao> locator = locatorInstance;
if (locator == null) {
LOG.info("Looking up bean '" + BEAN_NAME + "' in ApplicationContext due to context not yet being initialized");
final ApplicationContext applicationContext = PortalApplicationContextLocator.getApplicationContext();
applicationContext.getBean(UserFragmentSubscriptionDaoLocator.class.getName());
locator = locatorInstance;
if (locator == null) {
LOG.warn("Instance of '" + BEAN_NAME + "' still null after portal application context has been initialized");
return applicationContext.getBean(BEAN_NAME, IUserFragmentSubscriptionDao.class);
}
}
return locator.getInstance();
}
use of org.apereo.portal.fragment.subscribe.dao.IUserFragmentSubscriptionDao in project uPortal by Jasig.
the class SubscribedTabEvaluator method isApplicable.
@Override
public boolean isApplicable(IPerson person) {
IUserFragmentSubscriptionDao userFragmentInfoDao = UserFragmentSubscriptionDaoLocator.getUserIdentityStore();
// get the list of current fragment subscriptions for this person
List<IUserFragmentSubscription> fragments = userFragmentInfoDao.getUserFragmentInfo(person);
// with this evaluator instance
for (IUserFragmentSubscription fragment : fragments) {
if (fragment.isActive() && fragment.getFragmentOwner().equals(ownerId)) {
return true;
}
}
return false;
}
Aggregations