Changeset 7477


Ignore:
Timestamp:
2004-05-27T15:15:37+12:00 (20 years ago)
Author:
mdewsnip
Message:

Added four missing Format options: AllowExtendedOptions, DocumentArrowsTop, DocumentTitles, and RelatedDocuments.

File:
1 edited

Legend:

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

    r6539 r7477  
    3939import org.greenstone.gatherer.util.Codec;
    4040import org.w3c.dom.*;
     41
    4142/** This class encapsulates all the information about a format command from the collection configuration. This includes both the 'general' formatting commands, and the commands targetted at specific classifiers or classification component types. This class is, unfortunately, the most complex in terms of DOM model support, since we have to maintain a live reference to any classifier this format applies to. We temporarily use the feature name as the format name attribute but since the order of classifiers can change, this of course gets horribly out of date. Before the CollectionDesignManager saves the CollectionConfiguration it calls a method in the FormatManager to force all of the Formats to update their name attributes.
    4243 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4647    implements DOMProxyListEntry {
    4748
    48     /** The default features as specified by the Greenstone Developers manual. */
    49     static final public String DEFAULT_FEATURES[] = {"", "DocumentArrowsBottom","DocumentButtons","DocumentContents","DocumentHeading","DocumentImages","DocumentText","DocumentUseHTML","Search"};
     49    /** The default features (not all of these are in the Greenstone Developer's Guide). */
     50    static final public String DEFAULT_FEATURES[] = { "", "AllowExtendedOptions", "DocumentArrowsBottom", "DocumentArrowsTop", "DocumentButtons", "DocumentContents", "DocumentHeading", "DocumentImages", "DocumentText", "DocumentTitles", "DocumentUseHTML", "RelatedDocuments", "Search" };
    5051    /** The list of known feature parts. */
    51     static final public String DEFAULT_PARTS[] = {"","DateList","HList","Invisible","VList"};
    52 
    53     /** Not all features have an associated part, such as those in the default features list (apart from Search which does have parts!) */
     52    static final public String DEFAULT_PARTS[] = { "", "DateList", "HList", "Invisible", "VList" };
     53
     54    /** Only "" and "Search" can have parts */
    5455    static public boolean canHavePart(String name) {
    55     return !(name.equalsIgnoreCase(DEFAULT_FEATURES[1]) || name.equalsIgnoreCase(DEFAULT_FEATURES[2]) || name.equalsIgnoreCase(DEFAULT_FEATURES[3]) || name.equalsIgnoreCase(DEFAULT_FEATURES[4]) || name.equalsIgnoreCase(DEFAULT_FEATURES[5]) || name.equalsIgnoreCase(DEFAULT_FEATURES[6]) || name.equalsIgnoreCase(DEFAULT_FEATURES[7]));
    56     }
    57 
     56    return (name.equalsIgnoreCase("") || name.equalsIgnoreCase("Search"));
     57    }
     58   
    5859    static public String generateName(Object feature, String part) {
    5960    if(feature instanceof Classifier) {
     
    6566    }
    6667
    67     static public boolean isParamType(String name) {
    68     return (name.equalsIgnoreCase(DEFAULT_FEATURES[1]) || name.equalsIgnoreCase(DEFAULT_FEATURES[3]) || name.equalsIgnoreCase(DEFAULT_FEATURES[5]) || name.equalsIgnoreCase(DEFAULT_FEATURES[7]));
     68    /** Returns true if the parameter is a boolean type, false otherwise. */
     69    static public boolean isParamType(String name)
     70    {
     71    if (name.equalsIgnoreCase("AllowExtendedOptions") || name.equalsIgnoreCase("DocumentArrowsBottom") || name.equalsIgnoreCase("DocumentArrowsTop") || name.equalsIgnoreCase("DocumentContents") || name.equalsIgnoreCase("DocumentImages") || name.equalsIgnoreCase("DocumentTitles") || name.equalsIgnoreCase("DocumentUseHTML")) {
     72        return true;
     73    }
     74    else {
     75        return false;
     76    }
    6977    }
    7078
Note: See TracChangeset for help on using the changeset viewer.