Berry Baskets (Greenstone 3)

A berry basket functionality has been implemented in Greenstone 3. This allows the user to collect up a set of interesting of useful documents as she is browsing through a library. Once they are finished, they can view the basket of links, and email it to themselves.

Activating Berry Baskets

The library administrator can enable the Berry Basket functionality by including the BerryBasket serviceRack in the siteConfig.xml file. This is present by default: commenting it out will remove that functionality from the library.

The user can turn on this feature in the Preferences page. Once it is activated, little berries will appear in browsing lists and search results. These berries can be dragged into the basket that appears on the right hand side of the page.

Customizing Berry Baskets

Metadata

If you want to add an extra metadata field to the display, then you need to specify that metadata in web/sites/localsite/siteConfig.xml. Look for the BerryBasket serviceRack and add a metadataList containing the desired elements. For example:

<serviceRack name="BerryBaskets">
  <metadataList>
    <metadata name="dc.Creator"/>
    <metadata name="dc.Subject"/>
  </metadataList>
</serviceRack>

By default, these will just get added to the item's display. If you want to customise the display, take a look at the javascript code. web/interfaces/default/js/berrybasket/berrybasket.js, function showBasket() displays the small version on other pages, while web/interfaces/default/js/berrybasket/berrycheckout.js functions showFullView(), showTextView() and showEmail() display the different basket views. In particular, populateUrlsAndMetadata() displays the links plus metadata entries for Text and Email views.

By default the link in the basket will be to the Greenstone HTML version of the document. You can change this to link to the source document, eg the PDF version.

Edit web/interfaces/default/js/berrybasket/berrycheckout.js.

There are three variables at the top of this file:

var default_link_type = "document"; // or "source"
var source_link_collections = new Array();
var document_link_collections = new Array();

The default_link_type specifies whether links are to the Greenstone versions ("document") or to the source eg PDF versions ("source"); If you then want to have a few collections done the opposite way, use source_link_collections/document_link_collections to list the exceptions.

For example, if most collections use document, but pdfcoll and exampapers use source, then set the variables like this:

var default_link_type = "document";
var source_link_collections = ["pdfcoll", "exampapers"];

Similarly, use document_link_collections to set the exceptions if you have made the default "source".

Setting up the Email Results Functionality

This applies to nightly releases and the upcoming 3.09 release. Emailing the results didn't work properly in 3.08.

Please edit resources/web/global.properties.in (31 July 2018 and later binaries) or resources/web/global.properties (30 July 2018 or earlier binaries). Set your mail server, username and password etc by uncommenting the lines and setting the proper values.

#outgoing mail setup.
#  by default it will use port 25 on localhost. Uncomment and modify 
# these settings to use another mail server
# sample values are for gmail setup
# Note for gmail, you will need to enable account access for less secure apps
# for this to work. https://www.google.com/settings/security/lesssecureapps
#mail.smtp.host=smtp.gmail.com
#mail.smtp.username=xxx@gmail.com
#mail.smtp.password=xxxpassword
# port number,  eg for gmail: 465 (ssl) 587 (tls)
#mail.smtp.port=587
#mail.from=xxx@gmail.com
# set the following to ssl or tls
#mail.security=tls