public class MetacatHandler
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
FGDCDOCTYPE  | 
| Constructor and Description | 
|---|
MetacatHandler(java.util.Timer timer)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
handleBuildIndexAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      java.lang.String username,
                      java.lang.String[] groups)
Rebuild the index for one or more documents. 
 | 
protected void | 
handleDataquery(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
               javax.servlet.http.HttpServletResponse response,
               java.lang.String sessionId)  | 
void | 
handleDeleteAction(java.io.PrintWriter out,
                  java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                  javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response,
                  java.lang.String user,
                  java.lang.String[] groups)
Handle the database delete request and delete an XML document from the
 database connection 
 | 
protected void | 
handleEditCart(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
              javax.servlet.http.HttpServletResponse response,
              java.lang.String sessionId)  | 
protected void | 
handleExportAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                  javax.servlet.http.HttpServletResponse response,
                  java.lang.String user,
                  java.lang.String[] groups,
                  java.lang.String passWord)
Handle the "export" request of data package from Metacat in zip format 
 | 
protected void | 
handleGetAccessControlAction(java.io.PrintWriter out,
                            java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String username,
                            java.lang.String[] groupnames)
Handle "getaccesscontrol" action. 
 | 
void | 
handleGetAllDocidsAction(java.io.PrintWriter out,
                        java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                        javax.servlet.http.HttpServletResponse response)
Handle the "getalldocids" action. 
 | 
protected void | 
handleGetDocid(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
              javax.servlet.http.HttpServletResponse response)
Look up the pid (guid)-to-docid mapping. 
 | 
protected void | 
handleGetDoctypesAction(java.io.PrintWriter out,
                       java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                       javax.servlet.http.HttpServletResponse response)
Handle "getdoctypes" action. 
 | 
protected void | 
handleGetDTDSchemaAction(java.io.PrintWriter out,
                        java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                        javax.servlet.http.HttpServletResponse response)
Handle the "getdtdschema" action. 
 | 
protected void | 
handleGetLogAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                  javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response,
                  java.lang.String username,
                  java.lang.String[] groups,
                  java.lang.String sessionId)
Print a report from the event log based on filter parameters passed in
 from the web. 
 | 
void | 
handleGetMaxDocidAction(java.io.PrintWriter out,
                       java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                       javax.servlet.http.HttpServletResponse response)
Handle the "getlastdocid" action. 
 | 
protected void | 
handleGetPrincipalsAction(java.io.Writer out,
                         java.lang.String user,
                         java.lang.String password)
Handle the "getprincipals" action. 
 | 
protected void | 
handleGetRevisionAndDocTypeAction(java.io.PrintWriter out,
                                 java.util.Hashtable<java.lang.String,java.lang.String[]> params)
Handle "getrevsionanddoctype" action Given a docid, return it's current
 revision and doctype from data base The output is String look like
 "rev;doctype" 
 | 
void | 
handleIdIsRegisteredAction(java.io.PrintWriter out,
                          java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                          javax.servlet.http.HttpServletResponse response)
Check if the document is registered in either the xml_documents or xml_revisions table 
 | 
java.lang.String | 
handleInsertOrUpdateAction(java.lang.String ipAddress,
                          java.lang.String userAgent,
                          javax.servlet.http.HttpServletResponse response,
                          java.io.PrintWriter out,
                          java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                          java.lang.String user,
                          java.lang.String[] groups,
                          boolean generateSystemMetadata,
                          boolean writeAccessRules,
                          byte[] xmlBytes,
                          java.lang.String formatId,
                          org.dataone.service.types.v1.Checksum checksum)
Handle the database putdocument request and write an XML document to the
 database connection 
 | 
void | 
handleLoginAction(java.io.Writer out,
                 java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                 javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
Handle the login request. 
 | 
void | 
handleLogoutAction(java.io.Writer out,
                  java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                  javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
Handle the logout request. 
 | 
protected void | 
handleMultipartForm(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
Handle documents passed to metacat that are encoded using the
 "multipart/form-data" mime type. 
 | 
protected void | 
handleQuery(java.io.Writer out,
           java.util.Hashtable<java.lang.String,java.lang.String[]> params,
           javax.servlet.http.HttpServletResponse response,
           java.lang.String user,
           java.lang.String[] groups,
           java.lang.String sessionid)
Create the xml query, execute it and display the results. 
 | 
void | 
handleReadAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                javax.servlet.http.HttpServletRequest request,
                javax.servlet.http.HttpServletResponse response,
                java.lang.String user,
                java.lang.String passWord,
                java.lang.String[] groups)
Handle the "read" request of metadata/data files from Metacat or any
 files from Internet; transformed metadata XML document into HTML
 presentation if requested; zip files when more than one were requested. 
 | 
protected void | 
handleReadInlineDataAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          java.lang.String user,
                          java.lang.String passWord,
                          java.lang.String[] groups)
In eml2 document, the xml can have inline data and data was stripped off
 and store in file system. 
 | 
protected void | 
handleReindexAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   java.lang.String username,
                   java.lang.String[] groups)
Rebuild the index for one or more documents. 
 | 
protected void | 
handleReindexAllAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      java.lang.String username,
                      java.lang.String[] groups)
Rebuild the index for all documents in the systemMetadata table. 
 | 
protected void | 
handleSetAccessAction(java.io.PrintWriter out,
                     java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                     java.lang.String username,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)  | 
protected void | 
handleSpatialQuery(java.io.Writer out,
                  java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                  javax.servlet.http.HttpServletResponse response,
                  java.lang.String username,
                  java.lang.String[] groupnames,
                  java.lang.String sess_id)
handles all spatial queries -- these queries may include any of the
 queries supported by the WFS / WMS standards
 
 handleSQuery(out, params, response, username, groupnames, sess_id); 
 | 
protected void | 
handleSQuery(java.io.Writer out,
            java.util.Hashtable<java.lang.String,java.lang.String[]> params,
            javax.servlet.http.HttpServletResponse response,
            java.lang.String user,
            java.lang.String[] groups,
            java.lang.String sessionid)
Retreive the squery xml, execute it and display it 
 | 
protected void | 
handleValidateAction(java.io.PrintWriter out,
                    java.util.Hashtable<java.lang.String,java.lang.String[]> params)
Handle the validation request and return the results to the requestor 
 | 
MetacatResultSet | 
query(java.lang.String metacatUrl,
     java.util.Hashtable<java.lang.String,java.lang.String[]> params,
     java.lang.String username,
     java.lang.String[] groups,
     java.lang.String sessionid)  | 
static java.io.InputStream | 
read(java.lang.String docid)
Read a document from metacat and return the InputStream. 
 | 
void | 
readFromMetacat(java.lang.String ipAddress,
               java.lang.String userAgent,
               javax.servlet.http.HttpServletResponse response,
               java.io.OutputStream out,
               java.lang.String docid,
               java.lang.String qformat,
               java.lang.String user,
               java.lang.String[] groups,
               boolean withInlineData,
               java.util.Hashtable<java.lang.String,java.lang.String[]> params)
read metadata or data from Metacat 
 | 
protected void | 
scheduleSitemapGeneration(javax.servlet.http.HttpServletRequest request)
Schedule the sitemap generator to run periodically and update all
 of the sitemap files for search indexing engines. 
 | 
void | 
set_sitemapScheduled(boolean sitemapScheduled)  | 
void | 
setAccess(java.lang.String metacatUrl,
         java.lang.String username,
         java.lang.String docid,
         java.lang.String principal,
         java.lang.String permission,
         java.lang.String permissionType,
         java.lang.String permissionOrder)
set the access permissions on the document specified 
 | 
public static final java.lang.String FGDCDOCTYPE
protected void handleDataquery(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                               javax.servlet.http.HttpServletResponse response,
                               java.lang.String sessionId)
                        throws edu.ucsb.nceas.utilities.PropertyNotFoundException,
                               java.io.IOException
edu.ucsb.nceas.utilities.PropertyNotFoundExceptionjava.io.IOExceptionprotected void handleEditCart(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.String sessionId)
                       throws edu.ucsb.nceas.utilities.PropertyNotFoundException,
                              java.io.IOException
edu.ucsb.nceas.utilities.PropertyNotFoundExceptionjava.io.IOExceptionprotected void handleSpatialQuery(java.io.Writer out,
                                  java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                  javax.servlet.http.HttpServletResponse response,
                                  java.lang.String username,
                                  java.lang.String[] groupnames,
                                  java.lang.String sess_id)
                           throws edu.ucsb.nceas.utilities.PropertyNotFoundException,
                                  HandlerException
HandlerExceptionedu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic void handleLoginAction(java.io.Writer out,
                              java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                              javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws java.io.IOException
java.io.IOExceptionpublic void handleLogoutAction(java.io.Writer out,
                               java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                               javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws java.io.IOException
java.io.IOExceptionprotected void handleSQuery(java.io.Writer out,
                            java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String user,
                            java.lang.String[] groups,
                            java.lang.String sessionid)
                     throws edu.ucsb.nceas.utilities.PropertyNotFoundException
out - the output stream to the clientparams - the Hashtable of parameters that should be included in the
            squery.response - the response object linked to the clientconn - the database connectionedu.ucsb.nceas.utilities.PropertyNotFoundExceptionprotected void handleQuery(java.io.Writer out,
                           java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                           javax.servlet.http.HttpServletResponse response,
                           java.lang.String user,
                           java.lang.String[] groups,
                           java.lang.String sessionid)
                    throws edu.ucsb.nceas.utilities.PropertyNotFoundException,
                           java.io.UnsupportedEncodingException,
                           java.io.IOException
out - the output stream to the clientparams - the Hashtable of parameters that should be included in the
            squery.response - the response object linked to the clientjava.io.IOExceptionjava.io.UnsupportedEncodingExceptionedu.ucsb.nceas.utilities.PropertyNotFoundExceptionprotected void handleExportAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                  javax.servlet.http.HttpServletResponse response,
                                  java.lang.String user,
                                  java.lang.String[] groups,
                                  java.lang.String passWord)
params - the Hashtable of HTTP request parametersresponse - the HTTP response object linked to the clientuser - the username sent the requestgroups - the user's groupnamesprotected void handleReadInlineDataAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          java.lang.String user,
                                          java.lang.String passWord,
                                          java.lang.String[] groups)
params - the Hashtable of HTTP request parametersresponse - the HTTP response object linked to the clientuser - the username sent the requestgroups - the user's groupnamespublic void handleReadAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             java.lang.String user,
                             java.lang.String passWord,
                             java.lang.String[] groups)
params - the Hashtable of HTTP request parametersrequest - the HTTP request object linked to the clientresponse - the HTTP response object linked to the clientuser - the username sent the requestgroups - the user's groupnamespublic MetacatResultSet query(java.lang.String metacatUrl, java.util.Hashtable<java.lang.String,java.lang.String[]> params, java.lang.String username, java.lang.String[] groups, java.lang.String sessionid) throws java.lang.Exception
java.lang.Exceptionpublic void setAccess(java.lang.String metacatUrl,
                      java.lang.String username,
                      java.lang.String docid,
                      java.lang.String principal,
                      java.lang.String permission,
                      java.lang.String permissionType,
                      java.lang.String permissionOrder)
               throws java.lang.Exception
java.lang.Exceptionpublic static java.io.InputStream read(java.lang.String docid)
                                throws edu.ucsb.nceas.utilities.ParseLSIDException,
                                       edu.ucsb.nceas.utilities.PropertyNotFoundException,
                                       McdbException,
                                       java.sql.SQLException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
docid - - the metacat docid to readusername - - the DN of the principal attempting the readgroups - - the list of groups the DN belongs to as a String arrayInsufficientKarmaExceptionedu.ucsb.nceas.utilities.ParseLSIDExceptionedu.ucsb.nceas.utilities.PropertyNotFoundExceptionMcdbExceptionjava.sql.SQLExceptionjava.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic void readFromMetacat(java.lang.String ipAddress,
                            java.lang.String userAgent,
                            javax.servlet.http.HttpServletResponse response,
                            java.io.OutputStream out,
                            java.lang.String docid,
                            java.lang.String qformat,
                            java.lang.String user,
                            java.lang.String[] groups,
                            boolean withInlineData,
                            java.util.Hashtable<java.lang.String,java.lang.String[]> params)
                     throws java.lang.ClassNotFoundException,
                            java.io.IOException,
                            java.sql.SQLException,
                            McdbException,
                            edu.ucsb.nceas.utilities.PropertyNotFoundException,
                            edu.ucsb.nceas.utilities.ParseLSIDException,
                            InsufficientKarmaException
userAgent - edu.ucsb.nceas.utilities.PropertyNotFoundExceptionedu.ucsb.nceas.utilities.ParseLSIDExceptionInsufficientKarmaExceptionjava.lang.ClassNotFoundExceptionjava.io.IOExceptionjava.sql.SQLExceptionMcdbExceptionpublic java.lang.String handleInsertOrUpdateAction(java.lang.String ipAddress,
                                                   java.lang.String userAgent,
                                                   javax.servlet.http.HttpServletResponse response,
                                                   java.io.PrintWriter out,
                                                   java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                                   java.lang.String user,
                                                   java.lang.String[] groups,
                                                   boolean generateSystemMetadata,
                                                   boolean writeAccessRules,
                                                   byte[] xmlBytes,
                                                   java.lang.String formatId,
                                                   org.dataone.service.types.v1.Checksum checksum)
userAgent - generateSystemMetadata - public void handleDeleteAction(java.io.PrintWriter out,
                               java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                               javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               java.lang.String user,
                               java.lang.String[] groups)
protected void handleValidateAction(java.io.PrintWriter out,
                                    java.util.Hashtable<java.lang.String,java.lang.String[]> params)
protected void handleGetDocid(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                              javax.servlet.http.HttpServletResponse response)
                       throws java.io.IOException
params - response - java.io.IOExceptionprotected void handleGetRevisionAndDocTypeAction(java.io.PrintWriter out,
                                                 java.util.Hashtable<java.lang.String,java.lang.String[]> params)
protected void handleGetAccessControlAction(java.io.PrintWriter out,
                                            java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                            javax.servlet.http.HttpServletResponse response,
                                            java.lang.String username,
                                            java.lang.String[] groupnames)
protected void handleGetPrincipalsAction(java.io.Writer out,
                                         java.lang.String user,
                                         java.lang.String password)
                                  throws java.io.IOException
java.io.IOExceptionprotected void handleGetDoctypesAction(java.io.PrintWriter out,
                                       java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                       javax.servlet.http.HttpServletResponse response)
protected void handleGetDTDSchemaAction(java.io.PrintWriter out,
                                        java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                        javax.servlet.http.HttpServletResponse response)
public void handleIdIsRegisteredAction(java.io.PrintWriter out,
                                       java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                       javax.servlet.http.HttpServletResponse response)
out - the writer to write the xml results toparams - request parametersresponse - the http servlet responsepublic void handleGetAllDocidsAction(java.io.PrintWriter out,
                                     java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                     javax.servlet.http.HttpServletResponse response)
public void handleGetMaxDocidAction(java.io.PrintWriter out,
                                    java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                    javax.servlet.http.HttpServletResponse response)
protected void handleGetLogAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                  javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  java.lang.String username,
                                  java.lang.String[] groups,
                                  java.lang.String sessionId)
params - the parameters from the web requestrequest - the http request object for getting request detailsresponse - the http response object for writing outputprotected void handleBuildIndexAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                      javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      java.lang.String username,
                                      java.lang.String[] groups)
params - the parameters from the web requestrequest - the http request object for getting request detailsresponse - the http response object for writing outputusername - the username of the authenticated userprotected void handleReindexAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   java.lang.String username,
                                   java.lang.String[] groups)
params - the parameters from the web requestrequest - the http request object for getting request detailsresponse - the http response object for writing outputusername - the username of the authenticated userprotected void handleReindexAllAction(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                      javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      java.lang.String username,
                                      java.lang.String[] groups)
params - the parameters from the web requestrequest - the http request object for getting request detailsresponse - the http response object for writing outputusername - the username of the authenticated userprotected void handleMultipartForm(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
protected void handleSetAccessAction(java.io.PrintWriter out,
                                     java.util.Hashtable<java.lang.String,java.lang.String[]> params,
                                     java.lang.String username,
                                     javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
protected void scheduleSitemapGeneration(javax.servlet.http.HttpServletRequest request)
request - a servlet request, from which we determine the contextpublic void set_sitemapScheduled(boolean sitemapScheduled)
sitemapScheduled - toggle the _sitemapScheduled flagCopyright © 2020 Regents of the University of California. All Rights Reserved.