Changeset 25647


Ignore:
Timestamp:
2012-05-23T16:43:48+12:00 (12 years ago)
Author:
sjm84
Message:

More reformatting and minor fixes

File:
1 edited

Legend:

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

    r25466 r25647  
    305305        Element securityBlock = (Element) GSXML.getChildByTagName(coll_config_xml, GSXML.SECURITY_ELEM);
    306306
    307         if(securityBlock == null)
     307        if (securityBlock == null)
    308308        {
    309309            return;
    310310        }
    311        
     311
    312312        String scope = securityBlock.getAttribute(GSXML.SCOPE_ATT);
    313313        String defaultAccess = securityBlock.getAttribute(GSXML.DEFAULT_ACCESS_ATT);
     
    595595            if (subaction.equals("saveDocument"))
    596596            {
    597                 int k;
    598597                Element format_element = (Element) GSXML.getChildByTagName(request, GSXML.FORMAT_STRING_ELEM);
    599598                //String format_string = GSXML.getNodeText(format_element);
     
    601600                Element display_format = (Element) format_element.getFirstChild();
    602601
    603                 String format_string = GSXML.xmlNodeToString(display_format, false);
    604602                String collection_config = directory + "collectionConfig.xml";
    605603                Document config = this.converter.getDOM(new File(collection_config), "UTF-8");
     
    758756        {
    759757            String oid = request.getAttribute("oid");
    760             if(oid.contains("."))
     758            if (oid.contains("."))
    761759            {
    762760                oid = oid.substring(0, oid.indexOf("."));
    763761            }
    764            
     762
    765763            ArrayList<String> groups = getPermittedGroups(oid);
    766            
     764
    767765            Element groupList = this.doc.createElement(GSXML.GROUP_ELEM + GSXML.LIST_MODIFIER);
    768766            response.appendChild(groupList);
    769            
    770             for(String groupName : groups)
     767
     768            for (String groupName : groups)
    771769            {
    772770                Element group = this.doc.createElement(GSXML.GROUP_ELEM);
     
    786784    {
    787785        ArrayList<String> groups = new ArrayList<String>();
    788        
     786
    789787        if (_securityScopeCollection)
    790788        {
     
    806804        else
    807805        {
    808             if(oid != null && !oid.equals(""))
     806            if (oid != null && !oid.equals(""))
    809807            {
    810808                boolean inSet = false;
     
    823821                    }
    824822                }
    825                
    826                 if(!inSet && _publicAccess)
     823
     824                if (!inSet && _publicAccess)
    827825                {
    828826                    groups.add("");
     
    864862            {
    865863                fieldValue = getFieldValue(oid, fieldName);
    866                 if(fieldValue == null)
     864                if (fieldValue == null)
    867865                {
    868866                    return false;
     
    876874            String matchValue = GSXML.getNodeText(currentMatchStatement);
    877875            if (type.equals("match"))
    878             { 
    879                 if(matchValue.equals(fieldValue))
     876            {
     877                if (matchValue.equals(fieldValue))
    880878                {
    881879                    return true;
     
    884882            else if (type.equals("regex"))
    885883            {
    886                 if(fieldValue.matches(matchValue))
     884                if (fieldValue.matches(matchValue))
    887885                {
    888886                    return true;
     
    906904        Element paramList = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
    907905        metadataRequest.appendChild(paramList);
    908        
     906
    909907        Element param = this.doc.createElement(GSXML.PARAM_ELEM);
    910908        paramList.appendChild(param);
    911        
     909
    912910        param.setAttribute(GSXML.NAME_ATT, "metadata");
    913911        param.setAttribute(GSXML.VALUE_ATT, fieldName);
    914        
     912
    915913        Element docList = this.doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER);
    916914        metadataRequest.appendChild(docList);
    917        
     915
    918916        Element doc = this.doc.createElement(GSXML.DOC_NODE_ELEM);
    919917        docList.appendChild(doc);
    920        
     918
    921919        doc.setAttribute(GSXML.NODE_ID_ATT, oid);
    922        
     920
    923921        Element response = (Element) this.router.process(metadataMessage);
    924922        NodeList metadataElems = response.getElementsByTagName(GSXML.METADATA_ELEM);
    925        
    926         if(metadataElems.getLength() > 0)
     923
     924        if (metadataElems.getLength() > 0)
    927925        {
    928926            Element metadata = (Element) metadataElems.item(0);
    929927            return GSXML.getNodeText(metadata);
    930928        }
    931        
     929
    932930        return null;
    933931    }
Note: See TracChangeset for help on using the changeset viewer.