[glom] tests: Add a test that uses an example with text primary keys.



commit 6f3f37b5b25207adfd4d18dfa8155dab1c1dc402
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Nov 23 23:41:46 2012 +0100

    tests: Add a test that uses an example with text primary keys.
    
            * Makefile_tests.am:
            * tests/test_example_music_collection_text_pk_fields.glom:
            * tests/test_selfhosting_non_numeric_primary_keys.cc: Added a test
    	that uses a test-only .glom file that has had all its primary keys
    	changed to text fields.

 ChangeLog                                          |   10 +
 Makefile_tests.am                                  |    9 +-
 ...st_example_music_collection_text_pk_fields.glom | 1298 ++++++++++++++++++++
 tests/test_selfhosting_non_numeric_primary_keys.cc |  103 ++
 tests/test_selfhosting_utils.cc                    |   42 +-
 tests/test_selfhosting_utils.h                     |   12 +-
 6 files changed, 1469 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ac12f2f..473513e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-11-23  Murray Cumming  <murrayc murrayc com>
+
+        tests: Add a test that uses an example with text primary keys.
+
+        * Makefile_tests.am:
+        * tests/test_example_music_collection_text_pk_fields.glom:
+        * tests/test_selfhosting_non_numeric_primary_keys.cc: Added a test
+	that uses a test-only .glom file that has had all its primary keys
+	changed to text fields.
+
 1.23.2:
 
 2012-11-22  Murray Cumming  <murrayc murrayc com>
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 571095c..3ee1a4b 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -48,6 +48,7 @@ check_PROGRAMS =						\
 	tests/test_selfhosting_new_then_get_privs \
 	tests/test_selfhosting_new_then_alter_table \
 	tests/test_selfhosting_new_then_change_columns \
+	tests/test_selfhosting_non_numeric_primary_keys \
 	tests/test_selfhosting_sqlinjection \
 	tests/import/test_parsing \
 	tests/import/test_signals \
@@ -87,6 +88,7 @@ TESTS =	tests/test_document_load	\
 	tests/test_selfhosting_new_then_get_privs \
 	tests/test_selfhosting_new_then_alter_table \
 	tests/test_selfhosting_new_then_change_columns \
+	tests/test_selfhosting_non_numeric_primary_keys \
 	tests/test_selfhosting_sqlinjection \
 	tests/import/test_parsing \
 	tests/import/test_signals \
@@ -112,7 +114,8 @@ dist_noinst_SCRIPTS = tests/test_dtd_file_validation.sh \
 TESTS_ENVIRONMENT = PYTHONPATH=${PYTHONPATH}:$(abs_top_builddir)/glom/python_embed/python_module/.libs
 
 tests_ldadd = glom/libglom/libglom-$(GLOM_ABI_VERSION).la $(libglom_all_libs)
-tests_cppflags = $(glom_includes) $(LIBGLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)
+tests_cppflags = $(glom_includes) $(LIBGLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)\
+	-DGLOM_TEST_EXAMPLES_NOTINSTALLED=\""$(abs_top_srcdir)/tests"\"
 tests_cppflags_ui = $(glom_includes) $(GLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)
 
 glom_libglom_test_connectionpool_SOURCES = glom/libglom/test_connectionpool.cc
@@ -302,6 +305,10 @@ tests_test_selfhosting_new_then_change_columns_SOURCES = tests/test_selfhosting_
 tests_test_selfhosting_new_then_change_columns_LDADD = $(tests_ldadd)
 tests_test_selfhosting_new_then_change_columns_CPPFLAGS = $(tests_cppflags)
 
+tests_test_selfhosting_non_numeric_primary_keys_SOURCES = tests/test_selfhosting_non_numeric_primary_keys.cc $(sources_test_selfhosting_utils)
+tests_test_selfhosting_non_numeric_primary_keys_LDADD = $(tests_ldadd)
+tests_test_selfhosting_non_numeric_primary_keys_CPPFLAGS = $(tests_cppflags)
+
 tests_test_selfhosting_sqlinjection_SOURCES = tests/test_selfhosting_sqlinjection.cc $(sources_test_selfhosting_utils)
 tests_test_selfhosting_sqlinjection_LDADD = $(tests_ldadd)
 tests_test_selfhosting_sqlinjection_CPPFLAGS = $(tests_cppflags)
diff --git a/tests/test_example_music_collection_text_pk_fields.glom b/tests/test_example_music_collection_text_pk_fields.glom
new file mode 100644
index 0000000..0fdf8f6
--- /dev/null
+++ b/tests/test_example_music_collection_text_pk_fields.glom
@@ -0,0 +1,1298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glom_document xmlns="http://glom.org/glom_document"; translation_original_locale="en" database_title="Music Collection" is_example="true" format_version="9" title="Music Collection">
+  <trans_set>
+    <trans loc="cs" val="Hudebnà sbÃrka"/>
+    <trans loc="de" val="Musiksammlung"/>
+    <trans loc="el" val="ÎÎÏÏÎÎÎ ÏÏÎÎÎÎÎ"/>
+    <trans loc="es" val="ColecciÃn de mÃsica"/>
+    <trans loc="fr" val="Collection de musique"/>
+    <trans loc="gl" val="ColecciÃn de mÃsica"/>
+    <trans loc="id" val="Koleksi Musik"/>
+    <trans loc="lv" val="MÅzikas kolekcija"/>
+    <trans loc="pt_BR" val="ColeÃÃo de mÃsica"/>
+    <trans loc="sl" val="Zbirka glasbe"/>
+  </trans_set>
+  <connection hosting_mode="postgres_self" server="localhost" port="5433" try_other_ports="false" database="glom_musiccollection211"/>
+  <table name="albums" overview_x="15" overview_y="9" title="Albums">
+    <example_rows>
+      <example_row>
+        <value column="album_id">borntorun</value>
+        <value column="comments"/>
+        <value column="name">Born To Run</value>
+        <value column="artist_id">bruce</value>
+        <value column="publisher_id">0.000000</value>
+        <value column="year">1975</value>
+      </example_row>
+      <example_row>
+        <value column="album_id">trueblue</value>
+        <value column="comments"/>
+        <value column="name">True Blue</value>
+        <value column="artist_id">mad</value>
+        <value column="publisher_id">warnerbros</value>
+        <value column="year">1987</value>
+      </example_row>
+      <example_row>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="comments"/>
+        <value column="name">The Wild, the Innocent, &amp; the E-Street Shuffle</value>
+        <value column="artist_id">bruce</value>
+        <value column="publisher_id">0.000000</value>
+        <value column="year">1973</value>
+      </example_row>
+      <example_row>
+        <value column="album_id">signothetimes</value>
+        <value column="comments"/>
+        <value column="name">Sign 'O' The Times</value>
+        <value column="artist_id">prince</value>
+        <value column="publisher_id">1.000000</value>
+        <value column="year">1987</value>
+      </example_row>
+      <example_row>
+        <value column="album_id">superfly</value>
+        <value column="comments"/>
+        <value column="name">Superfly</value>
+        <value column="artist_id">curtis</value>
+        <value column="publisher_id">2.000000</value>
+        <value column="year">1972</value>
+      </example_row>
+    </example_rows>
+    <trans_set>
+      <trans loc="cs" val="Alba"/>
+      <trans loc="de" val="Alben"/>
+      <trans loc="el" val="ÎÎÏÎÎÎ"/>
+      <trans loc="en_GB" val="Albums"/>
+      <trans loc="es" val="Ãlbumes"/>
+      <trans loc="fr" val="Albums"/>
+      <trans loc="gl" val="Ãlbums"/>
+      <trans loc="id" val="Album"/>
+      <trans loc="lv" val="Albumi"/>
+      <trans loc="pt_BR" val="Ãlbuns"/>
+      <trans loc="sl" val="Albumi"/>
+    </trans_set>
+    <fields>
+      <field name="album_id" primary_key="true" unique="true" type="Text" title="Album ID">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="ID alba"/>
+          <trans loc="de" val="Albenkennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÏÎÎÏ"/>
+          <trans loc="en_GB" val="Album ID"/>
+          <trans loc="es" val="ID del aÌlbum"/>
+          <trans loc="fr" val="ID de l'album"/>
+          <trans loc="gl" val="ID do Ãlbum"/>
+          <trans loc="id" val="ID Album"/>
+          <trans loc="lv" val="Albuma ID"/>
+          <trans loc="pt_BR" val="ID de Ãlbum"/>
+          <trans loc="sl" val="ID albuma"/>
+        </trans_set>
+      </field>
+      <field name="comments" type="Text" title="Comments">
+        <formatting format_text_multiline="true"/>
+        <trans_set>
+          <trans loc="cs" val="PoznÃmky"/>
+          <trans loc="de" val="Kommentare"/>
+          <trans loc="el" val="ÎÏÏÎÎÎ"/>
+          <trans loc="es" val="Comentarios"/>
+          <trans loc="fr" val="Commentaires"/>
+          <trans loc="gl" val="Comentarios"/>
+          <trans loc="id" val="Komentar"/>
+          <trans loc="lv" val="KomentÄri"/>
+          <trans loc="pt_BR" val="ComentÃrios"/>
+          <trans loc="sl" val="Opombe"/>
+        </trans_set>
+      </field>
+      <field name="name" type="Text" title="Name">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="NÃzev"/>
+          <trans loc="de" val="Name"/>
+          <trans loc="el" val="ÎÎÎÎÎ"/>
+          <trans loc="es" val="Nombre"/>
+          <trans loc="fr" val="Nom"/>
+          <trans loc="gl" val="Nome"/>
+          <trans loc="id" val="Nama"/>
+          <trans loc="lv" val="Nosaukums"/>
+          <trans loc="pt_BR" val="Nome"/>
+          <trans loc="sl" val="Ime"/>
+        </trans_set>
+      </field>
+      <field name="artist_id" type="Text" title="Artist ID">
+        <formatting choices_related="true" choices_related_relationship="artist" choices_related_field="artist_id" choices_related_show_all="true">
+          <choices_related_extra_layout>
+            <data_layout_groups>
+              <data_layout_group>
+                <data_layout_item name="name" editable="true" use_default_formatting="true">
+                  <formatting/>
+                </data_layout_item>
+              </data_layout_group>
+            </data_layout_groups>
+          </choices_related_extra_layout>
+        </formatting>
+        <trans_set>
+          <trans loc="cs" val="ID umÄlce"/>
+          <trans loc="de" val="KÃnstlerkennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÎÎÎÏÎÏÎÎ"/>
+          <trans loc="en_GB" val="Artist ID"/>
+          <trans loc="es" val="ID del artista"/>
+          <trans loc="fr" val="ID de l'artiste"/>
+          <trans loc="gl" val="ID do artista"/>
+          <trans loc="id" val="ID Artis"/>
+          <trans loc="lv" val="IzpildÄtÄja ID"/>
+          <trans loc="pt_BR" val="ID de artista"/>
+          <trans loc="sl" val="ID izvajalca"/>
+        </trans_set>
+      </field>
+      <field name="publisher_id" type="Text" title="Publisher ID">
+        <formatting choices_related="true" choices_related_relationship="publisher" choices_related_field="publishers_id" choices_related_show_all="true">
+          <choices_related_extra_layout>
+            <data_layout_groups>
+              <data_layout_group>
+                <data_layout_item name="name" editable="true" use_default_formatting="true">
+                  <formatting/>
+                </data_layout_item>
+              </data_layout_group>
+            </data_layout_groups>
+          </choices_related_extra_layout>
+        </formatting>
+        <trans_set>
+          <trans loc="cs" val="ID vydavatele"/>
+          <trans loc="de" val="Herausgeber-Kennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÎÏÏÎ"/>
+          <trans loc="en_GB" val="Publisher ID"/>
+          <trans loc="es" val="ID de la editorial"/>
+          <trans loc="fr" val="ID de l'Ãditeur"/>
+          <trans loc="gl" val="ID da editorial"/>
+          <trans loc="id" val="ID Penerbit"/>
+          <trans loc="lv" val="IzdevÄja ID"/>
+          <trans loc="pt_BR" val="ID de editor"/>
+          <trans loc="sl" val="ID zaloÅnika"/>
+        </trans_set>
+      </field>
+      <field name="year" type="Number" title="Year">
+        <formatting format_decimal_places="2"/>
+        <trans_set>
+          <trans loc="cs" val="Rok"/>
+          <trans loc="de" val="Jahr"/>
+          <trans loc="el" val="ÎÏÎÏ"/>
+          <trans loc="en_GB" val="Year"/>
+          <trans loc="es" val="AÃo"/>
+          <trans loc="fr" val="AnnÃe"/>
+          <trans loc="gl" val="Ano"/>
+          <trans loc="id" val="Tahun"/>
+          <trans loc="lv" val="Gads"/>
+          <trans loc="pt_BR" val="Ano"/>
+          <trans loc="sl" val="Leto"/>
+        </trans_set>
+      </field>
+    </fields>
+    <relationships>
+      <relationship name="artist" key="artist_id" other_table="artists" other_key="artist_id" title="Artist">
+        <trans_set>
+          <trans loc="cs" val="UmÄlec"/>
+          <trans loc="de" val="KÃnstler"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÎÏÎÎÏ"/>
+          <trans loc="es" val="Artista"/>
+          <trans loc="fr" val="Artiste"/>
+          <trans loc="gl" val="Artista"/>
+          <trans loc="id" val="Artis"/>
+          <trans loc="lv" val="IzpildÄtÄjs"/>
+          <trans loc="pt_BR" val="Artista"/>
+          <trans loc="sl" val="Izvajalec"/>
+        </trans_set>
+      </relationship>
+      <relationship name="publisher" key="publisher_id" other_table="publishers" other_key="publishers_id" title="Publisher">
+        <trans_set>
+          <trans loc="cs" val="Vydavatel"/>
+          <trans loc="de" val="Herausgeber"/>
+          <trans loc="el" val="ÎÎÎÏÏÎÏ"/>
+          <trans loc="es" val="Editorial"/>
+          <trans loc="fr" val="Ãditeur"/>
+          <trans loc="gl" val="Editorial"/>
+          <trans loc="id" val="Penerbit"/>
+          <trans loc="lv" val="IzdevÄjs"/>
+          <trans loc="pt_BR" val="Editor"/>
+          <trans loc="sl" val="ZaloÅnik"/>
+        </trans_set>
+      </relationship>
+      <relationship name="songs" key="album_id" other_table="songs" other_key="album_id" auto_create="true" allow_edit="true" title="Songs">
+        <trans_set>
+          <trans loc="cs" val="Skladby"/>
+          <trans loc="de" val="Lieder"/>
+          <trans loc="el" val="ÎÏÎÎÎÏÎÎÎ"/>
+          <trans loc="es" val="Canciones"/>
+          <trans loc="fr" val="Chansons"/>
+          <trans loc="gl" val="CanciÃns"/>
+          <trans loc="id" val="Lagu"/>
+          <trans loc="lv" val="Dziesmas"/>
+          <trans loc="pt_BR" val="CanÃÃes"/>
+          <trans loc="sl" val="Skladbe"/>
+        </trans_set>
+      </relationship>
+    </relationships>
+    <data_layouts>
+      <data_layout name="details" parent_table="albums">
+        <data_layout_groups>
+          <data_layout_group name="overview" columns_count="2" title="Overview">
+            <trans_set>
+              <trans loc="cs" val="PÅehled"/>
+              <trans loc="de" val="Overview"/>
+              <trans loc="el" val="ÎÏÎÏÎÏÏÎÏÎ"/>
+              <trans loc="es" val="VisioÌn general"/>
+              <trans loc="fr" val="RÃsumÃ"/>
+              <trans loc="gl" val="Vista xeral"/>
+              <trans loc="id" val="Ringkasan"/>
+              <trans loc="lv" val="PÄrskats"/>
+              <trans loc="pt_BR" val="VisÃo geral"/>
+              <trans loc="sl" val="Pregled"/>
+            </trans_set>
+            <data_layout_item name="album_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+          <data_layout_group name="details" columns_count="2" title="Details">
+            <trans_set>
+              <trans loc="cs" val="Podrobnosti"/>
+              <trans loc="de" val="Details"/>
+              <trans loc="el" val="ÎÎÏÏÎÎÎÏÎÎÎÏ"/>
+              <trans loc="es" val="Detalles"/>
+              <trans loc="fr" val="DÃtails"/>
+              <trans loc="gl" val="Detalles"/>
+              <trans loc="id" val="Rincian"/>
+              <trans loc="lv" val="SÄkÄka informÄcija"/>
+              <trans loc="pt_BR" val="Detalhes"/>
+              <trans loc="sl" val="Podrobnosti"/>
+            </trans_set>
+            <data_layout_group name="artist" title="Artist">
+              <trans_set>
+                <trans loc="cs" val="UmÄlec"/>
+                <trans loc="de" val="Artist"/>
+                <trans loc="el" val="ÎÎÎÎÎÏÎÏÎÎÏ"/>
+                <trans loc="es" val="Artista"/>
+                <trans loc="fr" val="Artiste"/>
+                <trans loc="gl" val="Artista"/>
+                <trans loc="id" val="Artis"/>
+                <trans loc="lv" val="IzpildÄtÄjs"/>
+                <trans loc="pt_BR" val="Artista"/>
+                <trans loc="sl" val="Izvajalec"/>
+              </trans_set>
+              <data_layout_item name="artist_id" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" relationship="artist" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_group>
+            <data_layout_group name="publisher" title="Publisher">
+              <trans_set>
+                <trans loc="cs" val="Vydavatel"/>
+                <trans loc="de" val="Publisher"/>
+                <trans loc="el" val="ÎÎÎÏÏÎÏ"/>
+                <trans loc="es" val="Editorial"/>
+                <trans loc="fr" val="Ãditeur"/>
+                <trans loc="gl" val="Editorial"/>
+                <trans loc="id" val="Penerbit"/>
+                <trans loc="lv" val="IzdevÄjs"/>
+                <trans loc="pt_BR" val="Editor"/>
+                <trans loc="sl" val="ZaloÅnik"/>
+              </trans_set>
+              <data_layout_item name="publisher_id" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" relationship="publisher" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_group>
+            <data_layout_item name="year" editable="true" use_default_formatting="true">
+              <formatting format_thousands_separator="true" format_decimal_places="2"/>
+            </data_layout_item>
+            <data_layout_portal relationship="songs" portal_rows_count_min="6" portal_rows_count_max="6">
+              <data_layout_item name="name" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_portal>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+      <data_layout name="list" parent_table="albums">
+        <data_layout_groups>
+          <data_layout_group name="toplevel">
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="year" editable="true" use_default_formatting="true">
+              <formatting format_thousands_separator="true" format_decimal_places="2"/>
+            </data_layout_item>
+            <data_layout_item name="artist_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" relationship="artist" editable="true" use_default_formatting="true">
+              <title_custom use_custom="true" title="Artist Name">
+                <trans_set>
+                  <trans loc="cs" val="JmÃno umÄlce"/>
+                  <trans loc="de" val="KÃnstlername"/>
+                  <trans loc="el" val="ÎÎÎÎÎ ÎÎÎÎÎÏÎÏÎÎ"/>
+                  <trans loc="es" val="Nombre del artista"/>
+                  <trans loc="fr" val="Nom de l'artiste"/>
+                  <trans loc="gl" val="Nome do artista"/>
+                  <trans loc="id" val="Nama Artis"/>
+                  <trans loc="lv" val="IzpildÄtÄja vÄrds"/>
+                  <trans loc="pt_BR" val="Nome do artista"/>
+                  <trans loc="sl" val="Ime izvajalca"/>
+                </trans_set>
+              </title_custom>
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="publisher_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" relationship="publisher" editable="true" use_default_formatting="true">
+              <title_custom use_custom="true" title="Publisher Name">
+                <trans_set>
+                  <trans loc="cs" val="JmÃno vydavatele"/>
+                  <trans loc="de" val="Name des Herausgebers"/>
+                  <trans loc="el" val="ÎÎÎÎÎ ÎÎÎÏÏÎ"/>
+                  <trans loc="es" val="Nombre de la editorial"/>
+                  <trans loc="fr" val="Nom de l'Ãditeur"/>
+                  <trans loc="gl" val="Nome da editorial"/>
+                  <trans loc="id" val="Nama Penerbit"/>
+                  <trans loc="lv" val="IzdevÄja nosaukums"/>
+                  <trans loc="pt_BR" val="Nome do editor"/>
+                  <trans loc="sl" val="Ime izdajatelja"/>
+                </trans_set>
+              </title_custom>
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+    </data_layouts>
+    <reports>
+      <report name="albums_by_artist" show_table_title="true" title="Albums By Artist">
+        <data_layout_groups>
+          <data_layout_group>
+            <data_layout_item_groupby>
+              <groupby name="artist_id" editable="true" use_default_formatting="true"/>
+              <secondary_fields>
+                <data_layout_group>
+                  <data_layout_item name="name" relationship="artist" editable="true" use_default_formatting="true">
+                    <title_custom use_custom="true" title="Artist Name">
+                      <trans_set>
+                        <trans loc="cs" val="JmÃno umÄlce"/>
+                        <trans loc="de" val="KÃnstlername"/>
+                        <trans loc="el" val="ÎÎÎÎÎ ÎÎÎÎÎÏÎÏÎÎ"/>
+                        <trans loc="es" val="Nombre del artista"/>
+                        <trans loc="fr" val="Nom de l'artiste"/>
+                        <trans loc="gl" val="Nome do artista"/>
+                        <trans loc="id" val="Nama Artis"/>
+                        <trans loc="lv" val="IzpildÄtÄja vÄrds"/>
+                        <trans loc="pt_BR" val="Nome do artista"/>
+                        <trans loc="sl" val="Ime izvajalca"/>
+                      </trans_set>
+                    </title_custom>
+                    <formatting/>
+                  </data_layout_item>
+                </data_layout_group>
+              </secondary_fields>
+              <data_layout_item name="name" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="year" editable="true" use_default_formatting="true">
+                <formatting format_thousands_separator="true" format_decimal_places="2"/>
+              </data_layout_item>
+            </data_layout_item_groupby>
+          </data_layout_group>
+        </data_layout_groups>
+        <trans_set>
+          <trans loc="cs" val="Alba od umÄlce"/>
+          <trans loc="de" val="Alben nach KÃnstler"/>
+          <trans loc="el" val="ÎÎÏÎÎÎ ÎÎÏÎ ÎÎÎÎÎÏÎÏÎÎÏ"/>
+          <trans loc="es" val="Ãlbumes por artista"/>
+          <trans loc="fr" val="Albums par artiste"/>
+          <trans loc="gl" val="Ãlbums por artista"/>
+          <trans loc="id" val="Album Berdasar Artis"/>
+          <trans loc="lv" val="Albumi pÄc izpildÄtÄja"/>
+          <trans loc="pt_BR" val="Ãlbuns por artista"/>
+          <trans loc="sl" val="Albumi izvajalca"/>
+        </trans_set>
+      </report>
+    </reports>
+    <print_layouts/>
+  </table>
+  <table name="artists" default="true" overview_x="407" overview_y="119" title="Artists">
+    <example_rows>
+      <example_row>
+        <value column="artist_id">bruce</value>
+        <value column="description"/>
+        <value column="comments"/>
+        <value column="name">Bruce Springsteen</value>
+      </example_row>
+      <example_row>
+        <value column="artist_id">mad</value>
+        <value column="description"/>
+        <value column="comments"/>
+        <value column="name">Madonna</value>
+      </example_row>
+      <example_row>
+        <value column="artist_id">prince</value>
+        <value column="description"/>
+        <value column="comments"/>
+        <value column="name">Prince</value>
+      </example_row>
+      <example_row>
+        <value column="artist_id">curtis</value>
+        <value column="description"/>
+        <value column="comments"/>
+        <value column="name">Curtis Mayfield</value>
+      </example_row>
+    </example_rows>
+    <trans_set>
+      <trans loc="cs" val="UmÄlci"/>
+      <trans loc="de" val="KÃnstler"/>
+      <trans loc="el" val="ÎÎÎÎÎÏÎÏÎÎÏ"/>
+      <trans loc="en_GB" val="Artists"/>
+      <trans loc="es" val="Artistas"/>
+      <trans loc="fr" val="Artistes"/>
+      <trans loc="gl" val="Artistas"/>
+      <trans loc="id" val="Artis"/>
+      <trans loc="lv" val="IzpildÄtÄji"/>
+      <trans loc="pt_BR" val="Artistas"/>
+      <trans loc="sl" val="Izvajalci"/>
+    </trans_set>
+    <fields>
+      <field name="artist_id" primary_key="true" unique="true" type="Text" title="Artist ID">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="ID umÄlce"/>
+          <trans loc="de" val="KÃnstlerkennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÎÎÎÏÎÏÎÎ"/>
+          <trans loc="en_GB" val="Artist ID"/>
+          <trans loc="es" val="ID del artista"/>
+          <trans loc="fr" val="ID de l'artiste"/>
+          <trans loc="gl" val="ID do artista"/>
+          <trans loc="id" val="ID Artis"/>
+          <trans loc="lv" val="IzpildÄtÄja ID"/>
+          <trans loc="pt_BR" val="ID de artista"/>
+          <trans loc="sl" val="ID izvajalca"/>
+        </trans_set>
+      </field>
+      <field name="description" type="Text" title="Description">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="Popis"/>
+          <trans loc="de" val="Beschreibung"/>
+          <trans loc="el" val="ÎÎÏÎÎÏÎÏÎ"/>
+          <trans loc="es" val="DescripcioÌn"/>
+          <trans loc="fr" val="Description"/>
+          <trans loc="gl" val="DescriciÃn"/>
+          <trans loc="id" val="Deskripsi"/>
+          <trans loc="lv" val="Apraksts"/>
+          <trans loc="pt_BR" val="DescriÃÃo"/>
+          <trans loc="sl" val="Opis"/>
+        </trans_set>
+      </field>
+      <field name="comments" type="Text" title="Comments">
+        <formatting format_text_multiline="true"/>
+        <trans_set>
+          <trans loc="cs" val="PoznÃmky"/>
+          <trans loc="de" val="Kommentare"/>
+          <trans loc="el" val="ÎÏÏÎÎÎ"/>
+          <trans loc="es" val="Comentarios"/>
+          <trans loc="fr" val="Commentaires"/>
+          <trans loc="gl" val="Comentarios"/>
+          <trans loc="id" val="Komentar"/>
+          <trans loc="lv" val="KomentÄri"/>
+          <trans loc="pt_BR" val="ComentÃrios"/>
+          <trans loc="sl" val="Opombe"/>
+        </trans_set>
+      </field>
+      <field name="name" type="Text" title="Name">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="JmÃno"/>
+          <trans loc="de" val="Name"/>
+          <trans loc="el" val="ÎÎÎÎÎ"/>
+          <trans loc="es" val="Nombre"/>
+          <trans loc="fr" val="Nom"/>
+          <trans loc="gl" val="Nome"/>
+          <trans loc="id" val="Nama"/>
+          <trans loc="lv" val="VÄrds"/>
+          <trans loc="pt_BR" val="Nome"/>
+          <trans loc="sl" val="Ime"/>
+        </trans_set>
+      </field>
+    </fields>
+    <relationships>
+      <relationship name="albums" key="artist_id" other_table="albums" other_key="artist_id" auto_create="true" allow_edit="true" title="Albums">
+        <trans_set>
+          <trans loc="cs" val="Alba"/>
+          <trans loc="de" val="Alben"/>
+          <trans loc="el" val="ÎÎÏÎÎÎ"/>
+          <trans loc="es" val="AÌlbumes"/>
+          <trans loc="fr" val="Albums"/>
+          <trans loc="gl" val="Ãlbums"/>
+          <trans loc="id" val="Album"/>
+          <trans loc="lv" val="Albumi"/>
+          <trans loc="pt_BR" val="Ãlbuns"/>
+          <trans loc="sl" val="Albumi"/>
+        </trans_set>
+      </relationship>
+    </relationships>
+    <data_layouts>
+      <data_layout name="details" parent_table="artists">
+        <data_layout_groups>
+          <data_layout_group name="overview" columns_count="2" title="Overview">
+            <trans_set>
+              <trans loc="cs" val="PÅehled"/>
+              <trans loc="de" val="Overview"/>
+              <trans loc="el" val="ÎÏÎÏÎÏÏÎÏÎ"/>
+              <trans loc="es" val="VisioÌn general"/>
+              <trans loc="fr" val="RÃsumÃ"/>
+              <trans loc="gl" val="Vista xeral"/>
+              <trans loc="id" val="Ringkasan"/>
+              <trans loc="lv" val="PÄrskats"/>
+              <trans loc="pt_BR" val="VisÃo geral"/>
+              <trans loc="sl" val="Pregled"/>
+            </trans_set>
+            <data_layout_item name="artist_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+          <data_layout_group name="details" columns_count="2" title="Details">
+            <trans_set>
+              <trans loc="cs" val="Podrobnosti"/>
+              <trans loc="de" val="Details"/>
+              <trans loc="el" val="ÎÎÏÏÎÎÎÏÎÎÎÏ"/>
+              <trans loc="es" val="Detalles"/>
+              <trans loc="fr" val="DÃtails"/>
+              <trans loc="gl" val="Detalles"/>
+              <trans loc="id" val="Rincian"/>
+              <trans loc="lv" val="SÄkÄka informÄcija"/>
+              <trans loc="pt_BR" val="Detalhes"/>
+              <trans loc="sl" val="Podrobnosti"/>
+            </trans_set>
+            <data_layout_item name="description" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_portal relationship="albums" portal_rows_count_min="6" portal_rows_count_max="6">
+              <data_layout_item name="name" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="year" editable="true" use_default_formatting="true">
+                <formatting format_thousands_separator="true" format_decimal_places="2"/>
+              </data_layout_item>
+            </data_layout_portal>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+      <data_layout name="list" parent_table="artists">
+        <data_layout_groups>
+          <data_layout_group name="main">
+            <data_layout_item name="artist_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="description" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+    </data_layouts>
+    <reports/>
+    <print_layouts/>
+  </table>
+  <table name="publishers" overview_x="411" overview_y="235" title="Publishers">
+    <example_rows>
+      <example_row>
+        <value column="publishers_id">sony</value>
+        <value column="comments"/>
+        <value column="name">Sony</value>
+      </example_row>
+      <example_row>
+        <value column="publishers_id">warnerbros</value>
+        <value column="comments"/>
+        <value column="name">Warner Bros</value>
+      </example_row>
+      <example_row>
+        <value column="publishers_id">rhino</value>
+        <value column="comments"/>
+        <value column="name">Rhino</value>
+      </example_row>
+    </example_rows>
+    <trans_set>
+      <trans loc="cs" val="VydavatelÃ"/>
+      <trans loc="de" val="Herausgeber"/>
+      <trans loc="el" val="ÎÎÎÏÏÎÏ"/>
+      <trans loc="en_GB" val="Publishers"/>
+      <trans loc="es" val="Editoriales"/>
+      <trans loc="fr" val="Ãditeurs"/>
+      <trans loc="gl" val="Editoriais"/>
+      <trans loc="id" val="Penerbit"/>
+      <trans loc="lv" val="IzdevÄji"/>
+      <trans loc="pt_BR" val="Editores"/>
+      <trans loc="sl" val="ZaloÅniki"/>
+    </trans_set>
+    <fields>
+      <field name="publishers_id" primary_key="true" unique="true" type="Text" title="Publisher ID">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="ID vydavatele"/>
+          <trans loc="de" val="Herausgeber-Kennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÎÏÏÎ"/>
+          <trans loc="en_GB" val="Publisher ID"/>
+          <trans loc="es" val="ID de la editorial"/>
+          <trans loc="fr" val="ID de l'Ãditeur"/>
+          <trans loc="gl" val="ID da editorial"/>
+          <trans loc="id" val="ID Penerbit"/>
+          <trans loc="lv" val="IzdevÄja ID"/>
+          <trans loc="pt_BR" val="ID de editor"/>
+          <trans loc="sl" val="ID zaloÅnika"/>
+        </trans_set>
+      </field>
+      <field name="comments" type="Text" title="Comments">
+        <formatting format_text_multiline="true"/>
+        <trans_set>
+          <trans loc="cs" val="PoznÃmky"/>
+          <trans loc="de" val="Kommentare"/>
+          <trans loc="el" val="ÎÏÏÎÎÎ"/>
+          <trans loc="es" val="Comentarios"/>
+          <trans loc="fr" val="Commentaires"/>
+          <trans loc="gl" val="Comentarios"/>
+          <trans loc="id" val="Komentar"/>
+          <trans loc="lv" val="KomentÄri"/>
+          <trans loc="pt_BR" val="ComentÃrios"/>
+          <trans loc="sl" val="Opombe"/>
+        </trans_set>
+      </field>
+      <field name="name" type="Text" title="Name">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="JmÃno"/>
+          <trans loc="de" val="Name"/>
+          <trans loc="el" val="ÎÎÎÎÎ"/>
+          <trans loc="es" val="Nombre"/>
+          <trans loc="fr" val="Nom"/>
+          <trans loc="gl" val="Nome"/>
+          <trans loc="id" val="Nama"/>
+          <trans loc="lv" val="Nosaukums"/>
+          <trans loc="pt_BR" val="Nome"/>
+          <trans loc="sl" val="Ime"/>
+        </trans_set>
+      </field>
+    </fields>
+    <relationships>
+      <relationship name="albums" key="publishers_id" other_table="albums" other_key="publisher_id" title="Albums">
+        <trans_set>
+          <trans loc="cs" val="Alba"/>
+          <trans loc="de" val="Alben"/>
+          <trans loc="el" val="ÎÎÏÎÎÎ"/>
+          <trans loc="es" val="AÌlbumes"/>
+          <trans loc="fr" val="Albums"/>
+          <trans loc="gl" val="Ãlbums"/>
+          <trans loc="id" val="Album"/>
+          <trans loc="lv" val="Albumi"/>
+          <trans loc="pt_BR" val="Ãlbuns"/>
+          <trans loc="sl" val="Albumi"/>
+        </trans_set>
+      </relationship>
+    </relationships>
+    <data_layouts>
+      <data_layout name="details" parent_table="publishers">
+        <data_layout_groups>
+          <data_layout_group name="overview" columns_count="2" title="Overview">
+            <trans_set>
+              <trans loc="cs" val="PÅehled"/>
+              <trans loc="de" val="Overview"/>
+              <trans loc="el" val="ÎÏÎÏÎÏÏÎÏÎ"/>
+              <trans loc="es" val="VisioÌn general"/>
+              <trans loc="fr" val="RÃsumÃ"/>
+              <trans loc="gl" val="Vista xeral"/>
+              <trans loc="id" val="Ringkasan"/>
+              <trans loc="lv" val="PÄrskats"/>
+              <trans loc="pt_BR" val="VisÃo geral"/>
+              <trans loc="sl" val="Pregled"/>
+            </trans_set>
+            <data_layout_item name="publishers_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+          <data_layout_group name="details" title="Details">
+            <trans_set>
+              <trans loc="cs" val="Podrobnosti"/>
+              <trans loc="de" val="Details"/>
+              <trans loc="el" val="ÎÎÏÏÎÎÎÏÎÎÎÏ"/>
+              <trans loc="es" val="Detalles"/>
+              <trans loc="fr" val="DÃtails"/>
+              <trans loc="gl" val="Detalles"/>
+              <trans loc="id" val="Rincian"/>
+              <trans loc="lv" val="SÄkÄka informÄcija"/>
+              <trans loc="pt_BR" val="Detalhes"/>
+              <trans loc="sl" val="Podrobnosti"/>
+            </trans_set>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_portal relationship="albums" portal_rows_count_min="6" portal_rows_count_max="6">
+              <data_layout_item name="album_id" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" relationship="artist" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_portal>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+      <data_layout name="list" parent_table="publishers">
+        <data_layout_groups>
+          <data_layout_group name="main">
+            <data_layout_item name="publishers_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+    </data_layouts>
+    <reports/>
+    <print_layouts/>
+  </table>
+  <table name="songs" overview_x="407" overview_y="7" title="Songs">
+    <example_rows>
+      <example_row>
+        <value column="song_id">4thofjuly</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">4th of July, Asbury Park (Sandy)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">backstreets</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Backstreets</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">ballad</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Ballad of Dorothy Parker</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">borntorun</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Born To Run</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">estreetshuffle</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">E Street Shuffle</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">kittysback</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Kitty's Back</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">hotthing</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Hot Thing</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">foreverinmylife</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Forever In My Life</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">housequake</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Housequake</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">icouldnever</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">I Could Never Take The Place Of Your Man</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">ifiwasyourgirlfriend</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">If I Was Your Girlfriend</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">incident</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Incident on 57th Street</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">it</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">It</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">jungleland</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Jungleland</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">meeting</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Meeting Across The River</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">newyork</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">New York City Serenade</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">night</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Night</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">playinthtesunshine</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Play In The Sunshine</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">rosalita</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Rosalita (Come out Tonight)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">shestheone</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">She's The One</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">signothetimes</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Sign 'O' The Times</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">slowlove</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Slow Love</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">starfishand</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Starfish and Coffee</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">strangerelationship</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Strange Relationship</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">tenthavenue</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Tenth Avenue Freeze Out</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">thunderroad</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Thunder Road</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">ugotthelook</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">U Got The Look</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">wildbilly</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Wild Billy's Circus Story</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">junkiechase</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Junkie Chase (Instrumental)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">laisla</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">La Isla Bonita</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">littlechildrunningwild</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">Little Child Runnin' Wild</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">livetotell</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">Live To Tell</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">lovemakes</value>
+        <value column="comments"/>
+        <value column="album_id">thewildtheinnocent</value>
+        <value column="name">Love Makes The World Go Round</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">nothingonme</value>
+        <value column="comments"/>
+        <value column="album_id">superfly</value>
+        <value column="name">No Thing On Me (Cocaine Song)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">openyourheart</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">Open Your Heart</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">papadontpreach</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">Papa Don't Preach</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">pusherman</value>
+        <value column="comments"/>
+        <value column="album_id">superfly</value>
+        <value column="name">Pusherman</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">superfly</value>
+        <value column="comments"/>
+        <value column="album_id">superfly</value>
+        <value column="name">Superfly</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">thecross</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">The Cross</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">think</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Think (Instrumental)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">trueblue</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">True Blue</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">wherestheparty</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">Where's The Party</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">whiteheart</value>
+        <value column="comments"/>
+        <value column="album_id">trueblue</value>
+        <value column="name">White Heart</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">adore</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Adore</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">eddieyoushouldknowbetter</value>
+        <value column="comments"/>
+        <value column="album_id">borntorun</value>
+        <value column="name">Eddie You Should Know Better</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">freddiesdead</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Freddie's Dead</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">givemeyourlove</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Give Me Your Love (Love Song)</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">itsgonna</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">It's Gonna Be A Beautiful Night</value>
+      </example_row>
+      <example_row>
+        <value column="song_id">jimmyjimmy</value>
+        <value column="comments"/>
+        <value column="album_id">signothetimes</value>
+        <value column="name">Jimmy Jimmy</value>
+      </example_row>
+    </example_rows>
+    <trans_set>
+      <trans loc="cs" val="Skladby"/>
+      <trans loc="de" val="Lieder"/>
+      <trans loc="el" val="ÎÏÎÎÎÏÎÎÎ"/>
+      <trans loc="en_GB" val="Songs"/>
+      <trans loc="es" val="Canciones"/>
+      <trans loc="fr" val="Chansons"/>
+      <trans loc="gl" val="CanciÃns"/>
+      <trans loc="id" val="Lagu"/>
+      <trans loc="lv" val="Dziesmas"/>
+      <trans loc="pt_BR" val="CanÃÃes"/>
+      <trans loc="sl" val="Skladbe"/>
+    </trans_set>
+    <fields>
+      <field name="song_id" primary_key="true" unique="true" type="Text" title="Song ID">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="ID skladby"/>
+          <trans loc="de" val="Lied-Kennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÏÏÎÎÎÏÎÎÎÏ"/>
+          <trans loc="en_GB" val="Song ID"/>
+          <trans loc="es" val="ID de la canciÃn"/>
+          <trans loc="fr" val="ID de la chanson"/>
+          <trans loc="gl" val="ID da canciÃn"/>
+          <trans loc="id" val="ID Lagu"/>
+          <trans loc="lv" val="Dziesmas ID"/>
+          <trans loc="pt_BR" val="ID de canÃÃo"/>
+          <trans loc="sl" val="ID skladbe"/>
+        </trans_set>
+      </field>
+      <field name="comments" type="Text" title="Comments">
+        <formatting format_text_multiline="true"/>
+        <trans_set>
+          <trans loc="cs" val="PoznÃmky"/>
+          <trans loc="de" val="Kommentare"/>
+          <trans loc="el" val="ÎÏÏÎÎÎ"/>
+          <trans loc="es" val="Comentarios"/>
+          <trans loc="fr" val="Commentaires"/>
+          <trans loc="gl" val="Comentarios"/>
+          <trans loc="id" val="Komentar"/>
+          <trans loc="lv" val="KomentÄri"/>
+          <trans loc="pt_BR" val="ComentÃrios"/>
+          <trans loc="sl" val="Opombe"/>
+        </trans_set>
+      </field>
+      <field name="album_id" type="Text" title="Album ID">
+        <formatting choices_related="true" choices_related_relationship="album" choices_related_field="album_id" choices_related_show_all="true">
+          <choices_related_extra_layout>
+            <data_layout_groups>
+              <data_layout_group>
+                <data_layout_item name="name" editable="true" use_default_formatting="true">
+                  <formatting/>
+                </data_layout_item>
+              </data_layout_group>
+            </data_layout_groups>
+          </choices_related_extra_layout>
+        </formatting>
+        <trans_set>
+          <trans loc="cs" val="ID alba"/>
+          <trans loc="de" val="Albenkennung"/>
+          <trans loc="el" val="ÎÎÎÎÎÏÏÎÏÏÎÎÏ ÎÎÏÎÎÏ"/>
+          <trans loc="en_GB" val="Album ID"/>
+          <trans loc="es" val="ID del Ãlbum"/>
+          <trans loc="fr" val="ID de l'album"/>
+          <trans loc="gl" val="ID do Ãlbum"/>
+          <trans loc="id" val="ID Album"/>
+          <trans loc="lv" val="Albuma ID"/>
+          <trans loc="pt_BR" val="ID de Ãlbum"/>
+          <trans loc="sl" val="ID albuma"/>
+        </trans_set>
+      </field>
+      <field name="name" type="Text" title="Name">
+        <formatting/>
+        <trans_set>
+          <trans loc="cs" val="NÃzev"/>
+          <trans loc="de" val="Name"/>
+          <trans loc="el" val="ÎÎÎÎÎ"/>
+          <trans loc="es" val="Nombre"/>
+          <trans loc="fr" val="Nom"/>
+          <trans loc="gl" val="Nome"/>
+          <trans loc="id" val="Nama"/>
+          <trans loc="lv" val="Nosaukums"/>
+          <trans loc="pt_BR" val="Nome"/>
+          <trans loc="sl" val="Ime"/>
+        </trans_set>
+      </field>
+    </fields>
+    <relationships>
+      <relationship name="album" key="album_id" other_table="albums" other_key="album_id" title="Album">
+        <trans_set>
+          <trans loc="cs" val="Album"/>
+          <trans loc="de" val="Album"/>
+          <trans loc="el" val="ÎÎÏÎÎÏ"/>
+          <trans loc="es" val="AÌlbum"/>
+          <trans loc="fr" val="Album"/>
+          <trans loc="gl" val="Ãlbum"/>
+          <trans loc="id" val="Album"/>
+          <trans loc="lv" val="Albums"/>
+          <trans loc="pt_BR" val="Ãlbum"/>
+          <trans loc="sl" val="Album"/>
+        </trans_set>
+      </relationship>
+    </relationships>
+    <data_layouts>
+      <data_layout name="details" parent_table="songs">
+        <data_layout_groups>
+          <data_layout_group name="overview" columns_count="2" title="Overview">
+            <trans_set>
+              <trans loc="cs" val="PÅehled"/>
+              <trans loc="de" val="Overview"/>
+              <trans loc="el" val="ÎÏÎÏÎÏÏÎÏÎ"/>
+              <trans loc="es" val="VisioÌn general"/>
+              <trans loc="fr" val="RÃsumÃ"/>
+              <trans loc="gl" val="Vista xeral"/>
+              <trans loc="id" val="Ringkasan"/>
+              <trans loc="lv" val="PÄrskats"/>
+              <trans loc="pt_BR" val="VisÃo geral"/>
+              <trans loc="sl" val="Pregled"/>
+            </trans_set>
+            <data_layout_item name="song_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+          <data_layout_group name="details" columns_count="2" title="Details">
+            <trans_set>
+              <trans loc="cs" val="Podrobnosti"/>
+              <trans loc="de" val="Details"/>
+              <trans loc="el" val="ÎÎÏÏÎÎÎÏÎÎÎÏ"/>
+              <trans loc="es" val="Detalles"/>
+              <trans loc="fr" val="DÃtails"/>
+              <trans loc="gl" val="Detlles"/>
+              <trans loc="id" val="Rincian"/>
+              <trans loc="lv" val="SÄkÄka informÄcija"/>
+              <trans loc="pt_BR" val="Detalhes"/>
+              <trans loc="sl" val="Podrobnosti"/>
+            </trans_set>
+            <data_layout_group name="album" title="Album">
+              <trans_set>
+                <trans loc="cs" val="Album"/>
+                <trans loc="de" val="Album-KÃnstler"/>
+                <trans loc="el" val="ÎÎÏÎÎÏ"/>
+                <trans loc="es" val="AÌlbum"/>
+                <trans loc="fr" val="Album"/>
+                <trans loc="gl" val="Ãlbum"/>
+                <trans loc="id" val="Album"/>
+                <trans loc="lv" val="Albums"/>
+                <trans loc="pt_BR" val="Ãlbum"/>
+                <trans loc="sl" val="Album"/>
+              </trans_set>
+              <data_layout_item name="album_id" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" relationship="album" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_group>
+            <data_layout_group name="artist" title="Album Artist">
+              <trans_set>
+                <trans loc="cs" val="UmÄlci alba"/>
+                <trans loc="de" val="Album-KÃnstler"/>
+                <trans loc="el" val="ÎÎÏÎÎÏ ÎÎÎÎÎÏÎÏÎÎ"/>
+                <trans loc="es" val="Artista del Ãlbum"/>
+                <trans loc="fr" val="Artiste de l'album"/>
+                <trans loc="gl" val="Artista do Ãlbum"/>
+                <trans loc="id" val="Artis Album"/>
+                <trans loc="lv" val="Albuma izpildÄtÄjs"/>
+                <trans loc="pt_BR" val="Ãlbum de artista"/>
+                <trans loc="sl" val="Izvajalec albuma"/>
+              </trans_set>
+              <data_layout_item name="artist_id" relationship="album" related_relationship="artist" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+              <data_layout_item name="name" relationship="album" related_relationship="artist" editable="true" use_default_formatting="true">
+                <formatting/>
+              </data_layout_item>
+            </data_layout_group>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+      <data_layout name="list" parent_table="songs">
+        <data_layout_groups>
+          <data_layout_group name="main">
+            <data_layout_item name="song_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="comments" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="album_id" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+            <data_layout_item name="name" editable="true" use_default_formatting="true">
+              <formatting/>
+            </data_layout_item>
+          </data_layout_group>
+        </data_layout_groups>
+      </data_layout>
+    </data_layouts>
+    <reports/>
+    <print_layouts/>
+  </table>
+  <groups><!--These are only used when recreating a database from an example file. The actual access-control is on the server, of course.-->
+    <group name="glom_developer" developer="true"/>
+  </groups>
+  <library_modules/></glom_document>
diff --git a/tests/test_selfhosting_non_numeric_primary_keys.cc b/tests/test_selfhosting_non_numeric_primary_keys.cc
new file mode 100644
index 0000000..051f3ff
--- /dev/null
+++ b/tests/test_selfhosting_non_numeric_primary_keys.cc
@@ -0,0 +1,103 @@
+/* Glom
+ *
+ * Copyright (C) 2010 Openismus GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+71 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
+
+#include "tests/test_selfhosting_utils.h"
+#include <libglom/init.h>
+#include <libglom/utils.h>
+#include <libglom/db_utils.h>
+#include <glib.h> //For g_assert()
+#include <iostream>
+#include <cstdlib> //For EXIT_SUCCESS and EXIT_FAILURE
+
+static bool test(Glom::Document::HostingMode hosting_mode)
+{
+  Glom::Document document;
+  const bool recreated = 
+    test_create_and_selfhost_from_test_example("test_example_music_collection_text_pk_fields.glom", document, hosting_mode);
+  if(!recreated)
+  {
+    std::cerr << "Recreation failed." << std::endl;
+    return false;
+  }
+  
+  if(!test_example_musiccollection_data(&document))
+  {
+    std::cerr << "test_example_musiccollection_data() failed." << std::endl;
+    return false;
+  }
+
+  if(!test_table_exists("songs", document))
+  {
+    return false;
+  }
+
+  if(!test_table_exists("publishers", document))
+  {
+    return false;
+  }
+
+  //Test the system preferences for the database:
+  //TODO: We should store this only in the document anyway,
+  //and make it translatable:
+  /* TODO: This is not stored in the examples. Should it be?
+  const Glom::SystemPrefs prefs = 
+    Glom::DbUtils::get_database_preferences(&document);
+  g_return_val_if_fail(prefs.m_name == "Music Collection", false);
+  g_return_val_if_fail(prefs.m_org_name == "SomeOrganization Incorporated", false);
+  g_return_val_if_fail(prefs.m_org_address_street == "Some House", false);
+  g_return_val_if_fail(prefs.m_org_address_street2 == "123 Some Street", false);
+  g_return_val_if_fail(prefs.m_org_address_town == "Some Town", false);
+  g_return_val_if_fail(prefs.m_org_address_county == "Some State", false);
+  g_return_val_if_fail(prefs.m_org_address_postcode == "12345", false);
+  g_return_val_if_fail(prefs.m_org_address_country == "USA", false);
+  */
+
+  test_selfhosting_cleanup();
+ 
+  return true; 
+}
+
+int main()
+{
+  Glom::libglom_init();
+
+  //We run this test in several locales via 
+  //test_selfhosting_new_from_example_in_locales.sh,
+  //so we do this so the locale will really be used:
+  setlocale(LC_ALL, "");
+  
+  if(!test(Glom::Document::HOSTING_MODE_POSTGRES_SELF))
+  {
+    std::cerr << "Failed with PostgreSQL" << std::endl;
+    test_selfhosting_cleanup();
+    return EXIT_FAILURE;
+  }
+  
+  if(!test(Glom::Document::HOSTING_MODE_SQLITE))
+  {
+    std::cerr << "Failed with SQLite" << std::endl;
+    test_selfhosting_cleanup();
+    return EXIT_FAILURE;
+  }
+
+  Glom::libglom_deinit();
+
+  return EXIT_SUCCESS;
+}
diff --git a/tests/test_selfhosting_utils.cc b/tests/test_selfhosting_utils.cc
index f9135b7..d4fe532 100644
--- a/tests/test_selfhosting_utils.cc
+++ b/tests/test_selfhosting_utils.cc
@@ -262,26 +262,62 @@ bool test_create_and_selfhost_new_database(Glom::Document& document, Glom::Docum
   return true;
 }
 
+static bool test_create_and_selfhost_from_example_full_path(const std::string& example_path, Glom::Document& document, Glom::Document::HostingMode hosting_mode, const std::string& subdirectory_path = std::string())
+{
+  Glib::ustring uri;
+  try
+  {
+    uri = Glib::filename_to_uri(example_path);
+  }
+  catch(const Glib::ConvertError& ex)
+  {
+    std::cerr << G_STRFUNC << ": " << ex.what();
+    return false;
+  }
+
+  return test_create_and_selfhost_from_uri(uri, document, hosting_mode, subdirectory_path);
+}
 
 bool test_create_and_selfhost_from_example(const std::string& example_filename, Glom::Document& document, Glom::Document::HostingMode hosting_mode, const std::string& subdirectory_path)
 {
   Glib::ustring uri;
   
   // Get a URI for the example file:
+  std::string path;
   try
   {
-    const std::string path =
+    path =
        Glib::build_filename(GLOM_DOCDIR_EXAMPLES_NOTINSTALLED,
          example_filename);
-    uri = Glib::filename_to_uri(path);
   }
   catch(const Glib::ConvertError& ex)
   {
     std::cerr << G_STRFUNC << ": " << ex.what();
     return false;
   }
+
+  return test_create_and_selfhost_from_example_full_path(path, document, hosting_mode, subdirectory_path);
+}
+
+bool test_create_and_selfhost_from_test_example(const std::string& example_filename, Glom::Document& document, Glom::Document::HostingMode hosting_mode)
+{
+  Glib::ustring uri;
   
-  return test_create_and_selfhost_from_uri(uri, document, hosting_mode, subdirectory_path);
+  // Get a URI for the example file:
+  std::string path;
+  try
+  {
+    path =
+       Glib::build_filename(GLOM_TEST_EXAMPLES_NOTINSTALLED,
+         example_filename);
+  }
+  catch(const Glib::ConvertError& ex)
+  {
+    std::cerr << G_STRFUNC << ": " << ex.what();
+    return false;
+  }
+
+  return test_create_and_selfhost_from_example_full_path(path, document, hosting_mode);
 }
 
 bool test_create_and_selfhost_from_uri(const Glib::ustring& example_file_uri, Glom::Document& document, Glom::Document::HostingMode hosting_mode, const std::string& subdirectory_path)
diff --git a/tests/test_selfhosting_utils.h b/tests/test_selfhosting_utils.h
index ebf25c1..a11b76a 100644
--- a/tests/test_selfhosting_utils.h
+++ b/tests/test_selfhosting_utils.h
@@ -44,13 +44,23 @@ bool test_create_and_selfhost_new_database(Glom::Document& document, Glom::Docum
 
 /** Create a .glom file from an example, with database data, and start a PostgreSQL server if necessary.
  *
+ * @param example_filename The filename (not the full path) of the example .glom file.
  * @param hosting_mode Either HOSTING_MODE_POSTGRES_SELF or HOSTING_MODE_SQLITE
  * @param subdirectory_path: An additional directory path to use under the temporary directory that will be used to save the file.
  */
 bool test_create_and_selfhost_from_example(const std::string& example_filename, Glom::Document& document, Glom::Document::HostingMode hosting_mode, const std::string& subdirectory_path = std::string());
 
+/** Create a .glom file from a test example, with database data, and start a PostgreSQL server if necessary.
+ *
+ * @param example_filename The filename (not the full path) of the example .glom file.
+ * @param hosting_mode Either HOSTING_MODE_POSTGRES_SELF or HOSTING_MODE_SQLITE
+ */
+bool test_create_and_selfhost_from_test_example(const std::string& example_filename, Glom::Document& document, Glom::Document::HostingMode hosting_mode);
+
+
 /** Create a .glom file from an existing .glom example file with database data, and start a PostgreSQL server if necessary.
  *
+ * @param file_uri The full URI of the example .glom file.
  * @param hosting_mode Either HOSTING_MODE_POSTGRES_SELF or HOSTING_MODE_SQLITE
  * @param subdirectory_path: An additional directory path to use under the temporary directory that will be used to save the file.
  */
@@ -62,7 +72,7 @@ bool test_create_and_selfhost_from_uri(const Glib::ustring& file_uri, Glom::Docu
 bool test_selfhost(Glom::Document& document, const Glib::ustring& user, const Glib::ustring& password);
 
 
-bool test_model_expected_size(const Glib::RefPtr<Gnome::Gda::DataModel>& data_model, guint columns_count, guint rows_count);
+bool test_model_expected_size(const Glib::RefPtr<const Gnome::Gda::DataModel>& data_model, guint columns_count, guint rows_count);
 bool test_table_exists(const Glib::ustring& table_name, const Glom::Document& document);
 
 /** Return the URI of the temporary .glom file created by the test_create_and_selfhost_*() methods.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]