KickJava   Java API By Example, From Geeks To Geeks.

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


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 MetaWeblog API
33  * http://www.xmlrpc.com/metaWeblogApi
34  * also used the following enhancement
35  * http://www.xmlrpc.com/metaWeblogNewMediaObject
36  *
37  * Some design ideas taken from Blojsom, thanks.
38  *
39  * @author Stephan J. Schmidt
40  * @version $Id: MetaWeblogAPI.java 1612 2004-05-19 09:29:37Z stephan $
41  */

42
43 public interface MetaWeblogAPI extends BloggerAPI {
44
45   public Vector JavaDoc getRecentPosts(String JavaDoc blogid,
46                                String JavaDoc username,
47                                String JavaDoc password,
48                                int numberOfPosts) throws Exception JavaDoc;
49
50   /**
51    * http://www.xmlrpc.com/stories/storyReader$2509#threeEntrypoints
52    * @param blogid
53    * @param username
54    * @param password
55    * @param struct
56    * @param publish
57    * @return
58    * @throws Exception
59    */

60   public String JavaDoc newPost(String JavaDoc blogid,
61                         String JavaDoc username,
62                         String JavaDoc password,
63                         Hashtable JavaDoc struct,
64                         boolean publish) throws Exception JavaDoc;
65
66     /**
67      * http://www.xmlrpc.com/stories/storyReader$2509#threeEntrypoints
68      * @param postId
69      * @param username
70      * @param password
71      * @return
72      * @throws Exception
73      */

74   public Hashtable JavaDoc getPost(String JavaDoc postId,
75                            String JavaDoc username,
76                            String JavaDoc password) throws Exception JavaDoc;
77
78   /**
79    * yes. the metaweblog api takes a struct for the content, as opposed
80    * to the Blogger API that just takes a string.
81    * http://www.xmlrpc.com/stories/storyReader$2509#threeEntrypoints
82    * @param postId
83    * @param username
84    * @param password
85    * @param content
86    * @param publish
87    * @return
88    * @throws Exception
89    */

90   public boolean editPost(String JavaDoc postId,
91                               String JavaDoc username,
92                               String JavaDoc password,
93                               Hashtable JavaDoc content,
94                               boolean publish) throws Exception JavaDoc;
95
96     /**
97      * http://www.xmlrpc.com/metaWeblogNewMediaObject
98      * That document does not specify how one deletes an attachment. I will assume
99      * this is done by sending the same request but with an empty body of bytes.
100      * @param blogid
101      * @param username
102      * @param password
103      * @param content
104      * @return
105      * @throws Exception
106      */

107    public Hashtable JavaDoc newMediaObject(String JavaDoc blogid,
108                                    String JavaDoc username,
109                                    String JavaDoc password,
110                                    Hashtable JavaDoc content) throws Exception JavaDoc;
111
112
113     /* These methods were suggested for addition to the official metaweblog api on May 7, 2003.
114         http://www.blogger.com/developers/api/1_docs/
115
116       They belong to the blogger api and the metaweblog api should be backward compatible with it.
117      (If so the perhaps this class should just extend blogger api?)
118
119      -- this one is useful: metaWeblog.deletePost (appkey, postid, username, password, publish) returns boolean
120      metaWeblog.getTemplate (appkey, blogid, username, password, templateType) returns string
121      metaWeblog.setTemplate (appkey, blogid, username, password, template, templateType) returns boolean
122    metaWeblog.getUsersBlogs (appkey, username, password) returns array
123    */

124
125
126
127 }
128
Popular Tags