Looking for Roller? The Official Roller Wiki is now hosted by the Apache Software Foundation.
Blog Client is a Java based client library for interacting with a blog server that supports either the Atom Protocol or the XML-RPC based blogging APIs (BloggerAPI, MetaWeblogAPI, MovableTypeAPI). Below is a diagram that shows the interfaces and classes that make up the Blog Client API.
Below are the declarations of the API it stands today.
public interface BlogClient {
/** Returns array of user's blogids, TODO: metadata! */
public abstract String[] getUserBlogs() throws Exception;
/** Returns interface for interacting with a blog */
public abstract BlogSite getBlogSite(String blogId);
}
public interface BlogSite {
/** Create new and empty entry */
public BlogEntry createEntry();
/** Get a single Entry by token */
public BlogEntry getEntry(String token) throws Exception;
/** Returns list of most recent entries as Entry objects */
public List getRecentEntries(int maxEntries) throws Exception;
/** Returns available categories as a list of BlogEntry.Category objects. */
public List getCategories() throws Exception;
/** Create a new resource on the server and return it's URL */
public String createResource(
String name, String contentType, File file) throws Exception;
}
public interface BlogEntry {
/** Entry ID */
public String getId();
/** Token can be used to fetch this entry again later */
public String getToken();
/** Save this entry as new entry or update existing entry in blog server */
public void save(boolean publish) throws Exception;
/** Delete this entry from blog server */
public void delete() throws Exception;
public String getTitle();
public void setTitle(String title);
public String getSummary();
public void setSummary(String summary);
public Content getContent();
public void setContent(Content content);
public Person getAuthor();
public void setAuthor(Person author);
/** List of Category objects */
public List getCategories();
public void setCategories(List categories);
public Date getCreationDate();
public void setCreationDate(Date date);
public Date getPublicationDate();
public void setPublicationDate(Date date);
public Date getModificationDate();
public void setModificationDate(Date date);
public class Person {
String name;
String email;
String url;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String toString() {
return name;
}
}
public class Content {
String mode;
String type;
String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
/** Must be "xml" or "escaped" or "base64" */
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
}
public class Category {
public boolean equals(Object obj) {
Category other = (Category)obj;
if (obj == null) return false;
if (getName() != null && other.getName() != null
&& getName().equals(other.getName())) return true;
if (getId() != null && other.getId() != null
&& getId().equals(other.getId())) return true;
return false;
}
String id;
String name;
String url;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String toString() {
return name;
}
}
}
| Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
|---|---|---|---|---|---|---|
png |
BlogClientAPI.png | 42.7 kB | 3 | 17-Jan-2005 09:01 | DaveJohnson |