Package org.apache.maven.doxia.linkcheck.model

Examples of org.apache.maven.doxia.linkcheck.model.LinkcheckFile


        int totalValidLinks = 0;
        int totalErrorLinks = 0;
        int totalWarningLinks = 0;
        for ( Iterator it = linkcheckFiles.iterator(); it.hasNext(); )
        {
            LinkcheckFile linkcheckFile = (LinkcheckFile) it.next();

            totalLinks += linkcheckFile.getNumberOfLinks();
            totalValidLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.VALID_LEVEL );
            totalErrorLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.ERROR_LEVEL );
            totalWarningLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.WARNING_LEVEL );
        }

        sink.section1();
        sink.sectionTitle1();
        sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary" ) );
View Full Code Here


        // Content
        List linkcheckFiles = linkcheckModel.getFiles();
        for ( Iterator it = linkcheckFiles.iterator(); it.hasNext(); )
        {
            LinkcheckFile linkcheckFile = (LinkcheckFile) it.next();

            sink.tableRow();

            sink.tableCell();
            if ( linkcheckFile.getUnsuccessful() == 0 )
            {
                iconValid( locale, sink );
            }
            else
            {
                iconError( locale, sink );
            }
            sink.tableCell_();

            // tableCell( createLinkPatternedText( linkcheckFile.getRelativePath(), "./"
            // + linkcheckFile.getRelativePath() ) );
            sink.tableCell();
            sink.link( linkcheckFile.getRelativePath() );
            sink.text( linkcheckFile.getRelativePath() );
            sink.link_();
            sink.tableCell_();
            sink.tableCell();
            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks() ) );
            sink.tableCell_();
            sink.tableCell();
            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( LinkcheckFileResult.VALID_LEVEL ) ) );
            sink.tableCell_();
            sink.tableCell();
            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( LinkcheckFileResult.WARNING_LEVEL ) ) );
            sink.tableCell_();
            sink.tableCell();
            sink.text( String.valueOf( linkcheckFile.getNumberOfLinks( LinkcheckFileResult.ERROR_LEVEL ) ) );
            sink.tableCell_();

            sink.tableRow_();

            // Detail error
            if ( linkcheckFile.getUnsuccessful() != 0 )
            {
                sink.tableRow();

                sink.tableCell();
                sink.text( "" );
                sink.tableCell_();

                // TODO it is due to DOXIA-78
                sink.rawText( "<td colspan=\"5\">" );

                sink.table();

                for ( Iterator it2 = linkcheckFile.getResults().iterator(); it2.hasNext(); )
                {
                    LinkcheckFileResult linkcheckFileResult = (LinkcheckFileResult) it2.next();

                    if ( linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.VALID_LEVEL )
                    {
                        continue;
                    }

                    sink.tableRow();

                    sink.tableCell();
                    if ( linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.WARNING_LEVEL )
                    {
                        iconWarning( locale, sink );
                    }
                    else if ( linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.ERROR_LEVEL )
                    {
                        iconError( locale, sink );
                    }
                    sink.tableCell_();

                    sink.tableCell();
                    sink.italic();
                    if ( linkcheckFileResult.getTarget().startsWith( "#" ) )
                    {
                        sink.link( linkcheckFile.getRelativePath() + linkcheckFileResult.getTarget() );
                    }
                    else if ( linkcheckFileResult.getTarget().startsWith( "." ) )
                    {
                        // We need to calculate a correct absolute path here, because target is a relative path
                        String absolutePath = FilenameUtils.getFullPath( linkcheckFile.getRelativePath() )
                            + linkcheckFileResult.getTarget();
                        String normalizedPath = FilenameUtils.normalize( absolutePath );
                        if ( normalizedPath == null )
                        {
                            normalizedPath = absolutePath;
View Full Code Here

        int totalLinks = 0;
        int totalValidLinks = 0;
        int totalErrorLinks = 0;
        int totalWarningLinks = 0;
        for (Object linkcheckFile1 : linkcheckFiles) {
            LinkcheckFile linkcheckFile = (LinkcheckFile) linkcheckFile1;

            totalLinks += linkcheckFile.getNumberOfLinks();
            totalValidLinks += linkcheckFile.getNumberOfLinks(LinkcheckFileResult.VALID_LEVEL);
            totalErrorLinks += linkcheckFile.getNumberOfLinks(LinkcheckFileResult.ERROR_LEVEL);
            totalWarningLinks += linkcheckFile.getNumberOfLinks(LinkcheckFileResult.WARNING_LEVEL);
        }

        sink.section1();
        sink.sectionTitle1();
        sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary" ) );
View Full Code Here

        generateTableHeader( locale, true, sink );

        // Content
        List linkcheckFiles = linkcheckModel.getFiles();
        for (Object linkcheckFile1 : linkcheckFiles) {
            LinkcheckFile linkcheckFile = (LinkcheckFile) linkcheckFile1;

            sink.tableRow();

            sink.tableCell();
            if (linkcheckFile.getUnsuccessful() == 0) {
                iconValid(locale, sink);
            } else {
                iconError(locale, sink);
            }
            sink.tableCell_();

            // tableCell( createLinkPatternedText( linkcheckFile.getRelativePath(), "./"
            // + linkcheckFile.getRelativePath() ) );
            sink.tableCell();
            sink.link(linkcheckFile.getRelativePath());
            sink.text(linkcheckFile.getRelativePath());
            sink.link_();
            sink.tableCell_();
            sink.tableCell();
            sink.text(String.valueOf(linkcheckFile.getNumberOfLinks()));
            sink.tableCell_();
            sink.tableCell();
            sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.VALID_LEVEL)));
            sink.tableCell_();
            sink.tableCell();
            sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.WARNING_LEVEL)));
            sink.tableCell_();
            sink.tableCell();
            sink.text(String.valueOf(linkcheckFile.getNumberOfLinks(LinkcheckFileResult.ERROR_LEVEL)));
            sink.tableCell_();

            sink.tableRow_();

            // Detail error
            if (linkcheckFile.getUnsuccessful() != 0) {
                sink.tableRow();

                sink.tableCell();
                sink.text("");
                sink.tableCell_();

                // TODO it is due to DOXIA-78
                sink.rawText("<td colspan=\"5\">");

                sink.table();

                for (Object o : linkcheckFile.getResults()) {
                    LinkcheckFileResult linkcheckFileResult = (LinkcheckFileResult) o;

                    if (linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.VALID_LEVEL) {
                        continue;
                    }

                    sink.tableRow();

                    sink.tableCell();
                    if (linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.WARNING_LEVEL) {
                        iconWarning(locale, sink);
                    } else if (linkcheckFileResult.getStatusLevel() == LinkcheckFileResult.ERROR_LEVEL) {
                        iconError(locale, sink);
                    }
                    sink.tableCell_();

                    sink.tableCell();
                    sink.italic();
                    if (linkcheckFileResult.getTarget().startsWith("#")) {
                        sink.link(linkcheckFile.getRelativePath() + linkcheckFileResult.getTarget());
                    } else if (linkcheckFileResult.getTarget().startsWith(".")) {
                        // We need to calculate a correct absolute path here, because target is a relative path
                        String absolutePath = FilenameUtils.getFullPath(linkcheckFile.getRelativePath())
                                + linkcheckFileResult.getTarget();
                        String normalizedPath = FilenameUtils.normalize(absolutePath);
                        if (normalizedPath == null) {
                            normalizedPath = absolutePath;
                        }
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.linkcheck.model.LinkcheckFile

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.