Hi Mark,
Try moving the "dir namer" datasetNamer element inside the datasetSource
element. I think that will work. Let me know. If not, I have a few other ideas
that I'm hoping aren't the case.
Ethan
Mark A Ohrenschall wrote:
>
> Hi,
>
> I have a hierarchy of data sets reflected in the directory structure a file
> system, but I cannot find any way to control the name of the "middle" dataset
> elements (there are three levels of dataset elements) which correspond to --
> and are named after -- the directories containing the data files, e.g.,
> "saa/Products/netcdf/sst50" near the bottom of this email.
>
> The second and last paragraph of "Reflect hierarchy of your dataset collection
> in your catalog" at
> http://www.unidata.ucar.edu/projects/THREDDS/tech/cataloggen/CatalogGenConfig.html
> implies I have control over the naming of these dataset elements, but I'm
> unable to figure out how.
>
> Here is my XML configuration file:
>
> <!DOCTYPE catalog SYSTEM
> "http://www.unidata.ucar.edu/projects/THREDDS/xml/CatalogGenConfig.0.5.dtd">
> <catalog name="my data" version="0.6">
> <dataset name="SAA netCDF Products" dataType="Grid">
> <metadata metadataType="CatalogGenConfig">
> <catalogGenConfig type="Catalog">
> <datasetSource name="ds source" type="Local" structure="DirTree"
> accessPoint="/data/www/html/dods/saa/Products/netcdf/">
> <resultService name="DODSserver" serviceType="DODS"
> base="http://panther.ngdc.noaa.gov/cgi-bin/dods/nph-dods/dods/"
> accessPointHeader="/data/www/html/dods/"/>
> <datasetNamer name="netCDF namer" type="RegExp" addLevel="false"
> matchPattern="([^\/]+)\/([^\/]+)\.cdf$" substitutePattern="nc $1 $2"/>
> <datasetFilter name="My Test" type="RegExp"
> matchPattern="\/.+\.cdf$"/>
> </datasetSource>
> <datasetNamer name="dir namer" type="RegExp" addLevel="false"
> matchPattern="(.*)" substitutePattern="dir $1"/>
> </catalogGenConfig>
> <datasetNamer name="dir namer" type="RegExp" addLevel="false"
> matchPattern="(.*)" substitutePattern="dir $1"/>
> </metadata>
> </dataset>
> </catalog>
>
> And here is an excerpt of the generated output:
>
> [mao@panther THREDDS]$ /usr/java/j2sdk1.4.1_02/bin/java -classpath
> cataloggen-0.6.jar:thredds.jar:jdom-b8.jar:dods.1.1.1.jar
> thredds.cataloggen.CatalogGen file:///home/mao/THREDDS/saatest.xml trash;
> head trash
> readMetadataContent=[Element: <catalogGenConfig [Namespace:
> http://www.unidata.ucar.edu/thredds]/>]
> Catalog read successfully (file:///home/mao/THREDDS/saatest.xml):
> Message=----Catalog Validation version 0.6.02
> **Dataset (3) (SAA netCDF Products): is not selectable and does not have
> nested datasets
>
> CatalogGen: catalog written to trash.
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE catalog SYSTEM
> "http://www.unidata.ucar.edu/projects/THREDDS/xml/InvCatalog.0.6.dtd">
> <catalog xmlns="http://www.unidata.ucar.edu/thredds"
> xmlns:xlink="http://www.w3.org/1999/xlink" name="my data" version="0.6">
> <dataset name="SAA netCDF Products" dataType="Grid">
> <service name="DODSserver" serviceType="DODS"
> base="http://panther.ngdc.noaa.gov/cgi-bin/dods/nph-dods/dods/" />
> <dataset name="saa/Products/netcdf/sst50" serviceName="DODSserver">
> <dataset name="nc sst50 20030405_090000"
> urlPath="saa/Products/netcdf/sst50/20030405_090000.cdf" />
> <dataset name="nc sst50 20030401_210000"
> urlPath="saa/Products/netcdf/sst50/20030401_210000.cdf" />
> <dataset name="nc sst50 20030329_090000"
> urlPath="saa/Products/netcdf/sst50/20030329_090000.cdf" />
> <dataset name="nc sst50 20030325_210000"
> urlPath="saa/Products/netcdf/sst50/20030325_210000.cdf" />
> [mao@panther THREDDS]$ grep dir trash
> [mao@panther THREDDS]$
>
> (The grep is looking for "dir ..." name attribute values generated from the
> "dir namer" datasetNamer element.)
>
> Thanks,
>
> Mark
--
Ethan R. Davis Telephone: (303) 497-8155
Software Engineer Fax: (303) 497-8690
UCAR Unidata Program Center E-mail: edavis@xxxxxxxx
P.O. Box 3000
Boulder, CO 80307-3000 http://www.unidata.ucar.edu/