org.greenstone.gs3client.dlservices
Class FedoraServicesAPIA

java.lang.Object
  extended by org.greenstone.fedora.services.FedoraConnection
      extended by org.greenstone.fedora.services.FedoraGS3Connection
          extended by org.greenstone.gs3client.dlservices.FedoraServicesAPIA
All Implemented Interfaces:
org.greenstone.fedora.services.FedoraGS3DL, org.greenstone.fedora.services.FedoraToGS3Interface, org.greenstone.fedora.services.FedoraToGS3Interface.Constants, DigitalLibraryServicesAPIA

public class FedoraServicesAPIA
extends org.greenstone.fedora.services.FedoraGS3Connection
implements DigitalLibraryServicesAPIA

FedoraServicesAPIA implements DigitalLibraryServicesAPIA for enabling the Java-client to access a Fedora repository of Greenstone digital objects. This is made possible by its use of the FedoraGS3.jar file's functionality, as made available through the FedoraGS3Connection class.

Author:
ak19

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.greenstone.gs3client.dlservices.DigitalLibraryServicesAPIA
DigitalLibraryServicesAPIA.CancelException
 
Nested classes/interfaces inherited from interface org.greenstone.fedora.services.FedoraToGS3Interface
org.greenstone.fedora.services.FedoraToGS3Interface.Constants
 
Field Summary
 
Fields inherited from class org.greenstone.fedora.services.FedoraGS3Connection
CHILDREN, DESCENDANTS, fedoraGSearch, gSearchWSDLSuffix, gSearchWSDLURL, serviceNames, SERVICES
 
Fields inherited from class org.greenstone.fedora.services.FedoraConnection
APIA, baseURL, builder, defaultPortAddressSuffix, fedoraVersion, GET, INTERNAL_NODE, lang, maxresults, portAddressSuffix, SUPPORTED_VERSION, TYPE
 
Fields inherited from interface org.greenstone.gs3client.dlservices.DigitalLibraryServicesAPIA
propertiesFile
 
Fields inherited from interface org.greenstone.fedora.services.FedoraToGS3Interface.Constants
ALL_FIELDS, ALL_TITLES, ASSOCFILEPREFIX, COMMA, DOC_TITLES, FIELDNAME_ATT, FULLTEXT, GS3FilePathMacro, MAXDOCS, NUM_DOCS_MATCHED, OCCURS_ATT, QUERY, SIMPLEFIELD_ATT
 
Fields inherited from interface org.greenstone.fedora.services.FedoraGS3DL
_COLLECTION, COLLECTION, COLLECTIONNAME, COLON, DC, DLS, ENGLISH, EX, FEDORA_GS3, GREENSTONE, GREENSTONE_, HYPHEN, ID, METADATA, NAME, PERIOD, QUALIFIER, SECTION, SECTION_ELEMENT, TITLE, TOC, UTF8, WILDCARD
 
Constructor Summary
FedoraServicesAPIA()
          Default constructor
 
Method Summary
 java.lang.String describe()
           
 java.lang.String getAssocFileBaseURL(DocumentNodeData docNode)
           
 java.lang.String getDisplayName()
           
 java.lang.String query(java.lang.String collection, java.lang.String service, java.util.Map nameValParamsMap)
           
 java.lang.String retrieveBrowseMetadata(java.lang.String collection, java.lang.String service, java.lang.String[] nodeIDs)
           
 java.lang.String retrieveBrowseStructure(java.lang.String collection, java.lang.String service, java.lang.String classifierID)
           
 java.lang.String retrieveDocumentChildren(java.lang.String collection, java.lang.String docID)
           
 java.lang.String retrieveDocumentChildren(java.lang.String collection, java.lang.String[] docIDs)
           
 java.lang.String retrieveDocumentContent(java.lang.String collection, java.lang.String docID)
           
 java.lang.String retrieveDocumentContent(java.lang.String collection, java.lang.String[] docIDs)
           
 java.lang.String retrieveDocumentMetadata(java.lang.String collection, java.lang.String docID)
           
 java.lang.String retrieveDocumentMetadata(java.lang.String collection, java.lang.String[] docIDs)
           
 java.lang.String retrieveDocumentStructure(java.lang.String collection, java.lang.String docID)
           
 java.lang.String retrieveDocumentStructure(java.lang.String collection, java.lang.String[] docIDs)
           
 java.lang.String retrieveTitleMetadata(java.lang.String collection, java.lang.String docID)
           
 java.lang.String retrieveTitleMetadata(java.lang.String collection, java.lang.String[] docIDs)
           
 
Methods inherited from class org.greenstone.fedora.services.FedoraGS3Connection
addMetadataWithFixedTagName, addMetadataWithNamespacedTagNames, browse, browseMetadataRetrieve, containsSectionNumber, createClassifierElement, createDocNodeFromSubsection, createDocStructure, createNameValuePairElement, createResponseMessage, createServiceList, describeCollection, describeCollectionService, describeCollectionServices, describeFieldQueryService, describeService, describeTextQueryService, fieldQuery, getChildren, getChildren, getCollectionList, getCollectionMetadata, getCollectionMetadata, getContent, getContent, getContentBody, getDocPIDFromDocID, getDocumentMetadata, getDocumentMetadata, getDocumentStructure, getDocumentStructure, getGSearchWSDLURL, getMetadata, getMetadata, getSectionIDFromDocID, getServiceList, getServiceNames, getStructure, getStructure, getStructureElement, getTitleMetadata, getTitleMetadata, getTitleMetadata, initSearchFunctionality, main, setGSearchWSDLURL, setInitialisationProperties, textQuery
 
Methods inherited from class org.greenstone.fedora.services.FedoraConnection
browseTitlesByLetter, convertToMetaNumber, createAPIA, findObjectsWithTitlesContaining, getAssocFileBaseURL, getBaseURL, getChildrenOfSection, getChildrenOfSectionXML, getCollectionDocs, getCollectionName, getCollectionNames, getCollectionPID, getCollectionPIDs, getCollections, getCollectionTitle, getCollectionTitles, getDC, getDLS, getDocName, getDocTitle, getDocTitles, getEX, getFedoraVersion, getItem, getLanguage, getMaxResults, getPortAddressURL, getSection, getSectionDCMetadata, getSectionEXMetadata, getSectionNames, getSectionNumbers, getSectionTitle, getSectionTitles, getSubsection, getSubsectionXML, getSubstructure, getSupportedVersion, getTitle, getTitle, getTitles, getTOC, init, removePrefix, searchDocumentTitles, setLanguage, setMaxResults, showAuthenticationPopup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.greenstone.gs3client.dlservices.DigitalLibraryServicesAPIA
describeCollection, describeCollectionService, describeService, getAssocFileBaseURL, getLanguage, setLanguage
 

Constructor Detail

FedoraServicesAPIA

public FedoraServicesAPIA()
                   throws java.lang.Exception
Default constructor

Throws:
java.lang.Exception
Method Detail

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface DigitalLibraryServicesAPIA
Returns:
the name of this digital library for displaying in the client

getAssocFileBaseURL

public java.lang.String getAssocFileBaseURL(DocumentNodeData docNode)
Specified by:
getAssocFileBaseURL in interface DigitalLibraryServicesAPIA
Returns:
the directory path to the associated files of the given document node. For instance, the base url of a JEditorPane's HTML documents can be set to this.

describe

public java.lang.String describe()
Specified by:
describe in interface DigitalLibraryServicesAPIA
Returns:
Greenstone3 XML describe response message with information about collections contained and services (and any serviceRacks) supported by the Digital library.

retrieveDocumentMetadata

public java.lang.String retrieveDocumentMetadata(java.lang.String collection,
                                                 java.lang.String[] docIDs)
Specified by:
retrieveDocumentMetadata in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docIDs - is an array of document identifiers of documents whose metadata is requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing all the metadata of all the documents indicated by docIDs

retrieveDocumentMetadata

public java.lang.String retrieveDocumentMetadata(java.lang.String collection,
                                                 java.lang.String docID)
Specified by:
retrieveDocumentMetadata in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docID - is the document identifier of the document whose metadata is requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing all the metadata of the document denoted by docID

retrieveTitleMetadata

public java.lang.String retrieveTitleMetadata(java.lang.String collection,
                                              java.lang.String[] docIDs)
Specified by:
retrieveTitleMetadata in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docIDs - is an array of document identifiers of documents whose titles are requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing only the title metadata of the documents denoted by docIDs

retrieveTitleMetadata

public java.lang.String retrieveTitleMetadata(java.lang.String collection,
                                              java.lang.String docID)
Specified by:
retrieveTitleMetadata in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docID - is the document identifier of the document whose titles is requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing only the title metadata of the document denoted by docID

retrieveDocumentContent

public java.lang.String retrieveDocumentContent(java.lang.String collection,
                                                java.lang.String[] docIDs)
Specified by:
retrieveDocumentContent in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docIDs - is an array of document identifiers of documents whose (text) contents are requested
Returns:
a String representing Greenstone3 DocumentContentRetrieve XML containing the document contents of the documents indicated by docIDs

retrieveDocumentContent

public java.lang.String retrieveDocumentContent(java.lang.String collection,
                                                java.lang.String docID)
Specified by:
retrieveDocumentContent in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docID - is the document identifier of the document whose (text) content is requested
Returns:
a String representing Greenstone3 DocumentContentRetrieve XML containing the document contents of the document indicated by docID

retrieveDocumentStructure

public java.lang.String retrieveDocumentStructure(java.lang.String collection,
                                                  java.lang.String[] docIDs)
Specified by:
retrieveDocumentStructure in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docIDs - is an array of document identifiers of documents whose hierarchical structures are requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing the document structure of the documents indicated by docIDs: this means all their descendents

retrieveDocumentStructure

public java.lang.String retrieveDocumentStructure(java.lang.String collection,
                                                  java.lang.String docID)
Specified by:
retrieveDocumentStructure in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docID - is the document identifier of the document whose hierarchical structure is requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing the document structure of the document indicated by docID: this means all its descendents

retrieveDocumentChildren

public java.lang.String retrieveDocumentChildren(java.lang.String collection,
                                                 java.lang.String[] docIDs)
Specified by:
retrieveDocumentChildren in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docIDs - is an array of document identifiers of documents whose hierarchical structures are requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing a view of the document structure of the documents denoted by docs where only the requested documents and their direct children are returned.

retrieveDocumentChildren

public java.lang.String retrieveDocumentChildren(java.lang.String collection,
                                                 java.lang.String docID)
Specified by:
retrieveDocumentChildren in interface DigitalLibraryServicesAPIA
Parameters:
collection - is the name of the collection
docID - is the document identifier of the document whose hierarchical structure is requested
Returns:
a String representing Greenstone3 DocumentMetadataRetrieve XML containing a view of the document structure of the document denoted by docID where only the document and its direct children are returned.

retrieveBrowseStructure

public java.lang.String retrieveBrowseStructure(java.lang.String collection,
                                                java.lang.String service,
                                                java.lang.String classifierID)
Specified by:
retrieveBrowseStructure in interface DigitalLibraryServicesAPIA
Parameters:
classifierID - is of the form CL# where the number (#) marks out structured sections like CL1.1.3 or CL2
collection - is the name of the collection
service - is the name of the browse service (=ClassifierBrowse usually)
Returns:
a String representing Greenstone3 ClassifierBrowse XML giving the entire *structure* of the classification denoted by classifierID (including the structures of document descendents of the classifier).

retrieveBrowseMetadata

public java.lang.String retrieveBrowseMetadata(java.lang.String collection,
                                               java.lang.String service,
                                               java.lang.String[] nodeIDs)
Specified by:
retrieveBrowseMetadata in interface DigitalLibraryServicesAPIA
Parameters:
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).
collection - is the name of the collection
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)
Returns:
a String representing Greenstone3 ClassifierBrowseMetadataRetrieve XML giving all the metadata for all the subclassifiers denoted by nodeIDs.

query

public java.lang.String query(java.lang.String collection,
                              java.lang.String service,
                              java.util.Map nameValParamsMap)
Specified by:
query in interface org.greenstone.fedora.services.FedoraToGS3Interface
Specified by:
query in interface DigitalLibraryServicesAPIA
Overrides:
query in class org.greenstone.fedora.services.FedoraGS3Connection
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.