@Override public IPortletDefinitionId getPortletDefinitionId() { return this.portletDefinition.getPortletDefinitionId(); }
@Override public IPortletDefinitionId getPortletDefinitionId() { return this.portletDefinition.getPortletDefinitionId(); }
@Override public IPortletDefinitionId getPortletDefinitionId() { return this.portletDefinition.getPortletDefinitionId(); }
@Override public IPortletDefinitionId getPortletDefinitionId() { return this.portletDefinition.getPortletDefinitionId(); }
/** * Static utility method computing the permission target ID for a portlet definition. * * @param portletDefinition a portlet definition * @return String permission target ID for the portlet definition. * @throws IllegalArgumentException if portletDefinition is null * @since 4.1 */ public static String permissionTargetIdForPortletDefinition( final IPortletDefinition portletDefinition) { Validate.notNull( portletDefinition, "Cannot compute permission target ID for a null portlet definition."); final String portletPublicationId = portletDefinition.getPortletDefinitionId().getStringId(); return IPermission.PORTLET_PREFIX.concat(portletPublicationId); } }
/** * Static utility method computing the permission target ID for a portlet definition. * * @param portletDefinition a portlet definition * @return String permission target ID for the portlet definition. * @throws IllegalArgumentException if portletDefinition is null * @since 4.1 */ public static String permissionTargetIdForPortletDefinition( final IPortletDefinition portletDefinition) { Validate.notNull( portletDefinition, "Cannot compute permission target ID for a null portlet definition."); final String portletPublicationId = portletDefinition.getPortletDefinitionId().getStringId(); return IPermission.PORTLET_PREFIX.concat(portletPublicationId); } }
@Override public PortletDelegationDispatcher createRequestDispatcher( PortletRequest portletRequest, String fName) { final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinitionByFname(fName); final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId(); return this.createRequestDispatcher(portletRequest, portletDefinitionId); }
@Override public Set<PortletCategory> getParentCategories(IPortletDefinition child) { String childKey = child.getPortletDefinitionId().getStringId(); IEntity childEntity = GroupService.getEntity(childKey, IPortletDefinition.class); Set<PortletCategory> parents = new HashSet<>(); for (IGroupMember gm : childEntity.getParentGroups()) { if (gm.isGroup()) { String categoryId = gm.getKey(); parents.add(getPortletCategory(categoryId)); } } return parents; }
@Override public Set<PortletCategory> getParentCategories(IPortletDefinition child) { String childKey = child.getPortletDefinitionId().getStringId(); IEntity childEntity = GroupService.getEntity(childKey, IPortletDefinition.class); Set<PortletCategory> parents = new HashSet<>(); for (IGroupMember gm : childEntity.getParentGroups()) { if (gm.isGroup()) { String categoryId = gm.getKey(); parents.add(getPortletCategory(categoryId)); } } return parents; }
@ResourceMapping @RequestMapping(params = "action=getEntityList") public ModelAndView getEntityList() throws Exception { final List<IPortletDefinition> portletDefs = portletDefinitionDao.getPortletDefinitions(); final List<TranslatableEntity> entities = new ArrayList<TranslatableEntity>(); for (IPortletDefinition portletDef : portletDefs) { TranslatableEntity entity = new TranslatableEntity(); entity.setId(portletDef.getPortletDefinitionId().getStringId()); entity.setTitle(portletDef.getTitle()); entities.add(entity); } return new ModelAndView("json", "entities", entities); }
@Override protected void loadBasePortletPreferences( IPortletDefinition portletDefinition, Map<String, IPortletPreference> basePortletPreferences) { // Add descriptor prefs to base Map final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId(); final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId); final Preferences descriptorPreferences = portletDescriptor.getPortletPreferences(); for (final Preference preference : descriptorPreferences.getPortletPreferences()) { final IPortletPreference preferenceWrapper = new PortletPreferenceImpl(preference); basePortletPreferences.put(preferenceWrapper.getName(), preferenceWrapper); } }
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); }
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); }
@Override protected void loadBasePortletPreferences( IPortletDefinition portletDefinition, Map<String, IPortletPreference> basePortletPreferences) { // Add descriptor prefs to base Map final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId(); final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId); final Preferences descriptorPreferences = portletDescriptor.getPortletPreferences(); for (final Preference preference : descriptorPreferences.getPortletPreferences()) { final IPortletPreference preferenceWrapper = new PortletPreferenceImpl(preference); basePortletPreferences.put(preferenceWrapper.getName(), preferenceWrapper); } }
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()); }
/** * Get the list of user attributes the portlet expects. * * @param request The current request. * @param portletWindow The window to get the expected user attributes for. * @return The List of expected user attributes for the portlet */ protected List<? extends UserAttribute> getExpectedUserAttributes( HttpServletRequest request, final IPortletWindow portletWindow) { final IPortletEntity portletEntity = portletWindow.getPortletEntity(); final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition(); final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor( portletDefinition.getPortletDefinitionId()); return portletApplicationDescriptor.getUserAttributes(); } }
public PortletTuple(IPortletDefinition pdef) { this.id = pdef.getPortletDefinitionId().getStringId(); this.name = pdef.getName(); this.fname = pdef.getFName(); this.description = pdef.getDescription(); this.type = pdef.getType().getName(); this.lifecycleState = pdef.getLifecycleState().toString(); this.categories = getPortletCategories(pdef); }
private IPortletDefinition checkPortletDefinitionRenderPermissions( IUserInstance userInstance, final IPortletDefinition portletDefinition) { if (portletDefinition == null) { return null; } final IPerson person = userInstance.getPerson(); final EntityIdentifier ei = person.getEntityIdentifier(); final IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); if (ap.canRender(portletDefinition.getPortletDefinitionId().getStringId())) { return portletDefinition; } return null; }
private IPortletDefinition checkPortletDefinitionRenderPermissions( IUserInstance userInstance, final IPortletDefinition portletDefinition) { if (portletDefinition == null) { return null; } final IPerson person = userInstance.getPerson(); final EntityIdentifier ei = person.getEntityIdentifier(); final IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); if (ap.canRender(portletDefinition.getPortletDefinitionId().getStringId())) { return portletDefinition; } return null; }
@Override @PortalTransactional public IMarketplaceRating getRating(String userName, IPortletDefinition portletDefinition) { PortletDefinitionImpl tempPortlet = new PortletDefinitionImpl( portletDefinition.getType(), portletDefinition.getFName(), portletDefinition.getName(), portletDefinition.getTitle(), portletDefinition.getPortletDescriptorKey().getWebAppName(), portletDefinition.getPortletDescriptorKey().getPortletName(), portletDefinition.getPortletDescriptorKey().isFrameworkPortlet(), portletDefinition.getPortletDefinitionId()); MarketplaceRatingPK tempPK = new MarketplaceRatingPK(userName, tempPortlet); return this.getRating(tempPK); }