Class DDSServicesAction
- Direct Known Subclasses:
DDSServicesAction_1_1
- Version:
- $Id: DDSServicesAction.java,v 1.57 2010/07/23 01:23:12 jweather Exp $
- Author:
- John Weatherley
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringThe GetRecord request verbstatic StringThe list collections request verbstatic StringThe list content standards request verbstatic StringThe list fields request verbstatic StringThe list grade ranges request verbstatic StringThe list resource types request verbstatic StringThe list subjects request verbstatic StringThe list terms request verbstatic StringThe list xml formats request verbstatic StringThe search request verbstatic StringThe ServiceInfo request verbstatic StringThe UrlCheck request verbstatic StringThe seach all request verbFields inherited from class org.apache.struts.action.Action
defaultLocale, servlet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.struts.action.ActionForwarddoGetRecord(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a given record from the repository.protected org.apache.struts.action.ActionForwarddoListCollections(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a the available collections.protected org.apache.struts.action.ActionForwarddoListFields(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a list of the fields in the index.protected org.apache.struts.action.ActionForwarddoListTerms(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a list of terms for given field(s) in the index.protected org.apache.struts.action.ActionForwarddoListVocabEntries(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping, String verb) Handles a request to list a vocab and it's values including GradeRanges, Subjects, ResourceTypes and ContentStandards.protected org.apache.struts.action.ActionForwarddoListXmlFormats(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a the available XML formats.protected org.apache.struts.action.ActionForwarddoSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to perform a search over all records using the Lucene Query Language.protected org.apache.struts.action.ActionForwarddoServiceInfo(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to get a the service information.protected org.apache.struts.action.ActionForwarddoUrlCheck(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to check the repository for the existence of a given URL.protected org.apache.struts.action.ActionForwarddoUserSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to perform a search over item-level records using the User Query Language.org.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Processes the DDS web service request by forwarding to the appropriate corresponding JSP page for rendering.protected static final StringReturn a string for the current time and date, sutiable for display in log files and output to standout:protected StringGets the key used for caching the ListCollections response in the application scope.static final intGets the number of records that have been indexed inclucing adn, collection, anno and other metadata types regardless of status.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.static voidsetDebug(boolean db) Sets the debug attribute of the objectstatic voidsetMaxSearchResults(int maxResults) Sets the maximum number of search results that can be returned by the service.protected voidsetRecordXml(DDSServicesForm df, ResultDoc resultDoc) Sets the record XML in the form bean using the localized version of XML.Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
-
Field Details
-
URL_CHECK_VERB
The UrlCheck request verb -
GET_RECORD_VERB
The GetRecord request verb -
SEARCH_VERB
The search request verb -
USER_SEARCH_VERB
The seach all request verb -
SERVICE_INFO
The ServiceInfo request verb -
LIST_XML_FORMATS
The list xml formats request verb -
LIST_COLLECTIONS
The list collections request verb -
LIST_GRADE_RANGES
The list grade ranges request verb -
LIST_SUBJECTS
The list subjects request verb -
LIST_CONTENT_STANDARDS
The list content standards request verb -
LIST_RESOURCE_TYPES
The list resource types request verb -
LIST_FIELDS
The list fields request verb -
LIST_TERMS
The list terms request verb
-
-
Constructor Details
-
DDSServicesAction
public DDSServicesAction()
-
-
Method Details
-
getListCollectionsCacheKey
Gets the key used for caching the ListCollections response in the application scope. Should be overwritten by the subclasses and updated in the ListCollections.jsp page when a new version is created.- Returns:
- The listCollectionsCacheKey value
-
execute
public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception Processes the DDS web service request by forwarding to the appropriate corresponding JSP page for rendering.- Overrides:
executein classorg.apache.struts.action.Action- Parameters:
mapping- The ActionMapping used to select this instanceform- The ActionForm for the given pagerequest- The HTTP request we are processingresponse- The HTTP response we are creating- Returns:
- The ActionForward instance describing where and how control should be forwarded
- Throws:
Exception- If error.
-
doGetRecord
protected org.apache.struts.action.ActionForward doGetRecord(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a given record from the repository.Arguments: identifier, metadataPrefix.
Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
setRecordXml
Sets the record XML in the form bean using the localized version of XML. This method is overidden in at least one sub-class.- Parameters:
df- The formresultDoc- The resultDoc
-
doUserSearch
protected org.apache.struts.action.ActionForward doUserSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to perform a search over item-level records using the User Query Language. This request exposes the same search options that users experience when performing a search for educational resources in the DDS.Arguments: identifier, metadataPrefix.
Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doSearch
protected org.apache.struts.action.ActionForward doSearch(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to perform a search over all records using the Lucene Query Language.Arguments: identifier, metadataPrefix.
Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doUrlCheck
protected org.apache.struts.action.ActionForward doUrlCheck(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) Handles a request to check the repository for the existence of a given URL.Arguments: url (one or more}
Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
-
doListXmlFormats
protected org.apache.struts.action.ActionForward doListXmlFormats(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a the available XML formats.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doListCollections
protected org.apache.struts.action.ActionForward doListCollections(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a the available collections.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doListFields
protected org.apache.struts.action.ActionForward doListFields(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a list of the fields in the index.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doListTerms
protected org.apache.struts.action.ActionForward doListTerms(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a list of terms for given field(s) in the index.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doListVocabEntries
protected org.apache.struts.action.ActionForward doListVocabEntries(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping, String verb) throws Exception Handles a request to list a vocab and it's values including GradeRanges, Subjects, ResourceTypes and ContentStandards.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping usedverb- The verb requested- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
doServiceInfo
protected org.apache.struts.action.ActionForward doServiceInfo(HttpServletRequest request, HttpServletResponse response, RepositoryManager rm, DDSServicesForm df, org.apache.struts.action.ActionMapping mapping) throws Exception Handles a request to get a the service information.Error Exception Conditions:
badArgument - The request includes illegal arguments.- Parameters:
request- The HTTP requestresponse- The HTTP responserm- The RepositoryManager useddf- The beanmapping- ActionMapping used- Returns:
- An ActionForward to the JSP page that will handle the response
- Throws:
Exception- If error.
-
getNumRecords
Gets the number of records that have been indexed inclucing adn, collection, anno and other metadata types regardless of status. Specifically, number of index entries that are not errordocs.- Parameters:
rm- The RepositoryManager being used.- Returns:
- The number of records that are currently in the index.
-
setMaxSearchResults
public static void setMaxSearchResults(int maxResults) Sets the maximum number of search results that can be returned by the service.- Parameters:
maxResults- The new maxSearchResults value
-
getDateStamp
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 db) Sets the debug attribute of the object- Parameters:
db- The new debug value
-