User Tools

Site Tools


en:user:berry_baskets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:user:berry_baskets [2019/10/02 01:39] – [Metadata] kjdonen:user:berry_baskets [2019/10/02 02:12] – [Activating Berry Baskets] kjdon
Line 1: Line 1:
-====== Berry Baskets (Greenstone 3) ======+====== Favourites/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.+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 Favourites/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.+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/interfaces/default/interfaceConfig.xml file. 
 +<code> 
 +<optionList> 
 +  <option name="favouriteBasket" value="true"/> 
 +  <option name="berryBasket" value="false"/> 
 +</optionList> 
 +</code> 
 +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, and turn it on/off.  
 + 
 +To make it turned on by default, edit paramDefault in web/sites/localsite/siteConfig.xml. 
 +<code> 
 +<format> 
 +  <paramDefault name="favouritebasket" value="on"/>  (or 'berrybasket'
 +</format> 
 +</code> 
 +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. 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.
Line 36: Line 55:
 If we have a collection that doesn't have Title metadata (eg from a CSV spreadsheet), we can modify the code to display dc.Title instead. If we have a collection that doesn't have Title metadata (eg from a CSV spreadsheet), we can modify the code to display dc.Title instead.
  
-1. Edit web/sites/localsite/siteConfig.xml and add dc.Title into the metadataList:+1. Edit web/sites/localsite/siteConfig.xml and add dc.Title into the BerryBasket service metadataList:
 <code> <code>
 <serviceRack name="BerryBaskets"> <serviceRack name="BerryBaskets">
Line 68: Line 87:
 } }
 </code> </code>
 +
 +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.
 +<code>
 +Replace:
 +for (var metaItem in doc) {
 +  if ( !default_metas.includes(metaItem)){
 +     metadata += " "+metaItem+": "+ doc[metaItem]+" ";
 +  }
 +}
 +
 +with:
 +for (var metaItem in doc) {
 +  if ( !default_metas.includes(metaItem) && metaItem != 'dc.Title'){
 +     metadata += " "+metaItem+": "+ doc[metaItem]+" ";
 +  }
 +}
 +</code>
 +
 +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(), add in the following:
 +<code>
 +if (doc['dc.Title']) {
 +  metadata += "dc.Title: "+doc['dc.Title']+"\n";
 +}
 +</code>
 +
  
  
en/user/berry_baskets.txt · Last modified: 2023/07/24 01:44 by kjdon