en:user:berry_baskets
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
en:user:berry_baskets [2018/07/29 23:38] – created kjdon | en:user:berry_baskets [2019/10/02 02:12] – [Activating Berry Baskets] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 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. | + | A favourites/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 ===== | + | ===== Activating |
- | The library administrator can enable the Berry Basket functionality by including the BerryBasket | + | By default, Favourites is active, but not turned on. |
+ | |||
+ | The library administrator can change to use Berry Baskets, or disable the functionality by editing options in the web/ | ||
+ | < | ||
+ | < | ||
+ | <option name=" | ||
+ | <option name=" | ||
+ | </ | ||
+ | </ | ||
+ | Set both to false to disable this completely. | ||
+ | |||
+ | While the functionality is active, it is not turned on for the user by default. (It will be for 3.10 and later). The user can go to Preferences, | ||
+ | |||
+ | To make it turned on by default, edit paramDefault in web/ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | enable the Berry Basket functionality by including the BerryBasket | ||
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. | 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/ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Then restart Tomcat. | ||
+ | |||
+ | By default, these specified metadata elements will just get added to the item's display, e.g. at the bottom of the metadata lists in the ' | ||
+ | |||
+ | If you want to customise the display, take a look at the javascript code. web/ | ||
+ | |||
+ | === Using dc.Title instead of Title in Berry Basket display === | ||
+ | |||
+ | By default, the berry basket entries display Title metadata. If the linked item is a section, it will also display the book Title (root_Title). | ||
+ | |||
+ | If we have a collection that doesn' | ||
+ | |||
+ | 1. Edit web/ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 2. Edit web/ | ||
+ | |||
+ | Look for generateDocDisplay and edit it: | ||
+ | < | ||
+ | Replace: | ||
+ | a.href=generateURL(doc); | ||
+ | a.appendChild(document.createTextNode(doc[' | ||
+ | with either: | ||
+ | 1. Use this if all documents have dc.Title instead of Title | ||
+ | |||
+ | a.href=generateURL(doc); | ||
+ | a.appendChild(document.createTextNode(doc[' | ||
+ | |||
+ | or: | ||
+ | 2. use this if some documents have Title and some have dc.Title | ||
+ | |||
+ | a.href=generateURL(doc); | ||
+ | if (doc[' | ||
+ | | ||
+ | } else if (doc[' | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This will now display dc.Title instead of Title for the title link to the document in the full view. | ||
+ | However, as dc.Title is not defined as one of the standard metadatas, it also gets added to the end of the display. To prevent this, either add it to the default_metas list at the top of the file, or modify generateDocDisplay further. | ||
+ | < | ||
+ | Replace: | ||
+ | for (var metaItem in doc) { | ||
+ | if ( !default_metas.includes(metaItem)){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
+ | with: | ||
+ | for (var metaItem in doc) { | ||
+ | if ( !default_metas.includes(metaItem) && metaItem != ' | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | In the text and email view, all metadata is displayed in a list: First the hard-wired ones, then any that are not in the default list. So the dc.Title metadata just gets added to the list. If you added dc.Title to default_metas list as mentioned above, then you need to manually add it to the display to get it to appear. | ||
+ | |||
+ | For example, in populateUrlsAndMetadata(), | ||
+ | < | ||
+ | if (doc[' | ||
+ | metadata += " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Document Link ==== | ||
+ | |||
+ | 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/ | ||
+ | |||
+ | There are three variables at the top of this file: | ||
+ | < | ||
+ | var default_link_type = " | ||
+ | var source_link_collections = new Array(); | ||
+ | var document_link_collections = new Array(); | ||
+ | </ | ||
+ | |||
+ | The default_link_type specifies whether links are to the Greenstone versions (" | ||
+ | |||
+ | For example, if most collections use document, but pdfcoll and exampapers use source, then set the variables like this: | ||
+ | |||
+ | < | ||
+ | var default_link_type = " | ||
+ | var source_link_collections = [" | ||
+ | </ | ||
+ | |||
+ | Similarly, use document_link_collections to set the exceptions if you have made the default " | ||
+ | |||
+ | ===== 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/ | ||
+ | < | ||
+ | #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:// | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # port number, | ||
+ | # | ||
+ | # | ||
+ | # set the following to ssl or tls | ||
+ | # | ||
+ | </ |
en/user/berry_baskets.txt · Last modified: 2023/07/24 01:44 by kjdon