@Override public IUserLayoutNodeDescription getNode(String nodeId) throws PortalException { // check to see if it's in the layout first, if not then // build it.. IUserLayoutNodeDescription ulnd = null; // assume that not finding it in the implementation // means that it may be a requested (transient) node. try { ulnd = man.getNode(nodeId); } catch (PortalException pe) { if (log.isDebugEnabled()) log.debug( "Node '" + nodeId + "' is not in layout, " + "checking for a transient node..."); } if (null == ulnd) { // if the requested node hasn't been returned yet, it's // likely it's a transient node that isn't actually part of // the layout ulnd = getTransientNode(nodeId); } return ulnd; }
private boolean isFolder(IUserLayoutManager ulm, String id) { return ulm.getNode(id).getType().equals(IUserLayoutNodeDescription.LayoutNodeType.FOLDER); } }
IUserLayoutNodeDescription node = ulm.getNode(elementId);
node = userLayoutManager.getNode(layoutNodeId); } catch (PortalException e) {
node = userLayoutManager.getNode(layoutNodeId); } catch (PortalException e) {
.getUserLayoutManager(); if (!ulm.getNode(targetId).isEditAllowed()) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); return new ModelAndView( IUserLayoutNodeDescription node = ulm.getNode(targetId); if (node == null) { logger.warn("[updateAttributes()] Unable to locate node with id: " + targetId);
/** * Verify the requested node exists in the user's layout. Also if the node exists see if it is a * portlet node and if it is return the {@link IPortletWindowId} of the corresponding portlet. */ protected LayoutNodeType getLayoutNodeType(HttpServletRequest request, String folderNodeId) { final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager(); final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager(); final IUserLayoutNodeDescription node = userLayoutManager.getNode(folderNodeId); if (node == null) { return null; } return node.getType(); } }
IUserLayoutFolderDescription tab = (IUserLayoutFolderDescription) ulm.getNode(tabId);
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()); }
final Locale locale = RequestContextUtils.getLocale(request); if (!ulm.getNode(targetId).isAddChildAllowed()) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); return new ModelAndView(
ulm.addNode(ulm.getNode((String) channels.nextElement()), acceptor, null);
PortletEntityIdStringUtils.parseLayoutNodeId(consistentEntityIdString); if (!PortletEntityIdStringUtils.isDelegateLayoutNode(layoutNodeId)) { final IUserLayoutNodeDescription node = userLayoutManager.getNode(layoutNodeId); if (node == null || node.getType() != LayoutNodeType.PORTLET) { throw new IllegalArgumentException(
PortletEntityIdStringUtils.parseLayoutNodeId(consistentEntityIdString); if (!PortletEntityIdStringUtils.isDelegateLayoutNode(layoutNodeId)) { final IUserLayoutNodeDescription node = userLayoutManager.getNode(layoutNodeId); if (node == null || node.getType() != LayoutNodeType.PORTLET) { throw new IllegalArgumentException(
@Override public IPortletEntity getOrCreatePortletEntity( HttpServletRequest request, IUserInstance userInstance, String layoutNodeId) { final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager(); final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager(); // Find the channel and portlet definitions final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription) userLayoutManager.getNode(layoutNodeId); if (channelNode == null) { this.logger.warn( "No layout node exists for id " + layoutNodeId + ", no portlet entity will be returned."); return null; } final String channelPublishId = channelNode.getChannelPublishId(); final IPortletDefinition portletDefinition = this.getPortletDefinition(request, userInstance, channelPublishId); if (portletDefinition != null) { final IPerson person = userInstance.getPerson(); return this.getOrCreatePortletEntity( request, portletDefinition.getPortletDefinitionId(), layoutNodeId, person.getID()); } // No permission to see the portlet return null; }
@Override public IPortletEntity getOrCreatePortletEntity( HttpServletRequest request, IUserInstance userInstance, String layoutNodeId) { final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager(); final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager(); // Find the channel and portlet definitions final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription) userLayoutManager.getNode(layoutNodeId); if (channelNode == null) { this.logger.warn( "No layout node exists for id " + layoutNodeId + ", no portlet entity will be returned."); return null; } final String channelPublishId = channelNode.getChannelPublishId(); final IPortletDefinition portletDefinition = this.getPortletDefinition(request, userInstance, channelPublishId); if (portletDefinition != null) { final IPerson person = userInstance.getPerson(); return this.getOrCreatePortletEntity( request, portletDefinition.getPortletDefinitionId(), layoutNodeId, person.getID()); } // No permission to see the portlet return null; }
/** * Verify the requested portlet window corresponds to a node in the user's layout and return the * corresponding layout node id */ protected String verifyPortletWindowId( HttpServletRequest request, IPortletWindowId portletWindowId) { final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager(); final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager(); final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId); final IPortletWindowId delegationParentWindowId = portletWindow.getDelegationParentId(); if (delegationParentWindowId != null) { return verifyPortletWindowId(request, delegationParentWindowId); } final IPortletEntity portletEntity = portletWindow.getPortletEntity(); final String channelSubscribeId = portletEntity.getLayoutNodeId(); final IUserLayoutNodeDescription node = userLayoutManager.getNode(channelSubscribeId); if (node == null) { throw new IllegalArgumentException( "No layout node exists for id " + channelSubscribeId + " of window " + portletWindowId); } return node.getId(); }
IUserLayoutManager layoutManager = preferencesManager.getUserLayoutManager(); IUserLayoutNodeDescription nodeDescription = layoutManager.getNode(nodeId);