Hello Ethan,
Thank you for your e-mail.
Now I hope you have some time and patience for helping me, as I was
convinced that the best approach is to go for a CrawlableDataset.
I have come up with the following approach:
- Understand how the class CrawlableDatasetFile works
- For this, I will need to easily "run" a part of Thredds from within
Eclipse. As I can not find out if there is existing code that does
this, I will make my own "Test" class for performing some calls
involving CrawlableDatasetFile.
- After understanding the existing functionality, I will make a
similar class, named e.g. CrawlableDatasetDods. If more classes are
needed, I will also make them. As much as possible, I will copy code
from DodsDirDatasetSource and similar classes.
- I will change my "Test" class, to make calls that involve the new
CrawlableDatasetDods classes.
- All new CrawlableDatasetDods-related classes will be tested
extensively with my "Test" class, using at least two different DODS
servers as a source.
- As I do not know how to make the thredds.war file, I will submit all
classes to you, then I would like you to send me a new .war file
containing the entire thredds.
- If you think the classes I have created are useful, you can include
them in the official Thredds release. I have to discuss the copyright
with my boss, but we do have an "open-source" policy for everything we
develop.
- Unless I have made a terrible mistake in estimating the time I would
need for the above, my intention is to have everything ready within 1
week.
Please inform me if you have a better approach.
I have started making a simple "Test" class. See attachment:
Test.java. In this file, you will see that I could not figure out how
to properly use CollectionLevelScanner, CrawlableDataset, InvService
and InvCatalogImpl.
Could you please help me improve the "Test" class, and in particular
in the following aspects:
1. I have no data that CrawlableDatasetFile could crawl. Do you have a
link to some data that I can extract on my harddisk?
2. Help me understand collectionPath, collectionLevel and catalogLevel
by changing my code in Test.java (note that I already read the JavaDoc
of CollectionLevelScanner before writing Test.java)
3. Point me to some code with which I could see that a proper
InvCatalogImpl was generated (other than catalog.getName()).
Thanks in advance,
Bas Retsios.
==
Software Developer
IT Department, Sector Remote Sensing & GIS
International Institute for Geo-information Science and Earth
Observation (ITC)
P.O. Box 6, 7500 AA Enschede, The Netherlands
Phone +31 (0)53 4874 573, telefax +31 (0)53 4874 335
E-mail address@hidden, Internet http://www.itc.nl
------------------------------------------------------------------------
package thredds.cataloggen;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import thredds.catalog.InvCatalogImpl;
import thredds.catalog.InvService;
import thredds.crawlabledataset.CrawlableDatasetFactory;
import thredds.crawlabledataset.CrawlableDataset;
import thredds.crawlabledataset.CrawlableDatasetFilter;
public class Test {
public static void main(String[] args) throws IOException,
IllegalArgumentException, ClassNotFoundException,
NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
String collectionPath = "file:///d:/thredds/";
CrawlableDataset collectionLevel = CrawlableDatasetFactory
.createCrawlableDataset("file:///d:/thredds/",
null, null);
CrawlableDataset catalogLevel = CrawlableDatasetFactory
.createCrawlableDataset("file:///d:/thredds/",
null, null);
CrawlableDataset currentLevel = null;
CrawlableDatasetFilter filter = null;
InvService service = new InvService("my_service", "File",
"file:///d:/", null, null);
CollectionLevelScanner cls = new
CollectionLevelScanner(collectionPath,
collectionLevel, catalogLevel, currentLevel,
filter, service);
cls.scan();
InvCatalogImpl catalog = cls.generateCatalog();
String s = catalog.getName();
int i = 0;
}
}