Changeset 32434

Show
Ignore:
Timestamp:
10.09.2018 09:57:07 (9 months ago)
Author:
kjdon
Message:

don't need GSXML. prefix inside the class itself

Files:
1 modified

Legend:

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

    r32363 r32434  
    652652        { // this line is an attempted solution to the NullPointerException mentioned  
    653653            // in trac bug ticket #225. If n is null can't do n.getFirstChild() below. As per bug #225:  
    654             // GSXML.getNodeByPath() is called by GS2BrowseAction, which then calls this method. 
     654            // getNodeByPath() is called by GS2BrowseAction, which then calls this method. 
    655655            // If n is null, null will be returned which GS2BrowseAction already checks for. It's here 
    656656            // that the NullPointerException was thrown. 
     
    952952    public static Element createBasicResponse(Document owner, String from) 
    953953    { 
    954         Element response = owner.createElement(GSXML.RESPONSE_ELEM); 
    955         response.setAttribute(GSXML.FROM_ATT, from); 
    956         response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
     954        Element response = owner.createElement(RESPONSE_ELEM); 
     955        response.setAttribute(FROM_ATT, from); 
     956        response.setAttribute(TYPE_ATT, REQUEST_TYPE_PROCESS); 
    957957        return response; 
    958958    } 
     
    960960    public static Element createMetadataElement(Document owner, String name, String value) 
    961961    { 
    962         Element metaElem = owner.createElement(GSXML.METADATA_ELEM); 
    963         metaElem.setAttribute(GSXML.NAME_ATT, name); 
    964         metaElem.setAttribute(GSXML.VALUE_ATT, value); 
     962        Element metaElem = owner.createElement(METADATA_ELEM); 
     963        metaElem.setAttribute(NAME_ATT, name); 
     964        metaElem.setAttribute(VALUE_ATT, value); 
    965965        return metaElem; 
    966966    } 
     
    10311031        p.setAttribute(NAME_ATT, id); 
    10321032        p.setAttribute(TYPE_ATT, type); 
    1033         p.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, display_name)); 
     1033        p.appendChild(createDisplayTextElement(owner, DISPLAY_TEXT_NAME, display_name)); 
    10341034 
    10351035        if (default_value != null) 
     
    10431043                Element e = owner.createElement(PARAM_OPTION_ELEM); 
    10441044                e.setAttribute(NAME_ATT, option_ids[i]); 
    1045                 e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, option_names[i])); 
     1045                e.appendChild(createDisplayTextElement(owner, DISPLAY_TEXT_NAME, option_names[i])); 
    10461046                p.appendChild(e); 
    10471047            } 
     
    10561056        p.setAttribute(NAME_ATT, id); 
    10571057        p.setAttribute(TYPE_ATT, type); 
    1058         p.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, display_name)); 
     1058        p.appendChild(createDisplayTextElement(owner, DISPLAY_TEXT_NAME, display_name)); 
    10591059        if (default_value != null) 
    10601060        { 
     
    10671067                Element e = owner.createElement(PARAM_OPTION_ELEM); 
    10681068                e.setAttribute(NAME_ATT, option_ids.get(i)); 
    1069                 e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, option_names.get(i))); 
     1069                e.appendChild(createDisplayTextElement(owner, DISPLAY_TEXT_NAME, option_names.get(i))); 
    10701070                p.appendChild(e); 
    10711071            } 
     
    11381138        MyNodeList result = new MyNodeList(); 
    11391139 
    1140         NodeList matchingNodes = GSXML.getNamedElementsNS(parent, namespace_uri, node_local_name, attribute_names[0], attribute_values[0]); 
     1140        NodeList matchingNodes = getNamedElementsNS(parent, namespace_uri, node_local_name, attribute_names[0], attribute_values[0]); 
    11411141        for (int i = 0; i < matchingNodes.getLength(); i++) 
    11421142        { 
     
    11651165    public static void removeElementsWithAttributesNS(Element parent, String namespace_uri, String node_local_name, String[] attribute_names, String[] attribute_values) 
    11661166    { 
    1167         NodeList matchingNodes = GSXML.getElementsWithAttributesNS(parent, namespace_uri, node_local_name, attribute_names, attribute_values); 
     1167        NodeList matchingNodes = getElementsWithAttributesNS(parent, namespace_uri, node_local_name, attribute_names, attribute_values); 
    11681168        for (int i = 0; i < matchingNodes.getLength(); i++) 
    11691169        { 
     
    11841184        } 
    11851185 
    1186         Element old_elem = GSXML.getNamedElementNS(parent, namespace_uri, node_local_name, attribute_name, attribute_value); 
     1186        Element old_elem = getNamedElementNS(parent, namespace_uri, node_local_name, attribute_name, attribute_value); 
    11871187        if (old_elem != null) 
    11881188        { 
     
    16621662        ArrayList<String> groups = new ArrayList<String>(); 
    16631663 
    1664         Element groupList = (Element) GSXML.getChildByTagName(securityResponse, GSXML.GROUP_ELEM + GSXML.LIST_MODIFIER); 
     1664        Element groupList = (Element) getChildByTagName(securityResponse, GROUP_ELEM + LIST_MODIFIER); 
    16651665        if (groupList == null) 
    16661666        { 
     
    16681668        } 
    16691669 
    1670         NodeList groupElems = GSXML.getChildrenByTagName(groupList, GSXML.GROUP_ELEM); 
     1670        NodeList groupElems = getChildrenByTagName(groupList, GROUP_ELEM); 
    16711671 
    16721672        for (int i = 0; i < groupElems.getLength(); i++) 
    16731673        { 
    16741674            Element groupElem = (Element) groupElems.item(i); 
    1675             groups.add(groupElem.getAttribute(GSXML.NAME_ATT)); 
     1675            groups.add(groupElem.getAttribute(NAME_ATT)); 
    16761676        } 
    16771677