Changeset 7477
- Timestamp:
- 2004-05-27T15:15:37+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/Format.java
r6539 r7477 39 39 import org.greenstone.gatherer.util.Codec; 40 40 import org.w3c.dom.*; 41 41 42 /** 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. 42 43 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 46 47 implements DOMProxyListEntry { 47 48 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" }; 50 51 /** 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 */ 54 55 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 58 59 static public String generateName(Object feature, String part) { 59 60 if(feature instanceof Classifier) { … … 65 66 } 66 67 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 } 69 77 } 70 78
Note:
See TracChangeset
for help on using the changeset viewer.