ch.odi.justblog.api.blogger
Class Blogger

java.lang.Object
  extended bych.odi.justblog.api.blogger.Blogger

public class Blogger
extends java.lang.Object

Facade for the Blogger API. First set the credentials, call getUserInfo and getUsersBlogs. Then set the desired Blog. Now call newPost, editPost, getTemplate and setTemplate.

Author:
oglueck

Field Summary
static java.lang.String TEMPLATE_TYPE_ARCHIVE
           
static java.lang.String TEMPLATE_TYPE_MAIN
           
 
Constructor Summary
Blogger(java.net.URL url)
           
 
Method Summary
 void editPost(java.lang.String id, java.lang.String posting, boolean publish)
          Edits a given post.
 java.lang.String getTemplate(java.lang.String type)
          Retrieves a template.
 UserInfo getUserInfo()
          Returns the UserInfo object of the user set by the credentials.
 java.util.Collection getUsersBlogs()
          Returns information about all the blogs a given user is a member of.
 java.lang.String newPost(java.lang.String posting, boolean publish)
          Makes a new post to a designated blog.
 void setBlog(BloggerBlog blog)
           
 void setCredentials(java.lang.String username, char[] password)
          Sets the user credentials.
 void setTemplate(java.lang.String type, java.lang.String template)
          Sets a template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_TYPE_MAIN

public static final java.lang.String TEMPLATE_TYPE_MAIN
See Also:
Constant Field Values

TEMPLATE_TYPE_ARCHIVE

public static final java.lang.String TEMPLATE_TYPE_ARCHIVE
See Also:
Constant Field Values
Constructor Detail

Blogger

public Blogger(java.net.URL url)
Parameters:
url - URL of the XML-RPC2 endpoint.
Method Detail

setBlog

public void setBlog(BloggerBlog blog)

setCredentials

public void setCredentials(java.lang.String username,
                           char[] password)
Sets the user credentials. It is allowed to change the credentials at any time.

Parameters:
username -
password -

newPost

public java.lang.String newPost(java.lang.String posting,
                                boolean publish)
                         throws java.io.IOException,
                                ApiException
Makes a new post to a designated blog. Optionally, will publish the blog after making the post. A blog must be set before calling this method.

Parameters:
posting - The content to publish
publish - if true the content if made publicly available immediately
Returns:
the new ID of the content
Throws:
java.io.IOException
ApiException

editPost

public void editPost(java.lang.String id,
                     java.lang.String posting,
                     boolean publish)
              throws java.io.IOException,
                     ApiException
Edits a given post. Optionally, will publish the blog after making the edit. A blog must be set before calling this method.

Parameters:
id -
posting -
publish -
Throws:
java.io.IOException
ApiException

getUsersBlogs

public java.util.Collection getUsersBlogs()
                                   throws java.io.IOException,
                                          ApiException
Returns information about all the blogs a given user is a member of.

Returns:
Throws:
java.io.IOException
ApiException

getUserInfo

public UserInfo getUserInfo()
                     throws ApiException,
                            java.io.IOException
Returns the UserInfo object of the user set by the credentials.

Returns:
Throws:
ApiException
java.io.IOException

getTemplate

public java.lang.String getTemplate(java.lang.String type)
Retrieves a template. A blog must be set before calling this method.

Parameters:
type - one of the TEMPLATE_TYPE_* constants
Returns:

setTemplate

public void setTemplate(java.lang.String type,
                        java.lang.String template)
Sets a template. A blog must be set before calling this method.

Parameters:
type - one of the TEMPLATE_TYPE_* constants
template -


Copyright © 2005 Ortwin Glück. All Rights Reserved.