|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.fedora.services.FedoraConnection
public class FedoraConnection
Class that establishes a connection with Fedora's web services (via Java stub classes for the same) and then provides methods to retrieve Greenstone-specific data, such as the TOC, EX, DC,and Section datastreams of the Greenstone documents stored in Fedora's repository. These datastreams are returned as Strings without any changes being made to them.
Field Summary | |
---|---|
protected static fedora.server.access.FedoraAPIA |
APIA
The object used to access the Fedora API-A web service methods |
protected java.lang.String |
baseURL
The location of the fedora server, usually of the form http://localhost:8080/fedora |
protected javax.xml.parsers.DocumentBuilder |
builder
DocumentBuilder used to create and parse XML documents |
protected static java.lang.String |
defaultPortAddressSuffix
The part of the portAddress that comes after the baseURL. |
protected java.lang.String |
fedoraVersion
Version of the running fedora server |
protected static java.lang.String |
GET
|
protected static java.lang.String |
INTERNAL_NODE
|
protected java.lang.String |
lang
The preferred language of the displat content |
protected int |
maxresults
The maximum number of collections to retrieve |
protected java.lang.String |
portAddressSuffix
The user-specified portAddressSuffix of the Fedora Access web services (endpoint URL in the WSDL), usually of the form http://localhost:8080/fedora/services/access Users can tell FedoraGS3 to try accessing that first by setting the "port.address.suffix" property in the properties file. |
protected static java.lang.String |
SUPPORTED_VERSION
The version of fedora that is supported by class FedoraConnection |
protected static java.lang.String |
TYPE
|
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 | |
---|---|
FedoraConnection()
Default constructor which takes input from the user to get host, port, fedora username and password. |
|
FedoraConnection(java.io.File propertyFile)
Single argument constructor that takes the name of the properties file defining the values of the initialisation parameters required to instantiate a FedoraConnection. |
|
FedoraConnection(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String fedoraServerUsername,
java.lang.String fedoraServerPassword)
Code for this constructor is from DemoSOAPClient.java. |
Method Summary | |
---|---|
java.lang.String[] |
browseTitlesByLetter(java.lang.String collName,
java.lang.String letter)
Implements browsing document titles of a greenstone collection stored in the fedora repository by letter. |
protected java.lang.String |
convertToMetaNumber(java.lang.String number)
Given a number of the form x(.y.z), this method returns this number as is, except when x = 1, in which case, it would return .y.z That is, given number=3.2.1, this method would return 3.2.1 But, given number=1.2.3, this method would return .2.3. |
protected void |
createAPIA(fedora.server.access.FedoraAPIAServiceLocator serviceLocator,
java.lang.String portSuffix,
java.lang.String messageInsert,
boolean isUserSpecifiedPortAddressSuffix)
Tries to create the FedoraAPIA instance using the serviceLocator and the given portSuffix. |
protected fedora.server.types.gen.FieldSearchResult |
findObjectsWithTitlesContaining(java.lang.String collName,
java.lang.String titleWord)
|
java.lang.String |
getAssocFileBaseURL()
|
java.lang.String |
getBaseURL()
|
java.lang.String |
getChildrenOfSection(java.lang.String docPID,
java.lang.String sectionID)
|
org.w3c.dom.Element |
getChildrenOfSectionXML(java.lang.String docPID,
java.lang.String sectionID)
|
java.lang.String[] |
getCollectionDocs(java.lang.String colPID)
Searches the fedora repository for all greenstone:<colPID>* and returns the PIDs of the data objects found, with the exception of greenstone:<colPID>-collection, which is not a document but a collection PID. |
java.lang.String |
getCollectionName(java.lang.String collPID)
|
java.lang.String[] |
getCollectionNames(java.lang.String[] collPIDs)
|
java.lang.String |
getCollectionPID(java.lang.String collName)
|
java.lang.String[] |
getCollectionPIDs(java.lang.String[] collNames)
|
java.lang.String[] |
getCollections()
Gets all greenstone collections. |
java.lang.String |
getCollectionTitle(java.lang.String collPID)
Gets the title of the collection denoted by the given collection's pid by retrieving the title metadata for it from the collection's EX datastream. |
java.lang.String[] |
getCollectionTitles(java.lang.String[] collPIDs)
|
java.lang.String |
getDC(java.lang.String pid)
All objects (incl "greenstone:*" objects) in fedora - be they collections, top-level documents or document sections - have a DC datastream. |
java.lang.String |
getDLS(java.lang.String pid)
Some "greenstone:*" top-level documents in the fedora repository (but not greenstone collections or document sections) have a DLS metadata datastream. |
java.lang.String |
getDocName(java.lang.String docPID)
|
java.lang.String |
getDocTitle(java.lang.String docPID)
Gets the title metadata for a particular doc object in a collection denoted by docPID. |
java.lang.String[] |
getDocTitles(java.lang.String[] docPIDs)
|
java.lang.String |
getEX(java.lang.String pid)
All "greenstone:*" objects in fedora (be they collections be they collections, top-level documents or document sections) have an EX datastream. |
java.lang.String |
getFedoraVersion()
The version of the running Fedora server, which may or may not match the supported version. |
protected java.lang.String |
getItem(java.lang.String docPID,
java.lang.String itemID)
Return a datastream of a document, given the document's id and the item id of the datastream which is to be retrieved. |
java.lang.String |
getLanguage()
|
int |
getMaxResults()
The default maximum number of search results returned for a search. |
java.lang.String |
getPortAddressURL()
|
java.lang.String |
getSection(java.lang.String docPID,
java.lang.String sectionID)
|
java.lang.String |
getSectionDCMetadata(java.lang.String docPID,
java.lang.String sectionID)
|
java.lang.String |
getSectionEXMetadata(java.lang.String docPID,
java.lang.String sectionID)
Returns the section EX metadata XML datastream for SectionID which may be a section name or number. |
java.lang.String[] |
getSectionNames(java.lang.String docPID)
Given the pid of a document fedora data object, this method will return all itemIDs that are part of that data object and are Sections. |
java.lang.String[] |
getSectionNumbers(java.lang.String docPID)
Given the pid of a document fedora data object, this method will return all itemIDs that are part of that data object and are Sections, but just the Section numbers are returned. |
java.lang.String |
getSectionTitle(java.lang.String docPID,
java.lang.String sectionID)
|
java.lang.String[] |
getSectionTitles(java.lang.String[] docPIDs,
java.lang.String[] sectionIDs)
|
java.lang.String |
getSubsection(java.lang.String docPID,
java.lang.String sectionID)
|
org.w3c.dom.Element |
getSubsectionXML(java.lang.String docPID,
java.lang.String sectionID)
|
protected org.w3c.dom.Element |
getSubstructure(org.w3c.dom.Element e,
boolean descendents)
Convert the given Element to a String representing the same XML. |
static java.lang.String |
getSupportedVersion()
Static method that returns the version of Fedora supported by this class FedoraConnection. |
protected java.lang.String |
getTitle(java.lang.String exStream)
Given a string representation of a document's or document section's EX datastream -- which is a greenstone extracted metadata XML file -- of the form: <ex> <ex:metadata name="Title">sometitle</ex:metadata> <ex:metadata name="...">....</ex:metadata> ... |
java.lang.String |
getTitle(java.lang.String docPID,
java.lang.String sectionID)
|
java.lang.String[] |
getTitles(java.lang.String docPID,
java.lang.String[] sectionIDs)
|
java.lang.String |
getTOC(java.lang.String pid)
All "greenstone:*" objects in fedora (be they collections or documents) have a TOC datastream. |
protected void |
init(java.lang.String protocol,
java.lang.String host,
java.lang.String port,
java.lang.String fedoraServerUsername,
java.lang.String fedoraServerPassword)
Init method that is called by the constructor to set some important member variables including instantiating the APIA object used to invoke the Fedora APIA web service operations. |
static void |
main(java.lang.String[] args)
|
protected java.lang.String |
removePrefix(java.lang.String str,
java.lang.String prefix)
Given something like str="SECTION1.2.1" and prefix="SECTION" this method returns "1.2.1". |
java.lang.String[] |
searchDocumentTitles(java.lang.String collName,
java.lang.String titleContents,
boolean startsWith)
Implements querying document DC titles of a greenstone collection stored in the fedora repository for a term that may occur anywhere in their titles. |
protected void |
setInitialisationProperties(java.util.Properties properties)
Method that loops to display the dialog that retrieves the fedora server initialisation properties from the user. |
void |
setLanguage(java.lang.String lang)
Sets the the default language used to query for titles (and anything else where there are multiple language options). |
void |
setMaxResults(int maxresults)
Set the default maximum number of search results returned for a search. |
protected static java.util.Properties |
showAuthenticationPopup(java.util.Properties properties)
Static method that displays a popup to allow the user to provide Fedora authentication (username, pwd) and connection (protocol+host, port) details. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String SUPPORTED_VERSION
protected static final java.lang.String TYPE
protected static final java.lang.String INTERNAL_NODE
protected static final java.lang.String GET
protected static fedora.server.access.FedoraAPIA APIA
protected java.lang.String fedoraVersion
protected java.lang.String baseURL
protected java.lang.String portAddressSuffix
protected static final java.lang.String defaultPortAddressSuffix
protected java.lang.String lang
protected int maxresults
protected javax.xml.parsers.DocumentBuilder builder
Constructor Detail |
---|
public FedoraConnection(java.lang.String protocol, java.lang.String host, int port, java.lang.String fedoraServerUsername, java.lang.String fedoraServerPassword) throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, javax.net.ssl.SSLHandshakeException, java.rmi.RemoteException, FedoraGS3Exception.AuthenticationFailedException, FedoraGS3Exception.NotAFedoraServerException, java.net.ConnectException, java.lang.Exception
host
- - the fedora server host (may be prefixed with http:// or
https:// if parameter protocol is empty). If there's no protocol, and
no protocol prefixed to the host, then the protocol defaults to http.protocol
- - either http or https (or empty "")port
- - the port on which fedora is running.fedoraServerUsername
- - the administrator username required to
access the fedora server's repository. ("fedoraAdmin" unless changed).fedoraServerPassword
- - the fedora server repository's
administrator password. If none was set on fedora installation, this
can be empty ("").
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
javax.net.ssl.SSLHandshakeException
java.rmi.RemoteException
FedoraGS3Exception.AuthenticationFailedException
FedoraGS3Exception.NotAFedoraServerException
java.net.ConnectException
java.lang.Exception
public FedoraConnection() throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, FedoraGS3Exception.CancelledException, java.net.ConnectException, java.rmi.RemoteException, javax.net.ssl.SSLHandshakeException, java.lang.Exception
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
FedoraGS3Exception.CancelledException
java.net.ConnectException
java.rmi.RemoteException
javax.net.ssl.SSLHandshakeException
java.lang.Exception
public FedoraConnection(java.io.File propertyFile) throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, FedoraGS3Exception.CancelledException, java.net.ConnectException, java.rmi.RemoteException, javax.net.ssl.SSLHandshakeException, java.lang.Exception
propertyFile
- is the name of the properties file specifying the
values for Fedora server username, password, host and port.
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
FedoraGS3Exception.CancelledException
java.net.ConnectException
java.rmi.RemoteException
javax.net.ssl.SSLHandshakeException
java.lang.Exception
Method Detail |
---|
public static java.lang.String getSupportedVersion()
public java.lang.String getFedoraVersion()
public java.lang.String getLanguage()
getLanguage
in interface FedoraGS3DL
public void setLanguage(java.lang.String lang)
setLanguage
in interface FedoraGS3DL
lang
- - the two-letter language code to set the default language to.public int getMaxResults()
getMaxResults
in interface FedoraGS3DL
public void setMaxResults(int maxresults)
setMaxResults
in interface FedoraGS3DL
maxresults
- - the new default maximum number of search results to
be returned.protected void setInitialisationProperties(java.util.Properties properties) throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, FedoraGS3Exception.CancelledException, java.net.ConnectException, java.rmi.RemoteException, javax.net.ssl.SSLHandshakeException, java.lang.Exception
properties
- the Properties Hashmap storing values for
username, password, host and port (and any errormessage).
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
FedoraGS3Exception.CancelledException
java.net.ConnectException
java.rmi.RemoteException
javax.net.ssl.SSLHandshakeException
java.lang.Exception
protected static java.util.Properties showAuthenticationPopup(java.util.Properties properties) throws FedoraGS3Exception.CancelledException
properties
- is a Properties HashMap where the property Keys which must
have been put in here in advance (even with "" Values if appropriate) are:
- username - password - host (may - but need not - be prefixed with either of the protocols "http://" and "https://" - port - errorMessage (displayed near the top of the popup dialog). Can be "".The values stored in the properties HashMap for the above property are initially displayed in the fields and the user can overwrite them. This is useful in such cases where invalid values were entered and this popup must be redisplayed to allow the user to correct their previous input.
FedoraGS3Exception.CancelledException
protected void init(java.lang.String protocol, java.lang.String host, java.lang.String port, java.lang.String fedoraServerUsername, java.lang.String fedoraServerPassword) throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, FedoraGS3Exception.AuthenticationFailedException, java.rmi.RemoteException, java.lang.Exception
protocol
- can be http or httpshost
- is the name of the Fedora server hostport
- is the port number (String form) of the Fedora serverfedoraServerUsername
- is the user name to access the Fedora
ServerfedoraServerPassword
- is the password needed to access the
Fedora Server
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
FedoraGS3Exception.AuthenticationFailedException
java.rmi.RemoteException
java.lang.Exception
protected void createAPIA(fedora.server.access.FedoraAPIAServiceLocator serviceLocator, java.lang.String portSuffix, java.lang.String messageInsert, boolean isUserSpecifiedPortAddressSuffix) throws java.lang.Exception
java.lang.Exception
public java.lang.String[] getCollections() throws java.rmi.RemoteException
fedora-types:FieldSearchResult findObjects( fedora-types:ArrayOfString resultFields, xsd:nonNegativeInteger maxResults, fedora-types:FieldSearchQuery query )
getCollections
in interface FedoraGS3DL
java.rmi.RemoteException
public java.lang.String getDC(java.lang.String pid) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getDC
in interface FedoraGS3DL
pid
- - the fedora persistent identifier for an item in the fedora
repository.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
public java.lang.String getEX(java.lang.String pid) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getEX
in interface FedoraGS3DL
pid
- - the fedora persistent identifier for an item in the fedora
repository.
Use MIMETypedStream APIA.getDatastreamDissemination(pid, itemID,
asOfDateTime).
Use String(bytes[], charset="UTF-8") to convert MIMETypedStream.getStream().
java.rmi.RemoteException
java.io.UnsupportedEncodingException
getDC(String pid) throws Exception
public java.lang.String getDLS(java.lang.String pid) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getDLS
in interface FedoraGS3DL
pid
- - the fedora persistent identifier for an item in the fedora
repository.
Use MIMETypedStream APIA.getDatastreamDissemination(pid, itemID,
asOfDateTime).
Use String(bytes[], charset="UTF-8") to convert MIMETypedStream.getStream().
java.rmi.RemoteException
java.io.UnsupportedEncodingException
getDC(String pid) throws Exception
public java.lang.String getTOC(java.lang.String pid) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getTOC
in interface FedoraGS3DL
pid
- - the fedora persistent identifier for an item in the fedora
repository.
Use MIMETypedStream APIA.getDatastreamDissemination(pid, itemID,
asOfDateTime)
Use String(bytes[], charset="UTF-8") to convert MIMETypedStream.getStream()
java.rmi.RemoteException
java.io.UnsupportedEncodingException
getDC(String pid) throws Exception
public java.lang.String[] getCollectionNames(java.lang.String[] collPIDs)
getCollectionNames
in interface FedoraGS3DL
collPIDs
- - an array of Strings denoting the pids for greenstone
collections stored in the fedora repositoryl. These should be of the
format "greenstone:<collectionName>-collection".
public java.lang.String[] getCollectionPIDs(java.lang.String[] collNames)
getCollectionPIDs
in interface FedoraGS3DL
collNames
- - a list of names of greenstone collections
stored in the fedora repository.
public java.lang.String getCollectionPID(java.lang.String collName)
getCollectionPID
in interface FedoraGS3DL
collName
- - the name of a greenstone collection stored
stored in the fedora repository.
public java.lang.String getCollectionTitle(java.lang.String collPID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getCollectionTitle
in interface FedoraGS3DL
collPID
- is the pid of a greenstone collection in the fedora
repository.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String[] getCollectionTitles(java.lang.String[] collPIDs) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getCollectionTitles
in interface FedoraGS3DL
collPIDs
- - a list of pids identifying greenstone collections
stored in the fedora repository.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String[] getDocTitles(java.lang.String[] docPIDs) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getDocTitles
in interface FedoraGS3DL
docPIDs
- - a list of pids identifying documents stored in the
fedora repository.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getDocTitle(java.lang.String docPID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getDocTitle
in interface FedoraGS3DL
docPID
- is the pid of the document in the fedora repository
(docPID is of the form greenstone:<colName>-<doc-identifier>
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
protected java.lang.String getTitle(java.lang.String exStream) throws org.xml.sax.SAXException, java.io.IOException
exStream
- the EX datastream in String form of the document or
document section.
org.xml.sax.SAXException
java.io.IOException
public java.lang.String[] getSectionTitles(java.lang.String[] docPIDs, java.lang.String[] sectionIDs) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getSectionTitles
in interface FedoraGS3DL
docPIDs
- - a list of pids identifying documents stored in the
fedora repository.sectionIDs
- - a list of sectionIDs identifying individual sections
of documents stored in the fedora repository whose titles are requested.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getSectionTitle(java.lang.String docPID, java.lang.String sectionID) throws java.io.UnsupportedEncodingException, java.rmi.RemoteException, org.xml.sax.SAXException, java.io.IOException
getSectionTitle
in interface FedoraGS3DL
docPID
- - a pid identifying a document in the fedora repository.sectionID
- - the sectionID of the section of the
document whose title is requested.
java.io.UnsupportedEncodingException
java.rmi.RemoteException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String[] getCollectionDocs(java.lang.String colPID) throws java.rmi.RemoteException
getCollectionDocs
in interface FedoraGS3DL
colPID
- is the pid of the greenstone collection stored in
the fedora repository.
java.rmi.RemoteException
public java.lang.String[] getSectionNames(java.lang.String docPID) throws java.rmi.RemoteException
getSectionNames
in interface FedoraGS3DL
docPID
- is a fedora pid identifying a greenstone document object.
java.rmi.RemoteException
public java.lang.String[] getSectionNumbers(java.lang.String docPID) throws java.rmi.RemoteException
getSectionNumbers
in interface FedoraGS3DL
docPID
- is a fedora pid identifying a greenstone document object.
java.rmi.RemoteException
public java.lang.String[] getTitles(java.lang.String docPID, java.lang.String[] sectionIDs) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getTitles
in interface FedoraGS3DL
docPID
- is a fedora pid identifying a greenstone document object.sectionIDs
- is a list of identifiers identifying sections in the
document denoted by docPID, whose titles need to be returned. Each
sectionID may sectionID may be either a section name (e.g. SECTION1.5.1)
or a section number (eg. 1.5.1).
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getTitle(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getTitle
in interface FedoraGS3DL
docPID
- is a fedora pid identifying a greenstone document object.sectionID
- identifies the particular section in the document denoted
by docPID, whose title needs to be returned. The sectionID may be either a
section name (e.g. SECTION1.5.1) or a section number (eg. 1.5.1).
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getSection(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getSection
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
public java.lang.String getSectionDCMetadata(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getSectionDCMetadata
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
public java.lang.String getSectionEXMetadata(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
getSectionEXMetadata
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
public org.w3c.dom.Element getChildrenOfSectionXML(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getChildrenOfSectionXML
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getChildrenOfSection(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
getChildrenOfSection
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public org.w3c.dom.Element getSubsectionXML(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException
getSubsectionXML
in interface FedoraGS3DL
docPID
- - a fedora pid identifying a greenstone document object.sectionID
- - identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getSubsection(java.lang.String docPID, java.lang.String sectionID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException, org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
getSubsection
in interface FedoraGS3DL
docPID
- a fedora pid identifying a greenstone document object.sectionID
- identifyies the particular section in the
document denoted by docPID, may be a section name or number.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public java.lang.String[] browseTitlesByLetter(java.lang.String collName, java.lang.String letter) throws java.rmi.RemoteException, FedoraGS3Exception.FedoraVersionNotSupportedException
browseTitlesByLetter
in interface FedoraGS3DL
letter
- - the starting letter to browse by.
java.rmi.RemoteException
FedoraGS3Exception.FedoraVersionNotSupportedException
public java.lang.String[] searchDocumentTitles(java.lang.String collName, java.lang.String titleContents, boolean startsWith) throws java.rmi.RemoteException, FedoraGS3Exception.FedoraVersionNotSupportedException
searchDocumentTitles
in interface FedoraGS3DL
titleContents
- - the word or phrase to search the collection's
document titles for. Only one word, and this method finds Greenstone
DOCUMENT titles CONTAINING that word (if any).startsWith
- - if true, searches for titles that start with
titleContents. Else it searches for titles that contain titleContents.
java.rmi.RemoteException
FedoraGS3Exception.FedoraVersionNotSupportedException
protected fedora.server.types.gen.FieldSearchResult findObjectsWithTitlesContaining(java.lang.String collName, java.lang.String titleWord) throws java.rmi.RemoteException, FedoraGS3Exception.FedoraVersionNotSupportedException
collName
- - the collection of documents we'll be searching in.titleWord
- - the word we'll be searching the document titles for.
(Fedora's search returns all objects whose title contains that word).
Two kinds of search are provided by Fedora as stated in FedoraAccess.java
(see link):
"There are two search methods: a search on all fields or a search on specific fields. To search all fields the setTerms function of the FieldSearchQuery must be used, with the paramater being the desired string. To search by specific fields, you must create an array of Condition objects. Each condition consists of three parts: the field to be searched (.setProperty()), the operation to be used (.setOperator(ComparisonOperator. <operator>)), and the search string (.setValue())"We want to use the second search method above when browsing and searching, and search for: pid~greenstone:<collName>* title~<letter>* or pid~greenstone:<collName>* title~<first word of search phrase> See also fedora-2.2.1-src/src/java/fedora/client/search/Search.java. The fedora/tomcat/webapps/fedora/WEB-INF/web.xml is where the REST-based web services are defined. (The web.xml defines the "Servlets for REST-based interfaces to the Fedora Repository Server"). Do a search on the word "search": fedora.server.access.FieldSearchServlet is the class we need to look at It accesses a different Condition.java class: fedora.server.search.Condition.java The above is what is used by the REST-based interface in FieldSearchServlet.java While fedora-2.2.1-src/build/wsdl/fedora/server/types/gen/Condition.java is what's used in the fedora client application that makes use of the SOAP-based interface.
java.rmi.RemoteException
FedoraGS3Exception.FedoraVersionNotSupportedException
public java.lang.String getDocName(java.lang.String docPID)
getDocName
in interface FedoraGS3DL
docPID
- - pid of a greenstone document in the fedora repository.
public java.lang.String getCollectionName(java.lang.String collPID)
getCollectionName
in interface FedoraGS3DL
collPID
- - pid of a greenstone collection in the fedora repository.
protected org.w3c.dom.Element getSubstructure(org.w3c.dom.Element e, boolean descendents)
e
- - the element to start copying from.descendents
- - if true, e is copied with all its descendetns into the
element that's returned. If false, only e and its direct children are copied
protected java.lang.String getItem(java.lang.String docPID, java.lang.String itemID) throws java.rmi.RemoteException, java.io.UnsupportedEncodingException
docPID
- - pid of a greenstone document in the fedora repository.itemID
- - the itemID of a datastream of the fedora object
identified by docPID.
java.rmi.RemoteException
java.io.UnsupportedEncodingException
protected java.lang.String removePrefix(java.lang.String str, java.lang.String prefix)
prefix
- - the prefix which ought to be removed from the itemID.str
- - the value of the itemID.
protected java.lang.String convertToMetaNumber(java.lang.String number)
number
- - a proper (fedora-greenstone document) section number
public java.lang.String getBaseURL()
getBaseURL
in interface FedoraGS3DL
public java.lang.String getPortAddressURL()
getPortAddressURL
in interface FedoraGS3DL
public java.lang.String getAssocFileBaseURL()
getAssocFileBaseURL
in interface FedoraGS3DL
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |