org.alfresco.repo.blog
Class DefaultBlogIntegrationImplementation

java.lang.Object
  extended by org.alfresco.repo.blog.BaseBlogIntegrationImplementation
      extended by 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.


Field Summary
protected static java.lang.String ACTION_DELETE_POST
           
protected static java.lang.String ACTION_EDIT_POST
           
protected static java.lang.String ACTION_GET_POST
           
protected static java.lang.String ACTION_NEW_POST
          Blog actions
 
Constructor Summary
DefaultBlogIntegrationImplementation()
           
 
Method Summary
protected  java.lang.String checkForProtocol(java.lang.String url)
          Checks a url for a protocol and adds http if none present
protected  java.lang.String checkForTrainlingSlash(java.lang.String url)
          Checks the url for a trailing slash and adds one if none present
 boolean deletePost(BlogDetails blogDetails, java.lang.String postId)
          Delete an existing blog post
protected  java.lang.Object execute(java.lang.String url, java.lang.String method, java.util.List params)
          Executes an XML RPC method
protected abstract  java.lang.String getEndpointURL(BlogDetails blogDetails)
          Gets the XML RPC end point URL for the given blog details.
 java.util.Map getPost(BlogDetails blogDetails, java.lang.String postId)
          Get the details of an existing blog post
 java.lang.String newPost(BlogDetails blogDetails, java.lang.String title, java.lang.String body, boolean publish)
          Create a new post on the blog.
 boolean updatePost(BlogDetails blogDetails, java.lang.String postId, java.lang.String title, java.lang.String body, boolean publish)
          Update an exisiting blog post
 
Methods inherited from class org.alfresco.repo.blog.BaseBlogIntegrationImplementation
getDisplayName, getName, register, setBlogIntegrationService, setDisplayName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_NEW_POST

protected static final java.lang.String ACTION_NEW_POST
Blog actions

See Also:
Constant Field Values

ACTION_EDIT_POST

protected static final java.lang.String ACTION_EDIT_POST
See Also:
Constant Field Values

ACTION_GET_POST

protected static final java.lang.String ACTION_GET_POST
See Also:
Constant Field Values

ACTION_DELETE_POST

protected static final java.lang.String ACTION_DELETE_POST
See Also:
Constant Field Values
Constructor Detail

DefaultBlogIntegrationImplementation

public DefaultBlogIntegrationImplementation()
Method Detail

getEndpointURL

protected abstract java.lang.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 java.lang.String newPost(BlogDetails blogDetails,
                                java.lang.String title,
                                java.lang.String body,
                                boolean publish)
Description copied from interface: BlogIntegrationImplementation
Create a new post on the blog.

Parameters:
blogDetails - the blog details
title - the title of the post
body - the body of the post
publish - indicates whether the post is published or not
Returns:
String the newly created post id
See Also:
org.alfresco.module.blogIntegration.BlogIntegrationImplementation#newPost(org.alfresco.module.blogIntegration.BlogDetails, java.lang.String, java.lang.String, boolean)

updatePost

public boolean updatePost(BlogDetails blogDetails,
                          java.lang.String postId,
                          java.lang.String title,
                          java.lang.String body,
                          boolean publish)
Description copied from interface: BlogIntegrationImplementation
Update an exisiting blog post

Returns:
See Also:
org.alfresco.module.blogIntegration.BlogIntegrationImplementation#updatePost(org.alfresco.module.blogIntegration.BlogDetails, java.lang.String, java.lang.String, java.lang.String, boolean)

getPost

public java.util.Map getPost(BlogDetails blogDetails,
                             java.lang.String postId)
Description copied from interface: BlogIntegrationImplementation
Get the details of an existing blog post

Returns:
See Also:
org.alfresco.module.blogIntegration.BlogIntegrationImplementation#getPost(org.alfresco.module.blogIntegration.BlogDetails, java.lang.String)

deletePost

public boolean deletePost(BlogDetails blogDetails,
                          java.lang.String postId)
Description copied from interface: BlogIntegrationImplementation
Delete an existing blog post

Returns:
See Also:
org.alfresco.module.blogIntegration.BlogIntegrationImplementation#deletePost(org.alfresco.module.blogIntegration.BlogDetails, java.lang.String)

execute

protected java.lang.Object execute(java.lang.String url,
                                   java.lang.String method,
                                   java.util.List params)
Executes an XML RPC method

Parameters:
url -
method -
params -
Returns:

checkForProtocol

protected java.lang.String checkForProtocol(java.lang.String url)
Checks a url for a protocol and adds http if none present

Parameters:
url - the url
Returns:
String the checked url

checkForTrainlingSlash

protected java.lang.String checkForTrainlingSlash(java.lang.String url)
Checks the url for a trailing slash and adds one if none present

Parameters:
url - the url
Returns:
String the checked url


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.