KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > xmlrpc > BloggerAPI


1 /*
2  * This file is part of "SnipSnap Wiki/Weblog".
3  *
4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
5  * All Rights Reserved.
6  *
7  * Please visit http://snipsnap.org/ for updates and contact.
8  *
9  * --LICENSE NOTICE--
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  * --LICENSE NOTICE--
24  */

25
26 package org.snipsnap.xmlrpc;
27
28 import java.util.Hashtable JavaDoc;
29 import java.util.Vector JavaDoc;
30
31 /**
32  * Handles XML-RPC calls for the Blogger API
33  * http://xmlrpc.free-conversant.com/docs/bloggerAPI
34  * http://plant.blogger.com/api/index.html
35  *
36  * @author Stephan J. Schmidt
37  * @version $Id: BloggerAPI.java 1612 2004-05-19 09:29:37Z stephan $
38  */

39
40 public interface BloggerAPI extends XmlRpcHandler {
41     public String JavaDoc getName();
42
43
44     /**
45      * The following methods still need to me worked on
46    Blogger specific:
47    blogger.getUserInfo: Authenticates a user and returns basic user info (name, email, userid, etc.).
48    blogger.getTemplate: Returns the main or archive index template of a given blog.
49    blogger.setTemplate: Edits the main or archive index template of a given blog.
50    */

51
52     public String JavaDoc newPost(String JavaDoc appkey,
53                           String JavaDoc blogid,
54                           String JavaDoc username,
55                           String JavaDoc password,
56                           String JavaDoc content,
57                           boolean publish) throws Exception JavaDoc;
58
59     /**
60      * http://www.blogger.com/developers/api/1_docs/xmlrpc_editPost.html
61      */

62     public boolean editPost(String JavaDoc appkey,
63                             String JavaDoc postId,
64                                 String JavaDoc username,
65                                 String JavaDoc password,
66                                 String JavaDoc content,
67                                 boolean publish) throws Exception JavaDoc;
68
69
70     /**
71      * From the spec:
72      * blogger.getUsersBlogs: Returns information on all the blogs a given user is a member of.
73      * appkey (string): Unique identifier/passcode of the application sending the post. (See access info.)
74      * username (string): Login for a Blogger user who has permission to post to the blog.
75      * password (string): Password for said username.
76      *
77      * @param appkey Application key, currently not used by SnipSnap
78      * @param username Login of a SnipSnap user whit permission to post to weblog
79      * @param password Password credential
80      *
81      * @return bloglist List of Blogs, currently SnipSnap has only one weblog
82      **/

83     public Vector JavaDoc getUsersBlogs(String JavaDoc appkey,
84                                 String JavaDoc username,
85                                 String JavaDoc password) throws Exception JavaDoc;
86
87     /**
88      * From the spec:
89      * Returns an array of structs containing the latest n posts to a given blog, newest first.
90      * appkey (string): Unique identifier/passcode of the application sending the post. (See access info.)
91      * blogid (string): Unique identifier of the blog the post will be added to.
92      * username (string): Login for a Blogger user who has permission to post to the blog.
93      * password (string): Password for said username.
94      * numberOfPosts (int): Number of posts to retrieve.
95      *
96      * @param appkey Application key, currently not used by SnipSnap
97      * @param blogid Identifaction for the blog, currenty SnipSnap supports only one weblog
98      * @param username Login of a SnipSnap user whit permission to post to weblog
99      * @param password Password credential
100      * @param numberOfPosts Number of the posts to retrieve
101      *
102      * @return recentPosts List of recents weblog posts
103      **/

104     public Vector JavaDoc getRecentPosts(String JavaDoc appkey,
105                                  String JavaDoc blogid,
106                                  String JavaDoc username,
107                                  String JavaDoc password,
108                                  int numberOfPosts) throws Exception JavaDoc;
109
110     /**
111      * blogger.getPost
112      *
113      * Parameters:
114      *
115      * appkey : currently ignored
116      * postId : postId is a unique identifier for the post created. It is the value returned by blogger.newPost. postId will look like..."zoneId|convId|pathToWeblog|msgNum".
117      * username : the email address you use as a username for the site. This user must have privileges to post to the weblog as either the weblog owner, or a member of the owner group.
118      * password : the password you use for the site
119      *
120      * Returns:
121      *
122      * struct containing values content ( message body ), userId, postId and dateCreated.
123      **/

124     public Hashtable JavaDoc getPost(String JavaDoc appkey,
125                              String JavaDoc postId,
126                              String JavaDoc username,
127                              String JavaDoc password) throws Exception JavaDoc;
128
129     /**
130      * The blogger API document itself does not seem to reference
131      * delete post but the following does:
132      * http://xmlrpc.free-conversant.com/docs/bloggerAPI#deletePost
133     */

134     public boolean deletePost(String JavaDoc appkey,
135                               String JavaDoc postId,
136                               String JavaDoc username,
137                               String JavaDoc password,
138                               boolean publish) throws Exception JavaDoc;
139
140 }
141
Popular Tags