Kexi/Junior Jobs/Add support for importing tables from LibreOffice Base: Difference between revisions

From KDE Community Wiki
No edit summary
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Status: in progress''', assigned to Harshita Mistry ([email protected])
'''Status: done''', assigned to Harshita Mistry ([email protected]). Student's time zone: (GMT-05:00) Eastern Time - Toronto. Mentor's time zone (GMT+1) Poland - Warsaw.
 
Public Calendar with tasks and availability: [https://www.google.com/calendar/embed?src=harshimistry%40gmail.com].


<div style="float:right">http://www.wesnoth.org/images/GSOC_2014_150x150.png</div>{{Note|This task is assigned within the [https://google-melange.appspot.com/gsoc/homepage/google/gsoc2014 GSoC 2014] program for KDE. Application page: [https://google-melange.appspot.com/gsoc/project/details/google/gsoc2014/harshita/5717271485874176].}}
<div style="float:right">http://www.wesnoth.org/images/GSOC_2014_150x150.png</div>{{Note|This task is assigned within the [https://google-melange.appspot.com/gsoc/homepage/google/gsoc2014 GSoC 2014] program for KDE. Application page: [https://google-melange.appspot.com/gsoc/project/details/google/gsoc2014/harshita/5717271485874176].}}
Line 5: Line 7:
Goal: Add support for importing (Kexi calls it data/design migration) tables from LibreOffice (or OpenOffice) Base (ODB format) to Kexi.
Goal: Add support for importing (Kexi calls it data/design migration) tables from LibreOffice (or OpenOffice) Base (ODB format) to Kexi.


Proposed and mentored by [[User:Jstaniek|Jstaniek]], 2014
[[GSoC/2014/Ideas#Project:_Add_support_for_importing_tables_from_LibreOffice_Base_to_Kexi|Proposed]] and mentored by [[User:Jstaniek|Jstaniek]], 2014


==Knowledge Prerequisites==
==Knowledge Prerequisites==
Line 13: Line 15:
*In the GUI the feature shall be available in the same place as the import from MDB: External Data -> Import Tables -> Table Importing Wizard
*In the GUI the feature shall be available in the same place as the import from MDB: External Data -> Import Tables -> Table Importing Wizard
*Then user would see .odb support in the open file dialog, just like it has access to importing CSV or MDB
*Then user would see .odb support in the open file dialog, just like it has access to importing CSV or MDB
*cons5.odb (referred below in the ''Sample database'' section) database should properly import as a Kexi project, including:
**all tables with all columns and datatypes
**all data found in the tables
*Other objects such as queries, forms, reports, etc. should be skipped during the import
==Sample database==
Sample .odb databases are available for [http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html this] tutorial:
*From the libreoffice_base_files.zip archive cons4.odb has been extracted and altered a bit (added usage of more data types, floating point and BLOB in the ''patients'' table). Resulting database is [http://kexi-project.org/download/examples/base/cons5.odb cons5.odb].


==Hints==
==Hints==
*This task involves research on ODB format (it's relatively openly defined)
*This task involves research on ODB format (it's relatively openly defined)
*Qt/C++ shall be used for the task together with Java engine (HSQLDB) and probably connected via JNI. This could be introduction to later development of complete database import from ODB to a Kexi database.
*Qt/C++ shall be used for the task together with Java engine (HyperSQL aka HSQLDB) and probably connected via JNI. This could be introduction to later development of complete database import from ODB to a Kexi database.
*See [http://wiki.openoffice.org/wiki/FAQ_(Base)] for a start.
*See [http://wiki.openoffice.org/wiki/FAQ_(Base)] for a start.
*Sample .odb databases are available for [http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html this] tutorial.
*Then see the [http://www.hsqldb.org/doc/guide/index.html HSQL Guide]
*Studying kexi/migration/importtablewizard.cpp which is a GUI taking an instance of implementation of a migrate driver derived from KexiMigration::KexiMigrate (in your case - the ODB driver).  It's the m_migrateDriver attribute.
**In particular look what are the elements (files) of typical [http://www.hsqldb.org/doc/guide/running-chapt.html#rgc_hsqldb_db HyperSQL Database].
*Studying kexi/migration/importtablewizard.cpp which is a GUI, in ''m_migrateDriver'' attribute taking an instance of implementation of a migrate driver derived from KexiMigrate class (in your case - the ODBMigrate driver).  
*Implementing plugin (needed methods of the driver) in migration/odb/ by looking how it was performed for other cases, e.g. for mysql (see kexi/migration/mysql/ dir) or other cases such as pqxx, txt, xbase, sybase or mdb
*Implementing plugin (needed methods of the driver) in migration/odb/ by looking how it was performed for other cases, e.g. for mysql (see kexi/migration/mysql/ dir) or other cases such as pqxx, txt, xbase, sybase or mdb
*In the actual C++ implementation, KoOdfReadStore class from calligra libs can be used to read contents of the .odb.
*In the actual C++ implementation, KoOdfReadStore class from calligra libs can be used to read contents of the .odb.
Line 34: Line 45:


==Development==
==Development==
This is a notepad for development
1. [https://git.reviewboard.kde.org/r/118044 https://git.reviewboard.kde.org/r/118044]
    A java program that formats odb files and reads binary data from hsqldb using the hsqldb jdbc driver.
 
2. [https://git.reviewboard.kde.org/r/118067 https://git.reviewboard.kde.org/r/118067]
    A cpp program that calls a java program using Java Native Interface.
 
===Schedule===
https://www.google.com/calendar/embed?src=harshimistry%40gmail.com


===Coding standards===
===Coding standards===
Line 40: Line 58:


===Source Code Location===
===Source Code Location===
*Early stage: 3rd-party repository, cloned Calligra repo
*Early stage: 3rd-party repository, cloned Calligra repo (GitHub)
*Later: KDE repo(s)
*Finally: KDE repo(s)
**Feature branch: ''kexi-odb-mistry''
**Feature branch: ''kexi-odb-mistry'', based on master branch
*Accepted and reviewed code finds its way to the master branch of calligra.
*Accepted and reviewed code will be integrated with the master branch of calligra by the mentor.


===Code Review===
===Code Review===

Latest revision as of 20:45, 4 September 2014

Status: done, assigned to Harshita Mistry ([email protected]). Student's time zone: (GMT-05:00) Eastern Time - Toronto. Mentor's time zone (GMT+1) Poland - Warsaw.

Public Calendar with tasks and availability: [1].

GSOC_2014_150x150.png

Note

This task is assigned within the GSoC 2014 program for KDE. Application page: [2].


Goal: Add support for importing (Kexi calls it data/design migration) tables from LibreOffice (or OpenOffice) Base (ODB format) to Kexi.

Proposed and mentored by Jstaniek, 2014

Knowledge Prerequisites

C++, some Qt, some databases, some XML, software architecture

Requirements

  • In the GUI the feature shall be available in the same place as the import from MDB: External Data -> Import Tables -> Table Importing Wizard
  • Then user would see .odb support in the open file dialog, just like it has access to importing CSV or MDB
  • cons5.odb (referred below in the Sample database section) database should properly import as a Kexi project, including:
    • all tables with all columns and datatypes
    • all data found in the tables
  • Other objects such as queries, forms, reports, etc. should be skipped during the import

Sample database

Sample .odb databases are available for this tutorial:

  • From the libreoffice_base_files.zip archive cons4.odb has been extracted and altered a bit (added usage of more data types, floating point and BLOB in the patients table). Resulting database is cons5.odb.

Hints

  • This task involves research on ODB format (it's relatively openly defined)
  • Qt/C++ shall be used for the task together with Java engine (HyperSQL aka HSQLDB) and probably connected via JNI. This could be introduction to later development of complete database import from ODB to a Kexi database.
  • See [3] for a start.
  • Then see the HSQL Guide
  • Studying kexi/migration/importtablewizard.cpp which is a GUI, in m_migrateDriver attribute taking an instance of implementation of a migrate driver derived from KexiMigrate class (in your case - the ODBMigrate driver).
  • Implementing plugin (needed methods of the driver) in migration/odb/ by looking how it was performed for other cases, e.g. for mysql (see kexi/migration/mysql/ dir) or other cases such as pqxx, txt, xbase, sybase or mdb
  • In the actual C++ implementation, KoOdfReadStore class from calligra libs can be used to read contents of the .odb.

Organization of the works

  • commit changes to student's public branch at least once after each workday, not after a milestone
  • developing wire-frames/prototypes of the software in advance, especially important since the solution is rather hybrid
  • documenting them and developing/designing tests while the development progresses, not as the last step
  • developing both C++/Qt side of the solution as well as the Java side in parallel to catch possible difficulties earlier
  • putting the tasks in calendar (we may use e.g. a public Google calendar for that) so we can track the status

After implementation

TODO

Development

1. https://git.reviewboard.kde.org/r/118044

   A java program that formats odb files and reads binary data from hsqldb using the hsqldb jdbc driver.

2. https://git.reviewboard.kde.org/r/118067

   A cpp program that calls a java program using Java Native Interface. 

Schedule

https://www.google.com/calendar/embed?src=harshimistry%40gmail.com

Coding standards

Source Code Location

  • Early stage: 3rd-party repository, cloned Calligra repo (GitHub)
  • Finally: KDE repo(s)
    • Feature branch: kexi-odb-mistry, based on master branch
  • Accepted and reviewed code will be integrated with the master branch of calligra by the mentor.

Code Review