Changeset 16680


Ignore:
Timestamp:
2008-08-08T12:17:50+12:00 (16 years ago)
Author:
anna
Message:

Improved customization of metadata sets/elements used in the Depositor. Two aspects involved: the front-end user interface (depositoraction.cpp) and back-end GLI format panel. Associated changes include the depositor's macro file, GLI dictionary and GLI help document

Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/classes/dictionary.properties

    r16668 r16680  
    146146CDM.GUI.SuperCollection:Cross-Collection Search
    147147CDM.GUI.Translation:Translate Text
     148CDM.GUI.DepositorMetadata:Depositor Metadata
    148149CDM.HelpButton:Help for this screen
    149150CDM.HelpButton_Tooltip:Open up the GLI help for this screen
     
    279280CDM.TranslationManager.Translation:Translated Text
    280281CDM.TranslationManager.Translation_Tooltip:Enter the translation of the string here
     282CDM.DepositorMetadataManager.Warning:At least one metadata element should be selected.
    281283#*******************
    282284#
  • gli/trunk/help/en/help.xml

    r16650 r16680  
    440440<Text id="fc-m3">This pane shows the contents of the collection's extra.dm macro file. This is where collection specific macros can be defined. To learn more about macros, see Chapter 3 of the Greenstone Developer's Guide.</Text>
    441441</Section>
     442<Section name="depositormetadatasettings">
     443<Title>
     444<Text id="dm-1">Depositor Metadata</Text>
     445</Title>
     446<Text id="dm-2">The Greenstone Depositor enables user to add new items into an existing collection through web interface. This section describes the Depositor Metadata pane, where you can specify which metadata fields should be used to describe the new items added through Depositor. Any metadata sets that have been associated with the current collection will be available for selection. If there is no other metadata set than the "Greenstone Extracted Metadata Set" associated to the collection, the "Dublin Core Metadata Set" will be used as default. To learn more about the Depositor, see the online tutorial exercise at http://wiki.greenstone.org/wiki/gsdoc/tutorial/en/depositor.htm. Under the "Format" tab, click "Depositor Metadata".</Text>
     447<Text id="dm-3">The Depositor Metadata panel shows a checklist of available metadata fields. If there were more than one metadata sets associated with the collection, two adjacent metadata sets are displayed with different colors. Hover the mouse over a metadata element: a tool-tip displaying its description will appear.</Text>
     448<Text id="dm-4">Check those you want to be used to describe new items when they are deposited through the Depositor. A drop-down list contains two components will appear right after the element. This allows you to specify the input container of the element in the web interface. "text" means that a single text input will be used, whereas "textarea" means that a multi-line text input will be used. Select an appropirate one for the field.</Text>
     449<Text id="dm-5">At least one metadata element must be selected. If there is only one selected element in the list, de-select it will pop-up a warning message: <AutoText key="glidict::CDM.DepositorMetadataManager.Warning"/>.</Text>
     450</Section>
    442451</Section>
    443452<Section name="miscellaneous">
  • gli/trunk/help/en/help_index.xml

    r16650 r16680  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <Document><Section name="introduction"><Title>Introduction</Title><Section name="ofmiceandmenus"><Title>Of Mice and Menus</Title></Section><Section name="howtoavoidthisdocument"><Title>How to Avoid Reading This Document</Title></Section></Section><Section name="startingoff"><Title>Starting Off</Title><Section name="creatingacollection"><Title>Creating a New Collection</Title></Section><Section name="savingacollection"><Title>Saving the Collection</Title></Section><Section name="openingacollection"><Title>Opening an Existing Collection</Title></Section><Section name="deletingcollections"><Title>Deleting Collections</Title></Section></Section><Section name="downloadingfiles"><Title>Downloading Files from the Internet</Title><Section name="themirrorview"><Title>The Download view</Title></Section></Section><Section name="collectingfiles"><Title>Collecting Files for Your Collection</Title><Section name="thegatherview"><Title>The Gather View</Title></Section><Section name="creatingshortcuts"><Title>Creating A Shortcut in the Workspace Tree</Title></Section><Section name="creatingfolders"><Title>Creating Folders</Title></Section><Section name="addingfiles"><Title>Adding Files</Title></Section><Section name="replacingfiles"><Title>Renaming and Replacing Files</Title></Section><Section name="removingfiles"><Title>Removing Files</Title></Section><Section name="explodingfiles"><Title>"Exploding" Metadata Files</Title></Section><Section name="filteringthetree"><Title>Filtering the Trees</Title></Section></Section><Section name="enrichingacollection"><Title>Enriching Your Collection with Metadata</Title><Section name="theenrichview"><Title>The Enrich View</Title></Section><Section name="selectingmetadatasets"><Title>Selecting Metadata Sets</Title></Section><Section name="appendingmetadata"><Title>Appending New Metadata</Title></Section><Section name="addingpreviouslydefinedmetadata"><Title>Adding Previously Defined Metadata</Title></Section><Section name="updatingmetadata"><Title>Editing or Removing Metadata</Title></Section><Section name="reviewingmetadata"><Title>Reviewing Assigned Metadata</Title></Section><Section name="importingpreviouslyassignedmetadata"><Title>Importing Previously Assigned Metadata</Title></Section></Section><Section name="designingacollection"><Title>Configuring Your Collection</Title><Section name="thedesignview"><Title>The Design View</Title></Section><Section name="plugins"><Title>Document Plugins</Title></Section><Section name="searchindexes"><Title>Search Indexes</Title></Section><Section name="partitionindexes"><Title>Partition Indexes</Title><Section name="definefilters"><Title>Define Filters</Title></Section><Section name="assignpartitions"><Title>Assign Partitions</Title></Section><Section name="assignlanguages"><Title>Assign Languages</Title></Section></Section><Section name="classifiers"><Title>Browsing Classifiers</Title></Section></Section><Section name="producingthecollection"><Title>Producing Your Collection</Title><Section name="thecreateview"><Title>The Create View</Title></Section><Section name="builderrors"><Title>Errors in collection building</Title></Section><Section name="expertbuilding"><Title>Create view in Expert mode</Title></Section></Section><Section name="formattingacollection"><Title>Customizing Your Collection's Appearance</Title><Section name="theformatview"><Title>The Format View</Title></Section><Section name="generalsettings"><Title>General</Title></Section><Section name="searchmetadatasettings"><Title>Search</Title></Section><Section name="formatstatements"><Title>Format Features</Title></Section><Section name="translatetext"><Title>Translate Text</Title></Section><Section name="xcollectionsearching"><Title>Cross-Collection Search</Title></Section><Section name="collectionspecificmacros"><Title>Collection Specific Macros</Title></Section></Section><Section name="miscellaneous"><Title>Miscellaneous</Title><Section name="preferences"><Title>Preferences</Title></Section><Section name="fileassociations"><Title>File Associations</Title></Section><Section name="exporting"><Title>Exporting collections to other formats</Title></Section><Section name="exportingcollections"><Title>Exporting Collections to CD/DVD</Title></Section></Section></Document>
     2<Document><Section name="introduction"><Title>Introduction</Title><Section name="ofmiceandmenus"><Title>Of Mice and Menus</Title></Section><Section name="howtoavoidthisdocument"><Title>How to Avoid Reading This Document</Title></Section></Section><Section name="startingoff"><Title>Starting Off</Title><Section name="creatingacollection"><Title>Creating a New Collection</Title></Section><Section name="savingacollection"><Title>Saving the Collection</Title></Section><Section name="openingacollection"><Title>Opening an Existing Collection</Title></Section><Section name="deletingcollections"><Title>Deleting Collections</Title></Section></Section><Section name="downloadingfiles"><Title>Downloading Files from the Internet</Title><Section name="themirrorview"><Title>The Download view</Title></Section></Section><Section name="collectingfiles"><Title>Collecting Files for Your Collection</Title><Section name="thegatherview"><Title>The Gather View</Title></Section><Section name="creatingshortcuts"><Title>Creating A Shortcut in the Workspace Tree</Title></Section><Section name="creatingfolders"><Title>Creating Folders</Title></Section><Section name="addingfiles"><Title>Adding Files</Title></Section><Section name="replacingfiles"><Title>Renaming and Replacing Files</Title></Section><Section name="removingfiles"><Title>Removing Files</Title></Section><Section name="explodingfiles"><Title>"Exploding" Metadata Files</Title></Section><Section name="filteringthetree"><Title>Filtering the Trees</Title></Section></Section><Section name="enrichingacollection"><Title>Enriching Your Collection with Metadata</Title><Section name="theenrichview"><Title>The Enrich View</Title></Section><Section name="selectingmetadatasets"><Title>Selecting Metadata Sets</Title></Section><Section name="appendingmetadata"><Title>Appending New Metadata</Title></Section><Section name="addingpreviouslydefinedmetadata"><Title>Adding Previously Defined Metadata</Title></Section><Section name="updatingmetadata"><Title>Editing or Removing Metadata</Title></Section><Section name="reviewingmetadata"><Title>Reviewing Assigned Metadata</Title></Section><Section name="importingpreviouslyassignedmetadata"><Title>Importing Previously Assigned Metadata</Title></Section></Section><Section name="designingacollection"><Title>Configuring Your Collection</Title><Section name="thedesignview"><Title>The Design View</Title></Section><Section name="plugins"><Title>Document Plugins</Title></Section><Section name="searchindexes"><Title>Search Indexes</Title></Section><Section name="partitionindexes"><Title>Partition Indexes</Title><Section name="definefilters"><Title>Define Filters</Title></Section><Section name="assignpartitions"><Title>Assign Partitions</Title></Section><Section name="assignlanguages"><Title>Assign Languages</Title></Section></Section><Section name="classifiers"><Title>Browsing Classifiers</Title></Section></Section><Section name="producingthecollection"><Title>Producing Your Collection</Title><Section name="thecreateview"><Title>The Create View</Title></Section><Section name="builderrors"><Title>Errors in collection building</Title></Section><Section name="expertbuilding"><Title>Create view in Expert mode</Title></Section></Section><Section name="formattingacollection"><Title>Customizing Your Collection's Appearance</Title><Section name="theformatview"><Title>The Format View</Title></Section><Section name="generalsettings"><Title>General</Title></Section><Section name="searchmetadatasettings"><Title>Search</Title></Section><Section name="formatstatements"><Title>Format Features</Title></Section><Section name="translatetext"><Title>Translate Text</Title></Section><Section name="xcollectionsearching"><Title>Cross-Collection Search</Title></Section><Section name="collectionspecificmacros"><Title>Collection Specific Macros</Title></Section><Section name="depositormetadatasettings"><Title>Depositor Metadata</Title></Section></Section><Section name="miscellaneous"><Title>Miscellaneous</Title><Section name="preferences"><Title>Preferences</Title></Section><Section name="fileassociations"><Title>File Associations</Title></Section><Section name="exporting"><Title>Exporting collections to other formats</Title></Section><Section name="exportingcollections"><Title>Exporting Collections to CD/DVD</Title></Section></Section></Document>
  • gli/trunk/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r14679 r16680  
    7878    /** The text translation manager. */
    7979    static public TranslationView translation_manager;
     80    /** A manager of configuring depositor metadata */
     81    static public DepositorMetadataManager depositormetadata_manager;
    8082    /** These mark what needs to happen when building a collection where ONLY design options have been changed.
    8183        The build requirements of the higher numbers must include doing everything from the lower numbers. */
     
    128130    supercollection_manager = new SuperCollectionManager(collect_config.getSuperCollection());
    129131    searchmetadata_manager = new SearchMetadataManager();
     132    depositormetadata_manager = new DepositorMetadataManager();
    130133    translation_manager = new TranslationView();
    131134    if (Gatherer.GS3) {
     
    160163    supercollection_manager.destroy();
    161164    supercollection_manager = null;
     165    depositormetadata_manager.destroy();
     166    depositormetadata_manager = null;
    162167    translation_manager.destroy();
    163168    translation_manager = null;
     
    178183    language_manager.modeChanged(mode);
    179184    searchmetadata_manager.modeChanged(mode);
     185    depositormetadata_manager.modeChanged(mode);
    180186    }
    181187
  • gli/trunk/src/org/greenstone/gatherer/gui/FormatPane.java

    r14047 r16680  
    7070            contents = new String []{ "CDM.GUI.General", "CDM.GUI.SearchMetadata", "CDM.GUI.Formats", "CDM.GUI.Translation" };
    7171        } else {
    72             contents = new String []{ "CDM.GUI.General", "CDM.GUI.SearchMetadata", "CDM.GUI.Formats", "CDM.GUI.Translation", "CDM.GUI.SuperCollection","CDM.GUI.Macros" };
     72            contents = new String []{ "CDM.GUI.General", "CDM.GUI.SearchMetadata", "CDM.GUI.Formats", "CDM.GUI.Translation", "CDM.GUI.SuperCollection","CDM.GUI.Macros", "CDM.GUI.DepositorMetadata" };
    7373        }
    7474        JPanel side_panel = new JPanel ();
     
    170170            return CollectionDesignManager.supercollection_manager.getControls ();
    171171        }
     172    if(type.equals ("CDM.GUI.DepositorMetadata")) {
     173        return CollectionDesignManager.depositormetadata_manager.getControls ();
     174    }
    172175        return null;
    173176    }
  • gsdl/trunk/macros/deposit.dm

    r14738 r16680  
    1616# collector
    1717_globallinks_ {_homelink_}
     18
     19# metadata fields that will be displayed in the step1 page,
     20# this is determined by the depositormetadata macro defined in the collection's collect.cfg
     21_metadataconf_ {var DepositorMDFields = new Array();}
     22
     23# store any existing metadata values
     24_cachedmetadatavalues_ {var CachedMDValues = new Array();}
    1825
    1926#######################################################################
     
    146153
    147154#here goes the "memorization" macros for each form field. 
    148 _di1md.dc.Title_ {_If_("_:cgiargdi1md.dc.Title_" eq  "_cgiargdi1md.dc.Title_",_cgiargdi1md.dc.Title_,)}
    149 _di1md.dc.Creator_ {_If_("_:cgiargdi1md.dc.Creator_" eq  "_cgiargdi1md.dc.Creator_",_cgiargdi1md.dc.Creator_,)}
    150 _di1md.dc.Description_ {_If_("_:cgiargdi1md.dc.Description_" eq  "_cgiargdi1md.dc.Description_",_cgiargdi1md.dc.Description_,)}
     155#_di1md.Title_ {_If_("_:cgiargdi1md.Title_" eq  "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
     156#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq  "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
     157#_di1md.Description_ {_If_("_:cgiargdi1md.Description_" eq  "_cgiargdi1md.Description_",_cgiargdi1md.Description_,)}
     158#_di1md.Subject_ {_If_("_:cgiargdi1md.Subject_" eq "_cgiargdi1md.Subject_",_cgiargdi1md.Subject,)}
    151159
    152160_step1scriptextra_ {
     161
     162_metadataconf_
     163_cachedmetadatavalues_
     164
     165function loadForm() \{
     166
     167    var formcontainer = document.getElementById('formcontainer');
     168   
     169    if (!formcontainer) \{
     170        return;
     171    \}
     172   
     173    for (i=0; i < DepositorMDFields.length; i++) \{
     174        if (DepositorMDFields[i]==null) \{
     175            continue;
     176        \}
     177        metadataField = DepositorMDFields[i];
     178       
     179        var labelCell = document.createElement("td");
     180        labelCell.innerHTML = metadataField.label + ": ";
     181        labelCell.setAttribute("title", metadataField.tooltip);                         
     182
     183        var cachedValue;
     184        if(CachedMDValues[0] !=null && CachedMDValues[0]["di1md." + metadataField.name])\{
     185            cachedValue = CachedMDValues[0]["di1md." + metadataField.name];
     186        \} else \{
     187            cachedValue = "";
     188        \}
     189       
     190        var inputObj;
     191        if (metadataField.type=="text") \{
     192            inputObj = document.createElement("input");             
     193            inputObj.setAttribute("type","text");           
     194            inputObj.setAttribute("size","74");
     195            inputObj.setAttribute("value", cachedValue);
     196        \}
     197        else if (metadataField.type=="textarea") \{
     198            inputObj = document.createElement("textarea");             
     199            inputObj.setAttribute("rows","5");
     200            inputObj.setAttribute("cols", "40");
     201            inputObj.innerHTML = cachedValue;
     202        \} 
     203        inputObj.setAttribute("name", "di1md."+ metadataField.name);       
     204       
     205        var inputCell = document.createElement("td");
     206        inputCell.appendChild(inputObj);       
     207                               
     208        var entry = document.createElement("tr");   
     209        entry.appendChild(labelCell);
     210        entry.appendChild(inputCell);
     211       
     212        formcontainer.appendChild(entry);
     213    \}
     214\}
    153215
    154216function check\_submit (gotopage) \{
     
    157219  form.submit();
    158220\}
     221
     222if (window.addEventListener) window.addEventListener("load", loadForm, false);
     223else if (window.attachEvent) window.attachEvent("onload", loadForm);
     224
    159225}
    160226
     
    165231<input type=hidden name="e" value="_decodedcompressedoptions_">
    166232<input type=hidden name="p" value="_cgiargp_">
     233
    167234
    168235<center>
     
    178245
    179246<!--input goes here-->
    180 <p><table>
    181 <tr>
    182   <td>_textTitle_:</td>
    183   <td> <input type=text name=di1md.dc.Title value="_di1md.dc.Title_" size=74></td>
    184 </tr>
    185 <tr>
    186   <td>_textCreator_:</td>
    187   <td><input type=text name=di1md.dc.Creator value = "_di1md.dc.Creator_" size=74></td>
    188 </tr>
    189 <tr>
    190   <td>_textDescription_:</td>
    191   <td> <textarea rows=5 cols=40 name=di1md.dc.Description>_di1md.dc.Description_</textarea></td>
    192 
    193 </tr>
    194 </table>
    195 
    196 <!--
    197 <BR>
    198 <BR>
    199 <p>_textDescription_: <textarea rows=5 cols=20 name=di1md.dc.Description>_di1md.dc.Description_</textarea></p>
    200 </ul>
    201 -->
     247<!--dynamic load the metadata elements as configured in the collection's collect.cfg-->
     248<p><table id="formcontainer"></table>
    202249
    203250<div class="divbar">&nbsp;</div>
     
    249296
    250297#here goes the "memorization" macros for each form field. 
    251 #_di1_ {_If_("_:cgiargdi1md.dc.Title_" eq  "_cgiargdi1md.dc.Title_",_cgiargdi1md.dc.Title_,)}
    252 #_di1md.dc.Creator_ {_If_("_:cgiargdi1md.dc.Creator_" eq  "_cgiargdi1md.dc.Creator_",_cgiargdi1md.dc.Creator_,)}
     298#_di1_ {_If_("_:cgiargdi1md.Title_" eq  "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
     299#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq  "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
    253300
    254301_step3scriptextra_ {
  • gsdl/trunk/runtime-src/src/recpt/depositoraction.cpp

    r16310 r16680  
    362362      args["di1lastpage"] = lastpage_textt;     
    363363    }
     364
     365    // create cached metadata values
     366    text_t cached_metadata_values = "";
     367    cgiargsclass::const_iterator args_here = args.begin();
     368    cgiargsclass::const_iterator args_end = args.end();
     369    while (args_here != args_end) {
     370      text_t args_name = (*args_here).first;
     371      int prefix_len = macro_prefix.size();
     372      text_t args_prefix = substr(args_name.begin(),args_name.begin()+prefix_len+3);
     373
     374      if (args_prefix == (macro_prefix+"md.")) {     
     375    text_t args_val = args[args_name];
     376    text_t args_suffix = substr(args_name.begin()+prefix_len+3,args_name.end());
     377
     378    text_tarray mdvalues;
     379    splitchar (args_val.begin(), args_val.end(), ',', mdvalues);
     380    int numvalues = mdvalues.size();
     381
     382    for (int i = 0; i < numvalues; ++i) {
     383      if (!mdvalues[i].empty()) {         
     384        decode_cgi_arg(mdvalues[i]);
     385
     386        if (cached_metadata_values == "") {
     387          cached_metadata_values = "var CachedMDValues = new Array(\\{";
     388        } else {
     389          cached_metadata_values += ",";
     390        }
     391
     392        cached_metadata_values += "\"" + args_name + "\":\"" + args_val + "\"";
     393      }
     394    }   
     395      }
     396      ++args_here;
     397    }
     398
     399    if (cached_metadata_values != "") {
     400      cached_metadata_values += "\\});";
     401      args["cachedMDValues"] = cached_metadata_values;
     402    }
    364403  }
    365404  return true;
     
    420459  text_t depositorbar = "<table class=wizardbar border=0 cellspacing=4 cellpadding=0><tr>\n";
    421460
    422   if(stepstring == "step") {
     461  if(stepstring == "step") {   
     462    // check configured metadata elements
     463    if (args["metadataconf"] == "var DepositorMDFields = new Array();" || args["metadataconf"] == "") {
     464      text_t cfgfile_name = filename_cat (collecthome, args[macro_prefix + "dirname"], "etc", "collect.cfg");
     465      text_t cfgfile_content;
     466      text_t metadata_str;
     467     
     468      if (read_file (cfgfile_name, cfgfile_content)) {
     469    text_t::const_iterator here = cfgfile_content.begin();
     470    text_t::const_iterator end = cfgfile_content.end();
     471    while (here != end) {
     472      here = findchar (here, end, 'd');
     473      if (here == end) break;
     474      if ((here+17 < end) && (substr (here, here+17) == "depositormetadata")) {
     475        here = findchar (here, end, '"');
     476        if (here == end) break; 
     477        text_t enddelimit = "\"\n";
     478        getdelimitstr (here+1, end, enddelimit, metadata_str);
     479        args["metadataconf"] = "var DepositorMDFields = new Array("+metadata_str+");";     
     480      }
     481      ++here;
     482    }
     483      }
     484
     485      if (metadata_str == "") {
     486    args["metadataconf"] = "var DepositorMDFields = new Array({\"name\":\"dc.Title\",\"label\":\"Title\",\"tooltip\":\"dc.Title: A name given to the resource.\",\"type\":\"text\"}, {\"name\":\"dc.Creator\",\"label\":\"Creator\",\"tooltip\":\"dc.Creator: An entity primarily responsible for making the content of the resource.\",\"type\":\"text\"}, {\"name\":\"dc.Description\",\"label\":\"Description\",\"tooltip\":\"dc.Description: An account of the content of the resource.\",\"type\":\"textarea\"});";
     487      }
     488    }
    423489
    424490    here = depositor_page.begin();
     
    444510      depositorbar += "<td>_icongreyarrow_</td>\n";
    445511
    446     }
     512    }   
    447513
    448514    //the build and preview pages are always last
     
    467533
    468534    depositorbar += "</tr></table>\n";
    469    
     535
     536    // set the javascript so that the metadata form can read the existing values
     537    if (args["cachedMDValues"] != "") {
     538      disp.setmacro("cachedmetadatavalues", "depositor", args["cachedMDValues"]);
     539    }
     540    if (args["metadataconf"] != "") {
     541      disp.setmacro("metadataconf", "depositor", args["metadataconf"]);
     542    }   
    470543  }
    471544 
     
    710783    metadata_file += "        <Description>\n";
    711784
    712 
     785   
    713786    cgiargsclass::const_iterator args_here = args.begin();
    714787    cgiargsclass::const_iterator args_end = args.end();
     
    735808        decode_cgi_arg(mdvalues[i]);
    736809
    737         metadata_file += "            <Metadata mode=\"accumulate\" name=\"";
     810        metadata_file += "            <Metadata mode=\"accumulate\" name=\"";       
    738811        metadata_file += args_suffix;
    739812        metadata_file += "\">";
     
    743816      }
    744817    }
    745 
    746       }
    747 
     818      }       
    748819
    749820      ++args_here;
Note: See TracChangeset for help on using the changeset viewer.