Examples of DecorationModel


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

        Writer writer = null;
        try
        {
            String filename = getOutputName() + ".html";

            DecorationModel model = new DecorationModel();
            model.setBody( new Body() );

            Map<String, Object> attributes = new HashMap<String, Object>();
            attributes.put( "outputEncoding", "UTF-8" );
            attributes.put( "project", project );
View Full Code Here

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

            String filename = getOutputName() + ".html";

            Locale locale = Locale.getDefault();

            SiteRenderingContext siteContext = new SiteRenderingContext();
            siteContext.setDecoration( new DecorationModel() );
            siteContext.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" );
            siteContext.setLocale( locale );

            RenderingContext context = new RenderingContext( outputDirectory, filename );
View Full Code Here

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

        // TODO: push to a helper? Could still be improved by taking more of the site information from the site plugin
        FileOutputStream fileOutputStream = null;
        try
        {
            DecorationModel model = new DecorationModel();
            model.setBody( new Body() );
            Map<String, String> attributes = new HashMap<String, String>();
            attributes.put( "outputEncoding", getOutputEncoding() );
            Locale locale = Locale.getDefault();
            SiteRenderingContext siteContext = siteRenderer.createContextForSkin( getSkinArtifactFile(), attributes,
                                                                                  model, getName( locale ), locale );
View Full Code Here

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

    protected void renderer( ChangeLogReport mojo, File outputHtml )
        throws RendererException, IOException
    {
        Writer writer = null;
        SiteRenderingContext context = new SiteRenderingContext();
        context.setDecoration( new DecorationModel() );
        context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" );

        try
        {
            outputHtml.getParentFile().mkdirs();
View Full Code Here

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

    {
        SiteTool tool = (SiteTool) lookup( SiteTool.ROLE );
        assertNotNull( tool );

        SiteToolMavenProjectStub project = new SiteToolMavenProjectStub( "site-tool-test" );
        DecorationModel decorationModel = new DecorationModel();
        Skin skin = new Skin();
        skin.setGroupId( "org.apache.maven.skins" );
        skin.setArtifactId( "maven-stylus-skin" );
        decorationModel.setSkin( skin );
        assertNotNull( tool.getSkinArtifactFromRepository( getLocalRepo(), project.getRemoteArtifactRepositories(),
                                                           decorationModel ) );
    }
View Full Code Here

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

        String siteDirectory = "src/site";
        List<MavenProject> reactorProjects = new ArrayList<MavenProject>();

        project.setBasedir( null ); // get it from repo

        DecorationModel model =
            tool.getDecorationModel( project, reactorProjects, getLocalRepo(), project.getRemoteArtifactRepositories(),
                                     siteDirectory, Locale.getDefault(), "ISO-8859-1", "ISO-8859-1" );
        assertNotNull( model );
        assertNotNull( model.getBannerLeft() );
        assertEquals( "Maven", model.getBannerLeft().getName() );
        assertEquals( "images/apache-maven-project-2.png", model.getBannerLeft().getSrc() );
        assertEquals( "http://maven.apache.org/", model.getBannerLeft().getHref() );
        assertNotNull( model.getBannerRight() );
        assertNull( model.getBannerRight().getName() );
        assertEquals( "images/maven-logo-2.gif", model.getBannerRight().getSrc() );
        assertNull( model.getBannerRight().getHref() );
    }
View Full Code Here

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

        SiteToolMavenProjectStub project = new SiteToolMavenProjectStub( "no-site-test" );
        String siteDirectory = "src/site";
        List<MavenProject> reactorProjects = new ArrayList<MavenProject>();

        DecorationModel model =
            tool.getDecorationModel( project, reactorProjects, getLocalRepo(), project.getRemoteArtifactRepositories(),
                                     siteDirectory, Locale.getDefault(), "UTF-8", "UTF-8" );
        assertNotNull( model );
    }
View Full Code Here

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

    /** {@inheritDoc} */
    public Artifact getDefaultSkinArtifact( ArtifactRepository localRepository,
                                            List<ArtifactRepository> remoteArtifactRepositories )
        throws SiteToolException
    {
        return getSkinArtifactFromRepository( localRepository, remoteArtifactRepositories, new DecorationModel() );
    }
View Full Code Here

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

        props.put( "reports", "<menu ref=\"reports\"/>\n" );
        props.put( "modules", "<menu ref=\"modules\"/>\n" );

        MavenProject parentProject = getParentProject( project, reactorProjects, localRepository );

        DecorationModel decorationModel =
            getDecorationModel( project, parentProject, reactorProjects, localRepository, repositories, siteDirectory,
                                llocale, props, inputEncoding, outputEncoding );

        if ( decorationModel == null )
        {
            String siteDescriptorContent;

            try
            {
                // Note the default is not a super class - it is used when nothing else is found
                siteDescriptorContent =
                    IOUtil.toString( getClass().getResourceAsStream( "/default-site.xml" ), "UTF-8" );
            }
            catch ( IOException e )
            {
                throw new SiteToolException( "Error reading default site descriptor: " + e.getMessage(), e );
            }

            siteDescriptorContent = getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent,
                                                                          inputEncoding, outputEncoding );

            decorationModel = readDecorationModel( siteDescriptorContent );
        }

        if ( parentProject != null )
        {
            populateParentMenu( decorationModel, llocale, project, parentProject, true );
        }

        populateModulesMenu( project, reactorProjects, localRepository, decorationModel, llocale, true );

        if ( decorationModel.getBannerLeft() == null )
        {
            // extra default to set
            Banner banner = new Banner();
            banner.setName( project.getName() );
            decorationModel.setBannerLeft( banner );
        }

        return decorationModel;
    }
View Full Code Here

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

        catch ( IOException e )
        {
            throw new SiteToolException( "The site descriptor cannot be read!", e );
        }

        DecorationModel decoration = null;
        if ( siteDescriptorContent != null )
        {
            siteDescriptorContent = getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent,
                                                                          inputEncoding, outputEncoding );

            decoration = readDecorationModel( siteDescriptorContent );
            decoration.setLastModified( siteDescriptorLastModified );
        }

        if ( parentProject != null )
        {
            getLogger().debug( "Parent project loaded ..." );

            MavenProject parentParentProject = getParentProject( parentProject, reactorProjects, localRepository );

            DecorationModel parent =
                getDecorationModel( parentProject, parentParentProject, reactorProjects, localRepository, repositories,
                                    siteDirectory, locale, props, inputEncoding, outputEncoding );

            // MSHARED-116 requires an empty decoration model (instead of a null one)
            // MSHARED-145 requires us to do this only if there is a parent to merge it with
            if ( decoration == null && parent != null )
            {
                // we have no site descriptor: merge the parent into an empty one
                decoration = new DecorationModel();
            }

            String name = project.getName();
            if ( decoration != null && StringUtils.isNotEmpty( decoration.getName() ) )
            {
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.