edu.ucsb.nceas.metacat.clientview

## Class ClientFgdcHelper

- java.lang.Object
- - edu.ucsb.nceas.metacat.clientview.ClientFgdcHelper

-     public abstract class ClientFgdcHelper
      extends java.lang.Object

  Author:
    barteau

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `FGDC_DATA_FILE_DOCID_XPATH` Data Document ID location within an FGDC document.
    `static java.lang.String` | `FGDC_DATA_FILE_NAME_XPATH`
    `static java.lang.String` | `FGDC_DATA_FILE_NODES_XPATH` FGDC Data Document ID location within an FGDC document, relative to the "distinfo" parent node.
    `static java.lang.String` | `FGDC_DATA_FILE_QUERY_XPATH`
    `static java.lang.String` | `FGDC_DOCID_ROOT_XPATH`
    `static java.lang.String` | `FGDC_DOCID_XPATH` Metadata Document ID location within an FGDC document.
    `static java.lang.String` | `FGDC_FILE_NAME_XPATH`
    `static java.lang.String` | `FGDC_SYSTEM_ID` Identifies the FGDC DTD.
    `static java.lang.String` | `PATH4ANCESTOR`
    `static java.lang.String` | `SUB_DOCS_PATH`
    `static java.lang.String` | `XPATH_QUERY_TEMPLATE` Metadata Document ID query template within an FGDC document.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientFgdcHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clientDeleteRequest(ClientView clientViewBean, ClientViewHelper clientViewHelper)` Handles a client's request to delete a document.
    `static boolean` | `handlePackageUpload(java.lang.String metaDocId, java.util.HashMap dataDocIDs, java.lang.String contactName, java.lang.String metaFNm, org.w3c.dom.Document metadataDoc)`
    `static boolean` | `hasMetacatInfo(java.lang.String docId, org.w3c.dom.Document metadataDoc)`
    `static boolean` | `isFGDC(org.w3c.dom.Document metadataDoc)`
    `static void` | `updateFileNameAndType(org.w3c.dom.Node root, java.lang.String dataDocId, java.lang.String[] fileInfo)`
    `static void` | `updateMetadataFileName(org.w3c.dom.Node root, java.lang.String metadataDocId, java.lang.String fileName)`

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

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

- - ### Field Detail

    - #### FGDC_DATA_FILE_DOCID_XPATH

          public static final java.lang.String FGDC_DATA_FILE_DOCID_XPATH

      Data Document ID location within an FGDC document. XPath expression.
      See Also:
        Constant Field Values

    - #### FGDC_DATA_FILE_QUERY_XPATH

          public static final java.lang.String FGDC_DATA_FILE_QUERY_XPATH

      See Also:
        Constant Field Values

    - #### FGDC_DATA_FILE_NAME_XPATH

          public static final java.lang.String FGDC_DATA_FILE_NAME_XPATH

      See Also:
        Constant Field Values

    - #### FGDC_DATA_FILE_NODES_XPATH

          public static final java.lang.String FGDC_DATA_FILE_NODES_XPATH

      FGDC Data Document ID location within an FGDC document, relative to the "distinfo" parent node. XPath expression.
      See Also:
        Constant Field Values

    - #### PATH4ANCESTOR

          public static final java.lang.String PATH4ANCESTOR

      See Also:
        Constant Field Values

    - #### SUB_DOCS_PATH

          public static final java.lang.String SUB_DOCS_PATH

      See Also:
        Constant Field Values

    - #### FGDC_DOCID_XPATH

          public static final java.lang.String FGDC_DOCID_XPATH

      Metadata Document ID location within an FGDC document. XPath expression.
      See Also:
        Constant Field Values

    - #### FGDC_FILE_NAME_XPATH

          public static final java.lang.String FGDC_FILE_NAME_XPATH

      See Also:
        Constant Field Values

    - #### XPATH_QUERY_TEMPLATE

          public static final java.lang.String XPATH_QUERY_TEMPLATE

      Metadata Document ID query template within an FGDC document. Substitute %1s with Doc Id.
      See Also:
        Constant Field Values

    - #### FGDC_DOCID_ROOT_XPATH

          public static final java.lang.String FGDC_DOCID_ROOT_XPATH

      See Also:
        Constant Field Values

    - #### FGDC_SYSTEM_ID

          public static final java.lang.String FGDC_SYSTEM_ID

      Identifies the FGDC DTD.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClientFgdcHelper

          public ClientFgdcHelper()

  - ### Method Detail

    - #### clientDeleteRequest

          public static void clientDeleteRequest(ClientView clientViewBean,
                                                 ClientViewHelper clientViewHelper)

      Handles a client's request to delete a document. If its a data document, it removes the Doc Id from the FGDC metadata in the Metacat database. It determines what metadata Doc ID is including this Doc Id. It then queries metacat for the parent FGDC document and removes the Doc Id from it, and reloads the new version with a new revision number. If its a metadata document, it deletes any related data documents, then it deletes the metadata. In either instance, it sets the server feedback in the session ("updateFeedback").
      Parameters:
        `request` - HttpServletRequest which contains docId parameter.

    - #### handlePackageUpload

          public static boolean handlePackageUpload(java.lang.String metaDocId,
                                                    java.util.HashMap dataDocIDs,
                                                    java.lang.String contactName,
                                                    java.lang.String metaFNm,
                                                    org.w3c.dom.Document metadataDoc)
                                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### isFGDC

          public static boolean isFGDC(org.w3c.dom.Document metadataDoc)

    - #### hasMetacatInfo

          public static boolean hasMetacatInfo(java.lang.String docId,
                                               org.w3c.dom.Document metadataDoc)

    - #### updateFileNameAndType

          public static void updateFileNameAndType(org.w3c.dom.Node root,
                                                   java.lang.String dataDocId,
                                                   java.lang.String[] fileInfo)

    - #### updateMetadataFileName

          public static void updateMetadataFileName(org.w3c.dom.Node root,
                                                    java.lang.String metadataDocId,
                                                    java.lang.String fileName)

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