110 likes | 241 Views
Bulk XFDU Creator Sergey Nikhinson Lou Reich. Requirements. create an XFDU manifest and save it as template create new template or modify existing template specify pattern for file names that will be used as data and metadata objects
E N D
Bulk XFDU Creator Sergey Nikhinson Lou Reich
Requirements • create an XFDU manifest and save it as template • create new template or modify existing template • specify pattern for file names that will be used as data and metadata objects • specify relationships between data and metadata (content unit info) • specify necessary attributes for data/metadata/content units • specify other static information for XFDU package (e.g. header)
High Level Design Three major logical components: • XFDU Engine (XFDU Toolkit with some additions) • Templating engine • Templates
Design Diagram Templates Templating engine Files XFDU Engine Manifest Bulk Package Creator XFDU Package
Basic Flow • Templating engine consumes template(s) • Templating engine parses the template(s) and passes information about files to be used to XFDU Engine • XFDU Engine uses the passed information to create XFDU structures • The created structures are merged with the rest of the information in the template to create XFDU manifest • The created manifest is consumed by XFDU Engine • XFDU package is created by XFDU Engine
Use Cases Use Case Scenario 1 • User creates an XFDU instance (manifest) and saves it as template • User modifies the template to include patterns for file selection and other desired attributes • User runs bulk creator and produces XFDU package Use Case Scenario 2 • User uses existing XFDU manifest template • User modifies the template to include patterns for file selection and other desired attributes • User runs bulk creator and produces XFDU package
First Implementation • Apache Velocity as templating engine • Velocity template as input • Ant-style wild-carded path specification for files • Nested content units • Other information via velocity variables
Sample template <?xml version="1.0" encoding="UTF-8"?> <xfdu:XFDU xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ccsds.org/xfdu/2004 xfdu.xsd" xmlns:xfdu="http://www.ccsds.org/xfdu/2004"> <packageHeader ID="packageHeader"> <volumeInfo> <specificationVersion>1.0</specificationVersion> <!-- sequence information attribute is specified by producer--> <sequenceInformation sequenceSize="10" sequencePosition="1">producer1.seq10</sequenceInformation> </volumeInfo> <environmentInfo> <xmlData> <platform>Linux2.4.22-1.2129.nptl</platform> </xmlData> </environmentInfo> </packageHeader> <informationPackageMap ID="informationPackageMap"> <xfdu:contentUnit ID="$cuIdPrefix" anyMdID="$anyMdFilePattern> #set($tmp=!$cuContext.put('cuIdPrefix','blk')) #set($tmp=!$cuContext.put('anyMdFilePattern','usa_nasa_pds_mgst_1230/DATA/**/*.LBL')) #set($tmp=!$cuContext.put('dataObjectFilePattern','usa_nasa_pds_mgst_1230/DATA/**/*.TAB')) <dataObjectPointer dataObjectID = "$dataObjectFilePattern"/> </xfdu:contentUnit> </informationPackageMap> </xfdu:XFDU>
Partial sample output <informationPackageMap> <xfdu:contentUnit anyMdID="meta1 meta2" ID="blk_contentUnit1"> <dataObjectPointer dataObjectID="dataObject1"/> </xfdu:contentUnit> <xfdu:contentUnit anyMdID="meta1 meta2" ID="blk_contentUnit2"> <dataObjectPointer dataObjectID="dataObject2"/> </xfdu:contentUnit> <xfdu:contentUnit anyMdID="meta1 meta2" ID="blk_contentUnit3"> <dataObjectPointer dataObjectID="dataObject3"/> </xfdu:contentUnit> </informationPackageMap> <metadataSection> <metadataObject category="OTHER" classification="OTHER" ID="meta1"> <metadataReference mimeType="text/xml" vocabularyName="OTHER" locatorType="URL" href="file:usa_nasa_pds_mgst_1230/DATA/MARS/DATASET.LBL"/> </metadataObject> <metadataObject category="OTHER" classification="OTHER" ID="meta2"> <metadataReference mimeType="text/xml" vocabularyName="OTHER" locatorType="URL" href="file:usa_nasa_pds_mgst_1230/DATA/MARS/VAR.LBL"/> </metadataObject> </metadataSection>
Partial sample output (cont.) <dataObjectSection> <dataObject repID="" ID="dataObject1"> <byteStream size="937398" mimeType="application/octetstream"> <fileLocation locatorType="URL" href="file:usa_nasa_pds_mgst_1230/DATA/MARS/OBS23002.TAB"/> </byteStream> </dataObject> <dataObject repID="" ID="dataObject2"> <byteStream size="2298307" mimeType="application/octetstream"> <fileLocation locatorType="URL" href="usa_nasa_pds_mgst_1230/DATA/MARS/TLM23004.TAB"/> </byteStream> </dataObject> <dataObject repID="" ID="dataObject3"> <byteStream size="3835230" mimeType="application/octetstream"> <fileLocation locatorType="URL" href="usa_nasa_pds_mgst_1230/DATA/MARS/BOL23005.TAB"/> </byteStream> </dataObject> </dataObjectSection>
Future direction • Various pluggable strategies for file selection • User interface for template creation