use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletDefinitionImporterExporter method savePortletDefinition.
/*
* (non-Javadoc)
* @see org.apereo.portal.channel.IChannelPublishingService#saveChannelDefinition(org.apereo.portal.portlet.om.IPortletDefinition, org.apereo.portal.security.IPerson, org.apereo.portal.channel.ChannelLifecycleState, java.util.Date, java.util.Date, org.apereo.portal.ChannelCategory[], org.apereo.portal.groups.IGroupMember[])
*/
@Override
public IPortletDefinition savePortletDefinition(IPortletDefinition definition, IPerson publisher, List<PortletCategory> categories, List<IGroupMember> groupMembers) {
Map<ExternalPermissionDefinition, Set<IGroupMember>> permissions = new HashMap<>();
permissions.put(ExternalPermissionDefinition.SUBSCRIBE, new HashSet<>(groupMembers));
IPortletDefinition def = savePortletDefinition(definition, publisher, categories, permissions);
return def;
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletEntityTranslationController method getPortletDefinition.
@ResourceMapping
@RequestMapping(params = "action=getEntity")
public ModelAndView getPortletDefinition(@RequestParam("id") String portletId, @RequestParam("locale") String locale) throws Exception {
final IPortletDefinition definition = portletDefinitionDao.getPortletDefinition(portletId);
final PortletDefinitionTranslation translation = new PortletDefinitionTranslation();
translation.setId(portletId);
translation.setLocale(locale);
translation.setLocalized(new LocalizedPortletDefinition(definition, locale));
translation.setOriginal(new LocalizedPortletDefinition(definition, null));
return new ModelAndView("json", "portlet", translation);
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class ThreadNamingPortletExecutionInterceptorAdaptor method getFname.
protected String getFname(HttpServletRequest request, IPortletWindowId portletWindowId) {
final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
if (portletWindow == null) {
logger.warn("Failed to resolve IPortletWindow for id: " + portletWindowId + ", the id will be used instead of the fname");
return portletWindowId.toString();
}
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
return portletDefinition.getFName();
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletWindowRegistryImpl method wrapPortletWindowData.
protected IPortletWindow wrapPortletWindowData(HttpServletRequest request, PortletWindowData portletWindowData) {
final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId();
final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
if (portletEntity == null) {
return null;
}
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinition.getPortletDefinitionId());
if (portletDescriptor == null) {
return null;
}
final IPortletWindow portletWindow = new PortletWindowImpl(portletDescriptor, portletEntity, portletWindowData);
logger.trace("Wrapping PortletWindowData {} as IPortletWindow", portletWindow.getPortletWindowId());
return portletWindow;
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletEntityRegistryImpl method createConsistentPortletEntityId.
protected IPortletEntityId createConsistentPortletEntityId(IPortletEntity portletEntity) {
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
final String layoutNodeId = portletEntity.getLayoutNodeId();
final int userId = portletEntity.getUserId();
return this.createConsistentPortletEntityId(portletDefinitionId, layoutNodeId, userId);
}
Aggregations