Dashboard > blojsom > ... > Developers Guide > Pingback
  blojsom Log In   View a printable version of the current page.  
  Pingback
Added by David Czarnecki, last edited by David Czarnecki on Mar 01, 2006  (view change)
Labels: 
(None)

About Pingback

Pingback "is a method for web authors to request notification when somebody links to one of their documents. Typically, web publishing software will automatically inform the relevant parties on behalf of the user, allowing for the possibility of automatically creating links to referring documents."

Availability

The Pingback XML-RPC handler is available as of blojsom 2.23. There is a Pingback plugin that complements the Pingback handler.

Installation and Setup

Add the following line to your /WEB-INF/xmlrpc.properties file.

pingback=org.blojsom.extension.xmlrpc.handlers.PingbackHandler

Add the following to your /WEB-INF/web.xml file with the other <filter-mapping>...</filter-mapping> elements.

<filter-mapping>
    <filter-name>PermalinkFilter</filter-name>
    <servlet-name>blojsomxmlrpc</servlet-name>
</filter-mapping>

You can disable or enable pingbacks in your blog through the web administration console. Alternatively, you may add the following line to your /WEB-INF/(blog-id)/blog.properties file.

blog-pingbacks-enabled=true

Usage

The following Velocity snippet can be added to your template that outputs page information. Example, asual-head.vm.

#if ($BLOJSOM_PERMALINK)
    #foreach ($entry in $BLOJSOM_ENTRIES)
        #if ($velocityCount == 1)
        <!-- Pingback link -->
        #XMLRPCLink($entry 'xmlrpc')
        <link rel="pingback" href="$xmlrpcLink" />
        #end
    #end
#end

You can replace 'xmlrpc' with the name to which blojsom's XML-RPC servlet is mapped.

Setting a prefix for pingback e-mail messages

The default subject prefix for pingback e-mails is set to [blojsom] Pingback on: . If you would like to configure a different prefix for e-mail messages, set the plugin-pingback-email-prefix property in an individual /WEB-INF/(blog-id)/blog.properties. For example:

plugin-pingback-email-prefix=[your.blog.com] Pingback:

Pingback E-mail Templates

The pingback plugin uses Velocity templates to create the text for the e-mail that gets sent to the author of an entry when a pingback is made to that entry. There are two templates, org/blojsom/plugin/pingback/pingback-plugin-email-template-html.vm and org/blojsom/plugin/pingback/pingback-plugin-email-template-text.vm. The HTML template is used for the HTML portion of the e-mail message, while the text template is used for the text portion of the e-mail message for mail clients that cannot display HTML e-mail.

They are located inside the blojsom plugins JAR file in the blojsom web applications /WEB-INF/lib directory.

You can change the templates on a per-blog basis. Under your blog's templates directory, create the directory hierarchy, org/blojsom/plugin/pingback/. Create either the pingback-plugin-email-template-html.vm or pingback-plugin-email-template-text.vm template file. You can use the original template files form the blojsom plugin JAR file as a basis for your new template.

The following table describes the objects available to the pingback e-mail templates.

Variable Type Description
BLOJSOM_BLOG org.blojsom.blog.Blog Blog information.
BLOJSOM_USER org.blojsom.blog.BlogUser BlogUser information.
BLOJSOM_PINGBACK_PLUGIN_PINGBACK org.blojsom.blog.Pingback Pingback.
BLOJSOM_PINGBACK_PLUGIN_BLOG_ENTRY org.blojsom.blog.BlogEntry Entry.

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators