Examples of IUserLayoutNodeDescription


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

        final String rootFolderId = userLayoutManager.getRootFolderId();
        final Enumeration<String> rootsChildren = userLayoutManager.getChildIds(rootFolderId);
       
        int tabIndex = 0;
        for (String topNodeId = rootsChildren.nextElement(); rootsChildren.hasMoreElements(); topNodeId = rootsChildren.nextElement()) {
            final IUserLayoutNodeDescription topNode = userLayoutManager.getNode(topNodeId);
           
            if (!topNode.isHidden() && IUserLayoutNodeDescription.FOLDER == topNode.getType() && IUserLayoutFolderDescription.REGULAR_TYPE == ((IUserLayoutFolderDescription)topNode).getFolderType()) {
                tabIndex++;
                if (tabIndex == activeTabIndex) {
                    return (IUserLayoutFolderDescription)topNode;
                }
            }
View Full Code Here

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

                as.stopAnchoring();
            }

            // Obtain the channel description
            IUserLayoutChannelDescription channelDesc = null;
            IUserLayoutNodeDescription parentNode = null;
            try {
                final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
                channelDesc = (IUserLayoutChannelDescription) userLayoutManager.getNode(channelSubscribeId);
               
                final String parentNodeId = userLayoutManager.getParentId(channelDesc.getId());
View Full Code Here

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

                final IPerson person = userPreferencesManager.getPerson();
               
                final ApplicationEventPublisher applicationEventPublisher = EventPublisherLocator.getApplicationEventPublisher();
                final UserProfile currentProfile = userPreferencesManager.getCurrentProfile();
               
                IUserLayoutNodeDescription parentNode = null;
                try {
                    final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
                   
                    final String parentNodeId = userLayoutManager.getParentId(channelDescription.getId());
                    if (parentNodeId != null) {
View Full Code Here

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

        }

        if (channelTarget != null) {
            // Obtain the channel description
            IUserLayoutChannelDescription channelDesc = null;
            IUserLayoutNodeDescription parentNode = null;
            try {
                final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
                channelDesc = (IUserLayoutChannelDescription) userLayoutManager.getNode(channelTarget);
               
                final String parentNodeId = userLayoutManager.getParentId(channelDesc.getId());
View Full Code Here

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

    }

    public boolean doChannelAction(HttpServletRequest request, HttpServletResponse response, String channelSubscribeId, boolean noTimeout) throws PortalException {
        // see if the channel has already been instantiated
        // see if the channel is cached
        IUserLayoutNodeDescription node = userPreferencesManager.getUserLayoutManager().getNode(channelSubscribeId);
        if (!(node instanceof IUserLayoutChannelDescription)) {
            throw new PortalException("'" + channelSubscribeId + "' is not a channel node !");
        }

        final IUserLayoutChannelDescription channel = (IUserLayoutChannelDescription) node;
        final long timeOut = channel.getTimeout();

        IChannel ch = channelTable.get(channelSubscribeId);
        final IChannel originalChannel = ch;

        if (ch == null || ch instanceof CSecureInfo) {
            try {
                ch = instantiateChannel(request, response, channel);
            }
            catch (Throwable e) {
                ch = replaceWithErrorChannel(request, response, channelSubscribeId, ErrorCode.SET_STATIC_DATA_EXCEPTION, e, null, false);
            }
        }
       
        if (ch instanceof IPrivileged) {
            ch = this.feedPortalControlStructuresToChannel(request, response, channelSubscribeId, (IPrivileged) ch);
        }
       
        //If the channel object has changed (likely now an error channel) return immediatly
        if (originalChannel != null && originalChannel != ch) {
            return false;
        }
       
        final ChannelRuntimeData runtimeData = this.getChannelRuntimeData(request, channelSubscribeId, RequestType.ACTION);

        // Build a new channel renderer instance.
        final IChannelRenderer channelRenderer = cChannelRendererFactory.newInstance(ch, runtimeData);

        if (noTimeout) {
            channelRenderer.setTimeout(0);
        }
        else {
            channelRenderer.setTimeout(timeOut);
        }

        channelRenderer.startRendering();
       
        final int renderingStatus;
        try {
            renderingStatus = channelRenderer.completeRendering();
        }
        catch (Throwable t) {
            ch = replaceWithErrorChannel(request, response, channelSubscribeId, ErrorCode.RENDER_TIME_EXCEPTION, t, null, false);
            log.error("Failed to complete action", t);
            return false;
        }

        if (renderingStatus != IChannelRenderer.RENDERING_SUCCESSFUL) {
            final ErrorCode errorCode;
            if (renderingStatus == IChannelRenderer.RENDERING_TIMED_OUT) {
                errorCode = ErrorCode.TIMEOUT_EXCEPTION;
            }
            else {
                errorCode = ErrorCode.GENERAL_ERROR;
            }
           
            ch = replaceWithErrorChannel(request, response, channelSubscribeId, errorCode, null, "unsuccessful rendering", true);
            log.error("Action did not compplete successefully: " + renderingStatus);
            return false;
        }
       
        // Obtain the channel description
        IUserLayoutChannelDescription channelDesc = null;
        IUserLayoutNodeDescription parentNode = null;
        try {
            final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
            channelDesc = (IUserLayoutChannelDescription) userLayoutManager.getNode(channelSubscribeId);
           
            final String parentNodeId = userLayoutManager.getParentId(channelDesc.getId());
View Full Code Here

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

        // see if the channel has already been instantiated
        // see if the channel is cached
        IChannel ch;
        long timeOut=0;

        IUserLayoutNodeDescription node=userPreferencesManager.getUserLayoutManager().getNode(channelSubscribeId);
        if(!(node instanceof IUserLayoutChannelDescription)) {
            throw new PortalException("'"+channelSubscribeId+"' is not a channel node !");
        }

        IUserLayoutChannelDescription channel=(IUserLayoutChannelDescription) node;
View Full Code Here

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

        else {
            log.warn("Available RequestAttributes='" + requestAttributes + "' do not implement ServletRequestAttributes");
            request = null;
        }
       
        final IUserLayoutNodeDescription nodeDescription = ev.getNodeDescription();
        this.removeChannel(request, null, nodeDescription.getId());
    }
View Full Code Here

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

        return depth;
    }

    public IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription node, String parentId, String nextSiblingId) throws PortalException {
        boolean isChannel=false;
        IUserLayoutNodeDescription parent=this.getNode(parentId);
        if(canAddNode(node,parent,nextSiblingId)) {
            // assign new Id

            if(this.getLayoutStore()==null) {
                throw new PortalException("Store implementation has not been set.");
View Full Code Here

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

        markingNode=null;
    }

    public boolean moveNode(String nodeId, String parentId, String nextSiblingId) throws PortalException  {

        IUserLayoutNodeDescription parent=this.getNode(parentId);
        IUserLayoutNodeDescription node=this.getNode(nodeId);
        String oldParentNodeId=getParentId(nodeId);
        if(canMoveNode(node,parent,nextSiblingId)) {
            // must be a folder
            Document ulm=this.getUserLayoutDOM();
            Element childElement=(Element)ulm.getElementById(nodeId);
            Element parentElement=(Element)ulm.getElementById(parentId);
            if(nextSiblingId==null) {
                parentElement.appendChild(childElement);
            } else {
                Node nextSibling=ulm.getElementById(nextSiblingId);
                parentElement.insertBefore(childElement,nextSibling);
            }
            markLayoutDirty();
            clearMarkings();
            updateCacheKey();

            // inform the listeners
            boolean isChannel=false;
            if(node instanceof IUserLayoutChannelDescription) {
                isChannel=true;
            }
            final IUserLayoutNodeDescription oldParentNode = this.getNode(oldParentNodeId);
            LayoutMoveEvent ev=new LayoutMoveEvent(this, parent, node, oldParentNode);
            for(Iterator i=listeners.iterator();i.hasNext();) {
                LayoutEventListener lel=(LayoutEventListener)i.next();
                if(isChannel) {
                    lel.channelMoved(ev);
View Full Code Here

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

        }
    }

    public boolean deleteNode(String nodeId) throws PortalException {
        if(canDeleteNode(nodeId)) {
            IUserLayoutNodeDescription nodeDescription=this.getNode(nodeId);
            String parentNodeId=this.getParentId(nodeId);

            Document ulm=this.getUserLayoutDOM();
            Element childElement=(Element)ulm.getElementById(nodeId);
            Node parent=childElement.getParentNode();
            if(parent!=null) {
                parent.removeChild(childElement);
            } else {
                throw new PortalException("Node \""+nodeId+"\" has a NULL parent !");
            }
            markLayoutDirty();
            // clearMarkings(); // this one is questionable
            this.updateCacheKey();

            // inform the listeners
            boolean isChannel=false;
            if(nodeDescription instanceof IUserLayoutChannelDescription) {
                isChannel=true;
            }
            final IUserLayoutNodeDescription parentNode = this.getNode(parentNodeId);
            LayoutMoveEvent ev=new LayoutMoveEvent(this, null, nodeDescription, parentNode);
            for(Iterator i=listeners.iterator();i.hasNext();) {
                LayoutEventListener lel=(LayoutEventListener)i.next();
                if(isChannel) {
                    lel.channelDeleted(ev);
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.