Package org.apache.wiki

Examples of org.apache.wiki.WikiPage


    private static final long serialVersionUID = 0L;
   
    public int doWikiStartTag()
        throws IOException
    {
        WikiPage p = m_wikiContext.getPage();

        //
        //  We just simply set the page to be our parent page
        //  and call the superclass.
        //
        if( p instanceof Attachment )
        {
            setPage( ((Attachment)p).getParentName() );
        }
        else
        {
            String name = p.getName();

            int entrystart = name.indexOf("_blogentry_");

            if( entrystart != -1 )
            {
View Full Code Here


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

        String author = page.getAuthor();

        if( author != null && author.length() > 0 )
        {
            author = TextUtil.replaceEntities(author);
            if( engine.pageExists(author) )
View Full Code Here

        m_monthUrlFormat = new SimpleDateFormat( format );
    }

    private String format( String txt )
    {
        WikiPage p = m_wikiContext.getPage();

        if( p != null )
        {
            return TextUtil.replaceString( txt, "%p", p.getName() );
        }

        return txt;
    }
View Full Code Here

        nextMonth.add( Calendar.DATE, -1);
        nextMonth.add( Calendar.MONTH, 1 ); // Now move to 1st day of next month

        if ( day.before(nextMonth) )
        {
            WikiPage thePage = m_wikiContext.getPage();
            String pageName = thePage.getName();

            String calendarDate = m_dateFormat.format(day.getTime());
            String url = m_wikiContext.getURL( WikiContext.VIEW, pageName,
                                               "calendar.date="+calendarDate );
View Full Code Here

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

        if( page != null )
        {
            PageManager mgr = engine.getPageManager();

            PageLock lock = mgr.getCurrentLock( page );

            HttpSession session = pageContext.getSession();

            PageLock userLock = (PageLock) session.getAttribute("lock-"+page.getName());

            if( (lock != null && m_mode == LockState.LOCKED && lock != userLock ) ||
                (lock != null && m_mode == LockState.OWNED && lock == userLock ) ||
                (lock == null && m_mode == LockState.NOTLOCKED) )
            {
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

    }

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

        if( page != null )
        {
            Date d = page.getLastModified();

            //
            //  Date may be null if the page does not exist.
            //
            if( d != null )
View Full Code Here

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

        if( m_pageName == null )
        {
            page = m_wikiContext.getPage();
        }
        else
        {
            page = engine.getPage( m_pageName );
        }

        // System.out.println("Checking "+page);

        if( page != null && engine.pageExists( page.getName(), page.getVersion() ) )
        {
            return SKIP_BODY;
        }

        return EVAL_BODY_INCLUDE;
View Full Code Here

    public final int doWikiStartTag()
        throws IOException
    {
        WikiEngine engine   = m_wikiContext.getEngine();
        WikiPage   page     = null;
        String     versionString = "";
        String     pageName = null;
       
        //
        //  Determine the page and the link.
        //
        if( m_pageName == null )
        {
            page = m_wikiContext.getPage();
            if( page == null )
            {
                // You can't call this on the page itself anyways.
                return SKIP_BODY;
            }

            pageName = page.getName();
        }
        else
        {
            pageName = m_pageName;
        }

        //
        //  Determine the latest version, if the version attribute is "this".
        //
        if( m_version != null )
        {
            if( "this".equalsIgnoreCase(m_version) )
            {
                if( page == null )
                {
                    // No page, so go fetch according to page name.
                    page = engine.getPage( m_pageName );
                }
               
                if( page != null )
                {
                    versionString = "version="+page.getVersion();
                }
            }
            else
            {
                versionString = "version="+m_version;
View Full Code Here

        String url = null;
        WikiEngine engine = m_wikiContext.getEngine();

        if( m_pageName == null )
        {
            WikiPage page = m_wikiContext.getPage();

            if( page != null )
            {
                m_pageName = page.getName();
            }
        }

        if( m_templatefile != null )
        {
            String params = addParamsForRecipient( null, m_containedParams );
            String template = engine.getTemplateDir();
            url = engine.getURL( WikiContext.NONE, "templates/"+template+"/"+m_templatefile, params, false );
        }
        else if( m_jsp != null )
        {
            String params = addParamsForRecipient( null, m_containedParams );
            //url = m_wikiContext.getURL( WikiContext.NONE, m_jsp, params );
            url = engine.getURL( WikiContext.NONE, m_jsp, params, m_absolute );
        }
        else if( m_ref != null )
        {
            int interwikipoint;

            if( JSPWikiMarkupParser.isExternalLink(m_ref) )
            {
                url = m_ref;
            }
            else if( (interwikipoint = m_ref.indexOf(":")) != -1 )
            {
                String extWiki = m_ref.substring( 0, interwikipoint );
                String wikiPage = m_ref.substring( interwikipoint+1 );

                url = engine.getInterWikiURL( extWiki );

                if( url != null )
                {
                    url = TextUtil.replaceString( url, "%s", wikiPage );
                }
            }
            else if( m_ref.startsWith("#") )
            {
                // Local link
            }
            else if( TextUtil.isNumber(m_ref) )
            {
                // Reference
            }
            else
            {
                int hashMark = -1;

                String parms = (m_version != null) ? "version="+getVersion() : null;

                //
                //  Internal wiki link, but is it an attachment link?
                //
                WikiPage p = engine.getPage( m_pageName );

                if( p instanceof Attachment )
                {
                    url = m_wikiContext.getURL( WikiContext.ATTACH, m_pageName );
                }
                else if( (hashMark = m_ref.indexOf('#')) != -1 )
                {
                    // It's an internal Wiki link, but to a named section

                    String namedSection = m_ref.substring( hashMark+1 );
                    String reallink     = m_ref.substring( 0, hashMark );

                    reallink = MarkupParser.cleanLink( reallink );

                    String matchedLink;
                    String sectref = "";
                    if( (matchedLink = engine.getFinalPageName( reallink )) != null )
                    {
                        sectref = "section-"+engine.encodeName(matchedLink)+"-"+namedSection;
                        sectref = "#"+sectref.replace('%', '_');
                    }
                    else
                    {
                        matchedLink = reallink;
                    }

                    url = makeBasicURL( m_context, matchedLink, parms, m_absolute ) + sectref;
                }
                else
                {
                    String reallink = MarkupParser.cleanLink( m_ref );

                    url = makeBasicURL( m_context, reallink, parms, m_absolute );
                }
            }
        }
        else if( m_pageName != null && m_pageName.length() > 0 )
        {
            WikiPage p = engine.getPage( m_pageName );

            String parms = (m_version != null) ? "version="+getVersion() : null;

            parms = addParamsForRecipient( parms, m_containedParams );
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.