Examples of MenuOptionsDefinition


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

        return definition;
    }
   
    private MenuOptionsDefinition getOptionsDefinition(OptionsDefinitionBean options)
    {       
        MenuOptionsDefinition definition = null;
        if (document.getType().equals(PortalSiteManager.PAGE_NODE_TYPE))
        {
            definition =  getServiceLocator().getPageManager().newPageMenuOptionsDefinition();
        }else{
            definition = getServiceLocator().getPageManager().newFolderMenuOptionsDefinition();   
        }
        definition.setDepth(options.getDepth());
        definition.setOptions(options.getOptions());
        definition.setOrder(options.getOrder());
        definition.setPaths(options.isPaths());
        definition.setRegexp(options.isRegexp());
        definition.setSkin(options.getSkin());
        definition.setProfile(options.getProfile());         
        return definition;
    }
View Full Code Here

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

                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
                    final MenuOptionsDefinition option = (MenuOptionsDefinition) listItem
                            .getModelObject();
                    listItem.add(new Label("option", option.getOptions()));
                    listItem.add(new Label("order", option.getOrder()));
                    listItem.add(new Label("path", Boolean.toString(option
                            .isPaths())));
                    listItem.add(new Label("regexp", Boolean.toString(option
                            .isRegexp())));
                    listItem.add(new AjaxLink("edit")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow.setContent(new OptionsWindow(
                                    metaDataModalWindow.getContentId(),option, ajaxPanel));
                            metaDataModalWindow.show(target);
                            target.addComponent(ajaxPanel);
                        }
                    });
                    listItem.add(new AjaxLink("delete")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            menuActions(REMOVE_ACTION,option.getOptions(), new OptionsDefinitionBean());
                            target.addComponent(ajaxPanel);
                        }
                    }.add(new JavascriptEventConfirmation("onclick",
                            new ResourceModel("action.delete.confirm"))));
                }
            });
            add(new AjaxLink("new")
            {

                @Override
                public void onClick(AjaxRequestTarget target)
                {
                    MenuOptionsDefinition optionDefinition = null;
                    if (getUserSelectedNode().getDocType() == FileType.Folder)
                    {
                        optionDefinition = getServiceLocator().getPageManager()
                                .newFolderMenuOptionsDefinition();
                    } else
View Full Code Here

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

        newMenu.setSkin("tabs");
        newMenu.setMenuElements(new ArrayList());
        MenuSeparatorDefinition newSeparator = page.newMenuSeparatorDefinition();
        newSeparator.setText("-- Updated Menu --");
        newMenu.getMenuElements().add(newSeparator);
        MenuOptionsDefinition newOptions0 = page.newMenuOptionsDefinition();
        newOptions0.setOptions("/*.psml");
        newOptions0.setRegexp(true);
        newMenu.getMenuElements().add(newOptions0);
        MenuOptionsDefinition newOptions1 = page.newMenuOptionsDefinition();
        newOptions1.setOptions("/folder0");
        newMenu.getMenuElements().add(newOptions1);
        MenuDefinition newNestedMenu = page.newMenuDefinition();
        newNestedMenu.setOptions("/*/");
        newNestedMenu.setRegexp(true);
        newMenu.getMenuElements().add(newNestedMenu);
View Full Code Here

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

                    Object menuElement = menuElementsIter.next();
                    if (menuElement instanceof MenuOptionsDefinition)
                    {
                        // construct menu option elements from definition using
                        // defaults from menu definition as appropriate
                        MenuOptionsDefinition optionDefinition = (MenuOptionsDefinition)menuElement;
                        String locatorName = optionDefinition.getProfile();
                        if (locatorName == null)
                        {
                            locatorName = definition.getProfile();
                        }
                        String order = optionDefinition.getOrder();
                        if (order == null)
                        {
                            order = definition.getOrder();
                        }
                        List optionsAndMenus = constructMenuElements(view, context, path, optionDefinition.getOptions(), null, optionDefinition.getDepth(), optionDefinition.isPaths(), optionDefinition.isRegexp(), locatorName, order);

                        // append option and menu elements to current separator
                        // elements list
                        if (optionsAndMenus != null)
                        {
View Full Code Here

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

        newSeparator.setSkin("header");
        metadata = newSeparator.getMetadata();
        metadata.addField(Locale.FRENCH, "text", "-- [fr] Folder Menu --");
        metadata.addField(Locale.FRENCH, "title", "[fr] Rollover: Folder Menu");
        newMenu.getMenuElements().add(newSeparator);
        MenuOptionsDefinition newOptions0 = folder.newMenuOptionsDefinition();
        newOptions0.setOptions("/*.psml");
        newOptions0.setRegexp(true);
        newOptions0.setSkin("flash");
        newMenu.getMenuElements().add(newOptions0);
        MenuOptionsDefinition newOptions1 = folder.newMenuOptionsDefinition();
        newOptions1.setOptions("/folder0");
        newOptions1.setProfile("role-fallback");
        newOptions1.setOrder("/folder*");
        newOptions1.setDepth(1);
        newOptions1.setPaths(true);
        newMenu.getMenuElements().add(newOptions1);
        MenuDefinition newNestedMenu = folder.newMenuDefinition();
        newNestedMenu.setOptions("/*/");
        newNestedMenu.setRegexp(true);
        newNestedMenu.setDepth(2);
View Full Code Here

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

            return menuInclude;
        }
        else if (srcElement instanceof MenuOptionsDefinition)
        {
            // create the new menu options element and copy attributes
            MenuOptionsDefinition source = (MenuOptionsDefinition)srcElement;
            MenuOptionsDefinition menuOptions = null;
            if (type.equals(PAGE_NODE_TYPE))
            {
                menuOptions = newPageMenuOptionsDefinition();
            }
            else if (type.equals(FOLDER_NODE_TYPE))
            {
                menuOptions = newFolderMenuOptionsDefinition();
            }
            menuOptions.setDepth(source.getDepth());
            menuOptions.setOptions(source.getOptions());
            menuOptions.setOrder(source.getOrder());
            menuOptions.setPaths(source.isPaths());
            menuOptions.setProfile(source.getProfile());
            menuOptions.setRegexp(source.isRegexp());
            menuOptions.setSkin(source.getSkin());
            return menuOptions;
        }
        else if (srcElement instanceof MenuSeparatorDefinition)
        {
            // create the new menu separator element and copy attributes
View Full Code Here

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

        {
            return false;
        }
        else
        {
            MenuOptionsDefinition definition = (MenuOptionsDefinition) obj;
            if (!StringUtils.equals(definition.getOptions(), options) || !StringUtils.equals(definition.getProfile(), profile) ||
                !StringUtils.equals(definition.getOrder(), order) || !StringUtils.equals(definition.getSkin(), skin) || definition.getDepth() != depth ||
                definition.isPaths() != paths || definition.isRegexp() != regexp)
            {
                return false;
            }
            return true;
        }
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.