Package com.ecyrd.jspwiki

Examples of com.ecyrd.jspwiki.WikiPage


     */
    @Override
    public final int doWikiStartTag()
        throws IOException
    {
        WikiPage   page     = null;
        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;
        }
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

   
    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 = BlogUtil.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

    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

    public Hashtable getCategories( String blogid,
                                    String username,
                                    String password )
        throws XmlRpcException
    {
        WikiPage page = m_context.getEngine().getPage( blogid );

        checkPermissions( page, username, password, "view" );

        Hashtable ht = new Hashtable();
View Full Code Here

     */
    private Hashtable<String,Object> makeEntry( WikiPage page )
    {
        Hashtable<String, Object> ht = new Hashtable<String, Object>();

        WikiPage firstVersion = m_context.getEngine().getPage( page.getName(), 1 );

        ht.put("dateCreated", firstVersion.getLastModified());
        ht.put("link", getURL(page.getName()));
        ht.put("permaLink", getURL(page.getName()));
        ht.put("postid", page.getName());
        ht.put("userid", page.getAuthor());

View Full Code Here

    {
        Hashtable<String, Hashtable<String, Object>> result = new Hashtable<String, Hashtable<String, Object>>();

        log.info( "metaWeblog.getRecentPosts() called");

        WikiPage page = m_context.getEngine().getPage( blogid );

        checkPermissions( page, username, password, "view" );

        try
        {
            WeblogPlugin plugin = new WeblogPlugin();

            List<WikiPage> changed = plugin.findBlogEntries(m_context.getEngine().getPageManager(),
                                                            blogid,
                                                            new Date(0L),
                                                            new Date());

            Collections.sort( changed, new PageTimeComparator() );

            int items = 0;
            for( Iterator i = changed.iterator(); i.hasNext() && items < numberOfPosts; items++ )
            {
                WikiPage p = (WikiPage) i.next();

                result.put( "entry", makeEntry( p ) );
            }

        }
View Full Code Here

        throws XmlRpcException
    {
        log.info("metaWeblog.newPost() called");
        WikiEngine engine = m_context.getEngine();
       
        WikiPage page = engine.getPage( blogid );
        checkPermissions( page, username, password, "createPages" );

        try
        {
            WeblogEntryPlugin plugin = new WeblogEntryPlugin();

            String pageName = plugin.getNewEntryPage( engine, blogid );

            WikiPage entryPage = new WikiPage( engine, pageName );
            entryPage.setAuthor( username );

            WikiContext context = new WikiContext( engine, entryPage );

            StringBuffer text = new StringBuffer();
            text.append( "!"+content.get("title") );
View Full Code Here

        WikiEngine engine = m_context.getEngine();
        String url = "";

        log.info("metaWeblog.newMediaObject() called");

        WikiPage page = engine.getPage( blogid );
        checkPermissions( page, username, password, "upload" );

        String name = (String) content.get( "name" );
        byte[] data = (byte[]) content.get( "bits" );
View Full Code Here

TOP

Related Classes of com.ecyrd.jspwiki.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.