online-glom:gwt-glom.git
9 years agoEclipse project files: Use JDK 1.7 instead of JDK 1.6.
Murray Cumming [Fri, 9 Nov 2012 20:53:46 +0000 (21:53 +0100)]
Eclipse project files: Use JDK 1.7 instead of JDK 1.6.

        * .classpath:
        * .settings/org.eclipse.jdt.core.prefs: By changing the Eclipse
Java Compiler and Java Build path settings in the UI.

9 years agoDetails: Show images.
Murray Cumming [Mon, 23 Jul 2012 18:45:09 +0000 (20:45 +0200)]
Details: Show images.

        * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Move some code into
        * src/main/java/org/glom/web/server/ConfiguredDocumentSet.java:
so it can be used in:
        * src/main/java/org/glom/web/server/OnlineGlomImages.java: A new servlet just
for serving image data.
* src/main/webapp/WEB-INF/web.xml: Mention the new servlet.

* src/main/java/org/glom/web/shared/DataItem.java: Added get/setImageDataUrl().
        * src/main/java/org/glom/web/client/ui/details/DetailsCell.java:
setData(): For image field types, add a GWT Image widget,
with the URL that was set in the DataItem.

        * pom.xml: Depend on org.apache.httpcomponents for UriBuilder.
        * src/main/java/org/glom/web/server/database/DBAccess.java:
        convertResultSetToDTO(): Set the URL for image data, so the client browser
can retrieve the image from our new servlet. This uses UriBuilder.
Move getPrimaryKeyField to:
 * src/main/java/org/glom/web/server/libglom/Document.java:
Added getTablePrimaryKeyField().

        * src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
        * src/main/java/org/glom/web/server/database/ListDBAccess.java:
        * src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
        Adapted.

9 years agoAttempting to use base64 data URL for images.
Murray Cumming [Sun, 22 Jul 2012 19:29:08 +0000 (21:29 +0200)]
Attempting to use base64 data URL for images.

9 years agoUse the latest (now stable) version of GWT.
Murray Cumming [Fri, 9 Nov 2012 12:06:22 +0000 (13:06 +0100)]
Use the latest (now stable) version of GWT.

* pom.xml: And the latest version of the gwt-maven-plugin.

9 years agoAdded an Indonesian translation.
Murray Cumming [Thu, 8 Nov 2012 08:38:55 +0000 (09:38 +0100)]
Added an Indonesian translation.

* src/main/java/org/glom/web/OnlineGlom.gwt.xml:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_id.properties:
This is from the new translation in Glom.

9 years agoRename the servlet.
Murray Cumming [Sun, 22 Jul 2012 19:44:32 +0000 (21:44 +0200)]
Rename the servlet.

        * src/main/java/org/glom/web/OnlineGlom.gwt.xml:
        * src/main/java/org/glom/web/client/OnlineGlomService.java:
        * src/main/webapp/WEB-INF/web.xml: Change the servlet-name from libGlom
to gwtGlom, which is more appropriate.
This servlet name does not seem to be visible to the client side anyway.

9 years agoTests: Make the imports of assert*() consistent.
Murray Cumming [Sun, 22 Jul 2012 13:48:35 +0000 (15:48 +0200)]
Tests: Make the imports of assert*() consistent.

        * src/test/java/org/glom/web/client/GwtTestOnlineGlom.java:
        * src/test/java/org/glom/web/client/place/DetailsPlaceTest.java:
        * src/test/java/org/glom/web/client/place/ListPlaceTest.java:
        * src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
        * src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
        * src/test/java/org/glom/web/server/SelfHostExampleTest.java:
        * src/test/java/org/glom/web/server/libglom/DocumentTest.java:
        * src/test/java/org/glom/web/server/libglom/LayoutItemFieldTest.java:
        * src/test/java/org/glom/web/server/libglom/LayoutItemPortalDeepCloneTest.java:
        * src/test/java/org/glom/web/shared/DataItemTest.java:
Just do
import static org.junit.Assert.*;
which seems fairly common.

9 years ago1.21.10 1.21.10
Murray Cumming [Sun, 22 Jul 2012 11:12:41 +0000 (13:12 +0200)]
1.21.10

9 years agoRemove unused imports
Murray Cumming [Sat, 21 Jul 2012 22:56:34 +0000 (00:56 +0200)]
Remove unused imports

9 years agoRevert "pom.xml: Use gwt 2.5.1-rc1"
Murray Cumming [Sat, 21 Jul 2012 22:43:51 +0000 (00:43 +0200)]
Revert "pom.xml: Use gwt 2.5.1-rc1"

This reverts commit 848566d9a871d709420ea7d17c8992b3a269dea8.

Using GWT 2.5.1-rc1 seems to cause a strange Java->Javascript
compiler error:
Unexpected exception while processing element 'inherits

9 years agoRemove an outdated FIXME comment
Murray Cumming [Sat, 21 Jul 2012 22:34:26 +0000 (00:34 +0200)]
Remove an outdated FIXME comment

9 years agotests: Move a test that needs a database connection.
Murray Cumming [Sat, 21 Jul 2012 22:33:51 +0000 (00:33 +0200)]
tests: Move a test that needs a database connection.

        * src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
Move testGetListViewLayoutGroup() to
        * src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
because it needs a database connection.

9 years agoAdd back @Override lines. From Eclipse cleanup.
Murray Cumming [Sat, 21 Jul 2012 19:19:38 +0000 (21:19 +0200)]
Add back @Override lines. From Eclipse cleanup.

9 years agotests: Use @BeforeClass on tearDown().
Murray Cumming [Sat, 21 Jul 2012 19:02:57 +0000 (21:02 +0200)]
tests: Use @BeforeClass on tearDown().

        * src/test/java/org/glom/web/server/OnlineGlomPropertiesTest.java:
        * src/test/java/org/glom/web/server/SelfHostExampleTest.java:
        This avoids leaking a postgres process in SelfHostExampleTest.

9 years agotests: Test translations moe.
Murray Cumming [Sat, 21 Jul 2012 16:33:40 +0000 (18:33 +0200)]
tests: Test translations moe.

        * src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
        * src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
       Test titles in the non-default locale.

9 years agotests: Add SelfHostConfiguredDocumentTest
Murray Cumming [Sat, 21 Jul 2012 15:28:58 +0000 (17:28 +0200)]
tests: Add SelfHostConfiguredDocumentTest

        * src/test/java/org/glom/web/server/SelfHoster.java: Add getters for the
username and password, for use by ConfiguredDocument.
        * src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
This tests some of the ConfiguredDocument API that requires a database connection.

9 years agoDocument: Load title translations and test them.
Murray Cumming [Sat, 21 Jul 2012 13:47:08 +0000 (15:47 +0200)]
Document: Load title translations and test them.

        * src/main/java/org/glom/web/server/libglom/Document.java: Load the translations
of titles. I am surprised that we do not do this yet.
        * src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
        * src/test/java/org/glom/web/server/libglom/DocumentTest.java:
Test translations more.

9 years agoSet JDBC timeouts.
Murray Cumming [Fri, 20 Jul 2012 19:58:09 +0000 (21:58 +0200)]
Set JDBC timeouts.

* src/main/java/org/glom/web/server/ConfiguredDocument.java:
* src/main/java/org/glom/web/server/database/ListDBAccess.java:
Set the timeout here too.

9 years agotests: ConfiguredDocumentTest: Make this pass.
Murray Cumming [Fri, 20 Jul 2012 19:51:17 +0000 (21:51 +0200)]
tests: ConfiguredDocumentTest: Make this pass.

* src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
Disable tests that need a database connection.

9 years agoUse Java 1.7 instead of Java 1.6.
Murray Cumming [Fri, 20 Jul 2012 18:31:51 +0000 (20:31 +0200)]
Use Java 1.7 instead of Java 1.6.

* pom.xml: Specify the 1.7 JDK, though I don't like how we seem to need
to do this twice, at least for Eclipse.
This seems OK because it is the current version.

9 years agoSome error checking.
Murray Cumming [Fri, 20 Jul 2012 17:01:58 +0000 (19:01 +0200)]
Some error checking.

* src/main/java/org/glom/web/server/Log.java: Avoid using null strings.
* src/main/java/org/glom/web/server/database/ListDBAccess.java:
Avoid using a null Connection.

9 years agotests: Add a ConfiguredDocument test.
Murray Cumming [Fri, 20 Jul 2012 17:00:57 +0000 (19:00 +0200)]
tests: Add a ConfiguredDocument test.

* src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
Add this test.

9 years agoUpdate a comment
Murray Cumming [Fri, 20 Jul 2012 16:16:54 +0000 (18:16 +0200)]
Update a comment

9 years agoLayoutItemFIeld: getName(): Use the Field if it is set.
Murray Cumming [Fri, 20 Jul 2012 16:11:58 +0000 (18:11 +0200)]
LayoutItemFIeld: getName(): Use the Field if it is set.

* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java:
getName(): If the full field details have been set, return its name, so that
callers do not need to set the name separately.
* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
testExampleMusiccollectionData): Do not use a TYPE_FORWARD_ONLY statement,
so we can count the rows.

9 years agotests: SelfHoster: Test SqlUtils too.
Murray Cumming [Fri, 20 Jul 2012 15:02:29 +0000 (17:02 +0200)]
tests: SelfHoster: Test SqlUtils too.

* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
Retrieve some data and check it too, as in the regular Glom
test_selfhosting_new_from_example.cc test.
* src/test/java/org/glom/web/server/SelfHoster.java:
createConnection(): Make this public.

9 years agotests: SelfHoster: createConnection(): Do not warn about expected failures.
Murray Cumming [Fri, 20 Jul 2012 14:05:41 +0000 (16:05 +0200)]
tests: SelfHoster: createConnection(): Do not warn about expected failures.

Let the caller say if the connection is expected to fail, to avoid
irrelevant error output.

9 years agotests: SelfHoster: createAndSelfHostNewEmpty(): Sleep after starting server.
Murray Cumming [Fri, 20 Jul 2012 14:04:35 +0000 (16:04 +0200)]
tests: SelfHoster: createAndSelfHostNewEmpty(): Sleep after starting server.

* src/test/java/org/glom/web/server/SelfHoster.java:
createAndSelfHostNewEmpty(): Sleep initially, to avoid distracting errors
due to the inevitable need to retry the connection while the database server
starts.

9 years agotests: SelfHoster: createConnection(): Set a timeout.
Murray Cumming [Fri, 20 Jul 2012 13:08:22 +0000 (15:08 +0200)]
tests: SelfHoster: createConnection(): Set a timeout.

* src/test/java/org/glom/web/server/SelfHoster.java:
createConnection(): Use setLoginTimeout() because it otherwise seems to take
ages to actually return when it fails.

9 years agotests: SelfHoster: selfHost(): Close the test connection.
Murray Cumming [Fri, 20 Jul 2012 13:06:35 +0000 (15:06 +0200)]
tests: SelfHoster: selfHost(): Close the test connection.

* src/test/java/org/glom/web/server/SelfHoster.java: selfHost():
When we check that the connection works, close the connection. This seems
to not be closed automatically otherwise.

9 years agoUse slf4j-simple to see JDBC errors.
Murray Cumming [Fri, 20 Jul 2012 13:04:35 +0000 (15:04 +0200)]
Use slf4j-simple to see JDBC errors.

* pom.xml: Depend on slf4j-simple so we can see errors from JDBC.

9 years agoSelfHoster.discoverFirstFreePort(): Close the socket.
Murray Cumming [Thu, 19 Jul 2012 17:56:31 +0000 (19:56 +0200)]
SelfHoster.discoverFirstFreePort(): Close the socket.

* src/test/java/org/glom/web/server/SelfHoster.java:
discoverFirstFreePort(): Close the socket. Eclipse Juno warns about this.

9 years agoAvoid another code warning in Eclipse Juno.
Murray Cumming [Thu, 19 Jul 2012 17:53:43 +0000 (19:53 +0200)]
Avoid another code warning in Eclipse Juno.

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Do instanceof checks on the FileUtils.listFiles() result and its
items.

9 years agoSome cleanup by Eclipse
Murray Cumming [Fri, 13 Jul 2012 10:02:52 +0000 (12:02 +0200)]
Some cleanup by Eclipse

9 years agopom.xml: Use gwt 2.5.1-rc1
Murray Cumming [Fri, 13 Jul 2012 09:55:19 +0000 (11:55 +0200)]
pom.xml: Use gwt 2.5.1-rc1

9 years agopom.xml: Increased gwt-test-utils version.
Murray Cumming [Fri, 13 Jul 2012 09:54:58 +0000 (11:54 +0200)]
pom.xml: Increased gwt-test-utils version.

9 years agoAvoid some code warnings in Eclipse Juno
Murray Cumming [Fri, 13 Jul 2012 09:02:47 +0000 (11:02 +0200)]
Avoid some code warnings in Eclipse Juno

* src/main/java/org/glom/web/server/libglom/Document.java:
getNodeTextChildAsValue(), setNodeTextChildAsValue(): Handle the invalid type.
* src/test/java/org/glom/web/server/SelfHoster.java
createTextFile(): Make sure that the FileOutputStream is closed.

10 years agoSlight variable rename
Murray Cumming [Tue, 26 Jun 2012 19:02:33 +0000 (21:02 +0200)]
Slight variable rename

10 years agoAdded OnlineGlomPropertiesTest.
Murray Cumming [Fri, 22 Jun 2012 11:42:51 +0000 (13:42 +0200)]
Added OnlineGlomPropertiesTest.

* src/main/java/org/glom/web/server/OnlineGlomProperties.java:
Make sure we never return a null string.
* src/test/java/org/glom/web/server/OnlineGlomPropertiesTest.java:
Added tests of the OnlineGlomProperties API, using our sample file.

10 years agoMake OnlineGlomProperties be a normal class.
Murray Cumming [Wed, 20 Jun 2012 08:18:31 +0000 (10:18 +0200)]
Make OnlineGlomProperties be a normal class.

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Move OnlineGlomProperties into its own file to be a regular class:
* src/main/java/org/glom/web/server/OnlineGlomProperties.java:
This makes testing simpler.

10 years agoOnlineGlomServiceImpl.init(): Move some code into a new method.
Murray Cumming [Fri, 15 Jun 2012 14:47:18 +0000 (16:47 +0200)]
OnlineGlomServiceImpl.init(): Move some code into a new method.

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Create addDocument().

10 years agoOnlineGlomServiceImpl.OnlineGlomProperties: Improve getKey().
Murray Cumming [Fri, 15 Jun 2012 14:40:35 +0000 (16:40 +0200)]
OnlineGlomServiceImpl.OnlineGlomProperties: Improve getKey().

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
OnlineGlomProperties.getKey(): Make this more robust by moving the
check for *.*.filename to here.

10 years agoOnlineGlomServiceImpl: Improve the OnlineGlomProperties class.
Murray Cumming [Fri, 15 Jun 2012 14:29:17 +0000 (16:29 +0200)]
OnlineGlomServiceImpl: Improve the OnlineGlomProperties class.

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java
init(): Move knowledge of the config file format into the
OnlineGlomProperties inner class.

10 years agoSelfHostExampleTest: Make sure we cleanup on failure.
Murray Cumming [Fri, 15 Jun 2012 13:34:38 +0000 (15:34 +0200)]
SelfHostExampleTest: Make sure we cleanup on failure.

* src/test/java/org/glom/web/server/SelfHostExampleTest.java: Move
the use of cleanup() to a tearDown() JUnit method.

10 years ago1.21.9.3 1.21.9.3
Murray Cumming [Tue, 12 Jun 2012 09:31:02 +0000 (11:31 +0200)]
1.21.9.3

10 years agoConfiguredDocument: Add a primary key to portals at least once.
Murray Cumming [Tue, 12 Jun 2012 08:49:54 +0000 (10:49 +0200)]
ConfiguredDocument: Add a primary key to portals at least once.

* src/main/java/org/glom/web/server/ConfiguredDocument.java
updatePortalsExtras): Fix a typo so that we add the primary key
column at least once.
This is a fix for the previous commit:
ConfiguredDocument: Do not add a primary key to portals each time.

10 years agoSelfHoster: Avoid some compiler warnings.
Murray Cumming [Fri, 8 Jun 2012 21:14:04 +0000 (23:14 +0200)]
SelfHoster: Avoid some compiler warnings.

* src/test/java/org/glom/web/server/SelfHoster.java
executeCommandLineAndWait():
executeCommandLineAndWaitUntilSecondCommandReturnsSuccess(): Comment out
the now-unused streams for stdout and stderr from the command Processes.
These are not used because readln() hangs while waiting for a new line,
where there may be no next line. The commented out code is still there
to help us figure out how to do this properly.

10 years agoLayoutItemPortalDeepCloneTest: Test something to avoid warnings.
Murray Cumming [Fri, 8 Jun 2012 21:09:21 +0000 (23:09 +0200)]
LayoutItemPortalDeepCloneTest: Test something to avoid warnings.

* src/test/java/org/glom/web/server/libglom/LayoutItemPortalDeepCloneTest.java:
Make this actually test the cloning again, though it is not very useful
now that we do not use the part that had a problem with cloning before.

10 years agoFormatting by Eclipse
Murray Cumming [Fri, 8 Jun 2012 20:52:56 +0000 (22:52 +0200)]
Formatting by Eclipse

10 years agoSelfHoster: Keep trying pg_ctl after starting postgres.
Murray Cumming [Fri, 8 Jun 2012 20:51:11 +0000 (22:51 +0200)]
SelfHoster: Keep trying pg_ctl after starting postgres.

* src/test/java/org/glom/web/server/SelfHoster.java
executeCommandLineAndWaitUntilSecondCommandReturnsSuccess():
Try pg_ctl repeatedly (for ever) until it succeeds, as we do in
regular Glom. This seems mad but it seems to work because the first
command would fail if pg_ctl would eventually fail.

10 years agoSelfHoster: Wait until the server is really ready.
Murray Cumming [Fri, 8 Jun 2012 15:43:57 +0000 (17:43 +0200)]
SelfHoster: Wait until the server is really ready.

* src/test/java/org/glom/web/server/SelfHoster.java
selfHost(): Attempt the connection after starting the server, retrying
a few times if necessary, so that the server is really ready already when
we return from this method.
The regular Glom code does this too because pg_ctl reports success too soon.

10 years agoConfiguredDocument: Do not add a primary key to portals each time.
Murray Cumming [Fri, 8 Jun 2012 14:21:41 +0000 (16:21 +0200)]
ConfiguredDocument: Do not add a primary key to portals each time.

* src/main/java/org/glom/web/server/ConfiguredDocument.java
updatePortalsExtras(): Only add an extra primary key field if there is
none, to avoid adding one each time we retrieve the details layout from the
layouts cache.
This should fix bug #676986 (Ben Konrath)

10 years agoImprove ChangeLog entry.
Murray Cumming [Fri, 25 May 2012 12:17:06 +0000 (14:17 +0200)]
Improve ChangeLog entry.

10 years agoDocument.load(): Support version 7 documents.
Murray Cumming [Fri, 25 May 2012 12:15:24 +0000 (14:15 +0200)]
Document.load(): Support version 7 documents.

* src/main/java/org/glom/web/server/libglom/Document.java: Load the
database_title attribute if the title attribute is not there.

10 years agoEclipse cleanup of pom.xml
Murray Cumming [Thu, 24 May 2012 17:54:02 +0000 (19:54 +0200)]
Eclipse cleanup of pom.xml

10 years agoAdd configuration for auto-generating mvn:i18n from with Eclipse.
Ben Konrath [Thu, 24 May 2012 13:42:38 +0000 (15:42 +0200)]
Add configuration for auto-generating mvn:i18n from with Eclipse.

* pom.xml: Add PluginExecution configuration for gwt-maven-plugin.

10 years agoUpdate translations, adding French.
Murray Cumming [Thu, 24 May 2012 12:04:29 +0000 (14:04 +0200)]
Update translations, adding French.

* src/main/java/org/glom/web/OnlineGlom.gwt.xml:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_fr.properties:
Add a French translation, using the translation from Glom.

* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_cs.properties:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_es.properties:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_sl.properties:
Update these based on the translations from Glom.

10 years agoSelfHoster: Add some debug println messages to help when things fail.
Murray Cumming [Thu, 24 May 2012 09:29:19 +0000 (11:29 +0200)]
SelfHoster: Add some debug println messages to help when things fail.

* src/test/java/org/glom/web/server/SelfHoster.java: Add several
System.out.println() lines.

10 years agoTests: SelfHoster: Check other paths for PostgreSQL command-line tools.
Murray Cumming [Wed, 23 May 2012 10:46:58 +0000 (12:46 +0200)]
Tests: SelfHoster: Check other paths for PostgreSQL command-line tools.

* src/test/java/org/glom/web/server/SelfHoster.java:
getPathToPostgresExecutable(): Try some common paths (as on Ubuntu, for
instance) instead of just /usr/bin (as on Fedora). Check the result when
using this method.

10 years agoRemove LayoutItemPortal.get/setNavigationTable().
Murray Cumming [Wed, 23 May 2012 07:08:12 +0000 (09:08 +0200)]
Remove LayoutItemPortal.get/setNavigationTable().

* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemPortal.java:
Remove get/setNavigationTable(), which is only a cache, because it is not
used, and does not need to be used, because that decision should be made on
the server.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
updatePortalsExtras():
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
getNavigationRecord():
* src/test/java/org/glom/web/server/libglom/LayoutItemPortalDeepCloneTest.java:
Adapted.

10 years agoSome final keywords, by Eclipse
Murray Cumming [Mon, 21 May 2012 18:05:53 +0000 (20:05 +0200)]
Some final keywords, by Eclipse

10 years agoInitial self-hosting for tests.
Murray Cumming [Mon, 21 May 2012 18:02:45 +0000 (20:02 +0200)]
Initial self-hosting for tests.

* pom.xml: Change the scope for log4j, to hopefully make it
available to the test code which uses it indirectly via jOOQ.
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Allow
self-hosting, though we only use it for testing.

* src/main/java/org/glom/web/server/libglom/Document.java:
example rows: Use a map instead of a list for each row of values,
so we know what field they are for, instead of relying on the sequence
being correct. This is not very efficient, but it does not really need
to be.
* src/test/java/org/glom/web/server/libglom/DocumentTest.java
testReadTableExampleRows(): Adapted.

* src/main/java/org/glom/web/shared/DataItem.java: Added getValue()
that returns an Object, for generic use. Note that Object seems to be
the implicit base even of double.
* src/main/java/org/glom/web/shared/libglom/Field.java: Add getSqlType(),
for use in CREATE TABLE SQL queries.
* src/test/java/org/glom/web/server/SelfHoster.java: Add this class
to do self-hosting of PostgreSQL databases via its command-line
utilities, based on Glom's C++ code in test_selfhosting_utils.cc and
backends/postgres_self.cc. This is incomplete - it needs more
warnings about failures and it needs to clean up properly when things
fail.
* src/test/java/org/glom/web/server/SelfHostExampleTest.java: A simple
test of this new class.

10 years agoDocument: loading example data: Handle exceptions.
Murray Cumming [Mon, 21 May 2012 10:48:29 +0000 (12:48 +0200)]
Document: loading example data: Handle exceptions.

* src/main/java/org/glom/web/server/libglom/Document.java:
DateFormat.parse() and Double.valueOf() can throw exceptions, though
Eclipse did not warn about that.

10 years agoDocument: load(), save(): Handle the example rows.
Murray Cumming [Sun, 20 May 2012 20:58:11 +0000 (22:58 +0200)]
Document: load(), save(): Handle the example rows.

* src/main/java/org/glom/web/shared/DataItem.java: Add get/setDate()
and get/setImage().
* src/main/java/org/glom/web/server/libglom/Document.java:
load(), save(): Load and save the example rows, though the date, time
and image types are not handled properly yet.
* src/test/java/org/glom/web/server/libglom/DocumentTest.java:
Add testReadTableExampleRows() just to check that something is read.

10 years agoDocument: Add save().
Murray Cumming [Sun, 20 May 2012 12:10:14 +0000 (14:10 +0200)]
Document: Add save().

* src/main/java/org/glom/web/shared/libglom/Translatable.java:
Added getTranslationsMap() for use while saving.
* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java:
Adedd getUseDefaultFormatting() for use while saving.
* src/main/java/org/glom/web/server/libglom/Document.java: Added save()
and several private methods that it uses.

This will be useful while testing via self-hosting.
It is not complete, but should be complete enough for testing.

10 years agoAdded a TODO.
Murray Cumming [Thu, 17 May 2012 14:19:10 +0000 (16:19 +0200)]
Added a TODO.

10 years agoSome member sorting by Eclipse
Murray Cumming [Thu, 17 May 2012 13:50:33 +0000 (15:50 +0200)]
Some member sorting by Eclipse

10 years agoOnlineGlomService: Simplify the getList/RelatedViewData() methods.
Murray Cumming [Thu, 17 May 2012 13:46:52 +0000 (15:46 +0200)]
OnlineGlomService: Simplify the getList/RelatedViewData() methods.

* src/main/java/org/glom/web/client/OnlineGlomService.java
* src/main/java/org/glom/web/client/OnlineGlomServiceAsync.java
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java
Remove getSortedListViewData() and getSortedRelatedListData(), adding
the sort column index and ascending bool to the regular method.
Instead, a sort column index of -1 now means no sort.
This is less explicit, but it's fairly simple, reduces the amount of
code, and makes the OnlineGlomService API slightly smaller.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
getDataProvider():
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
getListViewData(), getRelatedListData():
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
getListViewData(), getRelatedListData():
* src/main/java/org/glom/web/server/database/ListDBAccess.java:
getListData():
* src/main/java/org/glom/web/server/database/ListViewDBAccess.java:
getData():
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
getData(): Adapted.

10 years agoRemove final again from where it breaks GWT serialization.
Murray Cumming [Thu, 17 May 2012 13:02:59 +0000 (15:02 +0200)]
Remove final again from where it breaks GWT serialization.

10 years agoCleanup by Eclipse: Add final keywords.
Murray Cumming [Thu, 17 May 2012 11:15:38 +0000 (13:15 +0200)]
Cleanup by Eclipse: Add final keywords.

10 years agoCleanup by Eclipse: Add parentheses.
Murray Cumming [Thu, 17 May 2012 11:11:34 +0000 (13:11 +0200)]
Cleanup by Eclipse: Add parentheses.

10 years agoSome cleanup by Eclipse
Murray Cumming [Thu, 17 May 2012 11:08:10 +0000 (13:08 +0200)]
Some cleanup by Eclipse

10 years agoSome reformatting by Eclipse
Murray Cumming [Thu, 17 May 2012 11:03:27 +0000 (13:03 +0200)]
Some reformatting by Eclipse

10 years ago1.21.9.2 1.21.9.2
Murray Cumming [Wed, 16 May 2012 09:11:18 +0000 (11:11 +0200)]
1.21.9.2

10 years agoUse translations for top-level groups too.
Murray Cumming [Wed, 16 May 2012 09:01:19 +0000 (11:01 +0200)]
Use translations for top-level groups too.

* src/main/java/org/glom/web/server/ConfiguredDocument.java:
updateTitlesForLocale(): Use the translation for the group
as well as for child items.

10 years ago1.21.9.1 1.21.9.1
Murray Cumming [Wed, 16 May 2012 08:06:31 +0000 (10:06 +0200)]
1.21.9.1

10 years agoMark 1.21.9 in the ChangeLog 1.21.9
Murray Cumming [Tue, 15 May 2012 12:43:38 +0000 (14:43 +0200)]
Mark 1.21.9 in the ChangeLog

10 years ago1.21.9
Murray Cumming [Tue, 15 May 2012 12:43:07 +0000 (14:43 +0200)]
1.21.9

10 years agoCorrections to navigation to related records.
Murray Cumming [Tue, 15 May 2012 11:20:21 +0000 (13:20 +0200)]
Corrections to navigation to related records.

* src/main/java/org/glom/web/client/OnlineGlomService.java:
* src/main/java/org/glom/web/client/OnlineGlomServiceAsync.java:
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
getRelatedListData(), getSortedRelatedListData)(), getRelatedListRowCount(),
getSuitableRecordToViewDetails(): Take a LayoutItemPortal instead of a
relationship name, because the relationship name is not necessarily unique
on the layout.
TOOD: This is inefficient, because it passes the whole list of
child field items back to the server, but it is more correct, and happens
to fix a bug with the primary key being lost after a few navigations.
There is probably a chance to make this more efficient anyway in some
more basic way.

* src/main/java/org/glom/web/client/activity/DetailsActivity.java
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.jav
* src/main/java/org/glom/web/server/ConfiguredDocument.java
* src/main/java/org/glom/web/server/database/DBAccess.java
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Adapted.

10 years agoFix the use of translations.
Murray Cumming [Tue, 15 May 2012 10:23:37 +0000 (12:23 +0200)]
Fix the use of translations.

* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Add updateTitlesForLocale().
getValidListViewLayoutGroup(), getDetailsLayoutGroup():
Call it to discard unwanted translations and to make getTitle() return
the wanted translation wihout the need for the client code to specify a locale.
* src/main/java/org/glom/web/shared/libglom/Translatable.java:
getTitle(): Fallback to the original title, as libglom does.

10 years agoDocument: Correctly report the number of available translation locales.
Murray Cumming [Tue, 15 May 2012 09:15:08 +0000 (11:15 +0200)]
Document: Correctly report the number of available translation locales.

* src/main/java/org/glom/web/server/libglom/Document.java: Fill
the available locale IDs list.
* src/test/java/org/glom/web/server/libglom/DocumentTest.java:
testLocales: Test this.

10 years agoSqlUtils: Use camelCase. nonative
Murray Cumming [Tue, 15 May 2012 08:22:37 +0000 (10:22 +0200)]
SqlUtils: Use camelCase.

* src/main/java/org/glom/web/server/SqlUtils.java: Use camelCase.
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
* src/main/java/org/glom/web/server/database/ListViewDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
* src/main/java/org/glom/web/server/ReportGenerator.java: Adapt.

10 years agoUse jOOQ's tableByName() and fieldByName.
Murray Cumming [Tue, 15 May 2012 08:11:17 +0000 (10:11 +0200)]
Use jOOQ's tableByName() and fieldByName.

* pom.xml: Use jOOQ 2.3.1 to get the new API.
* src/main/java/org/glom/web/server/SqlUtils.java:
build_sql_select_step_with_where_clause(), .createField(),
builder_add_join(): Use Factory.tableByName() and Factory.fieldByName()
so we can get correct quoting and escaping. Thanks to Lukas Eder for
adding this, and other things, to jOOQ.

10 years agoSqlUtils: Remove the Connection parameters.
Murray Cumming [Tue, 15 May 2012 07:27:08 +0000 (09:27 +0200)]
SqlUtils: Remove the Connection parameters.

* src/main/java/org/glom/web/server/SqlUtils.java:
build_sql_select_with_key(), build_sql_select_with_where_clause(),
createSelect(), build_sql_select_step_with_where_clause(),
build_sql_count_select_with_where_clause(),
build_sql_select_count_rows(): Remove the Connection parameter because
jOOQ does not actually need a connectionwhen it is just used to build
a SQL string:
https://groups.google.com/forum/#!topic/jooq-user/tIwobFOR2iM

* src/main/java/org/glom/web/server/ReportGenerator.java:
generateReport():
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
getData():
* src/main/java/org/glom/web/server/database/ListDBAccess.java:
Constructor, getListData(), getResultSizeOfSQLQuery():
* src/main/java/org/glom/web/server/database/ListViewDBAccess.java:
getSelectQuery(), getCountQuery():
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
getSelectQuery(), getCountQuery():
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
getNavigationRecord(): Adapted.

10 years agoFix quick find.
Murray Cumming [Mon, 14 May 2012 07:32:26 +0000 (09:32 +0200)]
Fix quick find.

* src/main/java/org/glom/web/server/SqlUtils.java:
get_find_where_clause_quick(): Use a comparison of
lowercase values, instead of a simple equals. Regular Glom
uses the PostgreSQL ILIKE operator but jOOQ does not
support that just yet, though it will soon.

10 years agoTableToViewDetails: Use a real serialization ID.
Murray Cumming [Mon, 14 May 2012 07:05:01 +0000 (09:05 +0200)]
TableToViewDetails: Use a real serialization ID.

* src/main/java/org/glom/web/shared/libglom/layout/TableToViewDetails.java:
Though this does not fix the serialization problem.

10 years agoAdded LayoutItemPortalDeepCloneTest
Murray Cumming [Sat, 12 May 2012 19:24:26 +0000 (21:24 +0200)]
Added LayoutItemPortalDeepCloneTest

10 years agoAdded missing TableToViewDetails.java file.
Murray Cumming [Fri, 11 May 2012 15:14:10 +0000 (17:14 +0200)]
Added missing TableToViewDetails.java file.

10 years agoReplace all appearances of Colour with color.
Murray Cumming [Wed, 9 May 2012 07:34:43 +0000 (09:34 +0200)]
Replace all appearances of Colour with color.

Because US English is dominant.

10 years agoUse colors in HTML format, solving a warning about an unused function.
Murray Cumming [Wed, 9 May 2012 07:32:48 +0000 (09:32 +0200)]
Use colors in HTML format, solving a warning about an unused function.

* src/main/java/org/glom/web/shared/libglom/NumericFormat.java
* src/main/java/org/glom/web/shared/libglom/layout/Formatting.java:
Add *asHTMLColor() versions of methods.
TODO: However, we should create and cache the results on the server.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java
* src/main/java/org/glom/web/client/ui/list/ListTable.java
* src/main/java/org/glom/web/server/ConfiguredDocument.java
* src/test/java/org/glom/web/server/libglom/DocumentTest.java:
Use the asHTMLcolor() versions.

10 years agoListViewTable: Constructor: Take the table name as a parameter.
Murray Cumming [Wed, 9 May 2012 07:14:52 +0000 (09:14 +0200)]
ListViewTable: Constructor: Take the table name as a parameter.

* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
Constructor: Take the tableName, and set the member variable, because
we use it here.
* src/main/java/org/glom/web/client/ui/ListViewImpl.java:
setCellTable(): Pass the table name.
This makes navigation to non-default tables work again. I don't know
why it worked before in the master branch.

10 years agoMake navigation work again.
Murray Cumming [Fri, 11 May 2012 11:56:30 +0000 (13:56 +0200)]
Make navigation work again.

* src/main/java/org/glom/web/server/libglom/Document.java:
Add getLayoutItemFieldShouldHaveNavigation().
* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java:
Replace get/setAddNavigation() with the partly-existing
get/setNavigationTableName(), with an empty string being no navigation,
because this is simpler. Use the new
Document.getLayoutItemFieldShouldHaveNavigation() method to set this.

* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Add updateFieldsExtras() and call setNavigationTableName in it.
getDetailsLayoutGroup(),
* src/main/java/org/glom/web/client/activity/DetailsActivity.java
createLayout(): Adapted.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java
Constructor: Adapted.

* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemPortal.java:
Replace get/setAddNavigation() with get/setNavigation(), returning a
TableToViewDetails class with both the table name and UsesRelationship,
because both are need. The previous code used java-libglom's output
variable (strangely, via sharedptr) to return both, but we cannot really
do that in Java.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
getNavigationRecord(): Adapt. However, we cannot actually use the cache
here because it somehow gets set to null during deepCopy(). I must test this.
* src/test/java/org/glom/web/server/libglom/DocumentTest.java
testGetSuitableTableToViewDetails(): Adapted.

TODO: Find out why deepClone() is not quite working.

10 years agoDBAccess: Simplify the retrievel of full field details.
Murray Cumming [Fri, 11 May 2012 11:52:11 +0000 (13:52 +0200)]
DBAccess: Simplify the retrievel of full field details.

* src/main/java/org/glom/web/server/database/DBAccess.java
getFieldsToShowForSQLQueryAddGroup(). This might be unnecessary anyway,
because the Document loading should have done this.

10 years agoSome unimportant code formatting/comments/logging.
Murray Cumming [Fri, 11 May 2012 11:36:44 +0000 (13:36 +0200)]
Some unimportant code formatting/comments/logging.

10 years agoDocument: Correct loading of doubly-related layout fields.
Murray Cumming [Fri, 11 May 2012 11:34:16 +0000 (13:34 +0200)]
Document: Correct loading of doubly-related layout fields.

* src/main/java/org/glom/web/server/libglom/Document.java:
loadUsesRelationship(): Actually set the related relationship, instead
of only setting it if it's not found.

10 years agoConfiguredDocument: Restore correct addition of hidden primary key items.
Murray Cumming [Mon, 7 May 2012 21:27:38 +0000 (23:27 +0200)]
ConfiguredDocument: Restore correct addition of hidden primary key items.

* src/main/java/org/glom/web/client/ui/list/ListTable.java
(ListTable.createCellTable): Uncomment out the check for the hidden
primary key.
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Only
add primary key items for top-level lists and portals, as before,
instead of adding them to each group.
* src/main/java/org/glom/web/shared/libglom/layout/LayoutGroup.java:
Actually implement the extra methods such as setHiddenPrimaryKey() and
comment that these are used only for top-level list groups and in portals.
This strangeness suggests even more that this should not be squeezed
into the LayoutGroup class.

10 years agoFix Formatting loading.
Murray Cumming [Mon, 7 May 2012 18:38:12 +0000 (20:38 +0200)]
Fix Formatting loading.

* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java:
getFormattingUsed(): Remove the duplicate Formatting member variable
in favour of the one from the base class.
* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemWithFormatting.java:
Initialize a new Formatting instead of using null by default, so we
have some defaults, instead of having to initialize one later just to
get the same defaults. This also makes loading of formatting from the
document work, because that expected a non-null.

10 years agoRelatedListTable: Make sure that the tableName is set.
Murray Cumming [Mon, 7 May 2012 10:17:22 +0000 (12:17 +0200)]
RelatedListTable: Make sure that the tableName is set.

* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
Constructor: Take the tableName so it is available later. Otherwise,
the server assumes that we mean the default table and cannot find the
relationship in it.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java
setData(): Pass the tableName to the RelatedListTable constructor.

10 years agoFix portal navigation via the Details button.
Murray Cumming [Mon, 7 May 2012 10:08:18 +0000 (12:08 +0200)]
Fix portal navigation via the Details button.

* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Add some checks for empty relationship names, and comments that an empty
table name is OK, because it is later interpreted as the default table.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
getNavigationRecord(): Uncomment and correct the code that decides what
table to navigate to.

10 years agoAdd some checks.
Murray Cumming [Mon, 7 May 2012 09:28:07 +0000 (11:28 +0200)]
Add some checks.

* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
RelatedListNavigationButtonCell.onEnterKeyDown(), setData():
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
getDataProvider():
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
addColumn():
* src/main/java/org/glom/web/server/database/DBAccess.java:
convertResultSetToDTO(), getPortal():
* src/main/java/org/glom/web/server/database/ListDBAccess.java
getListData():
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
Add checks for null objects and out of range access, with log messages to
give hints so we can fix these properly.

10 years agoPortals: some corrections.
Murray Cumming [Mon, 7 May 2012 09:25:04 +0000 (11:25 +0200)]
Portals: some corrections.

* src/main/java/org/glom/web/client/activity/DetailsActivity.java
setData():
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
constructor: Use getRelationshipNameUsed() instead of getName(), because
that is what is meant.
* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemPortal.java:
getFromField(): Fix a typo, to get the field name, not the table name.
* src/main/java/org/glom/web/server/database/DBAccess.java:
getPortal(): Fix a typo that stopped this from working.