- Timestamp:
- 2012-05-23T16:43:48+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r25466 r25647 305 305 Element securityBlock = (Element) GSXML.getChildByTagName(coll_config_xml, GSXML.SECURITY_ELEM); 306 306 307 if (securityBlock == null)307 if (securityBlock == null) 308 308 { 309 309 return; 310 310 } 311 311 312 312 String scope = securityBlock.getAttribute(GSXML.SCOPE_ATT); 313 313 String defaultAccess = securityBlock.getAttribute(GSXML.DEFAULT_ACCESS_ATT); … … 595 595 if (subaction.equals("saveDocument")) 596 596 { 597 int k;598 597 Element format_element = (Element) GSXML.getChildByTagName(request, GSXML.FORMAT_STRING_ELEM); 599 598 //String format_string = GSXML.getNodeText(format_element); … … 601 600 Element display_format = (Element) format_element.getFirstChild(); 602 601 603 String format_string = GSXML.xmlNodeToString(display_format, false);604 602 String collection_config = directory + "collectionConfig.xml"; 605 603 Document config = this.converter.getDOM(new File(collection_config), "UTF-8"); … … 758 756 { 759 757 String oid = request.getAttribute("oid"); 760 if (oid.contains("."))758 if (oid.contains(".")) 761 759 { 762 760 oid = oid.substring(0, oid.indexOf(".")); 763 761 } 764 762 765 763 ArrayList<String> groups = getPermittedGroups(oid); 766 764 767 765 Element groupList = this.doc.createElement(GSXML.GROUP_ELEM + GSXML.LIST_MODIFIER); 768 766 response.appendChild(groupList); 769 770 for (String groupName : groups)767 768 for (String groupName : groups) 771 769 { 772 770 Element group = this.doc.createElement(GSXML.GROUP_ELEM); … … 786 784 { 787 785 ArrayList<String> groups = new ArrayList<String>(); 788 786 789 787 if (_securityScopeCollection) 790 788 { … … 806 804 else 807 805 { 808 if (oid != null && !oid.equals(""))806 if (oid != null && !oid.equals("")) 809 807 { 810 808 boolean inSet = false; … … 823 821 } 824 822 } 825 826 if (!inSet && _publicAccess)823 824 if (!inSet && _publicAccess) 827 825 { 828 826 groups.add(""); … … 864 862 { 865 863 fieldValue = getFieldValue(oid, fieldName); 866 if (fieldValue == null)864 if (fieldValue == null) 867 865 { 868 866 return false; … … 876 874 String matchValue = GSXML.getNodeText(currentMatchStatement); 877 875 if (type.equals("match")) 878 { 879 if (matchValue.equals(fieldValue))876 { 877 if (matchValue.equals(fieldValue)) 880 878 { 881 879 return true; … … 884 882 else if (type.equals("regex")) 885 883 { 886 if (fieldValue.matches(matchValue))884 if (fieldValue.matches(matchValue)) 887 885 { 888 886 return true; … … 906 904 Element paramList = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); 907 905 metadataRequest.appendChild(paramList); 908 906 909 907 Element param = this.doc.createElement(GSXML.PARAM_ELEM); 910 908 paramList.appendChild(param); 911 909 912 910 param.setAttribute(GSXML.NAME_ATT, "metadata"); 913 911 param.setAttribute(GSXML.VALUE_ATT, fieldName); 914 912 915 913 Element docList = this.doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER); 916 914 metadataRequest.appendChild(docList); 917 915 918 916 Element doc = this.doc.createElement(GSXML.DOC_NODE_ELEM); 919 917 docList.appendChild(doc); 920 918 921 919 doc.setAttribute(GSXML.NODE_ID_ATT, oid); 922 920 923 921 Element response = (Element) this.router.process(metadataMessage); 924 922 NodeList metadataElems = response.getElementsByTagName(GSXML.METADATA_ELEM); 925 926 if (metadataElems.getLength() > 0)923 924 if (metadataElems.getLength() > 0) 927 925 { 928 926 Element metadata = (Element) metadataElems.item(0); 929 927 return GSXML.getNodeText(metadata); 930 928 } 931 929 932 930 return null; 933 931 }
Note:
See TracChangeset
for help on using the changeset viewer.