Skip to content

Commit 4c509ee

Browse files
committed
new version 1.2.2
1 parent 9b3eb0b commit 4c509ee

File tree

6 files changed

+66
-54
lines changed

6 files changed

+66
-54
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
**The use of this software subjects you to our [Terms Of Use][4] and [Data Protection Policy][5].**
3131

32-
# version [1.2.1][6]
32+
# version [1.2.2][6]
3333

3434
## Introduction:
3535

@@ -410,7 +410,13 @@ ___
410410
- Fixed a regression allowing errors to be displayed in the Spooler.
411411
- Integration of a fix to workaround the [issue #159988][91].
412412

413-
### What remains to be done for version 1.2.1:
413+
### What has been done for version 1.2.2:
414+
415+
- The creation of the database, during the first connection, uses the UNO API offered by the jdbcDriverOOo extension since version 1.3.2. This makes it possible to record all the information necessary for creating the database in 5 text tables which are in fact [5 csv files][92].
416+
- The extension will ask you to install the OAuth2OOo and jdbcDriverOOo extensions in versions 1.3.4 and 1.3.2 respectively minimum.
417+
- Many fixes.
418+
419+
### What remains to be done for version 1.2.2:
414420

415421
- Add new languages for internationalization...
416422

@@ -454,7 +460,7 @@ ___
454460
[37]: <https://img.shields.io/github/v/tag/prrvchr/mContactOOo?label=latest#right>
455461
[38]: <https://prrvchr.github.io/eMailerOOo/img/eMailerOOo.svg#middle>
456462
[39]: <https://github.com/prrvchr/eMailerOOo/releases/latest/download/eMailerOOo.oxt>
457-
[40]: <https://img.shields.io/github/downloads/prrvchr/eMailerOOo/latest/total?label=v1.2.1#right>
463+
[40]: <https://img.shields.io/github/downloads/prrvchr/eMailerOOo/latest/total?label=v1.2.2#right>
458464
[41]: <https://prrvchr.github.io/eMailerOOo/#merge-emails-with-mailing-lists>
459465
[42]: <https://prrvchr.github.io/eMailerOOo/#configure-connection>
460466
[43]: <https://prrvchr.github.io/eMailerOOo/#outgoing-emails>
@@ -506,3 +512,4 @@ ___
506512
[89]: <https://peps.python.org/pep-0508/>
507513
[90]: <https://prrvchr.github.io/eMailerOOo/#requirement>
508514
[91]: <https://bugs.documentfoundation.org/show_bug.cgi?id=159988>
515+
[92]: <https://github.com/prrvchr/eMailerOOo/tree/master/source/eMailerOOo/hsqldb>

README_fr.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
**L'utilisation de ce logiciel vous soumet à nos [Conditions d'utilisation][4] et à notre [Politique de protection des données][5].**
3131

32-
# version [1.2.1][6]
32+
# version [1.2.2][6]
3333

3434
## Introduction:
3535

@@ -410,7 +410,13 @@ ___
410410
- Correction d'une régression permettant l'affichage des erreurs dans le Spooler.
411411
- Intégration d'un correctif pour contourner le [dysfonctionnement #159988][91].
412412

413-
### Que reste-t-il à faire pour la version 1.2.1:
413+
### Ce qui a été fait pour la version 1.2.2:
414+
415+
- La création de la base de données, lors de la première connexion, utilise l'API UNO proposée par l'extension jdbcDriverOOo depuis la version 1.3.2. Cela permet d'enregistrer toutes les informations nécessaires à la création de la base de données dans 5 tables texte qui sont en fait [5 fichiers csv][92].
416+
- L'extension vous demandera d'installer les extensions OAuth2OOo et jdbcDriverOOo en version respectivement 1.3.4 et 1.3.2 minimum.
417+
- De nombreuses corrections.
418+
419+
### Que reste-t-il à faire pour la version 1.2.2:
414420

415421
- Ajouter de nouvelles langues pour l’internationalisation...
416422

@@ -454,7 +460,7 @@ ___
454460
[37]: <https://img.shields.io/github/v/tag/prrvchr/mContactOOo?label=latest#right>
455461
[38]: <https://prrvchr.github.io/eMailerOOo/img/eMailerOOo.svg#middle>
456462
[39]: <https://github.com/prrvchr/eMailerOOo/releases/latest/download/eMailerOOo.oxt>
457-
[40]: <https://img.shields.io/github/downloads/prrvchr/eMailerOOo/latest/total?label=v1.2.1#right>
463+
[40]: <https://img.shields.io/github/downloads/prrvchr/eMailerOOo/latest/total?label=v1.2.2#right>
458464
[41]: <https://prrvchr.github.io/eMailerOOo/README_fr#publipostage-de-courriels-avec-des-listes-de-diffusion>
459465
[42]: <https://prrvchr.github.io/eMailerOOo/README_fr#configuration-de-la-connexion>
460466
[43]: <https://prrvchr.github.io/eMailerOOo/README_fr#courriels-sortants>
@@ -506,3 +512,4 @@ ___
506512
[89]: <https://peps.python.org/pep-0508/>
507513
[90]: <https://prrvchr.github.io/eMailerOOo/README_fr#pr%C3%A9requis>
508514
[91]: <https://bugs.documentfoundation.org/show_bug.cgi?id=159988>
515+
[92]: <https://github.com/prrvchr/eMailerOOo/tree/master/source/eMailerOOo/hsqldb>

eMailerOOo.update.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
xmlns="http://openoffice.org/extensions/update/2006"
2929
xmlns:xlink="http://www.w3.org/1999/xlink">
3030
<identifier value="io.github.prrvchr.eMailerOOo"/>
31-
<version value="1.2.1"/>
31+
<version value="1.2.2"/>
3232
<update-download>
3333
<src xlink:href="https://github.com/prrvchr/eMailerOOo/releases/latest/download/eMailerOOo.oxt"/>
3434
</update-download>
@@ -40,7 +40,7 @@
4040
<name xlink:href="https://prrvchr.github.io/eMailerOOo/README_fr" lang="fr">eMailerOOo</name>
4141
</publisher>
4242
<release-notes>
43-
<src xlink:href="https://prrvchr.github.io/eMailerOOo/#what-has-been-done-for-version-121" lang="en"/>
44-
<src xlink:href="https://prrvchr.github.io/eMailerOOo/README_fr#ce-qui-a-%C3%A9t%C3%A9-fait-pour-la-version-121" lang="fr"/>
43+
<src xlink:href="https://prrvchr.github.io/eMailerOOo/#what-has-been-done-for-version-122" lang="en"/>
44+
<src xlink:href="https://prrvchr.github.io/eMailerOOo/README_fr#ce-qui-a-%C3%A9t%C3%A9-fait-pour-la-version-122" lang="fr"/>
4545
</release-notes>
4646
</description>

source/eMailerOOo/service/pythonpath/emailer/dbconfig.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
g_role = 'FrontOffice'
3939
g_dba = 'AD'
4040

41+
g_catalog = 'PUBLIC'
42+
g_schema = 'PUBLIC'
43+
4144
# XXX: If we want to be able to create DataBase we need to get some
4245
# XXX: DriverPropertyInfo from the driver. Here is the necessary information
4346
g_drvinfos = {'AutoIncrementCreation': lambda x: x.Value,

source/eMailerOOo/service/pythonpath/emailer/dbinit.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@
2929

3030
from com.sun.star.sdbc import SQLException
3131

32+
from com.sun.star.sdbcx import CheckOption
33+
3234
from .dbtool import createStaticTables
3335
from .dbtool import createStaticIndexes
3436
from .dbtool import createStaticForeignKeys
3537
from .dbtool import createTables
3638
from .dbtool import createIndexes
3739
from .dbtool import createForeignKeys
40+
from .dbtool import createViews
3841
from .dbtool import executeQueries
3942
from .dbtool import getConnectionInfos
4043
from .dbtool import getDataBaseTables
@@ -48,6 +51,10 @@
4851
from .dbtool import getForeignKeys
4952
from .dbtool import setStaticTable
5053

54+
from .dbqueries import getSqlQuery
55+
56+
from .dbconfig import g_catalog
57+
from .dbconfig import g_schema
5158
from .dbconfig import g_csv
5259
from .dbconfig import g_drvinfos
5360

@@ -65,14 +72,16 @@ def createDataBase(ctx, connection, odb):
6572
sleep(0.2)
6673
tables = connection.getTables()
6774
statement = connection.createStatement()
68-
statics = createStaticTables(tables)
69-
createStaticIndexes(tables)
70-
createStaticForeignKeys(tables)
75+
statics = createStaticTables(g_catalog, g_schema, tables)
76+
createStaticIndexes(g_catalog, g_schema, tables)
77+
createStaticForeignKeys(g_catalog, g_schema, tables)
7178
setStaticTable(statement, statics, g_csv, True)
7279
_createTables(connection, statement, tables)
7380
_createIndexes(statement, tables)
7481
_createForeignKeys(statement, tables)
75-
executeQueries(ctx, statement, _getQueries())
82+
views = _getViews(ctx, g_catalog, g_schema, 'Spooler', CheckOption.CASCADE)
83+
createViews(connection.getViews(), views)
84+
executeQueries(ctx, statement, _getProcedures(), 'create%s')
7685
statement.close()
7786
connection.getParent().DatabaseDocument.storeAsURL(odb, ())
7887
connection.close()
@@ -88,13 +97,12 @@ def _createIndexes(statement, tables):
8897
def _createForeignKeys(statement, tables):
8998
createForeignKeys(tables, getDataBaseForeignKeys(statement, getForeignKeys()))
9099

91-
def _getQueries():
92-
return (('createSpoolerView', None),
93-
('createInsertJob', None),
94-
('createInsertMergeJob', None),
95-
('createDeleteJobs', None),
96-
('createGetRecipient', None),
97-
('createGetMailer', None),
98-
('createGetAttachments', None),
99-
('createUpdateMailer', None))
100+
def _getViews(ctx, catalog, schema, view, *option):
101+
format = {'Catalog': catalog, 'Schema': schema}
102+
yield catalog, schema, view, getSqlQuery(ctx, 'get%sViewCommand' % view, format), *option
103+
104+
def _getProcedures():
105+
for name in ('InsertJob', 'InsertMergeJob', 'DeleteJobs', 'GetRecipient',
106+
'GetMailer', 'GetAttachments', 'UpdateMailer'):
107+
yield name
100108

source/eMailerOOo/service/pythonpath/emailer/dbqueries.py

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,27 @@ def getSqlQuery(ctx, name, format=None):
4040

4141
# DataBase creation Queries
4242
# Create View Queries
43-
if name == 'createSpoolerView':
44-
c1 = '"JobId"'
45-
c2 = '"BatchId"'
46-
c3 = '"State"'
47-
c4 = '"Subject"'
48-
c5 = '"Sender"'
49-
c6 = '"Recipient"'
50-
c7 = '"Document"'
51-
c8 = '"DataSource"'
52-
c9 = '"Query"'
53-
c10 = '"Table"'
54-
c11 = '"Filter"'
55-
c12 = '"Submit"'
56-
c13 = '"Sending"'
43+
if name == 'getSpoolerViewCommand':
44+
c1 = 'R."JobId"'
45+
c2 = 'S."BatchId"'
46+
c3 = 'R."State"'
47+
c4 = 'S."Subject"'
48+
c5 = 'S."Sender"'
49+
c6 = 'R."Recipient"'
50+
c7 = 'S."Document"'
51+
c8 = 'S."DataSource"'
52+
c9 = 'S."Query"'
53+
c10 = 'S."Table"'
54+
c11 = 'R."Filter"'
55+
c12 = 'S."Created" AS "Submit"'
56+
c13 = 'R."Modified" AS "Sending"'
5757
c = (c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13)
58-
s1 = '"Recipients"."JobId"'
59-
s2 = '"Senders"."BatchId"'
60-
s3 = '"Recipients"."State"'
61-
s4 = '"Senders"."Subject"'
62-
s5 = '"Senders"."Sender"'
63-
s6 = '"Recipients"."Recipient"'
64-
s7 = '"Senders"."Document"'
65-
s8 = '"Senders"."DataSource"'
66-
s9 = '"Senders"."Query"'
67-
s10 = '"Senders"."Table"'
68-
s11 = '"Recipients"."Filter"'
69-
s12 = '"Senders"."Created"'
70-
s13 = '"Recipients"."Modified"'
71-
s = (s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13)
72-
f1 = '"Senders"'
73-
f2 = 'JOIN "Recipients" ON "Senders"."BatchId"="Recipients"."BatchId"'
58+
f1 = '%(Catalog)s.%(Schema)s."Senders" AS S'
59+
f2 = 'INNER JOIN %(Catalog)s.%(Schema)s."Recipients" AS R ON R."BatchId" = S."BatchId"'
7460
f = (f1,f2)
75-
p = (','.join(c), ','.join(s), ' '.join(f))
76-
query = 'CREATE VIEW "Spooler" (%s) AS SELECT %s FROM %s;' % p
61+
p = (', '.join(c), ' '.join(f))
62+
command = 'SELECT %s FROM %s;' % p
63+
query = command % format
7764

7865
# Select Queries
7966
# Merger Composer Select Queries

0 commit comments

Comments
 (0)