Re: back to implementing a network datasource.

Hi Eric,

A while back, I asked if there were any tutorials/how-to's on setting up a custom datasource.


1) A GridPath can be converted to a url like string, and from such a string, back to a GridPath. I can build a visad.FieldImpl from the GridPath, allowing me to display a specified portion of a grid.

2) I've got a class called GridPathSelector (a subclass of JPanel) that allows the specification of a database, selecting a grid in that database, and specifying what fractions of the grid should be extracted. The class produces a GridPath. The class actually involves a tabbed pane and quite a few helper classes.

3) I've modified copies of the example data source to the extent that I've got a
  i) a class called GRDChooser that extends DataSourceImpl
  ii) a choosers.xml file
  iii) a datasource.xml
  iv) a subclass of IdvUIManager
4) *What I don't have* is a Data Chooser class that I trust. If I understand correctly, the init method of the Data Chooser class should create an instance of my GridPathSelector class, but its not clear when/how the values should be returned to the server for display.

I would suggest that you make a GridPathChooser (derived from IdvChooser) that uses your GridPathSelector for selecing the database, grid, etc. From this chooser you can have the IDV create a GridPathDataSource, derived from DataSourceImpl, that knows how to create the visad data structures, etc. The chooser would pass in the selected data base information. Look at the method from IdvChooser: protected boolean makeDataSource(Object definingObject, String dataType, Hashtable properties)

The dataType is the String id defined in datasource.xml
The defining object can be a List or some other structure that holds the database info. This definingObject gets
passed to your GridPathDataSource.

5) *Where* *do I put the xml files* in a window's environment?

In the user guide we have the following:
that covers the what/where/how of extending the idv with new resource files.
Also from the workshop materials we have:

I hope that helps.