Class RepositoryForm
java.lang.Object
org.apache.struts.action.ActionForm
org.dlese.dpc.dds.action.form.VocabForm
org.dlese.dpc.repository.action.form.RepositoryForm
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DCSAdminForm,RepositoryAdminForm
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayListcompressionsprotected StringdeletedRecordprotected StringearliestDatestampprotected StringexampleIDprotected Stringgranularityprotected HashtablemetadataFormatsprotected static PropertiesManagerA PropertiesManager that contains properties for this bean.protected StringProtocolVersionprotected StringproviderStatusprotected StringrecordFields inherited from class org.dlese.dpc.dds.action.form.VocabForm
audience, field, language, metaFormat, value, vocabFields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOaiError(String error, String message) Adds a feature to the Error attribute of the RepositoryForm objectGets the adminEmails attribute of the RepositoryForm object.Inserts the BASE_URL for this OAI provider.Gets the optional compressionTag attribute of the RepositoryForm object.Gets the datestamp attribute of the RepositoryForm objectGets the deletedRecord attribute of the RepositoryForm object.Gets the deletedStatus attribute of the RepositoryForm objectGets the optional descriptions that relate to this repository.protected static StringgetDs()Return a string for the current time and date, sutiable for display in log files and output to standout:Gets the earliestDatestamp attribute of the RepositoryForm objectIff OAI errors exist, returns the error tag(s) appropriate for the given response, otherwise returns an empty string.Get an example ID that might be disiminated from this repository.Gets the granularity attribute of the RepositoryForm object.Gets the identifier used in OAI requests.Gets the metadataFormats attribute of the RepositoryForm objectGets the metadata namespacess keyed by metadataPrefix.Gets the metadata schema URLs keyed by metadataPrefix.intGets the number of records that have a status of deleted in the OAI repository.intGets the number of records that have a status NOT deleted in the OAI repository.Gets the oaiIdPfx attribute of the RepositoryForm objectGet therequesttag that is required in all responses to an OAI request.Gets the protocolVersion attribute of the RepositoryForm objectGets the providerStatus attribute of the RepositoryForm objectGets the record attribute of the RepositoryForm object used in the OAI GetRecord request.Gets the repositoryIdentifier attribute of the RepositoryForm objectGets the repositoryName attribute of the RepositoryForm objectGets the requestedFormat attribute of the RepositoryForm objectGets the results attribute of the RepositoryForm objectGets the total number of results that should be returned to the harvester.Gets the array index offset for the result set that should be returned to the harvester.Gets the resumptionToken that should be returned with the results.Gets the rootCloseTag attribute of the RepositoryForm objectGets the rootOpenTag attribute of the RepositoryForm objectgetSets()Gets the sets attribute of the RepositoryForm objectGets the setSpecs attribute of the RepositoryForm objectGets the xMLDeclaration attribute of the RepositoryForm objectbooleanDetermines whether there has been at least one error generated for this request.protected final voidOutput a line of text to standard out, with datestamp, if debug is set to true.protected final voidOutput a line of text to error out, with datestamp.voidsetBaseURL(String baseURL) Sets the baseURL to the OAI provider.voidSets the datestamp attribute of the RepositoryForm objectstatic voidsetDebug(boolean isDebugOuput) Sets the debug attribute of the DocumentService objectvoidsetDeletedStatus(String val) Sets the deletedStatus attribute of the RepositoryForm objectvoidsetIdentifier(String id) Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.voidsetMetadataFormats(Hashtable formats) Sets the metadataFormats attribute of the RepositoryForm objectvoidsetOaiIdPfx(String oaiIdPfx) Sets the oaiIdPfx attribute of the RepositoryForm objectvoidSets the record attribute of the RepositoryForm object used in the OAI GetRecord request.voidsetRequestedFormat(String requestedFormat) Sets the requestedFormat attribute of the RepositoryForm objectvoidsetResults(ResultDocList results) Sets the results attribute of the RepositoryForm objectvoidsetResultsLength(String resultsLength) Sets the total number of results that should be returned to the harvester.voidsetResultsOffset(String resultsOffset) Sets the array index offset for the result set that should be returned to the harvester.voidsetResumptionToken(String resumptionToken) Sets the resumptionToken that should be returned with the results.voidsetSetSpecs(List s) Sets the setSpecs attribute of the RepositoryForm objectProvides 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, setVocabInterfaceMethods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
-
Field Details
-
properties
A PropertiesManager that contains properties for this bean. -
exampleID
exampleID -
ProtocolVersion
ProtocolVersion -
providerStatus
providerStatus -
earliestDatestamp
earliestDatestamp -
deletedRecord
deletedRecord -
granularity
granularity -
compressions
compressions -
metadataFormats
metadataFormats -
record
record
-
-
Constructor Details
-
RepositoryForm
public RepositoryForm()Constructor for the RepositoryForm object
-
-
Method Details
-
getBaseURL
Inserts the BASE_URL for this OAI provider.- Returns:
- A string containing the BASE_URL to this OAI provider.
-
setBaseURL
Sets the baseURL to the OAI provider.- Parameters:
baseURL- The new baseURL value.
-
getXMLDeclaration
Gets the xMLDeclaration attribute of the RepositoryForm object- Returns:
- The xMLDeclaration value
-
getRootOpenTag
Gets the rootOpenTag attribute of the RepositoryForm object- Returns:
- The rootOpenTag value
-
getRootCloseTag
Gets the rootCloseTag attribute of the RepositoryForm object- Returns:
- The rootCloseTag value
-
getOAIRequestTag
Get therequesttag 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 therequesttag 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
requesttag appropriate for the currnet OAI response.
-
addOaiError
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
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
Get an example ID that might be disiminated from this repository.- Returns:
- An example ID from this repository.
-
getRepositoryName
Gets the repositoryName attribute of the RepositoryForm object- Returns:
- The repositoryName value
-
getMetadataFormats
Gets the metadataFormats attribute of the RepositoryForm object- Returns:
- The metadataFormats value
-
setDeletedStatus
Sets the deletedStatus attribute of the RepositoryForm object- Parameters:
val- The new deletedStatus value
-
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
Sets the metadataFormats attribute of the RepositoryForm object- Parameters:
formats- The new metadataFormats value
-
setResumptionToken
Sets the resumptionToken that should be returned with the results.- Parameters:
resumptionToken- The new resumptionToken value
-
getResumptionToken
Gets the resumptionToken that should be returned with the results.- Returns:
- The resumptionToken value
-
setResultsOffset
Sets the array index offset for the result set that should be returned to the harvester.- Parameters:
resultsOffset- The new resultsOffset value
-
getResultsOffset
Gets the array index offset for the result set that should be returned to the harvester.- Returns:
- The resultsOffset value
-
setResultsLength
Sets the total number of results that should be returned to the harvester.- Parameters:
resultsLength- The new resultsLength value
-
getResultsLength
Gets the total number of results that should be returned to the harvester.- Returns:
- The resultsLength value
-
setRequestedFormat
Sets the requestedFormat attribute of the RepositoryForm object- Parameters:
requestedFormat- The new requestedFormat value
-
getRequestedFormat
Gets the requestedFormat attribute of the RepositoryForm object- Returns:
- The requestedFormat value
-
getRepositoryIdentifier
Gets the repositoryIdentifier attribute of the RepositoryForm object- Returns:
- The repositoryIdentifier value
-
getProtocolVersion
Gets the protocolVersion attribute of the RepositoryForm object- Returns:
- The protocolVersion value
-
getProviderStatus
Gets the providerStatus attribute of the RepositoryForm object- Returns:
- The providerStatus value
-
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
Gets the sets attribute of the RepositoryForm object- Returns:
- The sets value
-
getEarliestDatestamp
Gets the earliestDatestamp attribute of the RepositoryForm object- Returns:
- The earliestDatestamp value
-
getDeletedRecord
Gets the deletedRecord attribute of the RepositoryForm object. Legitimate values are no ; transient ; persistent- Returns:
- The deletedRecord value
-
getMetadataSchemaURLs
Gets the metadata schema URLs keyed by metadataPrefix.- Returns:
- The metadata schema URLs or null if none
-
getMetadataNamespaces
Gets the metadata namespacess keyed by metadataPrefix.- Returns:
- The metadata namespacess or null if none
-
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
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
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
Sets the results attribute of the RepositoryForm object- Parameters:
results- The new results value
-
getResults
Gets the results attribute of the RepositoryForm object- Returns:
- The results value
-
getRecord
Gets the record attribute of the RepositoryForm object used in the OAI GetRecord request.- Returns:
- The record value
-
setRecord
Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.- Parameters:
record- The new record value
-
getIdentifier
Gets the identifier used in OAI requests.- Returns:
- The record value
-
setIdentifier
Sets the record attribute of the RepositoryForm object used in the OAI GetRecord request.- Parameters:
id- The new identifier value
-
getOaiIdPfx
Gets the oaiIdPfx attribute of the RepositoryForm object- Returns:
- The oaiIdPfx value
-
setOaiIdPfx
Sets the oaiIdPfx attribute of the RepositoryForm object- Parameters:
oaiIdPfx- The new oaiIdPfx value
-
getDatestamp
Gets the datestamp attribute of the RepositoryForm object- Returns:
- The datestamp value
-
setDatestamp
Sets the datestamp attribute of the RepositoryForm object- Parameters:
s- The new datestamp value
-
getSetSpecs
Gets the setSpecs attribute of the RepositoryForm object- Returns:
- The setSpecs value
-
setSetSpecs
Sets the setSpecs attribute of the RepositoryForm object- Parameters:
s- The new setSpecs value
-
xmlToHtml
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
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
prtlnErr
Output a line of text to error out, with datestamp.- Parameters:
s- The text that will be output to error out.
-
prtln
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
-