/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see .
*/
package org.alfresco.repo.blog;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
/**
* 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
*/
public abstract class DefaultBlogIntegrationImplementation extends BaseBlogIntegrationImplementation
{
/** Blog actions */
protected static final String ACTION_NEW_POST = "metaWeblog.newPost";
protected static final String ACTION_EDIT_POST = "metaWeblog.editPost";
protected static final String ACTION_GET_POST = "metaWeblog.getPost";
protected static final String ACTION_DELETE_POST = "blogger.deletePost";
/**
* Gets the XML RPC end point URL for the given blog details.
*
* @param blogDetails blog details
* @return String the end point URL
*/
protected abstract String getEndpointURL(BlogDetails blogDetails);
/**
* @see org.alfresco.module.blogIntegration.BlogIntegrationImplementation#newPost(org.alfresco.module.blogIntegration.BlogDetails, java.lang.String, java.lang.String, boolean)
*/
public String newPost(BlogDetails blogDetails, String title, String body, boolean publish)
{
// Create the hash table containing details of the post's content
Hashtable content = new Hashtable();
content.put("title", title);
content.put("description", body);
// Create a list of parameters
List