Changeset 26062

Show
Ignore:
Timestamp:
02.08.2012 16:14:23 (7 years ago)
Author:
ak19
Message:

1. Getting the Reset To Default button in Format features to work when it is pressed on the global format statement. 2. default browse format statement needs to call the choose-title template.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/Format4gs3Manager.java

    r26018 r26062  
    6464public class Format4gs3Manager implements SharedByTwoFormatManager 
    6565{ 
    66  
    67   // The default global format 
    68   static final private String GLOBAL_FORMAT = ""; 
    69   static final private String GLOBAL = "global"; 
     66    // The default global format 
     67    static final private String GLOBAL_FORMAT; 
     68    static 
     69    {        
     70        // @formatter:off 
     71        String GLOBAL_FORMAT_TEMP = "" + 
     72        "<gsf:template name=\"choose-title\">" + 
     73            "<gsf:choose-metadata>" + 
     74                "<gsf:metadata name=\"dc.Title\"/>" + 
     75                "<gsf:metadata name=\"exp.Title\"/>" + 
     76                "<gsf:metadata name=\"ex.dc.Title\"/>" + 
     77                "<gsf:metadata name=\"Title\"/>" + 
     78                "<gsf:default>Untitled</gsf:default>" + 
     79            "</gsf:choose-metadata>" + 
     80        "</gsf:template>"; 
     81        GLOBAL_FORMAT = GLOBAL_FORMAT_TEMP; 
     82        // @formatter:on 
     83    } 
     84    static final private String GLOBAL = "global"; 
    7085    //The default search format 
    7186    static final private String SEARCH_FORMAT; 
     
    177192            "<td valign=\"top\">" + 
    178193                "<gsf:link type=\"document\">" + 
    179                     "<gsf:choose-metadata>" + 
    180                         "<gsf:metadata name=\"dc.Title\"/>" + 
    181                         "<gsf:metadata name=\"exp.Title\"/>" + 
    182                         "<gsf:metadata name=\"ex.dc.Title\"/>" + 
    183                         "<gsf:metadata name=\"Title\"/>" + 
    184                         "<gsf:default>Untitled</gsf:default>" + 
    185                     "</gsf:choose-metadata>" + 
     194                    "<xsl:call-template name=\"choose-title\">" +                    
    186195                "</gsf:link>" + 
    187196                "<gsf:switch>" + 
     
    206215            "</td>" + 
    207216            "<td valign=\"top\">" + 
    208                 "<gsf:choose-metadata>" + 
    209                     "<gsf:metadata name=\"dc.Title\"/>" + 
    210                     "<gsf:metadata name=\"exp.Title\"/>" + 
    211                     "<gsf:metadata name=\"ex.dc.Title\"/>" + 
    212                     "<gsf:metadata name=\"Title\"/>" + 
    213                     "<gsf:default>Untitled</gsf:default>" + 
    214                 "</gsf:choose-metadata>" + 
     217                "<xsl:call-template name=\"choose-title\">" + 
    215218                "<gsf:switch>" + 
    216219                    "<gsf:metadata name=\"Source\"/>" + 
     
    230233    static final private String SEARCHTYPE_FORMAT = "plain,simpleform,advancedform"; 
    231234    static final private String SEARCHTYPE = "searchType"; 
    232     static final private String[] FEATURE_NAME = { SEARCH, DISPLAY, CLASSIFIER_DEFAULT, SEARCHTYPE }; 
    233     static final private String[] FEATURE_FORMAT = { SEARCH_FORMAT, DISPLAY_DEFAULT_FORMAT, CLASSIFIER_DEFAULT_FORMAT, SEARCHTYPE_FORMAT }; 
     235    static final private String[] FEATURE_NAME = { SEARCH, GLOBAL, DISPLAY, CLASSIFIER_DEFAULT, SEARCHTYPE }; 
     236    static final private String[] FEATURE_FORMAT = { SEARCH_FORMAT, GLOBAL_FORMAT, DISPLAY_DEFAULT_FORMAT, CLASSIFIER_DEFAULT_FORMAT, SEARCHTYPE_FORMAT }; 
    234237 
    235238    static private HashMap default_format_map = null;