Changeset 22279


Ignore:
Timestamp:
2010-06-22T19:33:59+12:00 (11 years ago)
Author:
ak19
Message:

Same changes as in greenstone3's src-java folder version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3services/QBRSOAPServer.java

    r16785 r22279  
    132132    protected static final String docStructureOptions =
    133133        "entire ancestors parent siblings children descendants"; // note the spelling
    134     protected static final String docStructureInfo =
     134    protected static final String structureInfoOptions =
    135135        "numSiblings siblingPosition numChildren";
    136136    protected static final String browseStructureOptions =
     
    481481        // Create the <paramlist></paramlist> element of param elements,
    482482        // if any; and only if values are legal (that is, if they occur in 
    483         // static Strings docStructureOptions and docStructureInfo):
     483        // static Strings docStructureOptions and structureInfoOptions):
    484484        // <param name="structure" value = "structure[i]">
    485485        // <param name="info" value = "info[i]">
     
    497497        if(info != null) {
    498498            for(int i = 0; i < info.length; i++) {
    499                 if(docStructureInfo.indexOf(info[i]) != -1) {
     499                if(structureInfoOptions.indexOf(info[i]) != -1) {
    500500                    paramList.appendChild(GSXML.createParameter(
    501501                            this.doc, "info", info[i]));
     
    675675     * information is requested. Accepted values are ancestors, parent, siblings,
    676676     * children, descendants.
     677     * @param infoParams - structural info is requested. Can be numSiblings,
     678     * siblingPosition, numChildren
    677679    */
    678680    public String browse(String collection, String browseService, String lang,
    679             String[] classifierNodeIDs, String[] structureParams)
     681                 String[] classifierNodeIDs, String[] structureParams, String[] infoParams)
    680682    {
    681683        if(browseService.equals(""))
     
    698700            }
    699701        }
     702
     703        if(infoParams != null) {
     704            for(int i = 0; i < infoParams.length; i++) {
     705            if(structureInfoOptions.indexOf(infoParams[i]) != -1) {
     706                paramList.appendChild(GSXML.createParameter(
     707                                    this.doc, "info", info[i]));
     708            }
     709            }
     710        }
    700711       
    701712        // <classifierNodeList><classifier nodeID="CLx" />
     
    731742             // won't be null except when Node returned is not an element
    732743             // otherwise, MR always returns some response
     744
     745        // Return it as a String formatted for display
     746        String responseMsg = this.converter.getPrettyString(response);
     747                          // this.converter.getString(response);
    733748
    734749        // In order to avoid "Content is not allowed in prolog" exception on the
     
    857872        System.out.println("browse children of CL1-CL4:\n" +
    858873                ws.browse("gs2mgppdemo", "ClassifierBrowse", "",
    859                 new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}));
     874                      new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}, new String[]{"numChildren"}));
    860875       
    861876        System.out.println("browse descendants of CL2.3:\n" +
    862877                ws.browseDescendants("gs2mgppdemo", "ClassifierBrowse", "",
    863                 new String[]{"CL2.3"}));
     878                             new String[]{"CL2.3"}, new String[]{"siblingPosition"}));
    864879       
    865880        // (4) try 2 DocStructure
Note: See TracChangeset for help on using the changeset viewer.