|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3services.QBRSOAPServer
public class QBRSOAPServer
Class that provides the basic Query, Browse and Retrieve (QBR) web service operations for Greenstone 3. It contains a MessageRouter that carries out all the tasks by calling the appropriate Greenstone functionality for each request message passed to it, and returning a response message. All response messages are returned from the MessageRouter to clients invoking the web services. All return values are strings that represent XML messages. Method help() reads from the file QBRWebServicesHelp.properties to list the web service operations available. Method helpWithMethod(String methodName) reads from the same file to display a description of the requested operation. (These method descriptions are mostly the same as those in the Javadoc comments.) NOTE: to run this class, the folder containing this web service class' properties helpFile should be on the classpath.
Field Summary | |
---|---|
protected static java.lang.String |
browseStructureOptions
|
protected org.greenstone.gsdl3.util.XMLConverter |
converter
A converter class to parse XML and create Docs |
protected static java.lang.String |
csSubsetOptions
|
protected org.w3c.dom.Document |
doc
Container Document to create XML Nodes |
protected static java.lang.String |
docStructureInfo
|
protected static java.lang.String |
docStructureOptions
|
protected static java.lang.String |
helpErrormessage
Error message loading helpFile. |
protected static java.lang.String |
helpFile
The help properties file describing the web service operations |
protected org.greenstone.gsdl3.core.MessageRouter |
mr
Message Router object to pass requests messages to and which will process them. |
protected static java.lang.String |
mrSubsetOptions
|
protected static java.util.Properties |
properties
Properties map with mappings from methodname to help description string. |
protected static java.lang.String |
serviceSubsetOptions
|
protected java.lang.String |
site_name
site_name the MessageRouter works with, here set to "localsite" |
Constructor Summary | |
---|---|
QBRSOAPServer()
Constructor that initializes the web services' MessageRouter object Reads from GlobalProperties to get gsdl3_home and set the sitename. |
Method Summary | |
---|---|
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)
Sends a describe message to the MessageRouter. |
protected java.lang.String |
describe(java.lang.String to,
java.lang.String lang,
java.lang.String subsetOption,
java.lang.String validSubsetOptions)
For sending a describe message. |
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 java.lang.String |
error(java.lang.String errorMessage)
Creates a String response message to represent an XML error response message using the error specified in the message parameter. |
static java.lang.String |
help()
|
static java.lang.String |
helpWithMethod(java.lang.String methodname)
|
static void |
main(java.lang.String[] args)
|
protected java.lang.String |
metadataRetrieve(java.lang.String to,
java.lang.String lang,
java.lang.String[] nodeIDs,
java.lang.String[] metaNames,
java.lang.String NODE_ELEM)
Performs a metadata retrieve for documents and (browse) classification hierarchies. |
protected java.lang.String |
processInternal(org.w3c.dom.Element message)
Called by most other methods in order to send the constructed message to the Greenstone's MessageRouter, intercept the response and return it. |
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)
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)
DocumentContentRetrieve request sent to a collection's DocumentContentRetrieve service (see manual, 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)
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 |
---|
protected static java.lang.String helpErrormessage
protected static java.util.Properties properties
protected static java.lang.String helpFile
protected java.lang.String site_name
protected org.greenstone.gsdl3.core.MessageRouter mr
protected org.w3c.dom.Document doc
protected org.greenstone.gsdl3.util.XMLConverter converter
protected static final java.lang.String mrSubsetOptions
protected static final java.lang.String csSubsetOptions
protected static final java.lang.String serviceSubsetOptions
protected static final java.lang.String docStructureOptions
protected static final java.lang.String docStructureInfo
protected static final java.lang.String browseStructureOptions
Constructor Detail |
---|
public QBRSOAPServer()
Method Detail |
---|
public java.lang.String describe(java.lang.String lang, java.lang.String subsetOption)
lang
- is the language of the display content in the response.subsetOption
- are 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, displayItemListprotected java.lang.String describe(java.lang.String to, java.lang.String lang, java.lang.String subsetOption, java.lang.String validSubsetOptions)
to
- - the Greenstone module (MessageRouter, Collection,
ServiceCluster or (Collection-)Service to send this describe message to.
(The module asked to describe itself.)lang
- - the language of the display content in the response.subsetOption
- - the set of elements of the describe response that
are requested. These vary depending on the GS3 module asked to describe
itself.validSubsetOptions
- - the list of subsetOptions that are allowed
for the module this describe message is sent to. Parameter subsetOption
has to be among the list of validSubsetOptions.public 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 Greenstone-accepted 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, descendants (note spelling), entire.info
- - for specifying extra information to be retrieved.
Possible values for info parameters are numSiblings, siblingPosition,
numChildrenpublic 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 documentspublic 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 classifiersprotected java.lang.String metadataRetrieve(java.lang.String to, java.lang.String lang, java.lang.String[] nodeIDs, java.lang.String[] metaNames, java.lang.String NODE_ELEM)
to
- - the Document- or ClassifierBrowse- MetadataRetrieve service to
send this metadata retrieve message to.lang
- - the language of the display content in the responsenodeIDs
- - the list of (document or classifier) nodeIDs for which
to retrieve the metadata formetaNames
- - a list specifiying the names of the metadata items
to be retrieved for each nodeID. E.g. "Title", but a list is allowed.NODE_ELEM
- - either of GSXML's names for the <documentNode> or
<classifierNode> elements.public 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.protected java.lang.String processInternal(org.w3c.dom.Element message)
message
- is the XML message Element to send to GS3's MessageRouter.
protected java.lang.String error(java.lang.String errorMessage)
errorMessage
- - the errormessage to be conveyed
public static java.lang.String help()
public static 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 |