Class XMLUtils

java.lang.Object
org.javastro.ivoa.registry.XMLUtils

public class XMLUtils extends Object
  • Constructor Details

    • XMLUtils

      public XMLUtils()
  • Method Details

    • marshallResources

      public String marshallResources(org.javastro.ivoa.entities.resource.registry.iface.VOResources a)
    • marshall

      public <T> String marshall(T a)
    • unmarshal

      public List<org.javastro.ivoa.entities.resource.Resource> unmarshal(String xml) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • rawOAIToResources

      public String rawOAIToResources(Path input)
      Convert an OAI-PMH ListRecords response to a VOResources document.
      Parameters:
      input - path to raw OAI-PMH ListRecords response XML file.
      Returns:
      XML string containing a VOResources document with all the resources from the OAI-PMH ListRecords response in the input file.
    • rawOAIToResources

      public String rawOAIToResources(Source input)
      Convert an OAI-PMH ListRecords response to a VOResources document.
      Parameters:
      input - path to raw OAI-PMH ListRecords response XML file.
      Returns:
      XML string containing a VOResources document with all the resources from the OAI-PMH ListRecords response in the input file.
    • marshallElement

      public String marshallElement(jakarta.xml.bind.JAXBElement<?> element)
      Marshal an Object into a XML string. The XML is cleaned up with the cleaning stylesheet to ensure that it is a valid VOResources document.
      Parameters:
      element - the input object.
      Returns:
    • concatenateCache

      public Path concatenateCache(Path dir)
      Concatenate all the OAI ListRecords chunk files (*.xml) in a directory into a single VOResources document, using the fixHarvest stylesheet.
      Parameters:
      dir - directory containing the cached chunk files.
      Returns:
      path of a temporary file containing the combined XML (caller should delete it).
    • marshallOAI

      public String marshallOAI(org.javastro.ivoa.entities.oai.oaipmh.OAIPMH element)
    • OaiMetadataToResource

      public org.javastro.ivoa.entities.resource.Resource OaiMetadataToResource(org.javastro.ivoa.entities.oai.oaipmh.RecordType oai)
    • extractResource

      public org.javastro.ivoa.entities.resource.Resource extractResource(Node xml)
    • OaiIdentifyToResource

      public org.javastro.ivoa.entities.resource.Resource OaiIdentifyToResource(org.javastro.ivoa.entities.oai.oaipmh.IdentifyType oai)