Examples of IUserLayoutChannelDescription


Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

        String fname = getFname(nodeId);
        if ( null == fname || fname.equals("") )
            throw new PortalException( "Could not find a transient node " +
                                       "for id: " + nodeId );

        IUserLayoutChannelDescription ulnd = new UserLayoutChannelDescription();
        try
        {
            // check cache first
            IChannelDefinition chanDef = (IChannelDefinition)mChanMap.get(nodeId);

            if ( null == chanDef ) {
                chanDef = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl().getChannelDefinition(fname);
                mChanMap.put(nodeId,chanDef);
            }

            ulnd.setId(nodeId);
            ulnd.setName(chanDef.getName());
            ulnd.setUnremovable(true);
            ulnd.setImmutable(true);
            ulnd.setHidden(false);
            ulnd.setTitle(chanDef.getTitle());
            ulnd.setDescription(chanDef.getDescription());
            ulnd.setClassName(chanDef.getJavaClass());
            ulnd.setChannelPublishId("" + chanDef.getId());
            ulnd.setChannelTypeId("" + chanDef.getTypeId());
            ulnd.setFunctionalName(chanDef.getFName());
            ulnd.setTimeout(chanDef.getTimeout());
            ulnd.setEditable(chanDef.isEditable());
            ulnd.setHasHelp(chanDef.hasHelp());
            ulnd.setHasAbout(chanDef.hasAbout());

            Set<IChannelParameter> parms = chanDef.getParameters();
            for ( IChannelParameter parm : parms )
            {
                ulnd.setParameterValue(parm.getName(),parm.getValue());
                ulnd.setParameterOverride(parm.getName(),parm.getOverride());
            }

        }
        catch( Exception e )
        {
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager();
       
        //Find the channel and portlet definitions
        final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription)userLayoutManager.getNode(portletNodeId);
        final String channelPublishId = channelNode.getChannelPublishId();
        final IChannelDefinition channelDefinition = this.channelRegistryStore.getChannelDefinition(channelPublishId);
        if(null == channelDefinition) {
            throw new IllegalArgumentException("No channel definition found for publish id: " + channelPublishId);
        }
        final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(channelDefinition.getId());
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

    String method = request.getParameter("position");

    IChannelRegistryStore channelRegistryStore = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl();
    IChannelDefinition definition = channelRegistryStore.getChannelDefinition(sourceId);
   
        IUserLayoutChannelDescription channel = new UserLayoutChannelDescription(definition);
    for (IChannelParameter param : definition.getParameters()) {
        if (param.getOverride()) {
                String paramValue = request.getParameter(param.getName());
                if (paramValue != null) {
                    channel.setParameterValue(param.getName(), param.getValue());
                }
        }
    }

    IUserLayoutNodeDescription node = null;
    if (isTab(ulm, destinationId)) {
      Enumeration columns = ulm.getChildIds(destinationId);
      if (columns.hasMoreElements()) {
        while (columns.hasMoreElements()) {
          // attempt to add this channel to the column
          node = ulm.addNode(channel, (String) columns.nextElement(),
              null);
          // if it couldn't be added to this column, go on and try the next
          // one.  otherwise, we're set.
          if (node != null)
            break;
        }
      } else {

        IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
        newColumn.setName("Column");
        newColumn.setId("tbd");
        newColumn
            .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
        newColumn.setHidden(false);
        newColumn.setUnremovable(false);
        newColumn.setImmutable(false);

        // add the column to our layout
        IUserLayoutNodeDescription col = ulm.addNode(newColumn,
            destinationId, null);

        // add the channel
        node = ulm.addNode(channel, col.getId(), null);
      }

    } else if (isColumn(ulm, destinationId)) {
      // move the channel into the column
      node = ulm.addNode(channel, destinationId, null);
    } else {
      // If we're moving this element before another one, we need
      // to know what the target is. If there's no target, just
      // assume we're moving it to the very end of the column.
      String siblingId = null;
      if (method.equals("insertBefore"))
        siblingId = destinationId;

      // move the node as requested and save the layout
      node = ulm.addNode(channel, ulm.getParentId(destinationId),
          siblingId);
    }

    String nodeId = node.getId();

    // instantiate the channel in the user's layout
    final HttpSession session = request.getSession(false);
        ChannelManager cm = new ChannelManager(upm, session);
    cm.instantiateChannel(new PortalHttpServletRequestWrapper(request, response, userInstanceManager), response, channel.getId());

    try {
      // save the user's layout
      saveUserLayoutPreservingTab(ulm, upm, per);
    } catch (Exception e) {
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

            String nodeId = node.getId();
            IUserLayoutNodeDescription oldNode = getNode( nodeId );

            if( oldNode instanceof IUserLayoutChannelDescription )
            {
                IUserLayoutChannelDescription oldChanDesc = (IUserLayoutChannelDescription) oldNode;
                if (!(node instanceof IUserLayoutChannelDescription))
                {
                    throw new PortalException("Change channel to folder is "
                            + "not allowed by updateNode() method! Occurred "
                            + "in layout for "
                            + owner.getAttribute(IPerson.USERNAME) + ".");
                }
                IUserLayoutChannelDescription newChanDesc =
                    (IUserLayoutChannelDescription) node;
                updateChannelNode(nodeId, newChanDesc, oldChanDesc);

                // inform the listeners
                final String parentNodeId = this.getParentId(nodeId);
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

       
       
        final UserProfile userProfile = new UserProfile();
        userProfile.setProfileId(1);
       
        final IUserLayoutChannelDescription channelDescription = EasyMock.createMock(IUserLayoutChannelDescription.class);
        EasyMock.expect(channelDescription.getName()).andReturn("chanPub1").anyTimes();
        EasyMock.expect(channelDescription.getChannelPublishId()).andReturn("chanPub1").anyTimes();
        EasyMock.expect(channelDescription.getChannelSubscribeId()).andReturn("chanSub1").anyTimes();
       
        final IUserLayoutNodeDescription parentNodeDescription = EasyMock.createMock(IUserLayoutNodeDescription.class);
        EasyMock.expect(parentNodeDescription.getName()).andReturn("parentNode1").anyTimes();
        EasyMock.expect(parentNodeDescription.getId()).andReturn("parentNode1").anyTimes();
       
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

        final IPortletWindowRegistry portletWindowRegistry = createMock(IPortletWindowRegistry.class);
        final IUserInstanceManager userInstanceManager = createMock(IUserInstanceManager.class);
        final IUserInstance userInstance = createMock(IUserInstance.class);
        final IUserPreferencesManager userPreferencesManager = createMock(IUserPreferencesManager.class);
        final IUserLayoutManager userLayoutManager = createMock(IUserLayoutManager.class);
        final IUserLayoutChannelDescription userLayoutChannelDescription = createMock(IUserLayoutChannelDescription.class);
        final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        final IPortletDefinition portletDefinition = createMock(IPortletDefinition.class);
        final IChannelDefinition channelDefinition = createMock(IChannelDefinition.class);
        final IPerson person = createMock(IPerson.class);
        final IPortletEntityRegistry portletEntityRegistry = createMock(IPortletEntityRegistry.class);
        final IPortletEntity portletEntity = createMock(IPortletEntity.class);
        final IPortletWindow portletWindow = createMock(IPortletWindow.class);
       
        final MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId("42");
        final MockPortletEntityId portletEntityId = new MockPortletEntityId("subId1");
        final MockPortletWindowId portletWindowId = new MockPortletWindowId("windowId1");
       
        expect(userInstanceManager.getUserInstance(request)).andReturn(userInstance);
        expect(userInstance.getPreferencesManager()).andReturn(userPreferencesManager);
        expect(userPreferencesManager.getUserLayoutManager()).andReturn(userLayoutManager);
        expect(userLayoutManager.getSubscribeId("my-info-student-center-home")).andReturn("subId1");
        expect(userLayoutManager.getNode("subId1")).andReturn(userLayoutChannelDescription);
        expect(userLayoutChannelDescription.getChannelPublishId()).andReturn("42");
        expect(portletDefinitionRegistry.getPortletDefinition(42)).andReturn(portletDefinition);
        expect(portletDefinition.getChannelDefinition()).andReturn(channelDefinition);
        expect(channelDefinition.isPortlet()).andReturn(true);
        expect(userInstance.getPerson()).andReturn(person);
        expect(portletDefinition.getPortletDefinitionId()).andReturn(portletDefinitionId);
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

    /* (non-Javadoc)
     * @see org.jasig.portal.io.AbstractTokenReplacementFilter#replaceToken(java.lang.String)
     */
    @Override
    protected String replaceToken(String channelId) {
        final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription)this.userLayoutManager.getNode(channelId);
        final boolean disableDynamicTitle = Boolean.valueOf(channelNode.getParameterValue("disableDynamicTitle"));
       
        String title = null;
        if (!disableDynamicTitle) {
            title = this.channelManager.getChannelTitle(channelId);
        }
       
        if (title == null) {
            title = channelNode.getTitle();
        }
       
        return title;
    }
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

     * @param channelSubscribeId subscribe id of a channel
     * @return channel global id
     */
    protected String getChannelPublishId(String channelSubscribeId) throws PortalException {
        // Get the channel node from the user's layout
        IUserLayoutChannelDescription channel=(IUserLayoutChannelDescription) getUserLayoutManager().getNode(channelSubscribeId);
        if(channel!=null) {
            return channel.getChannelPublishId();
        }
       
        return null;
    }
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

                IAnchoringSerializer as = (IAnchoringSerializer)contentHandler;
                as.stopAnchoring();
            }

            // Obtain the channel description
            IUserLayoutChannelDescription channelDesc = null;
            try {
              channelDesc = (IUserLayoutChannelDescription)upm.getUserLayoutManager().getNode(channelSubscribeId);
            } catch (PortalException pe) {
              // Do nothing
            }
View Full Code Here

Examples of org.jasig.portal.layout.node.IUserLayoutChannelDescription

        if (channelTable.get(channelSubscribeId) != null) {
            // reinstantiation
            channelTable.remove(channelSubscribeId);
        }
        // get channel information from the user layout manager
        IUserLayoutChannelDescription channel=(IUserLayoutChannelDescription) upm.getUserLayoutManager().getNode(channelSubscribeId);
        if(channel!=null)
            return instantiateChannel(channel);
        else
            return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.