en:user:favourites
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:user:favourites [2023/07/24 01:47] – updated version info kjdon | en:user:favourites [2023/07/24 21:48] – [Customizing Favourites] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Greenstone 3 Favourites ====== | ||
- | ====== Favourites/Berry Baskets (Greenstone 3) ====== | + | //[ This page documents favourites for Greenstone 3 version 3.11. For 3.10 and earlier versions, please see our [[en: |
- | //[ This version | + | The favourites functionality allows the user to collect up a set of interesting or useful documents as she is browsing through the library. Once they are finished, they can view the basket of links, |
- | A favourites/berry basket functionality has been implemented in Greenstone 3. This allows the user to collect up a set of interesting or useful documents as she is browsing | + | When favourites |
- | Favourites - a star is displayed | + | A link to the favourites list is also displayed |
- | Berry Baskets - little berries are displayed by each document. Drag a berry on to the basket to add that document. | + | ===== Activating Favourites ===== |
- | The basket itself is displayed on the side of the page. Clicking the link in the basket will take you to a full view of the contents of the basket. | + | A library can enable |
- | ===== Activating | + | A user can enable/ |
- | By default, Favourites is active, not Berry Baskets. | ||
- | |||
- | The library administrator can change to use Berry Baskets, or disable the functionality altogether 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/off by default, set a paramDefault in web/ | ||
< | < | ||
< | < | ||
- | < | + | < |
</ | </ | ||
</ | </ | ||
- | ===== Customizing | + | ===== Customizing |
- | ==== Metadata ==== | + | The links in the list of favourites can now be customised using format statements (like we use to customise document lists for browsing and searching). |
- | If you want to add an extra metadata field to the display, then you need to specify that metadata | + | The content of the favourites page is defined |
- | < | + | The default templace for the documentNode is below. This will be used if there is no alternative specified in the FavouriteBasket ServiceRack, |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | </ | + | |
- | 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/ | ||
- | |||
- | === Example: 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/ | ||
< | < | ||
- | <serviceRack name="BerryBaskets"> | + | <xsl: |
- | <metadataList> | + | |
- | < | + | </xsl: |
- | </metadataList> | + | <xsl: |
- | </ | + | |
- | </code> | + | </xsl:template> |
- | + | ||
- | 2. Edit web/interfaces/ | + | |
- | + | ||
- | Look for generateDocDisplay and edit it: | + | |
- | <code> | + | |
- | 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 | + | The displayFavourite template displays a link to the source doc (eg pdf/image etc) plus the document |
- | However, as dc.Title | + | |
- | < | + | |
- | Replace: | + | |
- | for (var metaItem | + | |
- | if ( !default_metas.includes(metaItem)){ | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | with: | + | Web/ |
- | for (var metaItem | + | |
- | 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 | + | A collection can specify its own customisation for documents from that collection |
- | For example, in populateUrlsAndMetadata(), | + | For example: |
< | < | ||
- | if (doc[' | + | < |
- | metadata | + | |
- | } | + | < |
+ | < | ||
+ | </xsl:template> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
+ | The first template uses the default display template, but adds on dc.Creator metadata. The second template does away with the default altogether, and displays the dc.Title metadata, followed by the collection name in brackets. A pretty useless display, as it contains no link to the document, but just for illustrative purposes. | ||
+ | ===== Setting up the Email Results Functionality ===== | ||
- | ==== Document Link ==== | + | The favourites list can be emailed out using a mail server, or by using the user's existing mail client. |
- | By default | + | Mail server: |
+ | * the results | ||
+ | * requires | ||
+ | * works for all users | ||
- | Edit web/ | + | User's mail client: |
- | + | * doesn' | |
- | There are three variables at the top of this file: | + | |
- | < | + | * Won't work if the user has no default |
- | 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, | + | |
- | + | ||
- | < | + | |
- | 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 | + | If you have a mail server set up on the machine running tomcat, or you want to use another existing mail server, |
- | Please edit resources/ | + | Please edit resources/ |
< | < |
en/user/favourites.txt · Last modified: 2024/02/12 23:42 by kjdon