PostgreSQL Flat view

9 views
Skip to first unread message

ti...@nisula.org

unread,
Jan 31, 2020, 12:30:47 PM1/31/20
to Orbeon Forms
Hi,
I have installed Orbeon PE on self made docker container which contains tomcat (9.0.30), Orbeon 2019.2 PE and PostgreSQL JDBC drivers (42.2.9). In other docker container I have PostgreSQL 12.

I get it to work, but for some reason flat view not work properly, its add row to table but my own field is NULL?

I have following configs

/webapps/orbeon/META-INF/context.xml (I needed to replace docs config because it didn't work...)
<Context>


<Resource name="jdbc/postgresql" auth="Container"
         
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
         
url="jdbc:postgresql://db:5432/orbeon"
         
username="orbeon" password="passu" maxTotal="20" maxIdle="10"
     
maxWaitMillis="-1"/>

</Context>

/webapps/orbeon/WEB-INF/resources/config/properties-local.xml
<!-- Persistence (DB) -->
<property as="xs:boolean" name="oxf.fr.persistence.exist.active" value="false"/>
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*"  value="postgresql"/>
<property as="xs:boolean" name="oxf.fr.persistence.postgres.versioning" value="true"/>
<property as="xs:string" name="oxf.fr.persistence.*.data-format-version" value="2019.1.0"/>
<property as="xs:boolean" name="oxf.fr.persistence.postgresql.create-flat-view" value="true"/>

What I have missed?

BR,
Timo

Alessandro Vernet

unread,
Jan 31, 2020, 7:02:18 PM1/31/20
to orb...@googlegroups.com
Hi Timo,

Could you share with us the source of your form, so we can reproduce the
issue here? In Form Builder, you can go to the Advanced tab, Edit Source,
copy the source into a file, and attach that file. (And if this is larger
form, maybe you can create a minimal form, maybe even with just 1 field,
that reproduces this issue.)

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Timo Nisula

unread,
Feb 3, 2020, 1:34:58 AM2/3/20
to Orbeon Forms
Hi,

Sorry for delay. Here is source as attachement. There is only one text field and and when saved  postgresql database table shows

-Timo
test1.xml

Alessandro Vernet

unread,
Feb 6, 2020, 9:17:05 PM2/6/20
to orb...@googlegroups.com
Hi Timo,

It is my turn to apologize for the delay! I still didn't get a chance to
look into this, but it's on my list. I'll follow-up here as soon as I know
more about is going on.

Timo Nisula

unread,
Feb 7, 2020, 1:46:52 AM2/7/20
to orb...@googlegroups.com
Hi Alex,

No hurry.  I'm busy with another project right now ☺

-Timo

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1581041824329-0.post%40n4.nabble.com.

Alessandro Vernet

unread,
Feb 20, 2020, 12:58:17 PM2/20/20
to orb...@googlegroups.com
Hi Timo,

I tried to reproduce this, but it worked for me. Here is what I tried:

1. I installed a verbatim Orbeon Forms CE 2019.2.
2. I setup a `<Resource name="jdbc/postgresql">` in Tomcat .
3. Used the `properties-local.xml` linked below.
4. Create a form `a/a` in Form Builder, add a field, just so we have at
least 2 fields (for some very extensive testing!), publish, open the `/new`
page for the form, enter a couple of values, saves.
5. Run `select * from orbeon_f_a_a` ⇒ I can see the data entered in step 4.

If you try to follow the above steps, are you also getting the same result?

properties-local.xml
<http://discuss.orbeon.com/file/t119778/properties-local.xml>

Timo Nisula

unread,
Feb 21, 2020, 2:38:30 AM2/21/20
to orb...@googlegroups.com
Hi Alex,

Thanks, I followed your steps and it works.

I also tested add versioning to properties file and it worked also.

But when I added new data format version, it won't work any more.
<property as="xs:string" name="oxf.fr.persistence.*.data-format-version" value="2019.1.0"/>

So the problem is when you have flat view enabled and data-format-version set to newest "2019.0.1" it doesn't save values to database (though it creates table columns). Not sure is this case only with postgresql, not tested other DB's.

BR,
Timo


--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.

Alessandro Vernet

unread,
Feb 21, 2020, 4:54:20 PM2/21/20
to orb...@googlegroups.com
Hi Timo,

Ah, yes, indeed, flat views won't work if you're not using the default data
format in your database. We should remove that restriction, and I looked
into it, but unfortunately the change isn't trivial. So, for now I've
created issue #4440, and made this clear in limitation section of the Flat
view documentation.

https://github.com/orbeon/orbeon-forms/issues/4440
https://doc.orbeon.com/form-runner/persistence/flat-view

Timo Nisula

unread,
Feb 24, 2020, 2:42:06 AM2/24/20
to orb...@googlegroups.com
Hi Alex,

Thank you. So use default data format for time being :)

-Timo

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.

Alessandro Vernet

unread,
Feb 25, 2020, 2:03:15 PM2/25/20
to orb...@googlegroups.com
Ok Timo, and I'm at least glad you're able to change the data format at the
database level.
Reply all
Reply to author
Forward
0 new messages