Index: /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/DigitalLibraryServicesAPIA.java
===================================================================
--- /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/DigitalLibraryServicesAPIA.java	(revision 22297)
+++ /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/DigitalLibraryServicesAPIA.java	(revision 22298)
@@ -106,5 +106,5 @@
 	 * collection, describing the collection (display items) as well as
 	 * listing any services supported specifically by the collection. 
-	 * @param collection is the name of the collection to be described */
+	 * @param collection is the name of the collection to be described. */
 	public String describeCollection(String collection);
 	
@@ -112,5 +112,5 @@
 	 * collection's service, describing the service (display items). 
 	 * @param collection is the name of the collection to be described
-	 * @param service is the name of the collection's service to be described */
+	 * @param service is the name of the collection's service to be described. */
 	public String describeCollectionService(String collection, String service);
 	
@@ -125,6 +125,7 @@
 	 * @param collection is the name of the collection 
 	 * @param docIDs is an array of document identifiers of documents whose  
-	 * metadata is requested */
-	public String retrieveDocumentMetadata(String collection, String[] docIDs);
+	 * metadata is requested 
+	 * @param metadata is the list of metadata elements to be retrieved for each doc */
+	public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metadata);
 	
 	/**	@return a String representing Greenstone3 DocumentMetadataRetrieve XML 
@@ -132,6 +133,7 @@
 	 * @param collection is the name of the collection 
 	 * @param docID is the document identifier of the document whose metadata is 
-	 * requested */
-	public String retrieveDocumentMetadata(String collection, String docID);
+	 * requested 
+	 * @param metadata is the list of metadata elements to be retrieved for each doc */
+    public String retrieveDocumentMetadata(String collection, String docID, String[] metadata);
 
 	/**	@return a String representing Greenstone3 DocumentMetadataRetrieve XML 
@@ -178,4 +180,33 @@
 	 * structure is requested */
 	public String retrieveDocumentStructure(String collection, String docID); 
+
+
+    	/** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection 
+	 * @param docIDs is an array of document identifiers of documents whose
+	 * hierarchical structures are requested 
+	 * @param structure - strings specifying the required structure of each document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of each document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info);
+
+
+    	/** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection 
+	 * @param docID is the document identifier of the document whose hierarchical
+	 * structure is requested
+	 * @param structure - strings specifying the required structure of the document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of the document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info);
+
 
 	// UNUSED by the client, but still a very useful method:
@@ -205,7 +236,11 @@
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the browse service (=ClassifierBrowse usually) 
-	*/
-	public String retrieveBrowseStructure(
-			String collection, String service, String[] classifierIDs);
+	 * @param structure - the requested browse substructure. Can be any combination
+	 * of ancestors, parent, siblings, children, descendants.
+	 * @param info - the requested structural info. Can be numSiblings, siblingPosition,
+	 * numChildren
+	*/
+	public String retrieveBrowseStructure(String collection, String service, 
+					      String[] classifierIDs, String[] structure, String[] info);
 
 	/**	@return a String representing Greenstone3 
@@ -214,11 +249,12 @@
 	 * @param nodeIDs is of the form CL#.# where the number (#) marks
 	 * out structured sections like CL2.1.3. NodeIDs are generally subsections
-	 * of top-level classifierNodes (CL#, e.g. CL3). 
+	 * of top-level classifierNodes (CL#, e.g. CL3).
+	 * @param metafields are the classifier metadata fields that are to be returned.
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the Browse's MetadataRetrieve service 
 	 * (usually the browse service is ClassifierBrowse, in which case it always
 	 * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
-	public String retrieveBrowseMetadata(
-			String collection, String service, String[] nodeIDs);
+	public String retrieveBrowseMetadata(String collection, String service,
+					     String[] nodeIDs, String[] metafields);
 	
 	/**	@return a String representing Greenstone3 XML for a query process
Index: /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/FedoraServicesAPIA.java
===================================================================
--- /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/FedoraServicesAPIA.java	(revision 22297)
+++ /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/FedoraServicesAPIA.java	(revision 22298)
@@ -76,7 +76,9 @@
 	 * @param collection is the name of the collection 
 	 * @param docIDs is an array of document identifiers of documents whose  
-	 * metadata is requested */
-	public String retrieveDocumentMetadata(String collection, String[] docIDs) {
-		return this.getDocumentMetadata(docIDs);
+	 * metadata is requested 
+	 * @param metadata is the list of metadata elements requested. If "all" is specified
+	 * then all metadata is requested. */
+    public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metadata) {
+	return this.getDocumentMetadata(docIDs, metadata);
 	}
 	
@@ -85,7 +87,9 @@
 	 * @param collection is the name of the collection 
 	 * @param docID is the document identifier of the document whose metadata is 
-	 * requested */
-	public String retrieveDocumentMetadata(String collection, String docID) {
-		return this.getDocumentMetadata(docID);
+	 * requested.
+	 * @param metadata is the list of metadata elements requested. If "all" is specified
+	 * then all metadata is requested. */
+	public String retrieveDocumentMetadata(String collection, String docID, String[] metadata) {
+	    return this.getDocumentMetadata(docID, metadata);
 	}
 
@@ -96,5 +100,5 @@
 	 * are requested */
 	public String retrieveTitleMetadata(String collection, String[] docIDs) {
-		return this.getTitleMetadata(docIDs);
+	    return this.getDocumentMetadata(docIDs, new String[] {"Title"});
 	}
 	
@@ -105,5 +109,5 @@
 	 * requested */
 	public String retrieveTitleMetadata(String collection, String docID) {
-		return this.getTitleMetadata(docID);
+	    return this.getDocumentMetadata(docID, new String[] {"Title"});
 	}
 
@@ -134,5 +138,5 @@
 	 * hierarchical structures are requested */
 	public String retrieveDocumentStructure(String collection, String[] docIDs) {
-		return this.getDocumentStructure(docIDs);
+	    return this.getDocumentStructure(docIDs, new String[]{"descendants"}, new String[]{""});
 	}
 	
@@ -144,5 +148,5 @@
 	 * structure is requested*/
 	public String retrieveDocumentStructure(String collection, String docID) {
-		return this.getDocumentStructure(docID);
+	    return this.getDocumentStructure(docID, new String[]{"descendants"}, new String[]{""});
 	}
 
@@ -156,5 +160,5 @@
 	 * hierarchical structures are requested */
 	public String retrieveDocumentChildren(String collection, String[] docIDs) {
-		return this.getChildren(docIDs);
+	    return this.getDocumentStructure(docIDs, new String[]{"children"}, new String[]{""});
 	}
 	
@@ -166,8 +170,42 @@
 	 * structure is requested */
 	public String retrieveDocumentChildren(String collection, String docID) {
-		return this.getChildren(docID);
-	}
-	
-	/**	@return a String representing Greenstone3 ClassifierBrowse XML 
+	    return this.getDocumentStructure(docID, new String[]{"children"}, new String[]{""});
+	}
+	
+    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection. It's already included in the
+	 * docID for a Fedora DL.
+	 * @param docIDs is an array of document identifiers of documents whose
+	 * hierarchical structures are requested 
+	 * @param structure - strings specifying the required structure of each document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of each document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info) {
+	return this.getDocumentStructure(docIDs, structure, info);
+    }
+
+
+    	/** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection. It's already included in the
+	 * docID for a Fedora DL.
+	 * @param docID is the document identifier of the document whose hierarchical
+	 * structure is requested
+	 * @param structure - strings specifying the required structure of the document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of the document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info) {
+	return this.getDocumentStructure(docID, structure, info);
+    }
+
+
+    /**	@return a String representing Greenstone3 ClassifierBrowse XML 
 	 * giving the entire *structure* of the classification denoted by 
 	 * classifierID (including the structures of document descendents of 
@@ -177,9 +215,13 @@
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the browse service (=ClassifierBrowse usually)
+	 * @param structure - the requested browse substructure. Can be any combination
+	 * of ancestors, parent, siblings, children, descendants.
+	 * @param info - the requested structural info. Can be numSiblings, siblingPosition,
+	 * numChildren
 	*/
-	public String retrieveBrowseStructure(
-			String collection, String service, String[] classifierIDs) 
+	public String retrieveBrowseStructure(String collection, String service, String[] classifierIDs, 
+			String[] structure, String[] info) 
 	{
-		return this.browse(collection, classifierIDs);
+		return this.browse(collection, classifierIDs, structure, info);
 	}
 
@@ -190,12 +232,13 @@
 	 * out structured sections like CL2.1.3. NodeIDs are generally subsections
 	 * of top-level classifierNodes (CL#, e.g. CL3). 
+	 * @param metafields are the classifier metadata fields that are to be returned.
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the Browse's MetadataRetrieve service 
 	 * (usually the browse service is ClassifierBrowse, in which case it always
 	 * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
-	public String retrieveBrowseMetadata(
-			String collection, String service, String[] nodeIDs) 
+	public String retrieveBrowseMetadata(String collection, String service, 
+					     String[] nodeIDs, String[] metafields) 
 	{
-		return this.browseMetadataRetrieve(nodeIDs);
+	    return this.browseMetadataRetrieve(nodeIDs, metafields);
 	}
 	
Index: /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3ServicesAPIA.java
===================================================================
--- /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3ServicesAPIA.java	(revision 22297)
+++ /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3ServicesAPIA.java	(revision 22298)
@@ -254,7 +254,8 @@
 	 * @return a String representing Greenstone3 DocumentMetadataRetrieve XML 
 	 * containing all the metadata of all the documents indicated by docIDs 
-	*/
-	public String retrieveDocumentMetadata(String collection, String[] docIDs) {
-		return this.retrieveAllDocumentMetadata(collection, language, docIDs);
+	 * @param metadata is the list of metadata elements to be retrieved for each doc.
+	*/
+	public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metafields) {
+		return this.retrieveDocumentMetadata(collection, language, docIDs, metafields);
 	}
 	
@@ -266,8 +267,9 @@
 	 * @return a String representing Greenstone3 DocumentMetadataRetrieve XML 
 	 * containing all the metadata of the document denoted by docID 
-	*/
-	public String retrieveDocumentMetadata(String collection, String docID) {
-		return this.retrieveAllDocumentMetadata(collection, language, 
-				new String[] { docID });
+	 * @param metadata is the list of metadata elements to be retrieved for each doc.
+	*/
+    public String retrieveDocumentMetadata(String collection, String docID, String[] metafields) {
+		return this.retrieveDocumentMetadata(collection, language, 
+							new String[] { docID }, metafields);
 	}
 	
@@ -298,4 +300,36 @@
 				new String[] { docID }, titleMetaName);
 	}
+
+    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection.
+	 * @param docIDs is an array of document identifiers of documents whose
+	 * hierarchical structures are requested.
+	 * @param structure - strings specifying the required structure of each document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of each document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info) {
+	return retrieveDocumentStructure(collection, language, docIDs, structure, info);
+    }
+
+
+    	/** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
+	 * containing the requested portion of the document structure of the documents 
+	 * indicated by docIDs: 
+	 * @param collection is the name of the collection.
+	 * @param docID is the document identifier of the document whose hierarchical
+	 * structure is requested.
+	 * @param structure - strings specifying the required structure of the document. 
+	 * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
+	 * @param info - strings specifying the required structural info of the document. 
+	 * It can be any combination of: siblingPosition, numSiblings, numChildren.
+	*/
+    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info) {
+	return retrieveDocumentStructure(collection, language, 
+				  new String[] {docID}, structure, info);
+    }
 	
 	/**	Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface 
@@ -310,4 +344,5 @@
 		return this.retrieveEntireDocumentStructure(collection, language, docIDs);
 	}
+
 	/**	Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface 
 	 * contract.
@@ -322,4 +357,5 @@
 				new String[] { docID });
 	}
+
 	
 	/**	Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface 
@@ -360,10 +396,13 @@
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the browse service (=ClassifierBrowse usually)
-	*/
-	public String retrieveBrowseStructure(
-			String collection, String service, String[] classifierIDs) 
+	 * @param structure - the requested browse substructure. Can be any combination
+	 * of ancestors, parent, siblings, children, descendants.
+	 * @param info - the requested structural info. Can be numSiblings, siblingPosition,
+	 * numChildren
+	*/
+	public String retrieveBrowseStructure(String collection, String service,
+					      String[] classifierIDs, String[] structure, String[] info) 
 	{
-		return this.browseDescendants(collection, service, 
-				language, classifierIDs );
+	    return this.browse(collection, service, language, classifierIDs, structure, info);
 	}
 	
@@ -376,13 +415,13 @@
 	 * out structured sections like CL2.1.3. NodeIDs are generally subsections
 	 * of top-level classifierNodes (CL#, e.g. CL3). 
+	 * @param metafields are the classifier metadata fields that are to be returned.
 	 * @param collection is the name of the collection 
 	 * @param service is the name of the Browse's MetadataRetrieve service 
 	 * (usually the browse service is ClassifierBrowse, in which case it always
 	 * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
-	public String retrieveBrowseMetadata(
-			String collection, String service, String[] nodeIDs) 
+	public String retrieveBrowseMetadata(String collection, String service, 
+					     String[] nodeIDs, String[] metafields) 
 	{
-		return this.retrieveAllBrowseMetadata(collection, service, 
-				language, nodeIDs);
+	    return this.retrieveBrowseMetadata(collection, service, language, nodeIDs, metafields);
 	}
 	
Index: /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3WebServicesQBRAPI.java
===================================================================
--- /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3WebServicesQBRAPI.java	(revision 22297)
+++ /other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3WebServicesQBRAPI.java	(revision 22298)
@@ -590,11 +590,11 @@
 	 * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - pages 48, 49</a>
 	 * @param collection is the name of the Collection whose 
-	 * DocumentStructureRetrieve is requested 
-	 * @param lang is the language of the display content in the response 
+	 * DocumentStructureRetrieve is requested.
+	 * @param lang is the language of the display content in the response.
 	 * @param docNodeIDs is the list of documentNodeIDs for which the
 	 * structure ought to be retrieved. 
 	 * @param structure specifies what structure information needs to
 	 * be retrieved. The values can be one or more of ancestors, parent, 
-	 * siblings, children, descendents (NOTE SPELLING), entire.
+	 * siblings, children, descendants (NOTE SPELLING), entire.
 	 * @param info - for specifying extra information to be retrieved. 
 	 * Possible values for info parameters are numSiblings, siblingPosition, 
@@ -620,6 +620,6 @@
 	 * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - page 47</a>
 	 * @param collection is the name of the Collection whose 
-	 * DocumentMetadataRetrieve is requested 
-	 * @param lang is the language of the display content in the response 
+	 * DocumentMetadataRetrieve is requested.
+	 * @param lang is the language of the display content in the response.
 	 * @param docNodeIDs is the list of documentNodeIDs for which the
 	 * structure ought to be retrieved. 
@@ -641,5 +641,5 @@
 	 * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - page 47</a>
 	 * @param collection is the name of the Collection whose 
-	 * DocumentContentRetrieve is requested 
+	 * DocumentContentRetrieve is requested. 
 	 * @param lang is the language of the display content in the response 
 	 * @param docNodeIDs is the list of documentNodeIDs for which the
@@ -753,7 +753,9 @@
 	 * information is requested. Accepted values are ancestors, parent, siblings,
 	 * children, descendants.
+	 * @param infoParams - the requested structural info. Can be numSiblings, siblingPosition,
+	 * numChildren
 	*/
 	public String browse(String collection, String browseService, String lang, 
-			String[] classifierNodeIDs, String[] structureParams)
+			     String[] classifierNodeIDs, String[] structureParams, String[] infoParams)
 	{
 		call.setOperationName( "browse" );
@@ -764,7 +766,8 @@
 		addArrayParam("classifierNodeIDs");
 	    addArrayParam("structureParams");
+	    addArrayParam("infoParams");
 	    
 	    return invokeWith(new Object[] {collection, browseService, lang, 
-	    		classifierNodeIDs, structureParams});
+					    classifierNodeIDs, structureParams, infoParams});
 	}
 		
@@ -821,5 +824,5 @@
 			System.out.println("browse children of CL1-CL4:\n" +
 					ws.browse("gs2mgppdemo", "ClassifierBrowse", "", 
-					new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}));
+					new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}, new String[]{"numChildren"}));
 			
 			System.out.println("browse descendants of CL2.3:\n" +
@@ -861,6 +864,5 @@
 			System.out.println("retrieve all browse meta of CL1, CL2, CL2.1, CL3:\n" +
 					ws.retrieveAllBrowseMetadata("gs2mgppdemo", "", "", 
-					new String[]{"CL1", "CL2",
-					"CL2.1", "CL3"}));
+								     new String[]{"CL1", "CL2", "CL2.1", "CL3"}));
 			
 			System.out.println("retrieve Title, hastxt browse meta of CL1, CL2, CL2.1, CL3:\n" +
