Package org.jasig.portal.layout

Examples of org.jasig.portal.layout.LayoutEventListener


            if(nodeDescription instanceof IUserLayoutChannelDescription) {
                isChannel=true;
            }
            LayoutMoveEvent ev=new LayoutMoveEvent(this,nodeDescription,parentNodeId);
            for(Iterator i=listeners.iterator();i.hasNext();) {
                LayoutEventListener lel=(LayoutEventListener)i.next();
                if(isChannel) {
                    lel.channelDeleted(ev);
                } else {
                    lel.folderDeleted(ev);
                }
            }

            return true;
        } else {
View Full Code Here


                    // inform the listeners
                    LayoutEvent ev=new LayoutEvent( this, node);
                    for( Iterator i=listeners.iterator(); i.hasNext(); )
                    {
                        LayoutEventListener lel=(LayoutEventListener)i.next();
                        lel.channelUpdated( ev );
                    }
                    pushChanDiffsIntoPlf( newChannelElement,
                                          (IUserLayoutChannelDescription) node,
                                          oldChannel );
                }
                else
                {
                    throw new PortalException("Change channel to folder is " +
                            "not allowed by updateNode() method! Occurred " +
                            "in layout for "
                            + owner.getAttribute(IPerson.USERNAME) + ".");
                }
            }
            else
            {
                 // must be a folder
                UserLayoutFolderDescription oldFolder=(UserLayoutFolderDescription) oldNode;
                if (oldFolder.getId().equals(getRootFolderId()))
                    throw new PortalException("Update of root node is not currently allowed!");
                   
                if( node instanceof IUserLayoutFolderDescription )
                {
                    Document uld=this.userLayoutDocument;
                    // generate new XML Element
                    Element newFolderElement=node.getXML(uld);
                    Element oldFolderElement=(Element)uld.getElementById(nodeId);
                    Node parent=oldFolderElement.getParentNode();

                    // move children
                    Vector children=new Vector();
                    for( Node n=oldFolderElement.getFirstChild();
                        n!=null; n=n.getNextSibling() )
                    {
                        children.add(n);
                    }

                    for( int i=0; i<children.size(); i++ )
                    {
                        newFolderElement.appendChild((Node)children.get(i));
                    }

                    // replace the actual node
                    parent.removeChild(oldFolderElement);
                    parent.insertBefore(newFolderElement,nextSibling);
                    // register new child instead
                    newFolderElement.setIdAttribute(Constants.ATT_ID, true);

                    // inform the listeners
                    LayoutEvent ev=new LayoutEvent(this,node);
                    for(Iterator i=listeners.iterator();i.hasNext();) {
                        LayoutEventListener lel=(LayoutEventListener)i.next();
                        lel.folderUpdated(ev);
                    }
                    pushFolderDiffsIntoPlf( newFolderElement,
                                            (UserLayoutFolderDescription) node,
                                            oldFolder );
                }
View Full Code Here

TOP

Related Classes of org.jasig.portal.layout.LayoutEventListener

Copyright © 2018 www.massapicom. 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.