Package org.apache.maven.doxia.site.decoration

Examples of org.apache.maven.doxia.site.decoration.Menu


        assertEquals( "check breadcrumb href", "doxia/apache", breadcrumb.getHref() );

        LinkItem link = childModel.getBody().getLinks().get( 0 );
        assertEquals( "check link href", "doxia/bouncycastle/", link.getHref() );

        Menu menu = childModel.getBody().getMenus().get( 0 );
        LinkItem menuItem = menu.getItems().get( 0 );
        assertEquals( "check menu item href", "doxia/special/", menuItem.getHref() );
    }
View Full Code Here


        assertEquals( "check breadcrumb href", "doxia/core/apache", breadcrumb.getHref() );

        LinkItem link = childModel.getBody().getLinks().get( 0 );
        assertEquals( "check link href", "doxia/core/bouncycastle/", link.getHref() );

        Menu menu = childModel.getBody().getMenus().get( 0 );
        LinkItem menuItem = menu.getItems().get( 0 );
        assertEquals( "check menu item href", "doxia/core/special/", menuItem.getHref() );
    }
View Full Code Here

        assertEquals( "check breadcrumb href", "http://jakarta.apache.org/apache", breadcrumb.getHref() );

        LinkItem link = childModel.getBody().getLinks().get( 0 );
        assertEquals( "check link href", "http://jakarta.apache.org/bouncycastle/", link.getHref() );

        Menu menu = childModel.getBody().getMenus().get( 0 );
        LinkItem menuItem = menu.getItems().get( 0 );
        assertEquals( "check menu item href", "http://jakarta.apache.org/special/", menuItem.getHref() );
    }
View Full Code Here

        if ( categories == null )
        {
            throw new IllegalArgumentException( "The parameter 'categories' can not be null" );
        }

        Menu menu = decorationModel.getMenuRef( "reports" );

        if ( menu == null )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale;

            if ( menu.getName() == null )
            {
                menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectdocumentation" ) );
            }

            boolean found = false;
            if ( menu.getItems().isEmpty() )
            {
                List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );
                if ( !isEmptyList( categoryReports ) )
                {
                    MenuItem item = createCategoryMenu( i18n.getString( "site-tool", llocale,
                                                                        "decorationModel.menu.projectinformation" ),
                                                        "/project-info.html", categoryReports, llocale );
                    menu.getItems().add( item );
                    found = true;
                }

                categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_REPORTS );
                if ( !isEmptyList( categoryReports ) )
                {
                    MenuItem item = createCategoryMenu( i18n.getString( "site-tool", llocale,
                                                                        "decorationModel.menu.projectreports" ),
                                                        "/project-reports.html", categoryReports, llocale );
                    menu.getItems().add( item );
                    found = true;
                }
            }
            if ( !found )
            {
View Full Code Here

        if ( parentProject == null )
        {
            throw new IllegalArgumentException( "The parameter 'parentProject' can not be null" );
        }

        Menu menu = decorationModel.getMenuRef( "parent" );

        if ( menu == null )
        {
            return;
        }

        if ( keepInheritedRefs && menu.isInheritAsRef() )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale;

            String parentUrl = getDistMgmntSiteUrl( parentProject );

            if ( parentUrl != null )
            {
                if ( parentUrl.endsWith( "/" ) )
                {
                    parentUrl += "index.html";
                }
                else
                {
                    parentUrl += "/index.html";
                }

                parentUrl = getRelativePath( parentUrl, getDistMgmntSiteUrl( project ) );
            }
            else
            {
                // parent has no url, assume relative path is given by site structure
                File parentBasedir = parentProject.getBasedir();
                // First make sure that the parent is available on the file system
                if ( parentBasedir != null )
                {
                    // Try to find the relative path to the parent via the file system
                    String parentPath = parentBasedir.getAbsolutePath();
                    String projectPath = project.getBasedir().getAbsolutePath();
                    parentUrl = getRelativePath( parentPath, projectPath ) + "/index.html";
                }
            }

            // Only add the parent menu if we were able to find a URL for it
            if ( parentUrl == null )
            {
                getLogger().warn( "Unable to find a URL to the parent project. The parent menu will NOT be added." );
            }
            else
            {
                if ( menu.getName() == null )
                {
                    menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.parentproject" ) );
                }

                MenuItem item = new MenuItem();
                item.setName( parentProject.getName() );
                item.setHref( parentUrl );
                menu.addItem( item );
            }
    }
View Full Code Here

        if ( decorationModel == null )
        {
            throw new IllegalArgumentException( "The parameter 'decorationModel' can not be null" );
        }

        Menu menu = decorationModel.getMenuRef( "modules" );

        if ( menu == null )
        {
            return;
        }

        if ( keepInheritedRefs && menu.isInheritAsRef() )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale ;

            // we require child modules and reactors to process module menu
            if ( project.getModules().size() > 0 )
            {
                List<MavenProject> projects = reactorProjects;

                if ( menu.getName() == null )
                {
                    menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectmodules" ) );
                }

                    getLogger().debug( "Attempting to load module information from local filesystem" );

                    // Not running reactor - search for the projects manually
View Full Code Here

        if ( decorationModel != null && decorationModel.getMenus() != null )
        {
            for ( final Iterator it = decorationModel.getMenus().iterator(); it.hasNext(); )
            {
                final Menu menu = (Menu) it.next();

                for ( final Iterator it2 = menu.getItems().iterator(); it2.hasNext(); )
                {
                    final MenuItem item = (MenuItem) it2.next();

                    final DocumentTOCItem documentTOCItem = new DocumentTOCItem();
                    documentTOCItem.setName( item.getName() );
View Full Code Here

                                     Map<String, List<MavenReport>> categories )
    {
        checkNotNull( "decorationModel", decorationModel );
        checkNotNull( "categories", categories );

        Menu menu = decorationModel.getMenuRef( "reports" );

        if ( menu == null )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale;

        if ( menu.getName() == null )
        {
            menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectdocumentation" ) );
        }

        boolean found = false;
        if ( menu.getItems().isEmpty() )
        {
            List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );
            if ( !isEmptyList( categoryReports ) )
            {
                MenuItem item =
                    createCategoryMenu( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectinformation" ),
                                        "/project-info.html", categoryReports, llocale );
                menu.getItems().add( item );
                found = true;
            }

            categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_REPORTS );
            if ( !isEmptyList( categoryReports ) )
            {
                MenuItem item =
                    createCategoryMenu( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectreports" ),
                                        "/project-reports.html", categoryReports, llocale );
                menu.getItems().add( item );
                found = true;
            }
        }
        if ( !found )
        {
View Full Code Here

    {
        checkNotNull( "decorationModel", decorationModel );
        checkNotNull( "project", project );
        checkNotNull( "parentProject", parentProject );

        Menu menu = decorationModel.getMenuRef( "parent" );

        if ( menu == null )
        {
            return;
        }

        if ( keepInheritedRefs && menu.isInheritAsRef() )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale;

        String parentUrl = getDistMgmntSiteUrl( parentProject );

        if ( parentUrl != null )
        {
            if ( parentUrl.endsWith( "/" ) )
            {
                parentUrl += "index.html";
            }
            else
            {
                parentUrl += "/index.html";
            }

            parentUrl = getRelativePath( parentUrl, getDistMgmntSiteUrl( project ) );
        }
        else
        {
            // parent has no url, assume relative path is given by site structure
            File parentBasedir = parentProject.getBasedir();
            // First make sure that the parent is available on the file system
            if ( parentBasedir != null )
            {
                // Try to find the relative path to the parent via the file system
                String parentPath = parentBasedir.getAbsolutePath();
                String projectPath = project.getBasedir().getAbsolutePath();
                parentUrl = getRelativePath( parentPath, projectPath ) + "/index.html";
            }
        }

        // Only add the parent menu if we were able to find a URL for it
        if ( parentUrl == null )
        {
            getLogger().warn( "Unable to find a URL to the parent project. The parent menu will NOT be added." );
        }
        else
        {
            if ( menu.getName() == null )
            {
                menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.parentproject" ) );
            }

            MenuItem item = new MenuItem();
            item.setName( parentProject.getName() );
            item.setHref( parentUrl );
            menu.addItem( item );
        }
    }
View Full Code Here

        checkNotNull( "project", project );
        checkNotNull( "reactorProjects", reactorProjects );
        checkNotNull( "localRepository", localRepository );
        checkNotNull( "decorationModel", decorationModel );

        Menu menu = decorationModel.getMenuRef( "modules" );

        if ( menu == null )
        {
            return;
        }

        if ( keepInheritedRefs && menu.isInheritAsRef() )
        {
            return;
        }

        final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale ;

        // we require child modules and reactors to process module menu
        if ( project.getModules().size() > 0 )
        {
            List<MavenProject> projects = reactorProjects;

            if ( menu.getName() == null )
            {
                menu.setName( i18n.getString( "site-tool", llocale, "decorationModel.menu.projectmodules" ) );
            }

            getLogger().debug( "Attempting to load module information from local filesystem" );

            // Not running reactor - search for the projects manually
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.site.decoration.Menu

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.