Postres support

This commit is contained in:
Eric van der Vlist 2019-04-09 23:37:32 +02:00
parent b341335eaa
commit 380875a4f1
6 changed files with 157 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.xpr
secrets/license.xml
mysql-connector-java*.jar
postgresql-*.jar

3
Dockerfile-postgres Normal file
View File

@ -0,0 +1,3 @@
FROM postgres
COPY ./postgres/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d

View File

@ -0,0 +1,109 @@
CREATE TABLE orbeon_form_definition (
created TIMESTAMP,
last_modified_time TIMESTAMP,
last_modified_by VARCHAR(255),
app VARCHAR(255),
form VARCHAR(255),
form_version INT NOT NULL,
form_metadata VARCHAR(4000),
deleted CHARACTER(1) NOT NULL,
xml XML
);
CREATE TABLE orbeon_form_definition_attach (
created TIMESTAMP,
last_modified_time TIMESTAMP,
last_modified_by VARCHAR(255),
app VARCHAR(255),
form VARCHAR(255),
form_version INT NOT NULL,
deleted CHARACTER(1) NOT NULL,
file_name VARCHAR(255),
file_content BYTEA
);
CREATE TABLE orbeon_form_data (
id SERIAL PRIMARY KEY NOT NULL,
created TIMESTAMP,
last_modified_time TIMESTAMP,
last_modified_by VARCHAR(255),
username VARCHAR(255),
groupname VARCHAR(255),
organization_id INT,
app VARCHAR(255),
form VARCHAR(255),
form_version INT NOT NULL,
document_id VARCHAR(255),
deleted CHARACTER(1) NOT NULL,
draft CHARACTER(1) NOT NULL,
xml XML
);
CREATE TABLE orbeon_form_data_attach (
created TIMESTAMP,
last_modified_time TIMESTAMP,
last_modified_by VARCHAR(255),
username VARCHAR(255),
groupname VARCHAR(255),
organization_id INT,
app VARCHAR(255),
form VARCHAR(255),
form_version INT NOT NULL,
document_id VARCHAR(255),
deleted CHARACTER(1) NOT NULL,
draft CHARACTER(1) NOT NULL,
file_name VARCHAR(255),
file_content BYTEA
);
CREATE TABLE orbeon_form_data_lease (
document_id VARCHAR(255) NOT NULL PRIMARY KEY,
username VARCHAR(255) NOT NULL ,
groupname VARCHAR(255) ,
expiration TIMESTAMP NOT NULL
);
CREATE TABLE orbeon_organization (
id INT NOT NULL,
depth INT NOT NULL,
pos INT NOT NULL,
name VARCHAR(255) NOT NULL
);
CREATE TABLE orbeon_seq (
val SERIAL PRIMARY KEY NOT NULL
);
CREATE TABLE orbeon_i_current (
data_id INT NOT NULL,
created TIMESTAMP NOT NULL,
last_modified_time TIMESTAMP NOT NULL,
last_modified_by VARCHAR(255) ,
username VARCHAR(255) ,
groupname VARCHAR(255) ,
organization_id INT ,
app VARCHAR(255) NOT NULL,
form VARCHAR(255) NOT NULL,
form_version INT NOT NULL,
document_id VARCHAR(255) NOT NULL,
draft CHARACTER(1) NOT NULL,
FOREIGN KEY (data_id) REFERENCES orbeon_form_data(id)
);
CREATE TABLE orbeon_i_control_text (
data_id INT NOT NULL,
pos INT NOT NULL,
control VARCHAR(255) NOT NULL,
val TEXT NOT NULL,
FOREIGN KEY (data_id) REFERENCES orbeon_form_data(id)
);
CREATE INDEX orbeon_form_definition_i1 ON orbeon_form_definition (app, form);
CREATE INDEX orbeon_form_definition_att_i1 ON orbeon_form_definition_attach (app, form, file_name);
CREATE INDEX orbeon_from_data_i1 ON orbeon_form_data (app, form, document_id, draft);
CREATE INDEX orbeon_form_data_i2 ON orbeon_form_data (document_id);
CREATE INDEX orbeon_from_data_attach_i1 ON orbeon_form_data_attach (app, form, document_id, file_name, draft);
CREATE INDEX orbeon_from_data_attach_i2 ON orbeon_form_data_attach (document_id);
CREATE UNIQUE INDEX orbeon_i_current_i1 ON orbeon_i_current (data_id, draft);
CREATE INDEX orbeon_i_current_i2 ON orbeon_i_current (app, form, draft);
CREATE INDEX orbeon_i_control_text_i1 ON orbeon_i_control_text (data_id);

View File

@ -0,0 +1,2 @@
Files overriding the default Orbeon directories

View File

@ -0,0 +1,25 @@
<!--
Copyright (C) 2008 Orbeon, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation; either version
2.1 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 Lesser General Public License for more details.
The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<!-- NOTE: In the future, we can use <xi:fallback> and remove this file. -->
<properties xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oxf="http://www.orbeon.com/oxf/processors">
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="postgresql"/>
<property
as="xs:boolean"
name="oxf.fr.persistence.exist.active"
value="false"/>
<property
as="xs:boolean"
name="oxf.fr.persistence.postgresql.create-flat-view"
value="true"/>
</properties>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/orbeon"
docBase="/usr/local/orbeon"
reloadable="false"
override="true"
allowLinking="true"
>
<Resource name="jdbc/postgresql" auth="Container" type="javax.sql.DataSource"
initialSize="3" maxActive="10" maxIdle="10" maxWait="30000"
driverClassName="org.postgresql.Driver"
poolPreparedStatements="true"
validationQuery="select 1"
testOnBorrow="true"
username="orbeon"
password="osuaL4Ru"
url="jdbc:postgresql://db:5432/orbeon?useUnicode=true&amp;characterEncoding=UTF8&amp;socketTimeout=30&amp;tcpKeepAlive=true"/>
</Context>