<div dir="ltr">2013/6/6 Lionel Elie Mamane <span dir="ltr"><<a href="mailto:lionel@mamane.lu" target="_blank">lionel@mamane.lu</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">On Mon, Jun 03, 2013 at 09:49:01PM +0200, Zolnai Tamás wrote:<br>
<br>
>>> The feature which I intend to implement is making a new table and<br>
>>> insert into the already opened database.<br>
<br>
>> Yes, which is exactly what the procedure described in my previous<br>
>> mail also does. Except it is not limited to CSV and other<br>
>> calc-supported formats (but any supported database), and already<br>
>> gives you access to each sheet of a calc file instead of the first.<br>
<br>
>> Which was my main motivation for slapping a better UI on *this*<br>
>> procedure rather than on the more limited "go through Calc" route.<br>
<br>
> Well, misunderstandness around. I means making a new table and<br>
> insert it into the already opened database *in one step*, or more<br>
> steps but in an automated serial and without opening other window<br>
> and without copy&paste.<br>
<br>
</div>Yes, that's exactly what I mean, but I'm talking about the<br>
*implementation* of that idea. You wanted to embed a calc document<br>
(with the said CSV data) inside Base scripting/code, and then copy the<br>
table structure and data from there. That is: you want to "automate"<br>
the procedure of opening the CSV in calc, and copy/pasting the data in<br>
Base.<br>
<br>
I'm trying to get you to automate *another* procedure, that is<br>
copy/pasting the data from *Base* to *Base*.<br>
<br>
*Both* procedures will give the *same* result in the end for the<br>
specific case of CSV data, but the "calc to Base" procedure can only<br>
import data that Calc can handle, while the "base to base" procedure<br>
can handle any data that calc can handle AND ALSO any database that<br>
Base can handle. So for example, if you implement it following my<br>
idea, your "one step import" will also be able to e.g. import data<br>
from a PostgreSQL database into a MySQL database. More general, more<br>
useful. Please do it that way, and not through a Calc XEmbeddedObject<br>
like you originally planned.</blockquote><div><br></div><div style>Ok, I looked over the code and I agree that it can be more usefull to add the feature in this general form.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
>>> With this I just say that for the user it can be looked as a<br>
>>> different thing and so not make confusion.<br>
<br>
>> Well, if "drag'n drop" and "import" of the *same* data behave<br>
>> differently in the *same* application (that is, Base), I think this is<br>
>> confusing and unpredictable: even if the user knows of these two ways,<br>
>> why would he expect one to work "better" or "different" than the<br>
>> other?<br>
<br>
> I don't know what difference we actually speak about. In my first<br>
> plan I intended to use the same paste method and the same "Copy<br>
> Table" dialog which is used for "drag'n drop".<br>
<br>
</div>You intended to use the same code and dialog as which is used in "copy<br>
from Calc, paste in Base". I want you to use the same code and dialog<br>
as which is used in "copy from Base, paste in Base".<br>
<br>
Imagine you automate this "import data" procedure using your idea of<br>
"use Calc under the hood to get to the CSV data", that is same code as<br>
which is used in "copy from Calc, paste in Base". This "use Calc under<br>
the hood" is completely invisible to the user, (s)he is choosing a<br>
menu entry in *Base*. So the user will naturally compare these two things:<br>
<br>
 - Choose "import data" in Base task pane.<br>
<br>
 - Open the *same* data in a 2nd Base window, copy it, and paste in<br>
   the first Base window.<br>
<br>
And expect that the two behave the same. The user will IMHO *not* find<br>
"obvious" that "Choose 'import data' in Base task pane" will behave as<br>
if he opened the data in ANOTHER APPLICATION (which just happens to be<br>
LibreOffice Calc here) and *then* pasted it.</blockquote><div><br></div><div style>Yes I see what you say. I just intend to point at that by now it is not matter that copy a table from Base or from Calc, because the paste works just the same, using the same "Copy Table" dialog. But of course it can change in the future and the way of the two copy&paste ( "copy from Calc, paste in Base" and "copy from Base, paste in Base") can differentiate in time, so it is indeed better to use the code of Base. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
>>> The Writer OLE-object feature (...) the same file import as Calc do<br>
>>> (...) which more usefull than the page with the same aim in<br>
>>> Base. More usefull means more options and a table showing the<br>
>>> expected result.<br>
<br>
>> Well, if the CSV setup screen in Base sucks, we can fix<br>
>> *that*. Possibly even use the same setup screen than in Calc? As in:<br>
>> merge the two.<br>
<br>
> As I see its not an easy hack. In Clalc the import UI is a<br>
> ModalDialog, while in Base it is a TabPage which are not a<br>
> 'mergeable' pair, at least I don't see the way.<br>
<br>
</div>It is work, yes. If they cannot be merged, then this is unfortunate<br>
that we have to keep two implementations of the same feature, but we<br>
can still add the "right" features to the Base implementation.<br>
<br>
A few ideas:<br>
<br>
 - The Base wizard, when one chooses "connect to existing database"<br>
   and type "Text" and then clicks "next" fires up the Calc<br>
   ModalDialog instead of continuing with its TabPage procedure?<br>
<br>
 - The Base wizard, when one chooses "connect to existing database"<br>
   and type "Text" and then clicks "next" fires up a specialised<br>
   wizard that *does* have enough place?<br>
<div class="im"><br>
> Additionally in Base wizard there is no enough space for all options<br>
<br>
</div>Well, this can be fixed either by the specialised wizard thing or by<br>
just enlarging the Base wizard to have enough place.<br>
<div class="im"><br>
> and for the table which are in the Calc csv import dialog.<br>
<br>
</div>The table is a different issue. In the Base wizard "connect to<br>
existing database", one chooses a whole database (in the text/CSV<br>
case, a directory), not just a table, so it is not as natural to show<br>
a table. (which one from the multiple that are there?)<br>
<br>
The "import data" wizard needs to have an additional step (compared to<br>
the existing Base new/connect/open wizard) to choose which tables.<br>
<div class="im"><br>
> Plus the content of the mentioned table (containing expected result)<br>
> is already loaded in case of Calc, but in Base file-loading is<br>
> happen after setting the csv import options.<br>
<br>
</div>The "import data" wizard can make a connection with the options as<br>
they stand, and then tear down the connection and reopen it each time<br>
the settings are changed.</blockquote><div><br></div><div style>Well, enhanching Base connection to text database (which will be used for import too in my current plan) can be handled indenpedently from the primary task (import) and because I will start working on my GSoC project soon, this improvement remains for other times.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
> I just imagine a 4th option to the start page of Base wizard, with<br>
> label "Import table(s) from existing database".<br>
<br>
</div>To me this does not sound natural. That wizard is launched by File /<br>
New / Database. That's now where I would go looking to import data in<br>
an existing database.</blockquote><div><br></div><div style>Yes, you are right. In this case I will follow the original plan to add the new option to the "Tasks" pane. Anyway this will the easiest way. The wizard is indepedent from tha Base window and from the controller of this window and so it can be difficult to make the controller to use the same method as in case of paste or drag'n drop.</div>
<div style><br></div><div style>Best Regards,</div><div style>Tamás</div></div><br></div></div>