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

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


    private void renderer( CheckstyleAggregateReport mojo, File outputHtml )
        throws RendererException, Exception
    {
        Writer writer = null;
        SiteRenderingContext context = new SiteRenderingContext();
        context.setDecoration( new DecorationModel() );
        context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" );
        context.setLocale( Locale.ENGLISH );

        try
        {
View Full Code Here


        // 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

        if (!canGenerateReport()) {
            return;
        }

        try {
            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);
            Locale locale = Locale.getDefault();
View Full Code Here

    private void renderer( CheckstyleReport mojo, File outputHtml )
        throws RendererException, Exception
    {
        Writer writer = null;
        SiteRenderingContext context = new SiteRenderingContext();
        context.setDecoration( new DecorationModel() );
        context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" );
        context.setLocale( Locale.ENGLISH );

        try
        {
View Full Code Here

    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

    /**
     *
     */
    public void testBadHref()
    {
        final DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addBreadcrumb( createLinkItem( "Foo", "http://foo.apache.org/${property}" ) );
        assembler.resolvePaths( model, "http://foo.apache.org" );
        assertEquals( "Check size", 1, model.getBody().getBreadcrumbs().size() );
        assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org/${property}" ),
            model.getBody().getBreadcrumbs().get( 0 ) );
    }
View Full Code Here

    /**
     *
     */
    public void testBreadcrumbWithoutHref()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addBreadcrumb( createLinkItem( "Foo", null ) );
        assembler.resolvePaths( model, "http://foo.apache.org" );
        assertEquals( "Check size", 1, model.getBody().getBreadcrumbs().size() );
        assertEquals( "Check item", createLinkItem( "Foo", null ), model.getBody().getBreadcrumbs().get( 0 ) );
    }
View Full Code Here

     */
    public void testBreadcrumbs()
    {
        String parentHref = "http://parent.com/index.html";

        final DecorationModel parent = new DecorationModel();
        parent.setBody( new Body() );
        parent.getBody().addBreadcrumb( createLinkItem( "Parent", parentHref ) );

        DecorationModel child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child", "http://parent.com" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );


        // same with trailing slash
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );

        // now mixed
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );

        // and other way round
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );


        // now with child breadcrumb
        child = new DecorationModel();
        child.setBody( new Body() );
        child.getBody().addBreadcrumb( createLinkItem( "Child", "" ) );
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "Child", parentHref );


        // now with file url
        parentHref = "file://parent.com/index.html";
        ( parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "file://parent.com/child/", "file://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );


        // now with scp url
        parentHref = "scp://parent.com/index.html";
        ( parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "scp://parent.com/child/", "scp://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );
    }
View Full Code Here

    /**
     * http://jira.codehaus.org/browse/DOXIASITETOOLS-62
     */
    public void testBreadcrumbCutParentAfterDuplicate()
    {
        DecorationModel child = new DecorationModel(); // B > E
        child.setBody( new Body() );
        child.getBody().addBreadcrumb( createLinkItem( "B", null ) );
        child.getBody().addBreadcrumb( createLinkItem( "E", null ) );

        DecorationModel parent = new DecorationModel(); // A > B > C > D
        parent.setBody( new Body() );
        parent.getBody().addBreadcrumb( createLinkItem( "A", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "B", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "C", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "D", null ) );

        assembler.assembleModelInheritance( NAME, child, parent, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );

        final List<LinkItem> breadcrumbs = child.getBody().getBreadcrumbs(); // expected: A > B > E
View Full Code Here

    /**
     *
     */
    public void testBannerWithoutHref()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );

        Banner banner = createBanner( "Left", null, "/images/src.gif", "alt" );

        model.setBannerLeft( banner );

        assembler.resolvePaths( model, "http://foo.apache.org" );

        assertEquals( "Check banner", createBanner( "Left", null, "images/src.gif", "alt" ), model.getBannerLeft() );
    }
View Full Code Here

TOP

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

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.