use of org.apereo.portal.layout.IUserLayoutManager in project uPortal by Jasig.
the class TransientPortletEntityDao method determineDatabaseChannelSubscribeId.
protected String determineDatabaseChannelSubscribeId(String layoutNodeId) {
//Find the referenced Node in the user's layout
final IUserLayoutManager userLayoutManager = this.getUserLayoutManager();
final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription) userLayoutManager.getNode(layoutNodeId);
//Lookup the IportletDefinition for the node
final String portletPublishId = channelNode.getChannelPublishId();
final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(portletPublishId);
//Generate the subscribe ID used for the database
return this.getPersistentLayoutNodeId(portletDefinition.getPortletDefinitionId());
}
use of org.apereo.portal.layout.IUserLayoutManager in project uPortal by Jasig.
the class TransientPortletEntityDao method wrapEntity.
/**
* Adds a TransientPortletEntity wrapper to the portletEntity if it is needed. If the specified
* entity is transient but no transient subscribe id has been registered for it yet in the
* transientIdMap null is returned. If no wrapping is needed the original entity is returned.
*/
protected IPortletEntity wrapEntity(IPortletEntity portletEntity) {
if (portletEntity == null) {
return null;
}
final String persistentLayoutNodeId = portletEntity.getLayoutNodeId();
if (persistentLayoutNodeId.startsWith(TransientUserLayoutManagerWrapper.SUBSCRIBE_PREFIX)) {
final IUserLayoutManager userLayoutManager = this.getUserLayoutManager();
if (userLayoutManager == null) {
this.logger.warn("Could not find IUserLayoutManager when trying to wrap transient portlet entity: " + portletEntity);
return portletEntity;
}
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final String fname = portletDefinition.getFName();
final String layoutNodeId = userLayoutManager.getSubscribeId(fname);
return new TransientPortletEntity(portletEntity, layoutNodeId);
}
return portletEntity;
}
Aggregations