Examples of WikiEngine


Examples of com.ecyrd.jspwiki.WikiEngine

        doc.setContext( context ); // Make sure it is set
       
        //
        //  Do some sane defaults
        //
        WikiEngine engine = m_context.getEngine();
        String runplugins = engine.getVariable( m_context, MarkupParser.PROP_RUNPLUGINS );
        if( runplugins != null ) enablePlugins( TextUtil.isPositive(runplugins));
    }
View Full Code Here

Examples of com.ecyrd.jspwiki.WikiEngine

        OutputStream out = null;
     
        try
        {
            out = new BufferedOutputStream( new FileOutputStream(outFile) );
            WikiEngine engine = new WikiEngine(props);
       
            Exporter x = new Exporter(out, true );
       
            x.export(engine);
        }
View Full Code Here

Examples of com.ecyrd.jspwiki.WikiEngine

                                              String title,
                                              String baseName )
    {
        String basicPageName = ((baseName != null)?baseName:"Bug")+MarkupParser.cleanLink(title);

        WikiEngine engine = context.getEngine();

        String pageName = basicPageName;
        long   lastbug  = 2;

        while( engine.pageExists( pageName ) )
        {
            pageName = basicPageName + lastbug++;
        }

        return pageName;
View Full Code Here

Examples of com.ecyrd.jspwiki.WikiEngine

               commentText + "\" title=\"" + commentText + "\"/>";
    }

    private String imageUrl( WikiContext ctx )
    {
        WikiEngine engine = ctx.getEngine();
        String commentImage = engine.getWikiProperties().getProperty(PROP_NOTE_IMAGE,
                                                                     DEFAULT_NOTE_IMAGE);

        commentImage = "images/"+commentImage;
       
        String resource = engine.getTemplateManager().findResource( ctx,
                                                                    engine.getTemplateDir(),
                                                                    commentImage );

        return ctx.getURL( WikiContext.NONE, resource );
    }
View Full Code Here

Examples of com.ecyrd.jspwiki.WikiEngine

        return "text/html; charset=UTF-8";
    }

    private byte[] getText()
    {
        WikiEngine engine = ((WikiDavProvider)m_provider).getEngine();

        WikiContext context = new WikiContext( engine, m_page );
        context.setRequestContext( WikiContext.VIEW );

        context.setVariable( MarkupParser.PROP_RUNPLUGINS, "false" );
        context.setVariable( WikiEngine.PROP_RUNFILTERS, "false" );

        String text = engine.getHTML( context, m_page );

        try
        {
            return text.getBytes("UTF-8");
        }
View Full Code Here

Examples of com.ecyrd.jspwiki.WikiEngine

     {@inheritDoc}
     */
    public String execute( WikiContext context, Map params )
        throws PluginException
    {
        WikiEngine engine = context.getEngine();
        String prop = (String) params.get( PARAM_PROP );
       
        if ( "users".equals( prop ) )
        {
            Principal[] principals = WikiSession.userPrincipals( engine );
View Full Code Here

Examples of org.apache.wiki.WikiEngine

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

        if( page != null )
        {
            if( page instanceof Attachment )
            {
                pageContext.getOut().print( engine.beautifyTitle( ((Attachment)page).getParentName()) );
            }
            else
            {
                String name = page.getName();

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

                if( entrystart != -1 )
                {
                    name = name.substring( 0, entrystart );
                }

                int commentstart = name.indexOf("_comments_");

                if( commentstart != -1 )
                {
                    name = name.substring( 0, commentstart );
                }

                pageContext.getOut().print( engine.beautifyTitle(name) );
            }
        }

        return SKIP_BODY;
    }
View Full Code Here

Examples of org.apache.wiki.WikiEngine

    public final int doStartTag()
    {
        m_wikiContext = (WikiContext) pageContext.getAttribute( WikiTagBase.ATTR_CONTEXT,
                                                                PageContext.REQUEST_SCOPE );

        WikiEngine        engine = m_wikiContext.getEngine();
        AttachmentManager mgr    = engine.getAttachmentManager();
        WikiPage          page;

        page = m_wikiContext.getPage();

        if( !mgr.attachmentsEnabled() )
        {
            return SKIP_BODY;
        }

        try
        {
            if( page != null && engine.pageExists(page) )
            {
                Collection atts = mgr.listAttachments( page );

                if( atts == null )
                {
View Full Code Here

Examples of org.apache.wiki.WikiEngine

    /** {@inheritDoc} */
    public final int doWikiStartTag()
        throws IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiContext ctx;
       
        if( m_pageName == null )
        {
            ctx = m_wikiContext;
        }
        else
        {
            ctx = (WikiContext)m_wikiContext.clone();
            ctx.setPage( engine.getPage(m_pageName) );
        }

        Integer vernew = (Integer) pageContext.getAttribute( ATTR_NEWVERSION,
                                                             PageContext.REQUEST_SCOPE );
        Integer verold = (Integer) pageContext.getAttribute( ATTR_OLDVERSION,
                                                             PageContext.REQUEST_SCOPE );

        log.info("Request diff between version "+verold+" and "+vernew);

        if( ctx.getPage() != null )
        {
            JspWriter out = pageContext.getOut();

            String diff = engine.getDiff( ctx,
                                          vernew.intValue(),
                                          verold.intValue() );

            if( diff.length() == 0 )
            {
View Full Code Here

Examples of org.apache.wiki.WikiEngine

    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 ) );
                break;
              case PLAIN:
                out.print( engine.getText( m_wikiContext, insertedPage ) );
                break;
            }
           
            m_wikiContext.setRealPage( oldPage );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.