|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.blojsom.extension.xmlrpc.handlers.AbstractBlojsomAPIHandler org.blojsom.extension.xmlrpc.handlers.PingbackHandler
Pingback handler provides support for the Pingback 1.0 specification.
Field Summary | |
protected static java.lang.String |
API_NAME
|
protected static int |
PINGBACK_ACCESS_DENIED_CODE
|
protected static int |
PINGBACK_ALREADY_REGISTERED_CODE
|
protected static int |
PINGBACK_GENERIC_FAULT_CODE
|
protected static int |
PINGBACK_NO_LINK_TO_TARGET_URI_CODE
|
protected static int |
PINGBACK_SOURCE_URI_NON_EXISTENT_CODE
|
protected static int |
PINGBACK_TARGET_URI_NON_EXISTENT_CODE
|
protected static int |
PINGBACK_TARGET_URI_NOT_ENABLED_CODE
|
protected static int |
PINGBACK_UPSTREAM_SERVER_ERROR_CODE
|
Fields inherited from class org.blojsom.extension.xmlrpc.handlers.AbstractBlojsomAPIHandler |
_authorizationProvider, _blog, _blogEntryExtension, _blogUser, _configuration, _fetcher, _httpServletRequest, _httpServletResponse, _servletConfig, AUTHORIZATION_EXCEPTION, AUTHORIZATION_EXCEPTION_MSG, INVALID_POSTID, INVALID_POSTID_MSG, NOBLOGS_EXCEPTION, NOBLOGS_EXCEPTION_MSG, PERMISSION_EXCEPTION, PERMISSION_EXCEPTION_MSG, UNKNOWN_EXCEPTION, UNKNOWN_EXCEPTION_MSG, UNSUPPORTED_EXCEPTION, UNSUPPORTED_EXCEPTION_MSG |
Fields inherited from interface org.blojsom.util.BlojsomMetaDataConstants |
BLOG_ENTRY_METADATA_AUTHOR, BLOG_ENTRY_METADATA_AUTHOR_EXT, BLOG_ENTRY_METADATA_TIMESTAMP, BLOG_METADATA_COMMENTS_DISABLED, BLOG_METADATA_HEADER, BLOG_METADATA_PINGBACKS_DISABLED, BLOG_METADATA_TRACKBACKS_DISABLED, SOURCE_ATTRIBUTE |
Fields inherited from interface org.blojsom.extension.xmlrpc.BlojsomXMLRPCConstants |
BLOG_XMLRPC_CONFIGURATION_IP, BLOG_XMLRPC_ENTRY_EXTENSION_IP, DEFAULT_BLOG_XMLRPC_ENTRY_EXTENSION, DEFAULT_XMLRPC_HANDLER_KEY |
Constructor Summary | |
PingbackHandler()
Construct a new Pingback handler |
Method Summary | |
protected java.lang.Integer |
addPingback(java.util.Map context,
java.lang.String category,
java.lang.String permalink,
java.lang.String title,
java.lang.String excerpt,
java.lang.String url,
java.lang.String blogName,
java.lang.String[] blogFileExtensions,
java.lang.String blogHome,
java.lang.String blogPingbackDirectory,
java.lang.String blogFileEncoding,
java.util.Map pingbackMetaData,
Pingback pingback,
java.lang.String id)
Add a pingback for a given blog ID |
protected BlogCategory |
getBlogCategory(BlogUser user,
javax.servlet.http.HttpServletRequest httpServletRequest)
Determine the blog category based on the request |
protected java.lang.String |
getExcerptFromSource(java.lang.String source,
java.lang.String targetURI)
Try to extract an excerpt from the source text. |
java.lang.String |
getName()
Gets the name of API Handler. |
protected java.lang.String |
getTitleFromSource(java.lang.String source)
Try to find the <title></title> tags from the source text |
java.lang.String |
ping(java.lang.String sourceURI,
java.lang.String targetURI)
Notifies the server that a link has been added to sourceURI, pointing to targetURI. |
void |
setBlogUser(BlogUser blogUser)
Attach a blog instance to the API Handler so that it can interact with the blog |
Methods inherited from class org.blojsom.extension.xmlrpc.handlers.AbstractBlojsomAPIHandler |
checkXMLRPCPermission, getBlogCategoryDirectory, setAuthorizationProvider, setConfiguration, setFetcher, setHttpServletRequest, setHttpServletResponse, setServletConfig |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String API_NAME
protected static final int PINGBACK_GENERIC_FAULT_CODE
protected static final int PINGBACK_SOURCE_URI_NON_EXISTENT_CODE
protected static final int PINGBACK_NO_LINK_TO_TARGET_URI_CODE
protected static final int PINGBACK_TARGET_URI_NON_EXISTENT_CODE
protected static final int PINGBACK_TARGET_URI_NOT_ENABLED_CODE
protected static final int PINGBACK_ALREADY_REGISTERED_CODE
protected static final int PINGBACK_ACCESS_DENIED_CODE
protected static final int PINGBACK_UPSTREAM_SERVER_ERROR_CODE
Constructor Detail |
public PingbackHandler()
Method Detail |
public void setBlogUser(BlogUser blogUser) throws BlojsomException
setBlogUser
in class AbstractBlojsomAPIHandler
blogUser
- an instance of BlogUser
BlojsomException
- If there is an error setting the blog user instance or properties for the handlerBlogUser
public java.lang.String getName()
getName
in class AbstractBlojsomAPIHandler
protected java.lang.String getTitleFromSource(java.lang.String source)
source
- Source URI text
null
if title tags are not foundprotected java.lang.String getExcerptFromSource(java.lang.String source, java.lang.String targetURI)
source
- Source URI texttargetURI
- Target URI from which to start the excerpt
null
if we cannot find the targetURIpublic java.lang.String ping(java.lang.String sourceURI, java.lang.String targetURI) throws org.apache.xmlrpc.XmlRpcException
sourceURI
- The absolute URI of the post on the source page containing the link to the target site.targetURI
- The absolute URI of the target of the link, as given on the source page.
org.apache.xmlrpc.XmlRpcException
protected java.lang.Integer addPingback(java.util.Map context, java.lang.String category, java.lang.String permalink, java.lang.String title, java.lang.String excerpt, java.lang.String url, java.lang.String blogName, java.lang.String[] blogFileExtensions, java.lang.String blogHome, java.lang.String blogPingbackDirectory, java.lang.String blogFileEncoding, java.util.Map pingbackMetaData, Pingback pingback, java.lang.String id) throws org.apache.xmlrpc.XmlRpcException
context
- Contextcategory
- Categorypermalink
- Permalinktitle
- Pingback titleexcerpt
- Pingback excerpturl
- Pingback URLblogName
- Pingback blog nameblogFileExtensions
- File extensionsblogHome
- Blog homeblogPingbackDirectory
- Pingbacks directoryblogFileEncoding
- Blog file encodingpingbackMetaData
- Pingback meta-datapingback
- Pingback
id
- ID to use for pingback
0
if the pingback was registered, otherwise a fault code is returned
org.apache.xmlrpc.XmlRpcException
protected BlogCategory getBlogCategory(BlogUser user, javax.servlet.http.HttpServletRequest httpServletRequest)
httpServletRequest
- Request
BlogCategory
of the requested category
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |