Changeset 7597


Ignore:
Timestamp:
2004-06-16T16:43:32+12:00 (20 years ago)
Author:
kjdon
Message:

made static strings for the format names and default format strings - they were being defined twice. also made the defaults contain ex.metadata

File:
1 edited

Legend:

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

    r7578 r7597  
    6464    static final private String VALUE = "value";
    6565
     66    static final private String DATELIST = "DateList";
     67    static final private String DATELIST_DEFAULT_FORMAT = "<td>[link][icon][/link]</td>\n<td>[highlight]{Or}{[dls.Title],[dc.Title],[ex.Title],Untitled}[/highlight]</td>\n<td>[ex.Date]</td>";
     68    static final private String HLIST = "HList";
     69    static final private String HLIST_DEFAULT_FORMAT = "[link][highlight]{Or}{[dls.Title],[dc.Title],[ex.Title],Untitled}[/highlight][/link]";
     70    static final private String VLIST = "VList";
     71    static final private String VLIST_DEFAULT_FORMAT = "<td valign=top>[link][icon][/link]</td>\n<td valign=top>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td>\n<td valign=top>[highlight]\n{Or}{[dls.Title],[dc.Title],[ex.Title],Untitled}\n[/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td>";
     72    static final private String INVISIBLE = "Invisible";
     73    static final private String INVISIBLE_DEFAULT_FORMAT = "";
     74
    6675    /** This flag is set if some change has occured to the format commands. When a collection has been built for previewing, and the greenstone local library server is used, then we have to send commands to remove then add the new collection. */
    6776    private boolean formats_changed = false;
     
    8392
    8493    // Ensure the default formats for DateList, HList and VList are assigned
    85     if (getFormat("DateList") == null) {
    86         addFormat(new Format("","DateList","<td>[link][icon][/link]</td>\n<td>[highlight]{Or}{[dls.Title],[dc.Title],[Title],Untitled}[/highlight]</td>\n<td>[Date]</td>"));
    87     }
    88 
    89     if (getFormat("HList") == null) {
    90         addFormat(new Format("","HList","[link][highlight]{Or}{[dls.Title],[dc.Title],[Title],Untitled}[/highlight][/link]"));
    91     }
    92 
    93     if (getFormat("VList") == null) {
    94         addFormat(new Format("","VList","<td valign=top>[link][icon][/link]</td>\n<td valign=top>[srclink]{Or}{[thumbicon],[srcicon]}[/srclink]</td>\n<td valign=top>[highlight]\n{Or}{[dls.Title],[dc.Title],[Title],Untitled}\n[/highlight]{If}{[Source],<br><i>([Source])</i>}</td>"));
     94    if (getFormat(DATELIST) == null) {
     95        addFormat(new Format("",DATELIST,DATELIST_DEFAULT_FORMAT));
     96    }
     97
     98    if (getFormat(HLIST) == null) {
     99        addFormat(new Format("",HLIST,HLIST_DEFAULT_FORMAT));
     100    }
     101
     102    if (getFormat(VLIST) == null) {
     103        addFormat(new Format("",VLIST,VLIST_DEFAULT_FORMAT));
    95104    }
    96105    }
     
    194203    ArrayList part_model = new ArrayList();
    195204    part_model.add(new Part("", ""));
    196     part_model.add(new Part("DateList", "<td>[link][icon][/link]</td><td>[highlight]{Or}{[Title],Untitled}[/highlight]</td><td>[Date]</td>"));
    197     part_model.add(new Part("HList", "[link][highlight][Title][/highlight][/link]"));
    198     part_model.add(new Part("Invisible", ""));
    199     part_model.add(new Part("VList", "<td valign=top>[link][icon][/link]</td><td valign=top>[srclink]{Or}{[thumbicon],[srcicon]}[/srclink]</td><td valign=top>[highlight]{Or}{[Title],[dc.Title],[dls.Title],Untitled}[/highlight]{If}{[Source],<br><i>([Source])</i>}</td>"));
     205    part_model.add(new Part(DATELIST, DATELIST_DEFAULT_FORMAT));
     206    part_model.add(new Part(HLIST, HLIST_DEFAULT_FORMAT));
     207    part_model.add(new Part(INVISIBLE, INVISIBLE_DEFAULT_FORMAT));
     208    part_model.add(new Part(VLIST, VLIST_DEFAULT_FORMAT));
    200209    return part_model;
    201210    }
Note: See TracChangeset for help on using the changeset viewer.