KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > blogs > api > MetaWeblogAPI


1 /*
2  * ____.
3  * __/\ ______| |__/\. _______
4  * __ .____| | \ | +----+ \
5  * _______| /--| | | - \ _ | : - \_________
6  * \\______: :---| : : | : | \________>
7  * |__\---\_____________:______: :____|____:_____\
8  * /_____|
9  *
10  * . . . i n j a h i a w e t r u s t . . .
11  *
12  *
13  *
14  * ----- BEGIN LICENSE BLOCK -----
15  * Version: JCSL 1.0
16  *
17  * The contents of this file are subject to the Jahia Community Source License
18  * 1.0 or later (the "License"); you may not use this file except in
19  * compliance with the License. You may obtain a copy of the License at
20  * http://www.jahia.org/license
21  *
22  * Software distributed under the License is distributed on an "AS IS" basis,
23  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
24  * for the rights, obligations and limitations governing use of the contents
25  * of the file. The Original and Upgraded Code is the Jahia CMS and Portal
26  * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
27  * Ltd. owns the copyrights in the portions it created. All Rights Reserved.
28  *
29  * The Shared Modifications are Jahia View Helper.
30  *
31  * The Developer of the Shared Modifications is Jahia Solution Sàrl.
32  * Portions created by the Initial Developer are Copyright (C) 2002 by the
33  * Initial Developer. All Rights Reserved.
34  *
35  * ----- END LICENSE BLOCK -----
36  */

37
38 package org.jahia.blogs.api;
39
40 import org.apache.xmlrpc.XmlRpcException;
41
42 import java.util.Vector JavaDoc;
43 import java.util.Hashtable JavaDoc;
44
45 /**
46  * MetaWeblogAPI 1.0 API interface
47  *
48  * MetaWeblog API spec can be found at http://www.xmlrpc.com/metaWeblogApi
49  *
50  * @author Xavier Lawrence
51  */

52 public interface MetaWeblogAPI extends BloggerAPI {
53     
54     /**
55      * Authenticates a user and returns the categories available in the website
56      *
57      * @param blogID Unique identifier of the blog to get the categories from
58      * @param userName Login for a user who has permission to post to the blog
59      * @param password Password for given username
60      *
61      * @return A Hashtable containing the Categories
62      * @throws XmlRpcException If something goes wrong
63      */

64     public Hashtable JavaDoc getCategories(
65             final String JavaDoc blogID,
66             final String JavaDoc userName,
67             final String JavaDoc password)
68             throws XmlRpcException;
69     
70     /**
71      * Makes a new post to a designated blog. Optionally, will publish the blog
72      * after making the post
73      *
74      * @param blogID Unique identifier of the blog the post will be added to
75      * @param userName Login for a user who has permission to post to the blog
76      * @param password Password for given username
77      * @param struct Contents of the post
78      * @param publish If true, the blog will be published immediately after the
79      * post is made
80      *
81      * @return The Post ID as a String object
82      * @throws XmlRpcException If something goes wrong
83      */

84     public String JavaDoc newPost(
85             final String JavaDoc blogID,
86             final String JavaDoc userName,
87             final String JavaDoc password,
88             final Hashtable JavaDoc struct,
89             final boolean publish)
90             throws XmlRpcException;
91     
92     /**
93      * Edits a given post. Optionally, will publish the blog after making the
94      * edit.
95      *
96      * @param postID Unique identifier of the post to be changed
97      * @param userName Login for a user who has permission to post to the blog
98      * @param password Password for given username
99      * @param struct Contents of the post
100      * @param publish If true, the blog will be published immediately after the
101      * post is made
102      *
103      * @return True if the edition was successful
104      * @throws XmlRpcException If something goes wrong
105      */

106     public boolean editPost(
107             final String JavaDoc postID,
108             final String JavaDoc userName,
109             final String JavaDoc password,
110             final Hashtable JavaDoc struct,
111             final boolean publish)
112             throws XmlRpcException;
113     
114     /**
115      * Returns a specified post.
116      *
117      * @param postID Unique identifier of the post to be retrieved
118      * @param userName Login for a user who has permission to post to the blog
119      * @param password Password for given username
120      *
121      * @return The post data in a Hashtable
122      * @throws XmlRpcException If something goes wrong
123      */

124     public Hashtable JavaDoc getPost(
125             final String JavaDoc postID,
126             final String JavaDoc userName,
127             final String JavaDoc password)
128             throws XmlRpcException;
129     
130     /**
131      * Deletes a given post. Optionally, will publish the blog after making the
132      * delete.
133      *
134      * @param postID Unique identifier of the post to be removed
135      * @param userName Login for a user who has permission to post to the blog
136      * @param password Password for given userName
137      * @param publish If true, the blog will be published immediately after the
138      * post is made
139      *
140      * @return True if the edition was sucessful
141      * @throws XmlRpcException If something goes wrong
142      */

143     public boolean deletePost(
144             final String JavaDoc postID,
145             final String JavaDoc userName,
146             final String JavaDoc password,
147             final boolean publish)
148             throws XmlRpcException;
149     
150     /**
151      * Allows user to post a binary object, a file, to the server. If the file is
152      * allowed by the file-upload settings, then the file will be placed in the
153      * user's upload diretory.
154      *
155      * @param blogID Unique identifier of the blog the object will be added to
156      * @param userName Login for a user who has permission to post to the blog
157      * @param password Password for given username
158      * @param struct Contents of the object
159      *
160      * @return Returns a struct, which must contain at least one element, url,
161      * which is the url through which the object can be accessed. It must be
162      * either an FTP or HTTP url.
163      * @throws XmlRpcException If something goes wrong
164      */

165     public Hashtable JavaDoc newMediaObject(
166             final String JavaDoc blogID,
167             final String JavaDoc userName,
168             final String JavaDoc password,
169             final Hashtable JavaDoc struct)
170             throws XmlRpcException;
171     
172     /**
173      * Get a list of recent posts for a category
174      *
175      * @param blogID Unique identifier of the blog to get posts from
176      * @param userName Login for a user who has permission to post to the blog
177      * @param password Password for said username
178      * @param numposts Number of Posts to Retrieve
179      *
180      * @return A Vector of Hashtables containing the posts' data
181      * @throws XmlRpcException If something goes wrong
182      */

183     public Vector JavaDoc getRecentPosts(
184             final String JavaDoc blogID,
185             final String JavaDoc userName,
186             final String JavaDoc password,
187             final int numposts)
188             throws XmlRpcException;
189 }
190
Popular Tags