Integrates XWiki and bibsonomy
Type Doc (Velocity Macro)
Developed by

Yishay Mor

Rating
Rate!
Honeystore Strap Beach Sandals Shoes Tassels Red Flats Flats for Women's Fringed Leather 0 Votes
License GNU Lesser General Public License 2.1

Table of contents

It allows you to display publications on an XWiki page based on their tag in bibsonomy, and also to discuss individual entries.

This script is currently broken. There is a simple workaround, and a simple way to fix it, but I can't do it right now. Any help will be welcome, please contact me: yishaym at gmail dot com

this script pulls data from bibsonomy.org using RSS and parses the feed:

#set( $feed = $xwiki.feed.getFeeds("http://www.bibsonomy.org/publrssN/tag/ ${tag Women's Tassels Flats Shoes Strap for Honeystore Sandals Beach Red Leather Fringed Flats }?items=1000"))
#foreach ( $entry in $feed.entries)
  #set( $val = $entry.getDescription().value)
  ## get title
  #set( $index = $val.indexOf("bmtitle") +10)
  #set( $val = $val.substring( $index))
  #set( $index = $val.indexOf("
"))
  #set( $headline = $val.substring(0, $index))
  #set( $index = $index +6)
Flats Leather Red Tassels Women's Fringed Shoes Beach Honeystore Sandals for Strap Flats
  #set( $val = $val.substring( $index))
for Shoes Beach Sandals Flats Strap Fringed Flats Honeystore Leather Tassels Red Women's
  etc..
#end

As was bound to happen at some point, the format of the feed content has changed, and the code is now broken. As a quick fix, I replaced it with:

#set( $feed = $xwiki.feed.getFeeds("http://www.bibsonomy.org/publrssN/tag/ ${tag }?items=1000"))
#foreach ( $entry in $feed.entries)
$entry.getDescription().value)

I don't know if the change in the feed format is on the provider's side (i.e. bibsonomy) or on XWiki's side. In any case, I should use bibsonomy's API instead: http://www.bibsonomy.org/help/doc/api.html

Anyone interested in helping?

You can see a demo here: http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/scripts/BibsonomyDemo and the code here: http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/scripts/Bibsonomy?viewer=code&showlinenumbers=0

Its a very crude piece of code, I needed something for a project ASAP, and didn't have the time to do a decent job. But it works, and its a good proof of concept. If anyone is up to writing a cleaner, more efficient version - please do, and share.

Red Flats Fringed for Honeystore Tassels Flats Leather Strap Beach Sandals Shoes Women's This gizmo is pure velocity. To use it, copy the code below into a page on your site, say "script.Bibsonomy" and then, on any other page, you can use it by:

#includeInContext("scripts.Bibsonomy")
#publications_pp("MyTag")

Copy this code

##################################################################################################
## This is a dirty, ugly hack. it does the job, but its probably very inefficient and unstable. ##
##################################################################################################
## The following is a set of scripts which allow you to display a list of publications from     ##
## bibsonomy. This list is retrieved from the RSS feed of a tag. There's no option to limit the ##
## list to a specific user, etc. The easiest way to use this is to add the following two lines  ##
## to your page:                                                                                ##
##    #includeInContext("scripts.Bibsonomy")                                                    ##
##    #publications_pp("MyTag")                                               ##
##################################################################################################
## to make this code decent, we should use the bibsnomy API, retrieve the list in XML and       ##
## process that, probably in groovy.                                                            ##
##################################################################################################
## This code is provided as is, with no warranties, guaranties, or liabilities.                 ##
Flats Leather Strap Sandals Honeystore for Shoes Tassels Fringed Women's Flats Beach Red
## It is licensed under a Creative Commons BY-NC-SA 2.0 UK: England & Wales License.            ##
## http://creativecommons.org/licenses/by-nc-sa/2.0/uk/                                         ##
## Yishay Mor, yishaym@gmail.com                                                                ##
##################################################################################################


#set ($basename = $doc.getFullName()+".")
#set ($createUrl = "?create=")

#### create a new discussion page for bibsonomy entry
#macro(createPage $item $pagename)
#set ($newdoc = $xwiki.getDocument($pagename))
$newdoc.setParent($doc.getFullName())
#set ($content = '
'+$item.getDescription().value+'
')
$newdoc.setContent($content)
$newdoc.save()
## this should work, but needs programming rights:
## $context.setDoc($newdoc)


#end ### createPage

#### display a bibsonomy tag feed
#macro(bibsonomyfeed $feed $label $raw)
#if ($label)

$label


#end
#foreach ($entry in $feed.entries)
$entry.getDescription().value


#if(0)
#set($val = $entry.getDescription().value)
#if(!$raw)
  ## get title
  #set($index = $val.indexOf("bmtitle") +10)
  #set($val = $val.substring($index))
  #set($index = $val.indexOf("
"))
  #set($headline = $val.substring(0, $index))
Womens Tan Sandal Riviera Rip Curl P7nq5Ppv  #set($index = $index +6)
  #set($val = $val.substring($index))

----
  

$headline


  ## xtract bibsonomy key
  #set ($index = $headline.indexOf("/bibtex/") + 8)
  #if ($index <0) #set($index = 0) #end
  #set ($bibkey = $headline.substring($index))
  #set ($index  = $bibkey.indexOf("/"))
  #if ($index <0) #set($index = 0) #end
  #set ($bibkey = $bibkey.substring(0, $index))
  ## generate link to discussion doc
  #set($itempagename = $basename+$bibkey)
  #if ($request.create == $bibkey)
Sandals Beach Shoes Red Leather Fringed Women's Flats Flats Honeystore Strap Tassels for
     #createPage($entry $itempagename)
  #end

  ## page exists?
  #if ($xwiki.exists($itempagename))
     #set ($comcount = 0)
     #set ($bibdoc = $xwiki.getDocument($itempagename))
     #set ($comcount = $bibdoc.getComments().size())
     $comcount comments
  #else
     Discuss (new)
Tassels for Red Strap Flats Beach Flats Women's Shoes Honeystore Fringed Sandals Leather
  #end
  #if ($request.showabstracts.equalsIgnoreCase("true"))
     ## do nothing
  #else
Ankle nubuck Vanna Strappy Bootie Rockport Women's Black YctwFAzq     ## cut after the reference
     #set ($index = $val.indexOf("
") +6)
     #if ($index <0) #set($index = 0) #end
     #set ($val = $val.substring(0,$index))
  #end


{pre}

#else
----
{pre}
#end ## raw
$val
{/pre}

#end
Tassels Sandals Red Flats Strap Honeystore Fringed Leather Women's Shoes Flats Beach for
#end
#end #### macro(bibsonomy $tag)

############## bibsonomy publications feed
#macro(publications $tag)
#if ($request.filter && $request.filter.length() > 0)
#set ($tag = $tag+'+'+$request.filter)
#end
#set($feed = $xwiki.feed.getFeeds("http://www.bibsonomy.org/publrssN/tag/${tag}?items=1000"))
#set($title = ''+$tag+' publications' )
#bibsonomyfeed( $feed $title false)
for Honeystore Fringed Women's Sandals Shoes Leather Red Flats Beach Flats Strap Tassels
#end
############## /bibsonomy publications feed

############## bibsonomy publications feed with controls
#macro(publications_pp $tag)

&nbsp;Show abstracts&nbsp;




#publications($tag)
#end
############## /bibsonomy publications feed with controls
#macro(publicationspp $tag)
#publications_pp($tag)
#end

############## bibsonomy links feed
#macro(links $tag)
#set($feed = $xwiki.feed.getFeeds("http://www.bibsonomy.org/rss/tag/${tag}?items=1000"))
#set($title = ''+$tag+' links' )
#bibsonomyfeed( $feed $title true)
#end
############## /bibsonomy publications feed
Street Pewter Sandal Easy Flat Women's Bolt 7dxwYRg
############## bibsonomy all NOT WORKING
#macro(bibsonomyall $tag)

#publications( $tag)


#links( $tag)


#end
############## /bibsonomy all



##publications("XWiki")
Leather Shoes Sandals Beach Flats Tassels for Fringed Women's Honeystore Flats Strap Red
for Sandals Beach Leather Red Tassels Shoes Flats Fringed Flats Honeystore Strap Women's
Tags:
Created by Yishay Mor on 2008/06/18 11:45
       

No comments for this page

Honeystore Beach Leather for Women's Flats Sandals Red Shoes Tassels Fringed Strap Flats vnvOr746 Honeystore Beach Leather for Women's Flats Sandals Red Shoes Tassels Fringed Strap Flats vnvOr746 Honeystore Beach Leather for Women's Flats Sandals Red Shoes Tassels Fringed Strap Flats vnvOr746 Honeystore Beach Leather for Women's Flats Sandals Red Shoes Tassels Fringed Strap Flats vnvOr746 Honeystore Beach Leather for Women's Flats Sandals Red Shoes Tassels Fringed Strap Flats vnvOr746