Ignore:
Timestamp:
2007-03-28T16:16:49+12:00 (17 years ago)
Author:
lh92
Message:

Added code to read the pluginList from the collectConfig.xml. If tidy_html option is set then the tidy_option metadata is true

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/Collection.java

    r13860 r13994  
    4848    static Logger logger = Logger.getLogger(org.greenstone.gsdl3.collection.Collection.class.getName());
    4949
     50    /** is this collection being tidied */
     51    protected boolean useBook = false;
    5052    /** is this collection public or private */
    5153    protected boolean is_public = true;
     
    9698    }
    9799
     100    public boolean useBook() {
     101        return useBook;
     102    }
     103   
    98104    public boolean isPublic() {
    99105    return is_public;
     
    161167    }
    162168
     169    //check whether the html are tidy or not
     170    Element import_list = (Element)GSXML.getChildByTagName(coll_config_xml, GSXML.IMPORT_ELEM);
     171    if (import_list != null) {
     172        Element plugin_list = (Element)GSXML.getChildByTagName(import_list, GSXML.PLUGIN_ELEM+GSXML.LIST_MODIFIER);
     173        addPlugins(plugin_list);
     174        if (plugin_list != null){
     175            Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlug");
     176            if (plugin_elem != null) {
     177                //get the option
     178                Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-tidy_html");
     179                if (option_elem != null) {
     180                    useBook = true;
     181                }
     182            }
     183        }   
     184    }
     185    meta_list = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
     186    if (useBook == true)
     187        GSXML.addMetadata(this.doc, meta_list, "tidyoption", "tidy");
     188    else
     189        GSXML.addMetadata(this.doc, meta_list, "tidyoption", "untidy");
     190    addMetadata(meta_list);
     191   
    163192    // check whether we are public or not
    164193    if (meta_list != null) {
     
    210239    }
    211240
    212     if (subset.equals(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER) || subset.equals(GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER)) {
     241    if (subset.equals(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER) || subset.equals(GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER) || subset.equals(GSXML.PLUGIN_ELEM+GSXML.LIST_MODIFIER)) {
    213242        return findAndLoadInfo(coll_config_elem, build_config_elem);
    214243       
Note: See TracChangeset for help on using the changeset viewer.