edu.ucsb.nceas.metacat

## Class MetaCatServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - edu.ucsb.nceas.metacat.MetaCatServlet

- All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

      public class MetaCatServlet
      extends javax.servlet.http.HttpServlet

  A metadata catalog server implemented as a Java Servlet Valid actions are: action=login username password qformat action=logout qformat action=query -- query the values of all elements and attributes and return a result set of nodes meta_file_id -- returndoctype -- filterdoctype -- returnfield -- owner -- site -- operator -- casesensitive -- searchmode -- anyfield -- action=spatial_query -- run a spatial query. these queries may include any of the queries supported by the WFS / WMS standards xmax -- ymax -- xmin -- ymin -- skin -- pagesize -- pagestart -- action=squery -- structured query (see pathquery.dtd) query -- pagesize -- pagestart -- action=export -- export a zip format for data packadge docid -- action=read -- read any metadata/data file from Metacat and from Internet archiveEntryName -- docid -- qformat -- metadatadocid -- action=readinlinedata -- read inline data only inlinedataid action=insert -- insert an XML document into the database store qformat -- docid -- doctext -- dtdtext -- action=insertmultipart -- insert an xml document into the database using multipart encoding qformat -- docid -- action=update -- update an XML document that is in the database store qformat -- docid -- doctext -- dtdtext -- action=delete -- delete an XML document from the database store docid -- action=validate -- validate the xml contained in valtext valtext -- docid -- action=setaccess -- change access permissions for a user on a document. docid -- principal -- permission -- permType -- permOrder -- action=getaccesscontrol -- retrieve acl info for Metacat document docid -- action=getprincipals -- retrieve a list of principals in XML action=getalldocids -- retrieves a list of all docids registered with the system scope -- action=getlastdocid -- scope -- username -- action=isregistered -- checks to see if the provided docid is registered docid -- action=getrevisionanddoctype -- get a document's revision and doctype from database docid -- action=getversion -- action=getdoctypes -- retrieve all doctypes (publicID) action=getdtdschema -- retrieve a DTD or Schema file doctype -- action=getlog -- get a report of events that have occurred in the system ipAddress -- filter on one or more IP addresses> principal -- filter on one or more principals (LDAP DN syntax) docid -- filter on one or more document identifiers (with revision) event -- filter on event type (e.g., read, insert, update, delete) start -- filter out events before the start date-time end -- filter out events before the end date-time action=getloggedinuserinfo -- get user info for the currently logged in user ipAddress -- filter on one or more IP addresses> principal -- filter on one or more principals (LDAP DN syntax) docid -- filter on one or more document identifiers (with revision) event -- filter on event type (e.g., read, insert, update, delete) start -- filter out events before the start date-time end -- filter out events before the end date-time action=shrink -- Shrink the database connection pool size if it has grown and extra connections are no longer being used. action=buildindex -- docid -- action=refreshServices -- action=scheduleWorkflow -- Schedule a workflow to be run. Scheduling a workflow registers it with the scheduling engine and creates a row in the scheduled_job table. Note that this may be extracted into a separate servlet. delay -- The amount of time from now before the workflow should be run. The delay can be expressed in number of seconds, minutes, hours and days, for instance 30s, 2h, etc. starttime -- The time that the workflow should first run. If both are provided this takes precedence over delay. The time should be expressed as: MM/dd/yyyy HH:mm:ss with the timezone assumed to be that of the OS. endtime -- The time when the workflow should end. The time should be expressed as: MM/dd/yyyy HH:mm:ss with the timezone assumed to be that of the OS. intervalvalue -- The numeric value of the interval between runs intervalunit -- The unit of the interval between runs. Can be s, m, h, d for seconds, minutes, hours and days respectively workflowid -- The lsid of the workflow that we want to schedule. This workflow must already exist in the database. karid -- The karid for the workflow that we want to schedule. workflowname -- The name of the workflow. forwardto -- If provided, forward to this page when processing is done. qformat -- If provided, render results using the stylesheets associated with this skin. Default is xml. action=unscheduleWorkflow -- Unschedule a workflow. Unscheduling a workflow removes it from the scheduling engine and changes the status in the scheduled_job table to " unscheduled. Note that this may be extracted into a separate servlet. workflowjobname -- The job ID for the workflow run that we want to unschedule. This is held in the database as scheduled_job.name forwardto -- If provided, forward to this page when processing is done. qformat -- If provided, render results using the stylesheets associated with this skin. Default is xml. action=rescheduleWorkflow -- Unschedule a workflow. Rescheduling a workflow registers it with the scheduling engine and changes the status in the scheduled_job table to " scheduled. Note that this may be extracted into a separate servlet. workflowjobname -- The job ID for the workflow run that we want to reschedule. This is held in the database as scheduled_job.name forwardto -- If provided, forward to this page when processing is done. qformat -- If provided, render results using the stylesheets associated with this skin. Default is xml. action=deleteScheduledWorkflow -- Delete a workflow. Deleting a workflow removes it from the scheduling engine and changes the status in the scheduled_job table to " deleted. Note that this may be extracted into a separate servlet. workflowjobname -- The job ID for the workflow run that we want to delete. This is held in the database as scheduled_job.name forwardto -- If provided, forward to this page when processing is done. qformat -- If provided, render results using the stylesheets associated with this skin. Default is xml. action=reindex -- rebuild the solr index for the specified pids. pid -- the id of the document which will be rebuilt slor index. action=reindexall -- rebuild the solr index for all objects in the systemmetadata table. Here are some of the common parameters for actions doctype -- document type list returned by the query (publicID) qformat=xml -- display resultset from query in XML qformat=html -- display resultset from query in HTML qformat=zip -- zip resultset from query docid=34 -- display the document with the document ID number 34 doctext -- XML text of the document to load into the database acltext -- XML access text for a document to load into the database dtdtext -- XML DTD text for a new DTD to load into Metacat XML Catalog query -- actual query text (to go with 'action=query' or 'action=squery') valtext -- XML text to be validated scope --can limit the query by the scope of the id docid --the docid to check datadoc -- data document name (id)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `APPLICATION_NAME`
    `static java.lang.String` | `DEFAULT_ENCODING`
    `static java.lang.String` | `EML2KEYWORD`
    `static java.lang.String` | `NONAMESPACELOCATION`
    `static java.lang.String` | `SCHEMALOCATIONKEYWORD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetaCatServlet()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Close all db connections from the pool
    `void` | `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Handle "GET" method requests from HTTP clients
    `void` | `doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Handle "POST" method requests from HTTP clients
    `void` | `init(javax.servlet.ServletConfig config)` Initialize the servlet by creating appropriate database connections
    `void` | `initSecondHalf(javax.servlet.ServletContext context)` Initialize the remainder of the servlet.
    `static boolean` | `isFullyInitialized()` Reports whether the MetaCatServlet has been fully initialized
    `static boolean` | `isReadOnly(javax.servlet.http.HttpServletResponse response)`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SCHEMALOCATIONKEYWORD

          public static final java.lang.String SCHEMALOCATIONKEYWORD

      See Also:
        Constant Field Values

    - #### NONAMESPACELOCATION

          public static final java.lang.String NONAMESPACELOCATION

      See Also:
        Constant Field Values

    - #### EML2KEYWORD

          public static final java.lang.String EML2KEYWORD

      See Also:
        Constant Field Values

    - #### APPLICATION_NAME

          public static final java.lang.String APPLICATION_NAME

      See Also:
        Constant Field Values

    - #### DEFAULT_ENCODING

          public static final java.lang.String DEFAULT_ENCODING

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MetaCatServlet

          public MetaCatServlet()

  - ### Method Detail

    - #### init

          public void init(javax.servlet.ServletConfig config)
                    throws javax.servlet.ServletException

      Initialize the servlet by creating appropriate database connections
      Specified by:
        `init` in interface `javax.servlet.Servlet`
      Overrides:
        `init` in class `javax.servlet.GenericServlet`
      Throws:
        `javax.servlet.ServletException`

    - #### initSecondHalf

          public void initSecondHalf(javax.servlet.ServletContext context)
                              throws javax.servlet.ServletException

      Initialize the remainder of the servlet. This is the part that can only be initialized after metacat properties have been configured
      Parameters:
        `context` - the servlet context of MetaCatServlet
      Throws:
        `javax.servlet.ServletException`

    - #### destroy

          public void destroy()

      Close all db connections from the pool
      Specified by:
        `destroy` in interface `javax.servlet.Servlet`
      Overrides:
        `destroy` in class `javax.servlet.GenericServlet`

    - #### doGet

          public void doGet(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws javax.servlet.ServletException,
                            java.io.IOException

      Handle "GET" method requests from HTTP clients
      Overrides:
        `doGet` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `java.io.IOException`

    - #### doPost

          public void doPost(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             java.io.IOException

      Handle "POST" method requests from HTTP clients
      Overrides:
        `doPost` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `java.io.IOException`

    - #### isFullyInitialized

          public static boolean isFullyInitialized()

      Reports whether the MetaCatServlet has been fully initialized
      Returns:
        true if fully intialized, false otherwise

    - #### isReadOnly

          public static boolean isReadOnly(javax.servlet.http.HttpServletResponse response)
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2020 Regents of the University of California. All Rights Reserved.