Hi Ariel,

sorry for the delay, I've been busy with [1] recently ..

Note that some things I'll say here apply, in similar form, to the other
types you described in your other mails.

> 1. like with the FLAT SOURCE, only "ConnectionResource" =
> "sdbc:calc:file:///home/ariel/myfile.ods"
> 
> RESULT: CopyTableWizard.createWithInteractionHandler() throws
> com.sun.star.lang.IllegalArgumentException: "Only tables and queries are
> supported at the moment."

Since the wizard can copy a single table only, Command and CommandType
are required parameters. I'll add a note to the IDL reference about this.

> I didn't try with an *ActiveConnection*, because I didn't find the name
> of the properties to pass for the sheet name/database range name to
> XDriverManager::getConnectionWithInfo() or XDriver::connect().

You cannot select a single sheet with the connection. The connection
always provides the complete document as one "database" containing
multiple "tables" (aka sheets). Pointing to a certain table can only be
done with the Command parameter.


> The *API* reference does not tell much about this case (we find XDriver,
> XDriverManager, JDBCConnectionProperties, ODBCConnectionProperties,
> FILEConnectionProperties, DBASEConnectionProperties,
> FLATConnectionProperties, *but* there is no CALCConnectionProperties),

Actually, the CalcConnectionProperties service would be empty - IIRC,
the driver does not support any special settings.

> The conclusion here is also that a FilePicker is not enough: we must
> show the user all the sheets and database ranges in the spreadsheet
> document so that s/he chooses one before we can instantiate the
> CopyTableWizard.

Hmm. Would be nice to have this in the wizard, as first page, wouldn't
it? That is, if only a connection is provided, but no Command/Type, then
prepend a page which allows selecting a table/query to copy.
(named ranges in a spreadsheet are exposed as tables by the driver,
IIRC, so effectively selecting from the tables would include them.)

I might add this - in a later version :).

A canonical extension would be to select multiple tables to import, but
in this case, we need a separate dialog before - if you would select
multiple tables in the wizard, the current UI for field matching would
not be able to cope with this anymore. So, perhaps a beforehand-dialog
asking for tables to copy (and potential other settings) is better,
anyway. It would then invoke the Copy Table wizard for every single
table. Not sure.

On the medium run, I would like to make the UI from
Edit/Database/Properties available via UNO, too. More precise, I would
like the driver for a certain backend to provide its own UI (where
currently, we have hard-coded UI for all known drivers, but completely
separated from the drivers.). This implies this driver-provided UI is
available via UI, in some way (not necessarily as service, but perhaps
also as UI description, together with a service which can render the UI).

When this happens (if ever :), then an extension would be able to raise
the settings-UI for, say, text/csv, doing all the settings, create a
connection from those settings, and pass this connection to the wizard.

Alas, still some way to go, I fear.

Ciao
Frank

[1]http://wiki.services.openoffice.org/wiki/Macros_in_Database_Documents

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to