Package org.alfresco.repo.blog
Class DefaultBlogIntegrationImplementation
- java.lang.Object
-
- org.alfresco.repo.blog.BaseBlogIntegrationImplementation
-
- org.alfresco.repo.blog.DefaultBlogIntegrationImplementation
-
- All Implemented Interfaces:
BlogIntegrationImplementation
- Direct Known Subclasses:
TypepadIntegration,WordPressIntegration
public abstract class DefaultBlogIntegrationImplementation extends BaseBlogIntegrationImplementation
Default blog integration implementation. Uses various standard XML PRC blogging API to satisfy the blog integration implementation interface. Based on origional contribution by Sudhakar Selvaraj.- Author:
- Roy Wetherall
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringACTION_DELETE_POSTprotected static StringACTION_EDIT_POSTprotected static StringACTION_GET_POSTprotected static StringACTION_NEW_POSTBlog actions
-
Constructor Summary
Constructors Constructor Description DefaultBlogIntegrationImplementation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringcheckForProtocol(String url)Checks a url for a protocol and adds http if none presentprotected StringcheckForTrainlingSlash(String url)Checks the url for a trailing slash and adds one if none presentbooleandeletePost(BlogDetails blogDetails, String postId)Delete an existing blog postprotected Objectexecute(String url, String method, List<Object> params)Executes an XML RPC methodprotected abstract StringgetEndpointURL(BlogDetails blogDetails)Gets the XML RPC end point URL for the given blog details.Map<String,Object>getPost(BlogDetails blogDetails, String postId)Get the details of an existing blog postStringnewPost(BlogDetails blogDetails, String title, String body, boolean publish)Create a new post on the blog.booleanupdatePost(BlogDetails blogDetails, String postId, String title, String body, boolean publish)Update an exisiting blog post-
Methods inherited from class org.alfresco.repo.blog.BaseBlogIntegrationImplementation
getDisplayName, getName, register, setBlogIntegrationService, setDisplayName, setName
-
-
-
-
Field Detail
-
ACTION_NEW_POST
protected static final String ACTION_NEW_POST
Blog actions- See Also:
- Constant Field Values
-
ACTION_EDIT_POST
protected static final String ACTION_EDIT_POST
- See Also:
- Constant Field Values
-
ACTION_GET_POST
protected static final String ACTION_GET_POST
- See Also:
- Constant Field Values
-
ACTION_DELETE_POST
protected static final String ACTION_DELETE_POST
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEndpointURL
protected abstract String getEndpointURL(BlogDetails blogDetails)
Gets the XML RPC end point URL for the given blog details.- Parameters:
blogDetails- blog details- Returns:
- String the end point URL
-
newPost
public String newPost(BlogDetails blogDetails, String title, String body, boolean publish)
Description copied from interface:BlogIntegrationImplementationCreate a new post on the blog.- Parameters:
blogDetails- the blog detailstitle- the title of the postbody- the body of the postpublish- indicates whether the post is published or not- Returns:
- String the newly created post id
- See Also:
BlogIntegrationImplementation.newPost(org.alfresco.repo.blog.BlogDetails, java.lang.String, java.lang.String, boolean)
-
updatePost
public boolean updatePost(BlogDetails blogDetails, String postId, String title, String body, boolean publish)
Description copied from interface:BlogIntegrationImplementationUpdate an exisiting blog post- Parameters:
blogDetails- BlogDetailspostId- Stringtitle- Stringbody- Stringpublish- boolean- Returns:
- boolean
- See Also:
BlogIntegrationImplementation.updatePost(org.alfresco.repo.blog.BlogDetails, java.lang.String, java.lang.String, java.lang.String, boolean)
-
getPost
public Map<String,Object> getPost(BlogDetails blogDetails, String postId)
Description copied from interface:BlogIntegrationImplementationGet the details of an existing blog post- Parameters:
blogDetails- BlogDetailspostId- String- Returns:
- Map
- See Also:
BlogIntegrationImplementation.getPost(org.alfresco.repo.blog.BlogDetails, java.lang.String)
-
deletePost
public boolean deletePost(BlogDetails blogDetails, String postId)
Description copied from interface:BlogIntegrationImplementationDelete an existing blog post- Parameters:
blogDetails- BlogDetailspostId- String- Returns:
- boolean
- See Also:
BlogIntegrationImplementation.deletePost(org.alfresco.repo.blog.BlogDetails, java.lang.String)
-
execute
protected Object execute(String url, String method, List<Object> params)
Executes an XML RPC method- Parameters:
url- Stringmethod- String- Returns:
- Object
-
checkForProtocol
protected String checkForProtocol(String url)
Checks a url for a protocol and adds http if none present- Parameters:
url- the url- Returns:
- String the checked url
-
-