|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3client.dlservices.GS3WebServicesQBRAPI
public class GS3WebServicesQBRAPI
GS3WebServicesQBRAPI deals with invoking the Greenstone 3 web services functionality through use of Apache Axis' Service and Call objects. Each Greenstone 3 web service operation has an equivalent method here that invokes it, even if some of these web service operations are never called by the Java-client and therefore not prescribed by the DigitalLibraryServicesAPIA interface.
Field Summary | |
---|---|
protected org.apache.axis.client.Call |
call
Axis Call object for invoking Greenstone 3's WebServices using its WSDL file |
static java.lang.String |
defaultWsdlURL
The value that the input dialog's field wsdlURL will default to if there is (no properties file and) no wsdlURL property |
(package private) static org.apache.log4j.Logger |
LOG
The Logger for this class |
protected java.lang.String |
namespace
namespace of Greenstone 3's WebServices, as given in the WSDL file |
protected java.lang.String |
portName
port Name of Greenstone 3's WebServices, as given in the WSDL file |
protected org.apache.axis.client.Service |
service
Axis Service object for connecting to invoking Greenstone 3's WebServices using its WSDL file |
protected java.lang.String |
serviceName
service Name of Greenstone 3's WebServices, as given in the WSDL file |
protected java.lang.String |
wsdlURLName
Url of the Greenstone 3 WebServices' WSDL |
Constructor Summary | |
---|---|
GS3WebServicesQBRAPI(java.lang.String wsdlURLName)
GS3ServicesAPIA constructor, that given the url to the wsdl file, finds either service and port or the service's endpoint of the GS3 Web Services and instantiates the associated Service and Call objects. |
Method Summary | |
---|---|
protected void |
addArrayParam(java.lang.String arrayParamName)
Helper method. |
protected void |
addStringParam(java.lang.String paramName)
Helper method. |
java.lang.String |
basicQuery(java.lang.String collection,
java.lang.String lang,
java.lang.String query)
This method is used to perform the most basic query: it assumes defaults for all other parameters and provides only the query string. |
java.lang.String |
browse(java.lang.String collection,
java.lang.String browseService,
java.lang.String lang,
java.lang.String[] classifierNodeIDs,
java.lang.String[] structureParams)
To send a browse request for specific parts of a classifier node (children, ancestors, descendants). |
java.lang.String |
browseDescendants(java.lang.String collection,
java.lang.String browseService,
java.lang.String lang,
java.lang.String[] classifierNodeIDs)
To send a browse request for all the descendants of a classifier node. |
java.lang.String |
describe(java.lang.String lang,
java.lang.String subsetOption)
Describe request message sent to the Message Router. |
java.lang.String |
describeCollection(java.lang.String collection,
java.lang.String lang,
java.lang.String subsetOption)
For sending Describe messages to Collections. |
java.lang.String |
describeCollectionService(java.lang.String collection,
java.lang.String service,
java.lang.String lang,
java.lang.String subsetOption)
For sending a describe message to a Collection's Service. |
java.lang.String |
describeService(java.lang.String service,
java.lang.String lang,
java.lang.String subsetOption)
For sending a describe message to a Service hosted by the Message Router (no collection). |
java.lang.String |
describeServiceCluster(java.lang.String serviceCluster,
java.lang.String lang,
java.lang.String subsetOption)
For sending Describe messages to ServiceClusters. |
protected static java.util.Vector |
getElementsByTagNameNS(org.w3c.dom.Element parentElement,
java.lang.String namespacePrefix,
java.lang.String localName)
Static method that gets all the descendant elements of a portion of XMl within the same namespace as indicated by parameters namespacePrefix and localName. |
protected static void |
getElementsByTagNameNS(org.w3c.dom.Element parentElement,
java.lang.String namespacePrefix,
java.lang.String localName,
java.util.Vector v)
At method's end, Vector v will contain those descendent elements of parentElement where the element's name is prefixed by namespacePrefix and suffixed by localName. |
protected static void |
getElementsByTagNameSuffix(org.w3c.dom.Element parentElement,
java.lang.String localName,
java.util.Vector v)
Recursive method. |
java.lang.String |
getNamespace()
|
java.lang.String |
getPort()
|
java.lang.String |
getService()
|
java.lang.String |
getWsdl()
|
java.lang.String |
help()
|
java.lang.String |
helpWithMethod(java.lang.String methodname)
|
protected java.lang.String |
invokeWith(java.lang.Object[] params)
Helper method. |
static void |
main(java.lang.String[] args)
|
java.lang.String |
query(java.lang.String collection,
java.lang.String service,
java.lang.String lang,
java.util.Map nameToValsMap)
For executing a (process-type message) query-type service. |
java.lang.String |
retrieveAllBrowseMetadata(java.lang.String collection,
java.lang.String categoryName,
java.lang.String lang,
java.lang.String[] nodeIDs)
Retrieve all classification Metadata for browsing (sent to the ClassifierBrowseMetadataRetrieve service). |
java.lang.String |
retrieveAllDocumentMetadata(java.lang.String collection,
java.lang.String lang,
java.lang.String[] docNodeIDs)
(c) DocumentMetadataRetrieve request sent to a collection's DocumentMetadataRetrieve service to retrieve all of a document's metadata. |
java.lang.String |
retrieveBrowseMetadata(java.lang.String collection,
java.lang.String categoryName,
java.lang.String lang,
java.lang.String[] nodeIDs,
java.lang.String[] metaNames)
ClassifierBrowseMetadataRetrieve service to retrieve some specific metadata values of a document. |
java.lang.String |
retrieveDocumentContent(java.lang.String collection,
java.lang.String lang,
java.lang.String[] docNodeIDs)
(a) DocumentContentRetrieve request sent to a collection's DocumentContentRetrieve service (p.48) |
java.lang.String |
retrieveDocumentMetadata(java.lang.String collection,
java.lang.String lang,
java.lang.String[] docNodeIDs,
java.lang.String[] metaNames)
DocumentMetadataRetrieve service to retrieve some specific metadata values of a document. |
java.lang.String |
retrieveDocumentStructure(java.lang.String collection,
java.lang.String lang,
java.lang.String[] docNodeIDs,
java.lang.String[] structure,
java.lang.String[] info)
DocumentStructureRetrieve request sent to a collection's DocumentStructureRetrieve service (manual pp.48, 49) to retrieve the specified part of the document's structure. |
java.lang.String |
retrieveEntireDocumentStructure(java.lang.String collection,
java.lang.String lang,
java.lang.String[] docNodeIDs)
(b) DocumentStructureRetrieve request sent to a collection's DocumentStructureRetrieve service (manual pp.48, 49) to retrieve the entire document structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger LOG
public static final java.lang.String defaultWsdlURL
protected org.apache.axis.client.Service service
protected org.apache.axis.client.Call call
protected java.lang.String portName
protected java.lang.String namespace
protected java.lang.String serviceName
protected java.lang.String wsdlURLName
Constructor Detail |
---|
public GS3WebServicesQBRAPI(java.lang.String wsdlURLName) throws javax.xml.rpc.ServiceException, java.net.MalformedURLException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
wsdlURLName
- - location of the WSDL URL for Greenstone 3's
web services
javax.xml.rpc.ServiceException
java.net.MalformedURLException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
Method Detail |
---|
protected static java.util.Vector getElementsByTagNameNS(org.w3c.dom.Element parentElement, java.lang.String namespacePrefix, java.lang.String localName)
namespacePrefix
- - a String for the namespacePrefix to search for.
This can be the wildcard * for any/allnamespaces.localName
- - the suffix of the namespaceprefix. For instance, localName
"soap" will return elements that have the tag wsdlsoap.parentElement
- - the XML element whose descendants will be returned if
their element names conform to the specified namespacePrefix and localName
parameters.
protected static void getElementsByTagNameSuffix(org.w3c.dom.Element parentElement, java.lang.String localName, java.util.Vector v)
parentElement
- us the XML element whose descendants are to be
retrieved by the given TagNameSuffix.localName
- is the tagName suffix to retrieve the descendants of
parentElement by.v
- is a Vector of all the previously retrieved elements whose tag
names are suffixed by localName. This Vector is appended to by recursive
calls to this method.protected static void getElementsByTagNameNS(org.w3c.dom.Element parentElement, java.lang.String namespacePrefix, java.lang.String localName, java.util.Vector v)
parentElement
- is the XML element whose descendants are to be
retrieved by the given TagNameSuffix.namespacePrefix
- is the namespace prefix to look for in the
descendants of parentElement that will be collected in Vector v.localName
- is the tagName suffix to look for in the descendants of
parentElement that will be collected in Vector v.v
- is a Vector of all the previously retrieved elements whose tag
names are prefixed by namespacePrefix and suffixed by localName.
This Vector is appended to by recursive calls to this method.public java.lang.String getNamespace()
public java.lang.String getService()
public java.lang.String getPort()
public java.lang.String getWsdl()
protected java.lang.String invokeWith(java.lang.Object[] params)
protected void addStringParam(java.lang.String paramName)
paramName
- - the name of the String parameter to add to the call
objectprotected void addArrayParam(java.lang.String arrayParamName)
arrayParamName
- - the name of the Array parameter to add to the
Call objectpublic java.lang.String describe(java.lang.String lang, java.lang.String subsetOption)
lang
- is the language of the display content in the responsesubsetOption
- is the requested list of items to return in the response
For the Message Router this can be collectionList, serviceClusterList,
serviceList, siteListpublic java.lang.String describeServiceCluster(java.lang.String serviceCluster, java.lang.String lang, java.lang.String subsetOption)
serviceCluster
- is the name of the Service Cluster that this describe
request is sent to.lang
- is the language of the display content in the responsesubsetOption
- is the requested list of items to return in the response
For Service Clusters this can be metadataList, serviceList, displayItemList.public java.lang.String describeCollection(java.lang.String collection, java.lang.String lang, java.lang.String subsetOption)
collection
- is the name of the Collection that this describe request
is sent to.lang
- is the language of the display content in the responsesubsetOption
- is the requested list of items to return in the response
For Collections this can be metadataList, serviceList and displayItemList.public java.lang.String describeCollectionService(java.lang.String collection, java.lang.String service, java.lang.String lang, java.lang.String subsetOption)
collection
- is the name of the Collection whose service
this describe request is sent to.service
- is the name of the Service (of that collection) to
which this describe request is sent.lang
- is the language of the display content in the responsesubsetOption
- is the requested list of items to return in the response
For Services this can be paramList, displayItemListpublic java.lang.String describeService(java.lang.String service, java.lang.String lang, java.lang.String subsetOption)
service
- is the name of the MessageRouter's Service to which this
describe request is sent.lang
- is the language of the display content in the responsesubsetOption
- is the requested list of items to return in the response
For Services this can be paramList, displayItemListpublic java.lang.String query(java.lang.String collection, java.lang.String service, java.lang.String lang, java.util.Map nameToValsMap)
collection
- is the name of the Collection whose query service this
query-process request is sent to. If "", then the Message Router is assumed.service
- is the name of the Query Service (of that collection) to
which this request is sent.lang
- is the language of the display content in the responsenameToValsMap
- is a Map of the (fieldname, value) pairs for the
parameters of the query. The field names should be those recognised by
Greenstone 3. That is, the names must exist for the (Collection-)Service Query that this
message is sent To (as given in 'to' argument).
For names of arguments,public java.lang.String basicQuery(java.lang.String collection, java.lang.String lang, java.lang.String query)
collection
- is the Greenstone collection to be searchedlang
- is the preferred language of the display content in
the response to be returned.query
- is the string to be sought in the Greenstone collection
public java.lang.String retrieveDocumentContent(java.lang.String collection, java.lang.String lang, java.lang.String[] docNodeIDs)
collection
- is the name of the Collection whose
DocumentContentRetrieve is requestedlang
- is the language of the display content in the responsedocNodeIDs
- is the list of documentNodeIDs for which the
content ought to be retrieved.public java.lang.String retrieveEntireDocumentStructure(java.lang.String collection, java.lang.String lang, java.lang.String[] docNodeIDs)
collection
- is the name of the Collection whose
DocumentStructureRetrieve is requestedlang
- is the language of the display content in the responsedocNodeIDs
- is the list of documentNodeIDs for which the
entire structure ought to be retrieved.public java.lang.String retrieveDocumentStructure(java.lang.String collection, java.lang.String lang, java.lang.String[] docNodeIDs, java.lang.String[] structure, java.lang.String[] info)
collection
- is the name of the Collection whose
DocumentStructureRetrieve is requestedlang
- is the language of the display content in the responsedocNodeIDs
- is the list of documentNodeIDs for which the
structure ought to be retrieved.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.info
- - for specifying extra information to be retrieved.
Possible values for info parameters are numSiblings, siblingPosition,
numChildren.public java.lang.String retrieveAllDocumentMetadata(java.lang.String collection, java.lang.String lang, java.lang.String[] docNodeIDs)
collection
- is the name of the Collection whose
DocumentMetadataRetrieve is requestedlang
- is the language of the display content in the responsedocNodeIDs
- is the list of documentNodeIDs for which the
structure ought to be retrieved.public java.lang.String retrieveDocumentMetadata(java.lang.String collection, java.lang.String lang, java.lang.String[] docNodeIDs, java.lang.String[] metaNames)
collection
- is the name of the Collection whose
DocumentContentRetrieve is requestedlang
- is the language of the display content in the responsedocNodeIDs
- is the list of documentNodeIDs for which the
structure ought to be retrieved.metaNames
- is a list of metadata names which are requested
to be fetched for the specified documents.public java.lang.String retrieveAllBrowseMetadata(java.lang.String collection, java.lang.String categoryName, java.lang.String lang, java.lang.String[] nodeIDs)
collection
- is the name of the Collection whose
ClassifierBrowseMetadataRetrieve service is calledcategoryName
- - name of the browsing category, usually
ClassifierBrowse. (If left as "", then it defaults to ClassifierBrowse)lang
- is the language of the display content in the responsenodeIDs
- is the list of document or classifier NodeIDs
for which the metadata ought to be retrieved.public java.lang.String retrieveBrowseMetadata(java.lang.String collection, java.lang.String categoryName, java.lang.String lang, java.lang.String[] nodeIDs, java.lang.String[] metaNames)
collection
- is the name of the Collection whose
ClassifierBrowseMetadataRetrieve service is calledcategoryName
- - name of the browsing category, usually
"ClassifierBrowse". (If left as "", then it defaults to ClassifierBrowse)lang
- is the language of the display content in the responsenodeIDs
- is the list of document or classifier NodeIDs
for which the metadata ought to be retrieved.metaNames
- is a list of metadata names which are requested
to be fetched for the specified documents or classifierspublic java.lang.String browseDescendants(java.lang.String collection, java.lang.String browseService, java.lang.String lang, java.lang.String[] classifierNodeIDs)
collection
- is the name of the Collection whose browse Classifier
Browse Service is calledbrowseService
- is the name of the (Classifier) Browse Service (of
the given collection) to which this request message is sent.lang
- is the language of the display content in the responseclassifierNodeIDs
- is an array of classifierNodeIDs for which the
structures ought to be retrieved.public java.lang.String browse(java.lang.String collection, java.lang.String browseService, java.lang.String lang, java.lang.String[] classifierNodeIDs, java.lang.String[] structureParams)
collection
- is the name of the Collection whose browse Classifier
Browse Service is calledbrowseService
- is the name of the (Classifier) Browse Service (of
the given collection) to which this request message is sent.lang
- is the language of the display content in the responseclassifierNodeIDs
- is the list of classifierNodeIDs for which the
structure ought to be retrieved.structureParams
- the list of parameters indicating what structure
information is requested. Accepted values are ancestors, parent, siblings,
children, descendants.public java.lang.String help()
public java.lang.String helpWithMethod(java.lang.String methodname)
methodname
- is the name of the method to be described.
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |