Package org.jasig.portal.layout.node

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


            String id="s4";
            IUserLayoutNodeDescription node=man.getNode(id);
            assertTrue(node!=null);
            if(node!=null) {
                // make up a fake node, with the same id
                UserLayoutFolderDescription ts=new UserLayoutFolderDescription();
                ts.setId(node.getId());
                ts.setName("Main");
                ts.setHidden(false);
                ts.setImmutable(true);
                ts.setUnremovable(true);
                ts.setFolderType(UserLayoutFolderDescription.REGULAR_TYPE);
                assertEquals(ts,node);
            }
        }

        // get a channel
        {
            String id="n6";
            IUserLayoutNodeDescription node=man.getNode(id);
            assertTrue(node!=null);
            if(node!=null) {
                // make up a fake node, with the same id
                UserLayoutChannelDescription ts=new UserLayoutChannelDescription();
                ts.setId(node.getId());
                ts.setName("uPortal-Powered Sites");
                ts.setTitle("uPortal-Powered Sites");
                ts.setHidden(false);
                ts.setImmutable(true);
                ts.setUnremovable(true);
                ts.setClassName("org.jasig.portal.channels.CGenericXSLT");
                ts.setFunctionalName("");
                ts.setChannelPublishId("5");
                ts.setChannelTypeId("0");
                ts.setDescription("uPortal Demos channel");
                ts.setEditable(false);
                ts.setHasAbout(false);
                ts.setHasHelp(false);
                ts.setTimeout(10000);

                ts.setParameterValue("xmlUri","http://www.interactivebusiness.com/publish/jasigPortalDemos.rss");
                ts.setParameterValue("sslUri","CGenericXSLT/RSS/RSS-0_9x.ssl");

                assertEquals(ts,node);
            }
        }
    }
View Full Code Here


    public void testAddFolder() throws Exception {
        // testing by doing add and subsequent get

        // add a channel
        UserLayoutFolderDescription nfold=new UserLayoutFolderDescription();
        nfold.setName("Newly added folder");
        nfold.setHidden(false);
        nfold.setImmutable(true);
        nfold.setUnremovable(true);
        nfold.setFolderType(UserLayoutFolderDescription.REGULAR_TYPE);

        String parentId="s7";
        assertTrue("can a node be added ?",man.canAddNode(nfold,parentId,null));

        UserLayoutFolderDescription rfold=(UserLayoutFolderDescription) man.addNode(nfold,parentId,null);
        //        System.out.println("Layout\n"+XML.serializeNode(man.getUserLayoutDOM()));
        assertTrue("addNode() returned null",rfold!=null);
        nfold.setId(rfold.getId());
        assertEquals("comparing the original and addNode() result: ",nfold,rfold);

        // do a get
        IUserLayoutNodeDescription gnode=man.getNode(nfold.getId());
        assertEquals("comparing the original and getNode() result: ",nfold,gnode);
View Full Code Here

    }

    public void testUpdateFolder() throws Exception {
        String folderId="s1";
        UserLayoutFolderDescription fold=(UserLayoutFolderDescription) man.getNode(folderId);
        fold.setName("New name");
        fold.setHidden(true);
        fold.setFolderType(UserLayoutFolderDescription.REGULAR_TYPE);
        // get child list
        Enumeration ochildren=man.getChildIds(folderId);

        man.updateNode(fold);
        //        System.out.println("Layout\n"+XML.serializeNode(man.getUserLayoutDOM()));

        UserLayoutFolderDescription rfold=(UserLayoutFolderDescription) man.getNode(folderId);
        assertEquals("Comparing node used to update with the update result: ",fold,rfold);

        Enumeration nchildren=man.getChildIds(folderId);
       
        // convert to List because equals() is well defined on
View Full Code Here

        node.setDeleteAllowed( getRestriction( deleteAllowed ) );
        node.setMoveAllowed( getRestriction( moveAllowed ) );

        if( node instanceof UserLayoutFolderDescription )
        {
            UserLayoutFolderDescription fldr = null;
            fldr = (UserLayoutFolderDescription) node;
            fldr.setEditAllowed( getRestriction( editAllowed ) );
            fldr.setAddChildAllowed( getRestriction( addChildAllowed ) );
        }
        ulm.updateNode(node);
        saveLayout(false);
    }
View Full Code Here

   * @return the newly created tab or column
   */
  private final IUserLayoutFolderDescription createFolder (String name)
  {
    String id = "tbd";
    IUserLayoutFolderDescription folder=new UserLayoutFolderDescription();
    folder.setName(name);
    folder.setId(id);
    folder.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
    folder.setHidden(false);
    folder.setUnremovable(false);
    folder.setImmutable(false);
    return folder;
  }
View Full Code Here

   * @return the newly created tab or column
   */
  private final IUserLayoutFolderDescription createFolder (String name)
  {
    String id = "tbd";
    IUserLayoutFolderDescription folder=new UserLayoutFolderDescription();
    folder.setName(name);
    folder.setId(id);
    folder.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
    folder.setHidden(false);
    folder.setUnremovable(false);
    folder.setImmutable(false);
    return folder;
  }
View Full Code Here

     * @exception PortalException if the error occurs.
     */
    public IUserLayoutNodeDescription createNodeDescription( int nodeType ) throws PortalException {
            switch ( nodeType ) {
              case IUserLayoutNodeDescription.FOLDER:
                return new UserLayoutFolderDescription();
              case IUserLayoutNodeDescription.CHANNEL:
                return new UserLayoutChannelDescription();
              default:
                return null;
            }
View Full Code Here

                }
            }
            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;
View Full Code Here

     */
    public IUserLayoutNodeDescription createNodeDescription(int nodeType) throws PortalException
    {
        if (nodeType == IUserLayoutNodeDescription.FOLDER)
        {
            return new UserLayoutFolderDescription();
        }
        else
        {
            return new UserLayoutChannelDescription();
        }
View Full Code Here

    @Override
    public IUserLayoutNodeDescription createNodeDescription(LayoutNodeType nodeType) throws PortalException
    {
        if (nodeType == LayoutNodeType.FOLDER)
        {
            return new UserLayoutFolderDescription();
        }
        return new ChannelDescription();
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.layout.node.UserLayoutFolderDescription

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.