Package org.apache.wiki

Examples of org.apache.wiki.WikiPage


        feed.setTitle("List of blogs at this site");
        feed.setModified( new Date() );

        for( Iterator i = pages.iterator(); i.hasNext(); )
        {
            WikiPage p = (WikiPage) i.next();

            //
            //  List only weblogs
            //  FIXME: Unfortunately, a weblog is not known until it has
            //         been executed once, because plugins are off during
            //         the initial startup phase.
            //

            log.debug( p.getName()+" = "+p.getAttribute(WeblogPlugin.ATTR_ISWEBLOG)) ;

            if( !("true".equals(p.getAttribute(WeblogPlugin.ATTR_ISWEBLOG)) ) )
                continue;

            String encodedName = TextUtil.urlEncodeUTF8( p.getName() );

            WikiContext context = new WikiContext( m_engine, p );

            String title = TextUtil.replaceEntities(org.apache.wiki.rss.Feed.getSiteName(context));
View Full Code Here


    public final int doWikiStartTag()
        throws IOException,
               ProviderException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   insertedPage;

        //
        //  NB: The page might not really exist if the user is currently
        //      creating it (i.e. it is not yet in the cache or providers),
        //      AND we got the page from the wikiContext.
        //

        if( m_pageName == null )
        {
            insertedPage = m_wikiContext.getPage();
            if( !engine.pageExists(insertedPage) ) return SKIP_BODY;
        }
        else
        {
            insertedPage = engine.getPage( m_pageName );
        }

        if( insertedPage != null )
        {
            // FIXME: Do version setting later.
            // page.setVersion( WikiProvider.LATEST_VERSION );

            log.debug("Inserting page "+insertedPage);

            JspWriter out = pageContext.getOut();

            WikiPage oldPage = m_wikiContext.setRealPage( insertedPage );
           
            switch( m_mode )
            {
              case HTML:
                out.print( engine.getHTML( m_wikiContext, insertedPage ) );
View Full Code Here

    public final int doWikiStartTag()
        throws IOException,
               ProviderException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   page   = m_wikiContext.getPage();

        if( page != null && engine.pageExists(page.getName()) )
        {
            int version = page.getVersion();
            boolean include = false;

            WikiPage latest = engine.getPage( page.getName() );

            //log.debug("Doing version check: this="+page.getVersion()+
            //          ", latest="+latest.getVersion());

            switch( m_mode )
            {
                case LATEST:
                    include = (version < 0) || (latest.getVersion() == version);
                    break;

                case NOTLATEST:
                    include = (version > 0) && (latest.getVersion() != version);
                    break;

                case FIRST:
                    include = (version == 1 ) || (version < 0 && latest.getVersion() == 1);
                    break;

                case NOTFIRST:
                    include = version > 1;
                    break;
View Full Code Here

        
         *  @param name Page Name
         *  @param score A score from 0+
         */
        public SearchResultImpl( String name, int score ) {
            m_page  = new WikiPage( m_engine, name );
            m_score = score;
        }
View Full Code Here

   
    public final int doWikiStartTag()
        throws IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   page   = m_wikiContext.getPage();

        String encodedName = engine.encodeName( page.getName() );

        String rssURL      = engine.getGlobalRSSURL();
        String rssFeedURL  = engine.getURL(WikiContext.NONE, "rss.jsp",
                                           "page="+encodedName+"&amp;mode=wiki",
                                           true );
       
        if( rssURL != null )
        {
            String siteName = Feed.getSiteName(m_wikiContext);
            siteName = TextUtil.replaceEntities( siteName );
           
            pageContext.getOut().print("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS wiki feed for the entire site.\" href=\""+rssURL+"\" />\n");
            pageContext.getOut().print("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS wiki feed for page "+siteName+".\" href=\""+rssFeedURL+"\" />\n");

            // TODO: Enable this
            /*
            pageContext.getOut().print("<link rel=\"service.post\" type=\"application/atom+xml\" title=\""+
                                       siteName+"\" href=\""+atomPostURL+"\" />\n");
            */
            // FIXME: This does not work always, as plugins are not initialized until the first fetch
            if( "true".equals(page.getAttribute(WeblogPlugin.ATTR_ISWEBLOG)) )
            {
                String blogFeedURL = engine.getURL(WikiContext.NONE,"rss.jsp","page="+encodedName,true);
                String atomFeedURL = engine.getURL(WikiContext.NONE,"rss.jsp","page="+encodedName+"&amp;type=atom",true);
       
                pageContext.getOut().print("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS feed for weblog "+
View Full Code Here

   
    public final int doWikiStartTag()
        throws IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   page   = m_wikiContext.getPage();
        AttachmentManager mgr = engine.getAttachmentManager();

        try
        {
            if( page != null && engine.pageExists(page) && mgr.attachmentsEnabled() )
View Full Code Here

    {
        //
        //  Makes sure that we're indexing the latest version of this
        //  page.
        //
        WikiPage p = m_engine.getPage( wikiContext.getPage().getName() );
        reindexPage( p );
    }
View Full Code Here

    {
        if( (event instanceof WikiPageEvent) && (event.getType() == WikiPageEvent.PAGE_DELETE_REQUEST) )
        {
            String pageName = ((WikiPageEvent) event).getPageName();

            WikiPage p = m_engine.getPage( pageName );
            if( p != null )
            {
                pageRemoved( p );
            }
        }
View Full Code Here

        if (acl == null) {
            //
            //  If null, try the parent.
            //
            if (page instanceof Attachment) {
                WikiPage parent = m_engine.getPage(((Attachment) page).getParentName());

                acl = getPermissions(parent);
            } else {
                //
                //  Or, try parsing the page
View Full Code Here

        List blogEntries = pl.findBlogEntries( engine.getPageManager(),
                                               page, new Date(0L), new Date() );
       
        for( Iterator i = blogEntries.iterator(); i.hasNext(); )
        {
            WikiPage p = (WikiPage) i.next();

            // FIXME: Not correct, should parse page creation time.

            Date d = p.getLastModified();
            Calendar cal = Calendar.getInstance();
            cal.setTime( d );
            res.add( cal );
        }
View Full Code Here

TOP

Related Classes of org.apache.wiki.WikiPage

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.