Search in sources :

Example 51 with IPortletDefinition

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;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) HashMap(java.util.HashMap) ExternalPermissionDefinition(org.apereo.portal.io.xml.portlettype.ExternalPermissionDefinition) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Example 52 with IPortletDefinition

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);
}
Also used : ModelAndView(org.springframework.web.portlet.ModelAndView) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) ResourceMapping(org.springframework.web.portlet.bind.annotation.ResourceMapping) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 53 with IPortletDefinition

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();
}
Also used : IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Example 54 with IPortletDefinition

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;
}
Also used : IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) IPortletEntityId(org.apereo.portal.portlet.om.IPortletEntityId) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) PortletDefinition(org.apache.pluto.container.om.portlet.PortletDefinition)

Example 55 with IPortletDefinition

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);
}
Also used : IPortletDefinitionId(org.apereo.portal.portlet.om.IPortletDefinitionId) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Aggregations

IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)109 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)24 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)22 IAuthorizationPrincipal (org.apereo.portal.security.IAuthorizationPrincipal)17 ArrayList (java.util.ArrayList)16 IPortletDefinitionId (org.apereo.portal.portlet.om.IPortletDefinitionId)14 HashSet (java.util.HashSet)13 IPerson (org.apereo.portal.security.IPerson)13 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 PortletCategory (org.apereo.portal.portlet.om.PortletCategory)12 EntityIdentifier (org.apereo.portal.EntityIdentifier)11 IUserLayoutManager (org.apereo.portal.layout.IUserLayoutManager)9 HashMap (java.util.HashMap)8 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)8 IPortletDefinitionParameter (org.apereo.portal.portlet.om.IPortletDefinitionParameter)7 IPortletPreference (org.apereo.portal.portlet.om.IPortletPreference)7 IUserInstance (org.apereo.portal.user.IUserInstance)7 Locale (java.util.Locale)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 PortletDefinition (org.apache.pluto.container.om.portlet.PortletDefinition)6