<div dir="ltr">Hi Lionel,<div><br></div><div class="gmail_extra">2013/6/3 Lionel Elie Mamane <span dir="ltr"><<a href="mailto:lionel@mamane.lu" target="_blank">lionel@mamane.lu</a>></span><br><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">Hi,<br>
<br>
Would you mind if I included the developer's mailing list in CC in our<br>
discussion?</blockquote><div><br></div><div style>Of course not. :) </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">
On Mon, Jun 03, 2013 at 12:05:56PM +0200, Zolnai Tamás wrote:<br>
<br>
>    I'm working on a new feature in Base again. It's just a little<br>
> user helper feature to make available the direct import of an csv<br>
> file into table, without open Calc and copy&paste the content from<br>
> it to Base.<br>
<br>
</div>Base can already do that without resorting to Calc:<br>
<br>
1) Menu File / New / Database<br>
<br>
2) Connect to existing database / Text<br>
<br>
3) Fill in needed configuration<br>
<br>
3) Open the just created .odb file in window 1<br>
<br>
4) Open the destination .odb file in window 2<br>
<br>
5) Drag'n drop (or copy/paste) from window 1 to window 2.<br>
<br>
And it works for any supported database type, not only CSV, as long as<br>
the destination database driver supports SDBCX (that is, table<br>
creation).<br>
<br>
If you intend to put an easier / faster / ... UI on this procedure,<br>
sure, that seems nice.<br></blockquote><div><br></div><div> The usability of this method is the same as which I mentioned. Have to open an other window and use copy&paste (additionally make a useless file). So yes, my primary aim is to add an easier way.</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">
> already have the plan to implement it and it seems to me that it<br>
> will work not just with csv files but all Calc compatible format (in<br>
> this case only the first sheet will be imported, but later it can be<br>
> extended).<br>
<br>
</div>This starts to look like you want to reimplement a different way to<br>
achieve the same as the above, and not only slap a different / better<br>
UI on it. Unless there is a good reason (which one?), I'd rather<br>
not. Two implementations = more code, two sets of bugs, confusion for<br>
the user, ...<br>
<br>
Note that the above works "for any calc compatible format" by using<br>
"Spreadsheet" instead of "Text". And many other sources...<br>
<br>
Again, slapping a better UI on it, that would e.g. avoid the need to<br>
create an .odb file which the user will delete right after, would be<br>
nice. I imagine it would work like this: reuse the database wizard<br>
open existing database and "connect to existing database" stuff to<br>
setup a SDBC URL, but do *not* create a .odb file connecting to that<br>
URL. Instead, connect to that URL in code, list the tables, ask the<br>
user which tables to import, and import them into the current<br>
database. Bonus points for reusing the same codepath as a paste in the<br>
the copy/paste case (one time for each table).</blockquote><div><br></div><div>I didn't know about this feature up to now, but for the first blush it is not the same feature, at least from the users point of view. As I see these connection is a readonly access to a bunch of csv/text files (or sheets of one spreadsheet file) with openning an alone database to them. The feature which I intend to implement is making a new table and insert into the already opened database. With this I just say that for the user it can be looked as a different thing and so not make confusion.<br>
</div><div><div>(It's really an readonly access? Because copy&paste all the tables not a usefull method to make them modifyable.)</div><div><br></div><div>Implementation is an other part. Of course I will look up the code of this connection thing and reuse all the usefull code. But the implementation which I planed is not means real new code, but intentse use of UNO API. The Writer OLE-object feature use the XEmbeddedObject and other class linked with it. One advantage of using this XEmbeddedObject is that it uses implicitly the same file import as Calc do. So in case of csv/text files the Calc's csv import dialog will be opened, which more usefull than the page with the same aim in Base. More usefull means more options and a table showing the expected result.</div>
<div><br></div><div>I don't know the underlying code of this connection feature yet, but I would not suprise if it uses the same XEmbeddedObject.<br></div><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">
> I will use up the code which lies under the OLE-object feature of<br>
> Writer, which already contains the csv import.<br>
<br>
</div>Why would that be any better than what I outlined above?<br></blockquote><div><br></div><div style>Because of the mentioned csv import dialog.</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 only question is where this feature would be reachable. I have two<br>
> ideas and I think all of these two places should be used:<br>
>    1. Table view -> "Tasks". Add a 4th option like "Import Table From<br>
> File...". This point contains all other places which are almost the<br>
> duplicates of this "Tables" list (e.g. Insert menu with label "Table<br>
> (Import)..." ).<br>
>    2. Table view -> "Tables" -> context menu. The label can be "Import<br>
> Table...".<br>
<br>
</div>The context menu does not make that much sense to me, unless we *also*<br>
add the other tasks to it (and then also in Queries, Forms and Reports).</blockquote><div> </div><div><div>It comes in my mind just because the commonly used method is the copy&paste and so people get to use the context menu. :)</div>
<div>But of course the first point will be enough too.</div><div><br></div><div><br></div><div>Best Regards,</div><div>Tamás </div></div></div></div></div>