Package org.javastro.ivoa.registry
Class XMLUtils
java.lang.Object
org.javastro.ivoa.registry.XMLUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcatenateCache(Path dir) Concatenate all the OAI ListRecords chunk files (*.xml) in a directory into a single VOResources document, using the fixHarvest stylesheet.org.javastro.ivoa.entities.resource.ResourceextractResource(Node xml) <T> Stringmarshall(T a) marshallElement(jakarta.xml.bind.JAXBElement<?> element) Marshal an Object into a XML string.marshallOAI(org.javastro.ivoa.entities.oai.oaipmh.OAIPMH element) marshallResources(org.javastro.ivoa.entities.resource.registry.iface.VOResources a) org.javastro.ivoa.entities.resource.ResourceOaiIdentifyToResource(org.javastro.ivoa.entities.oai.oaipmh.IdentifyType oai) org.javastro.ivoa.entities.resource.ResourceOaiMetadataToResource(org.javastro.ivoa.entities.oai.oaipmh.RecordType oai) rawOAIToResources(Path input) Convert an OAI-PMH ListRecords response to a VOResources document.rawOAIToResources(Source input) Convert an OAI-PMH ListRecords response to a VOResources document.List<org.javastro.ivoa.entities.resource.Resource>
-
Constructor Details
-
XMLUtils
public XMLUtils()
-
-
Method Details
-
marshallResources
-
marshall
-
unmarshal
public List<org.javastro.ivoa.entities.resource.Resource> unmarshal(String xml) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
rawOAIToResources
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
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
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
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
-
OaiMetadataToResource
public org.javastro.ivoa.entities.resource.Resource OaiMetadataToResource(org.javastro.ivoa.entities.oai.oaipmh.RecordType oai) -
extractResource
-
OaiIdentifyToResource
public org.javastro.ivoa.entities.resource.Resource OaiIdentifyToResource(org.javastro.ivoa.entities.oai.oaipmh.IdentifyType oai)
-