//# 0 errors, 165 messages
//#
/*
    //#pebbleapihandler.java:1:1: class: net.sourceforge.pebble.webservice.PebbleAPIHandler
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.webservice;

import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.domain.BlogEntry;
import net.sourceforge.pebble.domain.Category;
import net.sourceforge.pebble.domain.Tag;
import net.sourceforge.pebble.api.decorator.ContentDecoratorContext;
import net.sourceforge.pebble.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlrpc.XmlRpcException;

import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;

/**
 * A handler for the Pebble API (accessed via XML-RPC).
 *
 * @author    Simon Brown
 */
public class PebbleAPIHandler extends AbstractAPIHandler {
    //#pebbleapihandler.java:54: method: void net.sourceforge.pebble.webservice.PebbleAPIHandler.net.sourceforge.pebble.webservice.PebbleAPIHandler()
    //#input(void net.sourceforge.pebble.webservice.PebbleAPIHandler()): this
    //#pebbleapihandler.java:54: end of method: void net.sourceforge.pebble.webservice.PebbleAPIHandler.net.sourceforge.pebble.webservice.PebbleAPIHandler()

  public static final String ID = "id";
  public static final String UUID = "uuid";
  public static final String DATE = "date";
  public static final String AUTHOR = "author";
  public static final String TITLE = "title";
  public static final String SUBTITLE = "subtitle";
  public static final String EXCERPT = "excerpt";
  public static final String BODY = "body";
  public static final String PERMALINK = "permalink";
  public static final String CATEGORIES = "categories";
  public static final String TAGS = "tags";
  public static final String ATTACHMENT = "attachment";
  public static final String ATTACHMENT_URL = "attachment.url";
  public static final String ATTACHMENT_SIZE = "attachment.size";
  public static final String ATTACHMENT_TYPE = "attachment.type";

  /** the log used by this class */
  private static Log log = LogFactory.getLog(PebbleAPIHandler.class);
    //#pebbleapihandler.java:73: method: net.sourceforge.pebble.webservice.PebbleAPIHandler.net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init
    //#pebbleapihandler.java:73: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler]
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.adaptBlogEntry(Lnet/sourceforge/pebble/domain/BlogEntry;)Ljava/util/Hashtable;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.authenticate(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.formatPostId(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getAuthenticationManager()Lorg/acegisecurity/AuthenticationManager;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getBlogWithBlogId(Ljava/lang/String;)Lnet/sourceforge/pebble/domain/Blog;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getBlogWithPostId(Ljava/lang/String;)Lnet/sourceforge/pebble/domain/Blog;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getPostId(Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getRecentBlogEntries(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/util/Vector;
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.setAuthenticationManager(Lorg/acegisecurity/AuthenticationManager;)V
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): log
    //#output(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): net/sourceforge/pebble/webservice/AbstractAPIHandler.__Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler]
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): net/sourceforge/pebble/webservice/AbstractAPIHandler.__Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.adaptBlogEntry(Lnet/sourceforge/pebble/domain/BlogEntry;)Ljava/util/Hashtable; == &adaptBlogEntry
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.authenticate(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;Ljava/lang/String;)V == &net/sourceforge/pebble/webservice/AbstractAPIHandler.authenticate
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.formatPostId(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; == &net/sourceforge/pebble/webservice/AbstractAPIHandler.formatPostId
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getAuthenticationManager()Lorg/acegisecurity/AuthenticationManager; == &net/sourceforge/pebble/webservice/AbstractAPIHandler.getAuthenticationManager
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getBlogWithBlogId(Ljava/lang/String;)Lnet/sourceforge/pebble/domain/Blog; == &net/sourceforge/pebble/webservice/AbstractAPIHandler.getBlogWithBlogId
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getBlogWithPostId(Ljava/lang/String;)Lnet/sourceforge/pebble/domain/Blog; == &net/sourceforge/pebble/webservice/AbstractAPIHandler.getBlogWithPostId
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getPostId(Ljava/lang/String;)Ljava/lang/String; == &net/sourceforge/pebble/webservice/AbstractAPIHandler.getPostId
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.getRecentBlogEntries(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/util/Vector; == &getRecentBlogEntries
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): __Dispatch_Table.setAuthenticationManager(Lorg/acegisecurity/AuthenticationManager;)V == &net/sourceforge/pebble/webservice/AbstractAPIHandler.setAuthenticationManager
    //#post(net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init): init'ed(log)
    //#pebbleapihandler.java:73: end of method: net.sourceforge.pebble.webservice.PebbleAPIHandler.net.sourceforge.pebble.webservice.PebbleAPIHandler__static_init

  /**
   * Gets a list of the recent blog entries.
   *
   * @param blogid    the ID of the blog (ignored)
   * @param username  the username used for logging in via XML-RPC
   * @param password  the password used for logging in via XML-RPC
   * @param numberOfPosts   the number of posts to get
   * @return  a Vector of Hashtables (an array of structs) representing blog entries
   * @throws org.apache.xmlrpc.XmlRpcException    if something goes wrong, including an authentication error
   */
  public Vector getRecentBlogEntries(String blogid, String username, String password, int numberOfPosts) throws XmlRpcException {
    log.debug("pebble.getRecentBlogEntries(" +
    //#pebbleapihandler.java:86: method: Vector net.sourceforge.pebble.webservice.PebbleAPIHandler.getRecentBlogEntries(String, String, String, int)
    //#pebbleapihandler.java:86: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Vector getRecentBlogEntries(String, String, String, int)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    //#input(Vector getRecentBlogEntries(String, String, String, int)): __Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler]
    //#input(Vector getRecentBlogEntries(String, String, String, int)): __Descendant_Table[others]
    //#input(Vector getRecentBlogEntries(String, String, String, int)): __Dispatch_Table.authenticate(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;Ljava/lang/String;)V
    //#input(Vector getRecentBlogEntries(String, String, String, int)): __Dispatch_Table.formatPostId(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(Vector getRecentBlogEntries(String, String, String, int)): __Dispatch_Table.getBlogWithBlogId(Ljava/lang/String;)Lnet/sourceforge/pebble/domain/Blog;
    //#input(Vector getRecentBlogEntries(String, String, String, int)): blogid
    //#input(Vector getRecentBlogEntries(String, String, String, int)): log
    //#input(Vector getRecentBlogEntries(String, String, String, int)): numberOfPosts
    //#input(Vector getRecentBlogEntries(String, String, String, int)): password
    //#input(Vector getRecentBlogEntries(String, String, String, int)): this
    //#input(Vector getRecentBlogEntries(String, String, String, int)): this.__Tag
    //#input(Vector getRecentBlogEntries(String, String, String, int)): this.authenticationManager
    //#input(Vector getRecentBlogEntries(String, String, String, int)): username
    //#output(Vector getRecentBlogEntries(String, String, String, int)): new Vector(getRecentBlogEntries#2) num objects
    //#output(Vector getRecentBlogEntries(String, String, String, int)): return_value
    //#new obj(Vector getRecentBlogEntries(String, String, String, int)): new Vector(getRecentBlogEntries#2)
    //#pre[2] (Vector getRecentBlogEntries(String, String, String, int)): log != null
    //#pre[6] (Vector getRecentBlogEntries(String, String, String, int)): this.__Tag == net/sourceforge/pebble/webservice/PebbleAPIHandler
    //#pre[7] (Vector getRecentBlogEntries(String, String, String, int)): this.authenticationManager != null
    //#presumption(Vector getRecentBlogEntries(String, String, String, int)): java.util.Iterator:next(...)@99 != null
    //#presumption(Vector getRecentBlogEntries(String, String, String, int)): net.sourceforge.pebble.domain.Blog:getRecentPublishedBlogEntries(...)@95 != null
    //#post(Vector getRecentBlogEntries(String, String, String, int)): return_value == &new Vector(getRecentBlogEntries#2)
    //#post(Vector getRecentBlogEntries(String, String, String, int)): new Vector(getRecentBlogEntries#2) num objects == 1
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.api.decorator.ContentDecoratorContext
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setView
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setMedia
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getBlog
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getContentDecoratorChain
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.decorator.ContentDecoratorChain:decorate
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Hashtable
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getTitle
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Hashtable:put
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getSubtitle
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getPermalink
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getExcerpt
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getBody
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getDate
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getAuthor
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getId
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getId
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:formatPostId
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Vector
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getCategories
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Category:getId
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.Vector:add
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getTagsAsList
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Tag:getName
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getAttachment
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Attachment:getUrl
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Attachment:getSize
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.lang.Long:valueOf
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.Attachment:getType
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:java.lang.String:valueOf
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:org.apache.xmlrpc.XmlRpcException
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogManager:getInstance
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.domain.BlogManager:getBlog
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:org.acegisecurity.providers.UsernamePasswordAuthenticationToken
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:org.acegisecurity.AuthenticationManager:authenticate
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:org.acegisecurity.context.SecurityContext:setAuthentication
    //#unanalyzed(Vector getRecentBlogEntries(String, String, String, int)): Effects-of-calling:net.sourceforge.pebble.util.SecurityUtils:isUserAuthorisedForBlogAsBlogContributor
    //#test_vector(Vector getRecentBlogEntries(String, String, String, int)): java.util.Iterator:hasNext(...)@98: {1}, {0}
        blogid + ", " +
        username + ", " +
        "********)");

    Blog blog = getBlogWithBlogId(blogid);
    authenticate(blog, username, password);

    Vector posts = new Vector();
    Collection coll = blog.getRecentPublishedBlogEntries(numberOfPosts);
    //#pebbleapihandler.java:95: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.Blog:getRecentPublishedBlogEntries(int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Vector getRecentBlogEntries(String, String, String, int)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.Blog:getRecentPublishedBlogEntries(int)
    Iterator it = coll.iterator();
    BlogEntry entry;
    while (it.hasNext()) {
      entry = (BlogEntry)it.next();
      posts.add(adaptBlogEntry(entry));
    }

    return posts;
    //#pebbleapihandler.java:103: end of method: Vector net.sourceforge.pebble.webservice.PebbleAPIHandler.getRecentBlogEntries(String, String, String, int)
  }

  /**
   * Helper method to adapt a blog entry into an XML-RPC compatible struct.
   *
   * @param entry   the BlogEntry to adapt
   * @return  a Hashtable representing the major properties of the entry
   */
  private Hashtable adaptBlogEntry(BlogEntry entry) {
    // first apply decorators - we don't want to go out naked :-)
    ContentDecoratorContext context = new ContentDecoratorContext();
    //#pebbleapihandler.java:114: method: Hashtable net.sourceforge.pebble.webservice.PebbleAPIHandler.adaptBlogEntry(BlogEntry)
    //#pebbleapihandler.java:114: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext()
    //#input(Hashtable adaptBlogEntry(BlogEntry)): __Descendant_Table[net/sourceforge/pebble/webservice/PebbleAPIHandler]
    //#input(Hashtable adaptBlogEntry(BlogEntry)): __Descendant_Table[others]
    //#input(Hashtable adaptBlogEntry(BlogEntry)): __Dispatch_Table.formatPostId(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(Hashtable adaptBlogEntry(BlogEntry)): entry
    //#input(Hashtable adaptBlogEntry(BlogEntry)): this
    //#input(Hashtable adaptBlogEntry(BlogEntry)): this.__Tag
    //#output(Hashtable adaptBlogEntry(BlogEntry)): new Hashtable(adaptBlogEntry#2) num objects
    //#output(Hashtable adaptBlogEntry(BlogEntry)): return_value
    //#new obj(Hashtable adaptBlogEntry(BlogEntry)): new Hashtable(adaptBlogEntry#2)
    //#pre[1] (Hashtable adaptBlogEntry(BlogEntry)): entry != null
    //#pre[3] (Hashtable adaptBlogEntry(BlogEntry)): this.__Tag == net/sourceforge/pebble/webservice/PebbleAPIHandler
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): java.util.Iterator:next(...)@133 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): java.util.Iterator:next(...)@141 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.Blog:getContentDecoratorChain(...)@117 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getAttachment(...)@148 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getAttachment(...)@149 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getAttachment(...)@150 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getBlog(...)@117 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getBlog(...)@128 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getCategories(...)@131 != null
    //#presumption(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getTagsAsList(...)@139 != null
    //#post(Hashtable adaptBlogEntry(BlogEntry)): return_value == &new Hashtable(adaptBlogEntry#2)
    //#post(Hashtable adaptBlogEntry(BlogEntry)): new Hashtable(adaptBlogEntry#2) num objects == 1
    //#unanalyzed(Hashtable adaptBlogEntry(BlogEntry)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Hashtable adaptBlogEntry(BlogEntry)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Hashtable adaptBlogEntry(BlogEntry)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Hashtable adaptBlogEntry(BlogEntry)): Effects-of-calling:java.lang.String:valueOf
    //#test_vector(Hashtable adaptBlogEntry(BlogEntry)): java.util.Iterator:hasNext(...)@132: {1}, {0}
    //#test_vector(Hashtable adaptBlogEntry(BlogEntry)): java.util.Iterator:hasNext(...)@140: {1}, {0}
    //#test_vector(Hashtable adaptBlogEntry(BlogEntry)): net.sourceforge.pebble.domain.BlogEntry:getAttachment(...)@146: Addr_Set{null}, Inverse{null}
    context.setView(ContentDecoratorContext.DETAIL_VIEW);
    //#pebbleapihandler.java:115: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setView(int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setView(int)
    context.setMedia(ContentDecoratorContext.XML_RPC);
    //#pebbleapihandler.java:116: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setMedia(int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setMedia(int)
    entry.getBlog().getContentDecoratorChain().decorate(context, entry);
    //#pebbleapihandler.java:117: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.BlogEntry:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.BlogEntry:getBlog()
    //#pebbleapihandler.java:117: Warning: method not available
    //#    -- call on ContentDecoratorChain net.sourceforge.pebble.domain.Blog:getContentDecoratorChain()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: ContentDecoratorChain net.sourceforge.pebble.domain.Blog:getContentDecoratorChain()
    //#pebbleapihandler.java:117: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.decorator.ContentDecoratorChain:decorate(ContentDecoratorContext, BlogEntry)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: void net.sourceforge.pebble.decorator.ContentDecoratorChain:decorate(ContentDecoratorContext, BlogEntry)

    Hashtable post = new Hashtable();
    post.put(TITLE, entry.getTitle());
    //#pebbleapihandler.java:120: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    post.put(SUBTITLE, entry.getSubtitle());
    //#pebbleapihandler.java:121: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getSubtitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getSubtitle()
    post.put(PERMALINK, entry.getPermalink());
    //#pebbleapihandler.java:122: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getPermalink()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getPermalink()
    post.put(EXCERPT, entry.getExcerpt());
    //#pebbleapihandler.java:123: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getExcerpt()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getExcerpt()
    post.put(BODY, entry.getBody());
    //#pebbleapihandler.java:124: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getBody()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getBody()
    post.put(DATE, entry.getDate());
    //#pebbleapihandler.java:125: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    post.put(AUTHOR, entry.getAuthor());
    //#pebbleapihandler.java:126: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getAuthor()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getAuthor()
    post.put(ID, entry.getId());
    //#pebbleapihandler.java:127: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getId()
    post.put(UUID, formatPostId(entry.getBlog().getId(), entry.getId()));
    //#pebbleapihandler.java:128: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.BlogEntry:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.BlogEntry:getBlog()
    //#pebbleapihandler.java:128: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Blog:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Blog:getId()
    //#pebbleapihandler.java:128: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getId()

    Vector categories = new Vector();
    Iterator it = entry.getCategories().iterator();
    //#pebbleapihandler.java:131: Warning: method not available
    //#    -- call on Set net.sourceforge.pebble.domain.BlogEntry:getCategories()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Set net.sourceforge.pebble.domain.BlogEntry:getCategories()
    while (it.hasNext()) {
      Category cat = (Category)it.next();
      categories.add(cat.getId());
    //#pebbleapihandler.java:134: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Category:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Category:getId()
    }
    post.put(CATEGORIES, categories);

    Vector tags = new Vector();
    it = entry.getTagsAsList().iterator();
    //#pebbleapihandler.java:139: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.BlogEntry:getTagsAsList()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.BlogEntry:getTagsAsList()
    while (it.hasNext()) {
      Tag tag = (Tag)it.next();
      tags.add(tag.getName());
    //#pebbleapihandler.java:142: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Tag:getName()
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Tag:getName()
    }
    post.put(TAGS, tags);

    if (entry.getAttachment() != null) {
    //#pebbleapihandler.java:146: Warning: method not available
    //#    -- call on Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
      Hashtable attachment = new Hashtable();
      attachment.put(ATTACHMENT_URL, entry.getAttachment().getUrl());
    //#pebbleapihandler.java:148: Warning: method not available
    //#    -- call on Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#pebbleapihandler.java:148: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Attachment:getUrl()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Attachment:getUrl()
      attachment.put(ATTACHMENT_SIZE, entry.getAttachment().getSize());
    //#pebbleapihandler.java:149: Warning: method not available
    //#    -- call on Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#pebbleapihandler.java:149: Warning: method not available
    //#    -- call on long net.sourceforge.pebble.domain.Attachment:getSize()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: long net.sourceforge.pebble.domain.Attachment:getSize()
      attachment.put(ATTACHMENT_TYPE, entry.getAttachment().getType());
    //#pebbleapihandler.java:150: Warning: method not available
    //#    -- call on Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: Attachment net.sourceforge.pebble.domain.BlogEntry:getAttachment()
    //#pebbleapihandler.java:150: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Attachment:getType()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.webservice.PebbleAPIHandler
    //#    method: Hashtable adaptBlogEntry(BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Attachment:getType()

      post.put(ATTACHMENT, attachment);
    }

    return post;
    //#pebbleapihandler.java:155: end of method: Hashtable net.sourceforge.pebble.webservice.PebbleAPIHandler.adaptBlogEntry(BlogEntry)
  }

}
    //#pebbleapihandler.java:: end of class: net.sourceforge.pebble.webservice.PebbleAPIHandler
