> 
> 2. FileDataSourceQueryChooser that register with the
> DataSourceQueryChooserManager will automatically get added. The only one
> caveat is that I have no way to automatically get the options panel
> fields if one is defined for that type. Other than GML can you think of
> any plugins that require options?

not sure.. but database connections need options - i think (see postgis 
plugin from Uwe on sourceforge, i.e. the one that can also write back)
I think one can change this, but i don't know if other people developes 
other plugins.. i.e. for raster files the Pirol-Image plugin should be 
checked.

just some thoughts.. i haven't checked any of those - so i may be wrong

stefan

> 
>         List loadChoosers =
> DataSourceQueryChooserManager.get(workbenchContext.getBlackboard()).getLoadDataSourceQueryChoosers();
>         for (Object chooser : loadChoosers) {
>             if (chooser instanceof FileDataSourceQueryChooser) {
>                 FileDataSourceQueryChooser fileChooser =
> (FileDataSourceQueryChooser)chooser;
>                 Class dataSourceClass = fileChooser.getDataSourceClass();
>                 String description = fileChooser.getDescription();
>                 List<String> extensions =
> Arrays.asList(fileChooser.getExtensions());
>                 DataSourceFileLoader fileLoader = new
> DataSourceFileLoader(workbenchContext, null, description, extensions);
>                 registry.createEntry(FileLoader.KEY, fileLoader);
>             }
>         }
> 
> Paul
> 
> Stefan Steiniger wrote:
>> Yep.. sounds and looks interesting.
>>
>> but two questions/comments:
>>
>> - what about skiping any further dialog - e.g. if jml or shape files 
>> should be loaded without any reference system info necessary. Is that 
>> possible.
>>
>> - how can we integrate the external plugins that deliver functionality 
>> such as dxf, mif, or PostGIS support. The problem here is that 
>> everything needs still to be the same as previously.
>>
>> stefan
>>
>> Paul Austin schrieb:
>>   
>>> All,
>>>
>>> I have now implemented what I think should be the 'Open File...' menu 
>>> item in the File menu which will allow uses to open files and add them 
>>> as layers to the current Project.
>>>
>>> This first screen shot shows the first page of the wizard where you can 
>>> select the File type (or leave it as All Files) and then select one or 
>>> more files to load.
>>>
>>>
>>>
>>> If All files was selected as the file filter and one or more of the file 
>>> extensions could be loaded by more than one file loader (e.g. *.xml can 
>>> be loaded by the GML Loader and FME GML Loader) then the following 
>>> wziard panel will be displayed when you select the Next button on the 
>>> previous page. This will allow you to select which loader to use for 
>>> each extension.
>>>
>>>
>>>
>>> If you uncheck the Use the same Settings for say *.xml you can select 
>>> the specific loader to use for each file as shown below.
>>>
>>>
>>>
>>> Some file loaders have options (e.g. GML loader requires a template 
>>> file) if the loader has options these will be displayed on the next 
>>> wizard page. If no loaders have options then this page will not be 
>>> displayed. This is where we could add in options for the SRS ID to use 
>>> for the loaded data set. Options that are required will not allow the 
>>> finish button to be selected until a value is specified.
>>>
>>>
>>>
>>> Again if you uncheck the Use same setting for all XXX then you can 
>>> define the options on a per file basis as shown below.
>>>
>>>
>>>
>>> This new infrastructure also handles ZIP, GZ, tar and tar.gz, files by 
>>> looking at the contents of the zip file and finding the appropriate file 
>>> loader for that type of file. You can mix and match different types of 
>>> file in the zip file (e.g. TIF, SHP and GML) and each file will be loaded.
>>>
>>> The FileLoader interface (attached) is implemented by loaders that can 
>>> load a file from a URI. There are implementations to wrap the file 
>>> DataSource and file ReferencedImageFactory implementations so they can 
>>> be loaded using the new framework.
>>>
>>> The following code fragments show how these existing classes are wrapped
>>>
>>>     DataSourceFileLoader gmlLoader = addStandardReaderWriterFileDataSource(
>>>       "GML 2.0", StandardReaderWriterFileDataSource.GML.class);
>>>
>>>     gmlLoader.addOptionField(
>>>       StandardReaderWriterFileDataSource.GML.INPUT_TEMPLATE_FILE_KEY,
>>>       "FileString", true);
>>>
>>>     addFactory(new GraphicImageFactory(), new String[] {"wld", "bpw", 
>>> "jpw", "gfw"});
>>>   :
>>>
>>>   private DataSourceFileLoader addStandardReaderWriterFileDataSource(
>>>     String description, Class readerClass) {
>>>     List extensions = getExtensions(readerClass);
>>>     if (extensions != null) {
>>>       DataSourceFileLoader fileLoader = new DataSourceFileLoader(
>>>         workbenchContext, readerClass, description, extensions);
>>>       registry.createEntry(FileLoader.KEY, fileLoader);
>>>       return fileLoader;
>>>     }
>>>     return null;
>>>   }
>>>
>>>   private List getExtensions(Class readerClass) {
>>>     try {
>>>       String[] extensions = 
>>> ((StandardReaderWriterFileDataSource)readerClass.newInstance()).getExtensions();
>>>       return Arrays.asList(extensions);
>>>     } catch (Exception e) {
>>>       
>>> workbenchContext.getWorkbench().getFrame().log(StringUtil.stackTrace(e));
>>>       return null;
>>>     }
>>>   }
>>>
>>>   private void addFactory(ReferencedImageFactory factory, String[] 
>>> supportFileExtensions) {
>>>     if (factory.isAvailable()) {
>>>       ReferencedImageFactoryFileLoader loader = new 
>>> ReferencedImageFactoryFileLoader(
>>>         workbenchContext, factory, supportFileExtensions);
>>>       registry.createEntry(FileLoader.KEY, loader);
>>>     }
>>>   }
>>>
>>>
>>> I'm going to bundle up a plugin so people can try this out and if they 
>>> like it I'll start work on getting it ready to commit.
>>>
>>> Paul
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find problems?  Stop.
>>> Now Search log events and configuration files using AJAX and a browser.
>>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>     
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems?  Stop.
>> Now Search log events and configuration files using AJAX and a browser.
>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>   
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to