org.greenstone.fedora.services
Interface FedoraToGS3Interface

All Known Implementing Classes:
FedoraGS3Connection

public interface FedoraToGS3Interface

Most of the following methods return the same data as FedoraGS3DL, but formatted as Greenstone Response-Message XML. This way our java-client can parse the returned XML in the same way and store them in the same data structures.

Author:
ak19

Nested Class Summary
static interface FedoraToGS3Interface.Constants
          Interface declaring some string constants of literals to look for
 
Method Summary
 java.lang.String browse(java.lang.String collectionName, java.lang.String classifierID)
          This method performs the implemented browse operation: allowing the user to browse the titles of documents in the given collection by letter and returning the results.
 java.lang.String browseMetadataRetrieve(java.lang.String[] classNodeIDs)
          This method performs something equivalent to a greenstone3 ClassifierBrowseMetadataRetrieve on the classifierNodeIDs
 java.lang.String describeCollection(java.lang.String collectionName)
           
 java.lang.String describeCollectionService(java.lang.String collectionName, java.lang.String serviceName)
          All collections in this Digital Library (Fedora Repository) share the same services, so this method returns the same as describeService(serviceName).
 java.lang.String describeCollectionServices(java.lang.String collectionName)
           
 java.lang.String describeService(java.lang.String serviceName)
          All collections in this Digital Library (Fedora Repository) share the same services, so this method returns the same as describeCollectionService(collName, serviceName).
 java.lang.String getChildren(java.lang.String docID)
           
 java.lang.String getChildren(java.lang.String[] docIDs)
           
 java.lang.String getCollectionList()
           
 java.lang.String getCollectionMetadata(java.lang.String collID)
          Given a collectionID, returns a GS3 DocumentMetadataRetrieve response message that gives the metadata for the collection identified
 java.lang.String getCollectionMetadata(java.lang.String[] collIDs)
          Given a list of collectionIDs, returns a GS3 DocumentMetadataRetrieve response message that gives the metadata for each collection identified
 java.lang.String getContent(java.lang.String docID)
          Given a list of document identifiers that are either docPIDs or concatenations of docPID+sectionID, this method retrieves their contents.
 java.lang.String getContent(java.lang.String[] docIDs)
          Given a document identifier that is either a docPID or a concatenation of docPID+sectionID, this method retrieves the content for it.
 java.lang.String getDocumentMetadata(java.lang.String docID)
          Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing the metadata for the document.
 java.lang.String getDocumentMetadata(java.lang.String[] docIDs)
          Given a list of document identifiers, a GS3 DocumentMetadataRetrieve response message is returned containing the metadata for each document.
 java.lang.String getDocumentStructure(java.lang.String docID)
           
 java.lang.String getDocumentStructure(java.lang.String[] docIDs)
           
 java.lang.String getGSearchIndexName()
           
 java.lang.String getGSearchWSDLURL()
           
 java.lang.String getMetadata(java.lang.String[] docIDsOrCollIDs)
           
 java.lang.String getServiceList()
           
 java.lang.String getTitleMetadata(java.lang.String docID)
          Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing ONLY the Title metadata for the document.
 java.lang.String getTitleMetadata(java.lang.String[] docIDs)
          Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing ONLY the Title metadata for the documents.
 java.lang.String query(java.lang.String collection, java.lang.String service, java.util.Map nameValParamsMap)
           
 void setGSearchIndexName(java.lang.String indexName)
          Sets the member variable gSearchIndexName that specifies the name of the index containing indexed GS3 documents.
 void setGSearchWSDLURL(java.lang.String url)
          Sets the member variable gSearchWSDLURL that specify the location of the WSDL file of FedoraGSearch's web services.
 

Method Detail

getGSearchWSDLURL

java.lang.String getGSearchWSDLURL()
Returns:
the gSearchWSDLURL, the url of the WSDL for the FedoraGSearch web services

setGSearchWSDLURL

void setGSearchWSDLURL(java.lang.String url)
Sets the member variable gSearchWSDLURL that specify the location of the WSDL file of FedoraGSearch's web services. Then it attempts to instantiate a connection to those web services.

Parameters:
url - is the new url of the GSearch web services WSDL file

getGSearchIndexName

java.lang.String getGSearchIndexName()
Returns:
the gSearchIndexName, the name of the index Fedora Generic Search will search in (where GS3 docs have been indexed into).

setGSearchIndexName

void setGSearchIndexName(java.lang.String indexName)
Sets the member variable gSearchIndexName that specifies the name of the index containing indexed GS3 documents. Then it attempts to instantiate a connection to the Fedora GSearch web services using this changed value for indexName.

Parameters:
indexName - is the new name of the index containing indexed GS3 docs that GSearch should search in.

getServiceList

java.lang.String getServiceList()
Returns:
a GS3 response message for a describe services request: indicating the list of services supported by the Fedora-Greenstone interface. These are DocumentContentRetrieve, DocumentMetadataRetrieve, DocumentStructureRetrieve, BrowseByLetter - as indicated by member variable serviceNames.

getCollectionList

java.lang.String getCollectionList()
Returns:
a GS3 describe response message listing the collections and collection-specific metadata stored in the Fedora-Greenstone repository.

describeCollection

java.lang.String describeCollection(java.lang.String collectionName)
Parameters:
collectionName - - the name of the collection that is to be described. It will be converted to a fedora collection pid, which is of the form "greenstone:<collectionName>-collection".
Returns:
a GS3 describe response message for a collection in the Fedora-Greenstone repository.

describeCollectionServices

java.lang.String describeCollectionServices(java.lang.String collectionName)
Parameters:
collectionName - - the name of the collection whose services are to be described. It will be converted to a fedora collection pid, which is of the form "greenstone:<collectionName>-collection".
Returns:
a GS3 describe response message for the services of a collection in the Fedora-Greenstone repository. So far, these services are the same for all fedora collections: they are the services given in member variable serviceNames: DocumentContent/Metadata/StructureRetrieve, browse.

describeCollectionService

java.lang.String describeCollectionService(java.lang.String collectionName,
                                           java.lang.String serviceName)
All collections in this Digital Library (Fedora Repository) share the same services, so this method returns the same as describeService(serviceName).

Parameters:
collectionName - - the name of the collection whose service is to be described. It will be converted to a fedora collection pid, which is of the form "greenstone:<collectionName>-collection".
serviceName - - the name of the service in the collection which is to be described.
Returns:
a GS3 describe response message for the requested service of the given collection. DocumentContent/Metadata/StructureRetrieve return nothing special except their names; browse (and any query) return more complex XML responses.

describeService

java.lang.String describeService(java.lang.String serviceName)
All collections in this Digital Library (Fedora Repository) share the same services, so this method returns the same as describeCollectionService(collName, serviceName).

Parameters:
serviceName - - the name of the service in the collection which is to be described.
Returns:
a GS3 describe response message for the requested service of the given collection. DocumentContent/Metadata/StructureRetrieve return nothing special except their names; browse (and any query) return more complex XML responses. All collections in this Digital Library (Fedora Repository) share the same services, so this method returns the same as describeService(serviceName).

getContent

java.lang.String getContent(java.lang.String docID)
Given a list of document identifiers that are either docPIDs or concatenations of docPID+sectionID, this method retrieves their contents.

Parameters:
docID - is expected to be of the form "greenstone:<collectionName>-<docPID>-<sectionNumber>" or "greenstone:<collectionName>-<docPID>" If it is "greenstone:<collectionName>-<docPID>", then the content for "greenstone:<collectionName>-1" ("greenstone:<collectionName>-Section1") is returned.

getContent

java.lang.String getContent(java.lang.String[] docIDs)
Given a document identifier that is either a docPID or a concatenation of docPID+sectionID, this method retrieves the content for it.

Parameters:
docIDs - an array of document IDs where each is expected to be of the form "greenstone:<collectionName>-<docPID>-<sectionNumber>" or "greenstone:<collectionName>-<docPID>" If it is "greenstone:<collectionName>-<docPID>", then the content for "greenstone:<collectionName>-1" ("greenstone:<collectionName>-Section1") is returned.

getDocumentStructure

java.lang.String getDocumentStructure(java.lang.String docID)
Parameters:
docID - the identifier for the document whose structure is required. This is either of the format "greenstone:<collectionName>-<docPID>" OR "greenstone:<collectionName>-<docPID>-" where "greenstone:<collectionName>-<docPID>-1" is the same as "greenstone:<collectionName>-<docPID>" and will return the same response
Returns:
the documentStructure of the document or section given by docID. The structure is returned in the XML format of a Greenstone3 DocumentStructureRetrieve response message. This method returns the entire subSection of the docID (that is, all descendents included).

getChildren

java.lang.String getChildren(java.lang.String docID)
Parameters:
docID - the identifier for the document whose structure is required. This is of the format "greenstone:<collectionName>-<docPID>" OR "greenstone:<collectionName>-<docPID>-" where "greenstone:<collectionName>-<docPID>-1" is the same as "greenstone:<collectionName>-<docPID>" and will return the same response
Returns:
a view of the structure of the document or section given by docID which contains only the section and its direct children. This structure is returned in the XML format of a Greenstone3 DocumentStructureRetrieve response message.

getDocumentStructure

java.lang.String getDocumentStructure(java.lang.String[] docIDs)
Parameters:
docIDs - an array of document identifiers whose structures are requested These are of the format "greenstone:<collectionName>-<docPID>" OR "greenstone:<collectionName>-<docPID>-<sectionNumber>" where "greenstone:<collectionName>-<docPID>-1" is the same as "greenstone:<collectionName>-<docPID>" and will return the same response
Returns:
the documentStructure of the documents or sections given by docIDs. The structure is returned in the XML format of a Greenstone3 DocumentStructureRetrieve response message. This method returns the entire subSection of each docID (that is, all descendents included).

getChildren

java.lang.String getChildren(java.lang.String[] docIDs)
Parameters:
docIDs - an array of document identifiers whose structures are requested These are of the format "greenstone:<collectionName>-<docPID>" OR "greenstone:<collectionName>-<docPID>-<sectionNumber>" where "greenstone:<collectionName>-<docPID>-1" is the same as "greenstone:<collectionName>-<docPID>" and will return the same response
Returns:
the documentStructure of the documents or sections given by docIDs but only the sections and their children (not any further descendents). The structure is returned in the XML format of a Greenstone3 DocumentStructureRetrieve response message.

getCollectionMetadata

java.lang.String getCollectionMetadata(java.lang.String[] collIDs)
Given a list of collectionIDs, returns a GS3 DocumentMetadataRetrieve response message that gives the metadata for each collection identified

Parameters:
collIDs - is an array of fedora pids identifying collections in the fedora repository
Returns:
a GS3 DocumentMetadataRetrieve response message containing the EX metadata for all the requested collections

getDocumentMetadata

java.lang.String getDocumentMetadata(java.lang.String[] docIDs)
Given a list of document identifiers, a GS3 DocumentMetadataRetrieve response message is returned containing the metadata for each document.

Parameters:
docIDs - is an array of document identifiers (docID can either be <pid>s items (documents) in the fedora repository, or "<pid>-sectionNumber".
Returns:
a GS3 DocumentMetadataRetrieve response message containing the EX, DC, DLS metadata for all the requested documents

getCollectionMetadata

java.lang.String getCollectionMetadata(java.lang.String collID)
Given a collectionID, returns a GS3 DocumentMetadataRetrieve response message that gives the metadata for the collection identified

Parameters:
collID - is a fedora pid identifying a collection in its repository
Returns:
a GS3 DocumentMetadataRetrieve response message containing the EX metadata for the requested collection

getDocumentMetadata

java.lang.String getDocumentMetadata(java.lang.String docID)
Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing the metadata for the document.

Parameters:
docID - is a document identifier (docID can either be a <pid> of an item (document) in the fedora repository, or it can be "<pid>-sectionNumber".
Returns:
a GS3 DocumentMetadataRetrieve response message containing the EX, DC, DLS metadata for all the requested document

getMetadata

java.lang.String getMetadata(java.lang.String[] docIDsOrCollIDs)
Parameters:
docIDsOrCollIDs - is an array of identifiers which may be either the fedora pids for collections, or otherwise may be a document identifier. In the last case, the document ID may consist of either "documentPID-sectionNumber" or may just be just fedora documentPID
Returns:
a greenstone DocumentMetadataRetrieve response for the documents or collections indicated by the docIDsOrCollIDs.

getTitleMetadata

java.lang.String getTitleMetadata(java.lang.String docID)
Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing ONLY the Title metadata for the document.

Parameters:
docID - is a document identifier (docID can either be a <pid> of an item (document) in the fedora repository, or it can be "<pid>-sectionNumber".
Returns:
a GS3 DocumentMetadataRetrieve response message containing the Title metadata for the requested document

getTitleMetadata

java.lang.String getTitleMetadata(java.lang.String[] docIDs)
Given a document identifier, returns a GS3 DocumentMetadataRetrieve response message containing ONLY the Title metadata for the documents.

Parameters:
docIDs - is a list of document identifiers (where docID can either be a <pid> of an item (document) in the fedora repository, or it can be "<pid>-sectionNumber".
Returns:
a GS3 DocumentMetadataRetrieve response message containing the Title metadata for all the requested documents

browseMetadataRetrieve

java.lang.String browseMetadataRetrieve(java.lang.String[] classNodeIDs)
This method performs something equivalent to a greenstone3 ClassifierBrowseMetadataRetrieve on the classifierNodeIDs

Parameters:
classNodeIDs - are the IDs of the classifierNode for which the metadata needs to be returned
Returns:
a GS3 ClassifierBrowseMetadataRetrieve response message which lists the metadata for all the classifierNodes passed as parameter.

browse

java.lang.String browse(java.lang.String collectionName,
                        java.lang.String classifierID)
This method performs the implemented browse operation: allowing the user to browse the titles of documents in the given collection by letter and returning the results.

Parameters:
classifierID - is the id of the classifier on which to browse. In this case, the classifier indicates whether we browse titles by letter, or browse (documents) by collection; and it is of the form <CL(letter)>.
collectionName - is the name of the collection whose documents starting with the given letter will be returned.
Returns:
a GS3 DocumentStructureRetrieve response message which lists all the documents that start with the letter indicated by parameter classifier.

query

java.lang.String query(java.lang.String collection,
                       java.lang.String service,
                       java.util.Map nameValParamsMap)
Parameters:
nameValParamsMap - is a Map of name and value pairs for all the query field data values. The names match the field names that describeCollectionService() would have returned for the query service.
collection - is the name of the collection
service - is the name of the query service This method is only ever called when any of the services in the digital library described themselves as type=query. Therefore any digital libraries that have no query services, can just return emtpy message strings (or even "") since this method will never be called on them anyway.
Returns:
a String representing Greenstone3 XML for a query process response returning the results for the query denoted by parameter nameValParamsMap.