[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: example config catalogs



Hi Nathan,

John Caron wrote:

Nathan, I've answered a little bit, but I need to forward this to ethan to answer most of these questions, I hope he's watching his email to answer soon.

Nathan Potter wrote:



John,


So I made this catalog.xml:

<?xml version="1.0" encoding="UTF-8"?>
<catalog name="TestData_NC" version="1.0.1"
xmlns="http://www.unidata.ucar.edu/namespaces/thredds/ InvCatalog/v1.0">

<service name="TestData" serviceType="OpenDAP" base="/thredds/ contextPath/"/>

<datasetScan location="/nc" path="nc" name="Test netCDF Data" serviceName="OpenDAP"> <crawlableDatasetImpl className="opendap.olfs.S4CrawlableDataset">
    </datasetScan>

</catalog>

And I have questions:

- In the <service> element what is the attribute "base" set to, the location of the servlet:

      $CATALINA_HOME/webapps/myservlet

  Or is it set to:

      $CATALINA_HOME/content/thredds


The service base is the (first part of the) external URL of the dataset, that is the URL that your clients will see. Since this determines which servlet gets called when it comes into Tomcat, you need to make sure it matches. I prefer using "/contextName/servletMapping/", which then makes it reletive to the catalog URL. The contextName matches your war file, and the servletMapping matches what you put into the web.xml. So if your war file is opendap.war, and you have

 <servlet-mapping>
   <servlet-name>DefaultHandlerServlet</servlet-name>
   <url-pattern>/*</url-pattern>
 </servlet-mapping>

in your web.xml,


then use /opendap/ as the service base, and the DefaultHandlerServlet will bet called when any URLS of the form
 http://servername:8080/opendap/

get sent.



- Given that I identify my implementation of CrawlableDataset to the THREDDS code as above, how do I get one built? The constructor requires both a path and a config object, and that config object is something I have and THREDDS doesn't. Seems like I either need to pass an instance of my CrawlableDataset, or my config object, into CatalogRootHandler.


I think the code will instantiate an object for you.
ethan?

Your CrawlableDataset will be passed an org.jdom.Element object that is the child of the crawlableDatasetImpl element. That is the only thing that is supported at the moment.



- Logging: I read the basic docs on the Log4j and the Simple Logging Facade. I like this. I don't understand how to use it. I am concerned that my hacks to get THREDDS into my servlet don't address a number of startup issues surrounding logging that THREDDS may require. You're ThreddsDefault.makeDebugActions() is pretty involved, and I don't really get it.


There's a question of how much of the thredds framework you want to use. If you want to use all of it, thats great, we can leverage each others work. The DebugActions allow remote testing and info. Very useful. I can give you permssion to look at how the TDS on motherlode works if you want. Anyway, you need to decide whether to use all or a part of it.

The SLF/Log4j is worth useing in any case.


- Caching: It looks like caching is an integral part of your code base. Is it isolated in the servlet related code, or are there implementations of caching related activities in the catalog stuff that I need to be aware of?


Im using caching deep in my data server, but not in the servlet handling part. So you still have a choice.



I am NOT talking to a filesystem. I can't give THREDDS a file root, or a file type/format. I can give provide a CrawlableDataset instance that can traverse the data store. I can hand you all of the traditional OPeNDAP/DODS responses, although from what I got from Ethan's description once I get the catalog working I would have my servlet to respond to a DODS request for, say a DDS, by calling CatalogRootHandler.findRequestedDataset(...) for the data set, then if a CRawlableDataset comes back (indicating that this data set exists and is not filtered) I can use the CrawlableDataset to do what I need to get the stuff to send to the client. Is that true?


We undersstand that, thats what CrawlableDataset does for you.
Ethan can you explain his next steps?

I think you've got it Nathan. You check that a CrawlableDataset is allowed for that path by calling findRequestedDataset(...). If you get a CrawlableDataset back, you can cast it to a opendap.olfs.S4CrawlableDataset and call whatever access information/methods you need to on that. We would cast to CrawlableDatasetFile and call getFile() on it.

Ethan


Lets just incrementally get this working one step at a time. First thing is to get catalogs generated using CrawlableDataset.
Dont worry, we will get all this working ASAP.


--
Ethan R. Davis                                Telephone: (303) 497-8155
Software Engineer                             Fax:       (303) 497-8690
UCAR Unidata Program Center                   E-mail:    address@hidden
P.O. Box 3000
Boulder, CO  80307-3000                       http://www.unidata.ucar.edu/
---------------------------------------------------------------------------