Changeset 3867


Ignore:
Timestamp:
2003-03-12T16:30:32+13:00 (21 years ago)
Author:
kjdon
Message:

more stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r3850 r3867  
    7575    public static final String PARAM_IGNORE_POS_ATT = "ignore";
    7676    public static final String CLASSIFIER_CONTENT_ATT = "content";
     77
     78    // document stuff
    7779    public static final String DOC_NODE_ELEM = "documentNode";
     80    public static final String DOC_NODE_CONTENT_ELEM = "documentNodeContent";
     81    public static final String DOC_NODE_STRUCTURE_ELEM = "documentNodeStructure";
    7882    public static final String DOC_NODE_ID_ATT = "documentID";
    7983    public static final String DOC_NODE_NAME_ATT = "documentNodeName";
     
    8488    public static final String NODE_TYPE_LEAF = "leaf";
    8589
     90    // classifier stuff
     91    public static final String CLASS_NODE_ELEM = "classifierNode";
     92    public static final String CLASS_NODE_ID_ATT = "classifierID";
     93   
    8694    // parameter types
    8795    public static final String PARAM_TYPE_INTEGER = "integer";
     
    126134    public static final String COMM_TYPE_SOAP_JAVA = "soap";
    127135   
     136
     137    /** takes a list of elements, and returns an array of strings
     138     * of the values of attribute att_name */
     139    public static String [] getAttributeValuesFromList(Element list,
     140                               String att_name) {
     141   
     142    NodeList children = list.getChildNodes();
     143   
     144    int num_nodes = children.getLength();
     145    String []ids = new String[num_nodes];
     146    for (int i=0; i<num_nodes; i++) {
     147        Element e = (Element)children.item(i);
     148        String id = e.getAttribute(att_name);       
     149        ids[i] = id;       
     150    }
     151   
     152    return ids;
     153    }
     154
     155   
    128156    // takes a node with a resource elements inside it and extracts all the
    129157    // HASH oids - name att for resource
     
    258286    public static boolean addDocText(Document owner, Element doc, String text) {
    259287
    260     Element content = owner.createElement(CONTENT_ELEM);
     288    Element content = owner.createElement(DOC_NODE_CONTENT_ELEM);
    261289    Text t = owner.createTextNode(text);
    262290    content.appendChild(t);
     
    282310
    283311    /** adds an empty MetadataList elem to a doc, and returns a ref to it*/
    284     public static Element addMetaList(Document owner, Element doc) {
    285     Element list = owner.createElement(METADATA_ELEM+LIST_MODIFIER);
    286     doc.appendChild(list);
    287     return list;
    288     }
     312//      public static Element addMetaList(Document owner, Element doc) {
     313//      Element list = owner.createElement(METADATA_ELEM+LIST_MODIFIER);
     314//      doc.appendChild(list);
     315//      return list;
     316//      }
    289317    /** adds a metadata elem to a list */
    290318    public static boolean addMetadata(Document owner, Element list,
Note: See TracChangeset for help on using the changeset viewer.