DLESE Tools
v1.6.0

org.dlese.dpc.repository.action.form
Class RepositoryForm

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.dlese.dpc.dds.action.form.VocabForm
          extended by org.dlese.dpc.repository.action.form.RepositoryForm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DCSAdminForm, RepositoryAdminForm

public class RepositoryForm
extends VocabForm
implements Serializable

A base class bean for creating output used in OAI requests. This class extends ActionFrom, however for security reasons it does not contain any setter functions. All setter functions are contained in the subclass ProviderAcminForm.

Version:
$Id: RepositoryForm.java,v 1.17 2010/07/14 00:18:49 jweather Exp $
Author:
John Weatherley
See Also:
Serialized Form

Field Summary
protected  ArrayList compressions
          compressions
protected  String deletedRecord
          deletedRecord
protected  String earliestDatestamp
          earliestDatestamp
protected  String exampleID
          exampleID
protected  String granularity
          granularity
protected  Hashtable metadataFormats
          metadataFormats
protected static PropertiesManager properties
          A PropertiesManager that contains properties for this bean.
protected  String ProtocolVersion
          ProtocolVersion
protected  String providerStatus
          providerStatus
protected  String record
          record
 
Fields inherited from class org.dlese.dpc.dds.action.form.VocabForm
audience, field, language, metaFormat, value, vocab
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
RepositoryForm()
          Constructor for the RepositoryForm object
 
Method Summary
 void addOaiError(String error, String message)
          Adds a feature to the Error attribute of the RepositoryForm object
 ArrayList getAdminEmails()
          Gets the adminEmails attribute of the RepositoryForm object.
 String getBaseURL()
          Inserts the BASE_URL for this OAI provider.
 ArrayList getCompressions()
          Gets the optional compressionTag attribute of the RepositoryForm object.
 String getDatestamp()
          Gets the datestamp attribute of the RepositoryForm object
 String getDeletedRecord()
          Gets the deletedRecord attribute of the RepositoryForm object.
 String getDeletedStatus()
          Gets the deletedStatus attribute of the RepositoryForm object
 ArrayList getDescriptions()
          Gets the optional descriptions that relate to this repository.
protected static String getDs()
          Return a string for the current time and date, sutiable for display in log files and output to standout:
 String getEarliestDatestamp()
          Gets the earliestDatestamp attribute of the RepositoryForm object
 ArrayList getErrors()
          Iff OAI errors exist, returns the error tag(s) appropriate for the given response, otherwise returns an empty string.
 String getExampleID()
          Get an example ID that might be disiminated from this repository.
 String getGranularity()
          Gets the granularity attribute of the RepositoryForm object.
 String getIdentifier()
          Gets the identifier used in OAI requests.
 Hashtable getMetadataFormats()
          Gets the metadataFormats attribute of the RepositoryForm object
 Map getMetadataNamespaces()
          Gets the metadata namespacess keyed by metadataPrefix.
 Map getMetadataSchemaURLs()
          Gets the metadata schema URLs keyed by metadataPrefix.
 int getNumDeletedDocs()
          Gets the number of records that have a status of deleted in the OAI repository.
 int getNumNonDeletedDocs()
          Gets the number of records that have a status NOT deleted in the OAI repository.
 String getOaiIdPfx()
          Gets the oaiIdPfx attribute of the RepositoryForm object
 String getOAIRequestTag(HttpServletRequest req)
          Get the request tag that is required in all responses to an OAI request.
 String getProtocolVersion()
          Gets the protocolVersion attribute of the RepositoryForm object
 String getProviderStatus()
          Gets the providerStatus attribute of the RepositoryForm object
 String getRecord()
          Gets the record attribute of the RepositoryForm object used in the OAI GetRecord request.
 String getRepositoryIdentifier()
          Gets the repositoryIdentifier attribute of the RepositoryForm object
 String getRepositoryName()
          Gets the repositoryName attribute of the RepositoryForm object
 String getRequestedFormat()
          Gets the requestedFormat attribute of the RepositoryForm object
 ResultDocList getResults()
          Gets the results attribute of the RepositoryForm object
 String getResultsLength()
          Gets the total number of results that should be returned to the harvester.
 String getResultsOffset()
          Gets the array index offset for the result set that should be returned to the harvester.
 String getResumptionToken()
          Gets the resumptionToken that should be returned with the results.
 String getRootCloseTag()
          Gets the rootCloseTag attribute of the RepositoryForm object
 String getRootOpenTag()
          Gets the rootOpenTag attribute of the RepositoryForm object
 ArrayList getSets()
          Gets the sets attribute of the RepositoryForm object
 List getSetSpecs()
          Gets the setSpecs attribute of the RepositoryForm object
 String getXMLDeclaration()
          Gets the xMLDeclaration attribute of the RepositoryForm object
 boolean hasErrors()
          Determines whether there has been at least one error generated for this request.
protected  void prtln(String s)
          Output a line of text to standard out, with datestamp, if debug is set to true.
protected  void prtlnErr(String s)
          Output a line of text to error out, with datestamp.
 void setBaseURL(String baseURL)
          Sets the baseURL to the OAI provider.
 void setDatestamp(String s)
          Sets the datestamp attribute of the RepositoryForm object
static void setDebug(boolean isDebugOuput)
          Sets the debug attribute of the DocumentService object
 void setDeletedStatus(String val)
          Sets the deletedStatus attribute of the RepositoryForm object
 void setIdentifier(String id)
          Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.
 void setMetadataFormats(Hashtable formats)
          Sets the metadataFormats attribute of the RepositoryForm object
 void setOaiIdPfx(String oaiIdPfx)
          Sets the oaiIdPfx attribute of the RepositoryForm object
 void setRecord(String record)
          Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.
 void setRequestedFormat(String requestedFormat)
          Sets the requestedFormat attribute of the RepositoryForm object
 void setResults(ResultDocList results)
          Sets the results attribute of the RepositoryForm object
 void setResultsLength(String resultsLength)
          Sets the total number of results that should be returned to the harvester.
 void setResultsOffset(String resultsOffset)
          Sets the array index offset for the result set that should be returned to the harvester.
 void setResumptionToken(String resumptionToken)
          Sets the resumptionToken that should be returned with the results.
 void setSetSpecs(List s)
          Sets the setSpecs attribute of the RepositoryForm object
 String xmlToHtml(String s)
          Provides HTML encoding for XML resulting in text that looks good in a Web browser.
 
Methods inherited from class org.dlese.dpc.dds.action.form.VocabForm
getAudience, getField, getFieldId, getFieldLabel, getIsVocabTermAvailable, getLanguage, getVocab, getVocabList, getVocabList, getVocabTerm, setField, setField, setMetaFormat, setValue, setVocab, setVocabInterface
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected static PropertiesManager properties
A PropertiesManager that contains properties for this bean.


exampleID

protected String exampleID
exampleID


ProtocolVersion

protected String ProtocolVersion
ProtocolVersion


providerStatus

protected String providerStatus
providerStatus


earliestDatestamp

protected String earliestDatestamp
earliestDatestamp


deletedRecord

protected String deletedRecord
deletedRecord


granularity

protected String granularity
granularity


compressions

protected ArrayList compressions
compressions


metadataFormats

protected Hashtable metadataFormats
metadataFormats


record

protected String record
record

Constructor Detail

RepositoryForm

public RepositoryForm()
Constructor for the RepositoryForm object

Method Detail

getBaseURL

public String getBaseURL()
Inserts the BASE_URL for this OAI provider.

Returns:
A string containing the BASE_URL to this OAI provider.

setBaseURL

public void setBaseURL(String baseURL)
Sets the baseURL to the OAI provider.

Parameters:
baseURL - The new baseURL value.

getXMLDeclaration

public String getXMLDeclaration()
Gets the xMLDeclaration attribute of the RepositoryForm object

Returns:
The xMLDeclaration value

getRootOpenTag

public String getRootOpenTag()
Gets the rootOpenTag attribute of the RepositoryForm object

Returns:
The rootOpenTag value

getRootCloseTag

public String getRootCloseTag()
Gets the rootCloseTag attribute of the RepositoryForm object

Returns:
The rootCloseTag value

getOAIRequestTag

public String getOAIRequestTag(HttpServletRequest req)
Get the request tag that is required in all responses to an OAI request. If the request contained a badVerb or badArgument error then no argument=value pairs are returned. For all other responses the request tag includes all argument=value pairs as atributes and the OAI BASE_URL as the tag body.

Parameters:
req - Description of the Parameter
Returns:
String The OAI-PMH request tag appropriate for the currnet OAI response.

addOaiError

public void addOaiError(String error,
                        String message)
Adds a feature to the Error attribute of the RepositoryForm object

Parameters:
error - The OAI Error.
message - The message that will be returned in the OAI response that describes the reason for the error.

hasErrors

public boolean hasErrors()
Determines whether there has been at least one error generated for this request.

Returns:
True iff there were no errors reported, else false.

getErrors

public ArrayList getErrors()
Iff OAI errors exist, returns the error tag(s) appropriate for the given response, otherwise returns an empty string.

Returns:
The OAI errors appropritate for this response or empty string.

getExampleID

public String getExampleID()
Get an example ID that might be disiminated from this repository.

Returns:
An example ID from this repository.

getRepositoryName

public String getRepositoryName()
Gets the repositoryName attribute of the RepositoryForm object

Returns:
The repositoryName value

getMetadataFormats

public Hashtable getMetadataFormats()
Gets the metadataFormats attribute of the RepositoryForm object

Returns:
The metadataFormats value

setDeletedStatus

public void setDeletedStatus(String val)
Sets the deletedStatus attribute of the RepositoryForm object

Parameters:
val - The new deletedStatus value

getDeletedStatus

public String getDeletedStatus()
Gets the deletedStatus attribute of the RepositoryForm object

Returns:
The deletedStatus value

getNumDeletedDocs

public int getNumDeletedDocs()
Gets the number of records that have a status of deleted in the OAI repository.

Returns:
The number of deleted documents.

getNumNonDeletedDocs

public int getNumNonDeletedDocs()
Gets the number of records that have a status NOT deleted in the OAI repository.

Returns:
The number of non-deleted documents in the repository.

setMetadataFormats

public void setMetadataFormats(Hashtable formats)
Sets the metadataFormats attribute of the RepositoryForm object

Parameters:
formats - The new metadataFormats value

setResumptionToken

public void setResumptionToken(String resumptionToken)
Sets the resumptionToken that should be returned with the results.

Parameters:
resumptionToken - The new resumptionToken value

getResumptionToken

public String getResumptionToken()
Gets the resumptionToken that should be returned with the results.

Returns:
The resumptionToken value

setResultsOffset

public void setResultsOffset(String resultsOffset)
Sets the array index offset for the result set that should be returned to the harvester.

Parameters:
resultsOffset - The new resultsOffset value

getResultsOffset

public String getResultsOffset()
Gets the array index offset for the result set that should be returned to the harvester.

Returns:
The resultsOffset value

setResultsLength

public void setResultsLength(String resultsLength)
Sets the total number of results that should be returned to the harvester.

Parameters:
resultsLength - The new resultsLength value

getResultsLength

public String getResultsLength()
Gets the total number of results that should be returned to the harvester.

Returns:
The resultsLength value

setRequestedFormat

public void setRequestedFormat(String requestedFormat)
Sets the requestedFormat attribute of the RepositoryForm object

Parameters:
requestedFormat - The new requestedFormat value

getRequestedFormat

public String getRequestedFormat()
Gets the requestedFormat attribute of the RepositoryForm object

Returns:
The requestedFormat value

getRepositoryIdentifier

public String getRepositoryIdentifier()
Gets the repositoryIdentifier attribute of the RepositoryForm object

Returns:
The repositoryIdentifier value

getProtocolVersion

public String getProtocolVersion()
Gets the protocolVersion attribute of the RepositoryForm object

Returns:
The protocolVersion value

getProviderStatus

public String getProviderStatus()
Gets the providerStatus attribute of the RepositoryForm object

Returns:
The providerStatus value

getAdminEmails

public ArrayList getAdminEmails()
Gets the adminEmails attribute of the RepositoryForm object. If this is the first run, the admin e-mail will be set to the default value.

Returns:
The adminEmails value

getSets

public ArrayList getSets()
Gets the sets attribute of the RepositoryForm object

Returns:
The sets value

getEarliestDatestamp

public String getEarliestDatestamp()
Gets the earliestDatestamp attribute of the RepositoryForm object

Returns:
The earliestDatestamp value

getDeletedRecord

public String getDeletedRecord()
Gets the deletedRecord attribute of the RepositoryForm object. Legitimate values are no ; transient ; persistent

Returns:
The deletedRecord value

getMetadataSchemaURLs

public Map getMetadataSchemaURLs()
Gets the metadata schema URLs keyed by metadataPrefix.

Returns:
The metadata schema URLs or null if none

getMetadataNamespaces

public Map getMetadataNamespaces()
Gets the metadata namespacess keyed by metadataPrefix.

Returns:
The metadata namespacess or null if none

getGranularity

public String getGranularity()
Gets the granularity attribute of the RepositoryForm object. Legitimate values are YYYY-MM-DD and YYYY-MM-DDThh:mm:ssZ with meanings as defined in ISO8601.

Returns:
The granularity value

getCompressions

public ArrayList getCompressions()
Gets the optional compressionTag attribute of the RepositoryForm object. "none" indicates no compression is supported, resulting in no compression tag being output. Other possible values may include: gzip ; compress as defined in RFC 2616 . There can be multiple supported compression schemes.

Returns:
An ArrayList of the supported compression schemes or null if none are supported.

getDescriptions

public ArrayList getDescriptions()
Gets the optional descriptions that relate to this repository. See OAI implemnetation guidelines for details. The info here is the description container (the part between the <description> tag).

Returns:
An ArrayList of descriptions for this repository.

setResults

public void setResults(ResultDocList results)
Sets the results attribute of the RepositoryForm object

Parameters:
results - The new results value

getResults

public ResultDocList getResults()
Gets the results attribute of the RepositoryForm object

Returns:
The results value

getRecord

public String getRecord()
Gets the record attribute of the RepositoryForm object used in the OAI GetRecord request.

Returns:
The record value

setRecord

public void setRecord(String record)
Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.

Parameters:
record - The new record value

getIdentifier

public String getIdentifier()
Gets the identifier used in OAI requests.

Returns:
The record value

setIdentifier

public void setIdentifier(String id)
Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.

Parameters:
id - The new identifier value

getOaiIdPfx

public String getOaiIdPfx()
Gets the oaiIdPfx attribute of the RepositoryForm object

Returns:
The oaiIdPfx value

setOaiIdPfx

public void setOaiIdPfx(String oaiIdPfx)
Sets the oaiIdPfx attribute of the RepositoryForm object

Parameters:
oaiIdPfx - The new oaiIdPfx value

getDatestamp

public String getDatestamp()
Gets the datestamp attribute of the RepositoryForm object

Returns:
The datestamp value

setDatestamp

public void setDatestamp(String s)
Sets the datestamp attribute of the RepositoryForm object

Parameters:
s - The new datestamp value

getSetSpecs

public List getSetSpecs()
Gets the setSpecs attribute of the RepositoryForm object

Returns:
The setSpecs value

setSetSpecs

public void setSetSpecs(List s)
Sets the setSpecs attribute of the RepositoryForm object

Parameters:
s - The new setSpecs value

xmlToHtml

public String xmlToHtml(String s)
Provides HTML encoding for XML resulting in text that looks good in a Web browser. Uses the indentation that existed in the original text. Use this method to encode text that will be displayed in a web browser (e.g. JSP or HTML page).

Parameters:
s - The string to convert.
Returns:
A string suitable for display as HTML

getDs

protected static String getDs()
Return a string for the current time and date, sutiable for display in log files and output to standout:

Returns:
The dateStamp value

prtlnErr

protected final void prtlnErr(String s)
Output a line of text to error out, with datestamp.

Parameters:
s - The text that will be output to error out.

prtln

protected final void prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true.

Parameters:
s - The String that will be output.

setDebug

public static void setDebug(boolean isDebugOuput)
Sets the debug attribute of the DocumentService object

Parameters:
isDebugOuput - The new debug value

DLESE Tools
v1.6.0