Package org.apache.wiki.search

Examples of org.apache.wiki.search.SearchResult


        row.addElement( new th().setAlign("left").addElement("Score"));

        int idx = 0;
        for( Iterator i = results.iterator(); i.hasNext() && idx++ <= maxItems; )
        {
            SearchResult sr = (SearchResult) i.next();
            row = new tr();
           
            td name = new td().setWidth("30%");
            name.addElement( "<a href=\""+
                             context.getURL( WikiContext.VIEW, sr.getPage().getName() )+
                             "\">"+engine.beautifyTitle(sr.getPage().getName())+"</a>");
            row.addElement( name );
           
            row.addElement( new td().addElement(""+sr.getScore()));
           
            t.addElement( row );
        }
       
        if( results.isEmpty() )
View Full Code Here


    private int nextResult()
    {
        if( m_iterator != null && m_iterator.hasNext() && m_count++ < m_maxItems )
        {
            SearchResult r = (SearchResult) m_iterator.next();
           
            // Create a wiki context for the result
            WikiEngine engine = m_wikiContext.getEngine();
            HttpServletRequest request = m_wikiContext.getHttpRequest();
            Command command = PageCommand.VIEW.targetedCommand( r.getPage() );
            WikiContext context = new WikiContext( engine, request, command );
           
            // Stash it in the page context
            pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
                                      context,
View Full Code Here

            try
            {
                input = new FileInputStream( wikipages[i] );
                String pagetext = FileUtil.readContents( input, m_encoding );
                SearchResult comparison = matcher.matchPageContent( wikiname, pagetext );
                if( comparison != null )
                {
                    res.add( comparison );
                }
            }
View Full Code Here

        row.addContent(th2);
       
        int idx = 0;
        for ( Iterator<SearchResult> i = results.iterator(); i.hasNext() && idx++ <= maxItems; )
        {
            SearchResult sr = i.next();
            row = XhtmlUtil.element(XHTML.tr);

            Element name = XhtmlUtil.element(XHTML.td);
            name.setAttribute(XHTML.ATTR_width,"30%");
           
            name.addContent( XhtmlUtil.link(context.getURL( WikiContext.VIEW, sr.getPage().getName()),
                    engine.beautifyTitle(sr.getPage().getName())) );
            row.addContent(name);
           
            row.addContent(XhtmlUtil.element(XHTML.td,""+sr.getScore()));
           
            table.addContent(row);
        }
       
        if ( results.isEmpty() )
View Full Code Here

            try
            {
                input = new FileInputStream( wikipages[i] );
                String pagetext = FileUtil.readContents( input, m_encoding );
                SearchResult comparison = matcher.matchPageContent( wikiname, pagetext );
                if( comparison != null )
                {
                    res.add( comparison );
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.wiki.search.SearchResult

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.