Package org.apache.jetspeed.om.folder

Examples of org.apache.jetspeed.om.folder.MenuExcludeDefinition


        return definition;
    }
   
    private MenuExcludeDefinition getExcludesDefinition(ExcludesDefinitionBean excludes)
    {       
        MenuExcludeDefinition definition = null;
        if (document.getType().equals(PortalSiteManager.PAGE_NODE_TYPE))
        {
            definition =  getServiceLocator().getPageManager().newPageMenuExcludeDefinition();
        }else{
            definition = getServiceLocator().getPageManager().newFolderMenuExcludeDefinition();   
        }
        definition.setName(excludes.getName());
        return definition;
    }
View Full Code Here


                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
                    final MenuExcludeDefinition option = (MenuExcludeDefinition) listItem
                            .getModelObject();
                    listItem.add(new Label("name", option.getName()));
                    AjaxLink editLink = new AjaxLink("edit")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow.setContent(new ExcludesWindow(
                                    metaDataModalWindow.getContentId(),option, ajaxPanel));
                            metaDataModalWindow.show(target);
                        }
                    };
                    editLink.add(new Label("editLabel",new ResourceModel("common.edit")));
                    listItem.add(editLink);
                    AjaxLink deleteLink = new AjaxLink("delete")
                    {
                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            menuActions(REMOVE_ACTION,option.getName(), new ExcludesDefinitionBean());
                            target.addComponent(ajaxPanel);
                        }
                    };
                    deleteLink.add(new JavascriptEventConfirmation("onclick",
                            new ResourceModel("action.delete.confirm")));
                    deleteLink.add(new Label("deleteLabel",new ResourceModel("common.delete")));
                    listItem.add(deleteLink);
                }
            });
            Form excludeForm = new Form("excludeForm");
            add(excludeForm);
            add(new AjaxButton("new",new ResourceModel("common.new"),excludeForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    MenuExcludeDefinition excludeDefinition = null;
                    if (getUserSelectedNode().getDocType() == FileType.Folder)
                    {
                        excludeDefinition = getServiceLocator()
                                .getPageManager()
                                .newFolderMenuExcludeDefinition();
View Full Code Here

        newMenu.getMenuElements().add(newOptions1);
        MenuDefinition newNestedMenu = page.newMenuDefinition();
        newNestedMenu.setOptions("/*/");
        newNestedMenu.setRegexp(true);
        newMenu.getMenuElements().add(newNestedMenu);
        MenuExcludeDefinition newExcludeMenu = page.newMenuExcludeDefinition();
        newExcludeMenu.setName("exclude-menu");
        newMenu.getMenuElements().add(newExcludeMenu);
        MenuIncludeDefinition newIncludeMenu = page.newMenuIncludeDefinition();
        newIncludeMenu.setName("include-menu");
        newIncludeMenu.setNest(true);
        newMenu.getMenuElements().add(newIncludeMenu);
View Full Code Here

                        // exclusion requires current separated elements
                        if ((separatedElements != null) && !separatedElements.isEmpty())
                        {
                            // exclude top level referenced menu definition
                            // options assuming reference to menu is not cyclic
                            MenuExcludeDefinition excludeDefinition = (MenuExcludeDefinition)menuElement;
                            if ((menus == null) || !menus.contains(excludeDefinition.getName()))
                            {
                                // get named root menu from context, (menu may
                                // not exist in this context so failure to
                                // access menu is ignored)
                                MenuImpl excludeMenu = null;
                                try
                                {
                                    excludeMenu = (MenuImpl)context.getMenu(excludeDefinition.getName());
                                }
                                catch (NodeNotFoundException nnfe)
                                {
                                }
                                catch (SecurityException se)
View Full Code Here

        newNestedMenu.setRegexp(true);
        newNestedMenu.setDepth(2);
        newNestedMenu.setOrder("/x*/,/y*/,/z*/");
        newNestedMenu.setSkin("bold");
        newMenu.getMenuElements().add(newNestedMenu);
        MenuExcludeDefinition newExcludeMenu = folder.newMenuExcludeDefinition();
        newExcludeMenu.setName("exclude-menu");
        newMenu.getMenuElements().add(newExcludeMenu);
        MenuIncludeDefinition newIncludeMenu = folder.newMenuIncludeDefinition();
        newIncludeMenu.setName("include-menu");
        newIncludeMenu.setNest(true);
        newMenu.getMenuElements().add(newIncludeMenu);
        folder.getMenuDefinitions().add(newMenu);
        newMenu = folder.newMenuDefinition();
        newMenu.setName("folder-breadcrumb-menu");
        newMenu.setSkin("bread-crumbs");
        newMenu.setOptions("./");
        newMenu.setPaths(true);
        folder.getMenuDefinitions().add(newMenu);
        pageManager.updateFolder(folder);
       
        assertNull(folder.getParent());

        Page page = pageManager.newPage("/default-page.psml");
        assertEquals("Default Page", page.getTitle());
        page.setTitle("Default Page");
        page.setVersion("6.89");
        page.setDefaultDecorator("tigris", Fragment.LAYOUT);
        page.setDefaultDecorator("blue-gradient", Fragment.PORTLET);
        page.setSkin("skin-1");
        page.setShortTitle("Default");
        metadata = page.getMetadata();
        metadata.addField(Locale.FRENCH, "title", "[fr] Default Page");
        metadata.addField(Locale.JAPANESE, "title", "[ja] Default Page");
        SecurityConstraints pageConstraints = page.newSecurityConstraints();
        pageConstraints.setOwner("user");
        List inlinePageConstraints = new ArrayList(1);
        SecurityConstraint pageConstraint = page.newSecurityConstraint();
        pageConstraint.setUsers(Shared.makeListFromCSV("jetspeed"));
        pageConstraint.setPermissions(Shared.makeListFromCSV("edit"));
        inlinePageConstraints.add(pageConstraint);
        pageConstraints.setSecurityConstraints(inlinePageConstraints);
        List pageConstraintsRefs = new ArrayList(1);
        pageConstraintsRefs.add("manager-edit");
        pageConstraints.setSecurityConstraintsRefs(pageConstraintsRefs);
        page.setSecurityConstraints(pageConstraints);
        List pageMenus = new ArrayList();
        newMenu = page.newMenuDefinition();
        newMenu.setName("page-menu-1");
        newMenu.setTitle("The Test Page Menu");
        metadata = newMenu.getMetadata();
        metadata.addField(Locale.FRENCH, "title", "[fr] The Test Page Menu");
        newSeparator = page.newMenuSeparatorDefinition();
        newSeparator.setText("-- Page Menu --");
        List menuElements = new ArrayList();
        menuElements.add(newSeparator);
        newOptions0 = page.newMenuOptionsDefinition();
        newOptions0.setOptions("/*.psml");
        menuElements.add(newOptions0);
        newNestedMenu = page.newMenuDefinition();
        newNestedMenu.setOptions("/*/");
        menuElements.add(newNestedMenu);
        newExcludeMenu = page.newMenuExcludeDefinition();
        newExcludeMenu.setName("exclude-menu");
        menuElements.add(newExcludeMenu);
        newIncludeMenu = page.newMenuIncludeDefinition();
        newIncludeMenu.setName("include-menu");
        menuElements.add(newIncludeMenu);
        newMenu.setMenuElements(menuElements);
View Full Code Here

            return menu;
        }
        else if (srcElement instanceof MenuExcludeDefinition)
        {
            // create the new menu exclude element and copy attributes
            MenuExcludeDefinition source = (MenuExcludeDefinition)srcElement;
            MenuExcludeDefinition menuExclude = null;
            if (type.equals(PAGE_NODE_TYPE))
            {
                menuExclude = newPageMenuExcludeDefinition();
            }
            else if (type.equals(FOLDER_NODE_TYPE))
            {
                menuExclude = newFolderMenuExcludeDefinition();
            }
            menuExclude.setName(source.getName());
            return menuExclude;
        }
        else if (srcElement instanceof MenuIncludeDefinition)
        {
            // create the new menu include element and copy attributes
View Full Code Here

        {
            return false;
        }
        else
        {
            MenuExcludeDefinition definition = (MenuExcludeDefinition) obj;
            if (!StringUtils.equals(definition.getName(), name))
            {
                return false;
            }
            return true;
        }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.folder.MenuExcludeDefinition

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.