Class NSDLCollectionUtils

java.lang.Object
org.dlese.dpc.schemedit.ndr.util.integration.NSDLCollectionUtils

public class NSDLCollectionUtils extends Object
Utilities for working with NSDL Collection records housed in the NCS instance.
Author:
ostwald
  • Constructor Details

    • NSDLCollectionUtils

      public NSDLCollectionUtils()
  • Method Details

    • setBaseServiceUrl

      public static void setBaseServiceUrl(String baseUrl)
    • getBaseServiceUrl

      public static String getBaseServiceUrl()
    • getCollectionMetadataHandle

      public static String getCollectionMetadataHandle(String aggHandle)
    • getNCSCollectionID

      public static String getNCSCollectionID(NSDLCollectionReader collReader)
      Extracts the NCS collection id from a NSDLCollectionReader instance.

      Never returns null so we can stuff into xml without worry

      Parameters:
      collReader - Description of the Parameter
      Returns:
      The collection id value, or an empty string if one cannot be found
    • getNCSRecord

      public static NCSCollectReader getNCSRecord(URL resourceUrl)
      Gets an NCSCollectReader instance for a given resourceUrl.

      Uses web service to find a metadata record for the resourceUrl and then creates a reader object from the response.

      Parameters:
      resourceUrl - Description of the Parameter
      Returns:
      The nCSRecord value
    • getNCSCollectionID

      public static String getNCSCollectionID(String resourceUrl)
      Finds the collection id for the provided collection resource url.

      Parameters:
      resourceUrl - Description of the Parameter
      Returns:
      The nCSCollectionID value
    • getNCSCollectionRecordIDs

      public static List getNCSCollectionRecordIDs() throws Exception
      Gets a list of collection ids from the NCSL Collections collection.
      Returns:
      The nCSCollectionIDs value
      Throws:
      Exception - Description of the Exception
    • getNCSCollectionIDs

      public static List getNCSCollectionIDs() throws Exception
      Throws:
      Exception
    • getNCSRecord

      public static NCSCollectReader getNCSRecord(String recId) throws Exception
      Returns NCSCollectReader instance for NCS Collect record having provided id.
      Parameters:
      recId - Description of the Parameter
      Returns:
      The nCSRecord value
      Throws:
      Exception - Description of the Exception
    • getNCSRecordByTitle

      public static NCSCollectReader getNCSRecordByTitle(String title) throws Exception
      Gets the nCSRecordByTitle attribute of the NSDLCollectionUtils class
      Parameters:
      title - Description of the Parameter
      Returns:
      The nCSRecordByTitle value
      Throws:
      Exception - Description of the Exception
    • main

      public static void main(String[] args)
      The main program for the NSDLCollectionUtils class
      Parameters:
      args - The command line arguments
    • compare

      public static void compare(String aggHandle) throws Exception
      Description of the Method
      Parameters:
      aggHandle - Description of the Parameter
      Throws:
      Exception - Description of the Exception
    • compare

      public static void compare(NSDLCollectionReader nsdl, NCSCollectReader ncs)
      Description of the Method
      Parameters:
      nsdl - Description of the Parameter
      ncs - Description of the Parameter
    • compareInfoModels

      public static void compareInfoModels() throws Exception
      Description of the Method
      Throws:
      Exception - Description of the Exception