10 years agoAdd client-side tests for StringUtils and Utils.
Murray Cumming [Tue, 4 Dec 2012 20:32:04 +0000 (21:32 +0100)]
Add client-side tests for StringUtils and Utils.

        * src/test/java/org/glom/web/client/ Added.
        * src/test/java/org/glom/web/client/ Added.
This is mostly just to catch java->javascript compilation problems.

10 years agotests: Add client-side test for StringUtils.
Murray Cumming [Tue, 4 Dec 2012 05:30:55 +0000 (06:30 +0100)]
tests: Add client-side test for StringUtils.

10 years agoAdd GwtTestReportPlace.
Murray Cumming [Sun, 2 Dec 2012 21:53:36 +0000 (22:53 +0100)]
Add GwtTestReportPlace.

        * src/test/java/org/glom/web/client/place/
This is like the existing GwtTest*Place tests.
It would be nice if we could just test that all client and shared
code can be compiled to Javascript without creating a test for it.
Currently, we only discover problems when starting it in a browser.

10 years agoAdd GwtTestDetailsPlace to test the same code as client-side.
Murray Cumming [Sun, 2 Dec 2012 21:44:31 +0000 (22:44 +0100)]
Add GwtTestDetailsPlace to test the same code as client-side.

        * src/test/java/org/glom/web/client/place/
See the comment about the awkward client-side-only Date API.
Ignoring this Date API issue, it would be nice if we could test
the same code as both Java (server) and generated Javascript (client)
without duplicating most of the test code.

10 years agoAdd GwtTestDetailsPlace to test the same code as client-side.
Murray Cumming [Sun, 2 Dec 2012 21:44:31 +0000 (22:44 +0100)]
Add GwtTestDetailsPlace to test the same code as client-side.

        * src/test/java/org/glom/web/client/place/
See the comment about the awkward client-side-only Date API.
Ignoring this Date API issue, it would be nice if we could test
the same code as both Java (server) and generated Javascript (client)
without duplicating most of the test code.

10 years agoDataItemTest: Test the date type too, and improve the asserts.
Murray Cumming [Sun, 2 Dec 2012 21:42:57 +0000 (22:42 +0100)]
DataItemTest: Test the date type too, and improve the asserts.

        * src/test/java/org/glom/web/shared/
Add testdate(). See the comment about the awkward server-side-only
Date API.

10 years agoDetailsPlace: Use a date-formatting API available in GWT client code.
Murray Cumming [Sun, 2 Dec 2012 21:28:01 +0000 (22:28 +0100)]
DetailsPlace: Use a date-formatting API available in GWT client code.

        * src/main/java/org/glom/web/client/place/
        getStringForData(): Use DateTimeFormat.getFormat(), because that works
on the client side (but not the server side) instead of String.format()
with Date.getYear()/getMonth()/getDate(), because they work only on the
server side (but not on the client side). Rather annoying.
        * src/test/java/org/glom/web/client/place/ Rename to
        * src/test/java/org/glom/web/client/place/ Rename to
GwtTestListPlaceTest, so we can run these as client-side (generated
Javascript) code so we can catch these problems sooner.
It is unfortunate that the code cannot run on the server-side as Java,
but it does not need to.

10 years agoIn the UI, allow primary keys to be any type, and test it.
Murray Cumming [Sun, 2 Dec 2012 20:52:07 +0000 (21:52 +0100)]
In the UI, allow primary keys to be any type, and test it.

* src/main/java/org/glom/web/shared/
        Added isUnknownType() for convenience.
        * src/main/java/org/glom/web/client/place/
        getToken(): Move some code into getStringForData() and handle
other data types.
        * src/main/java/org/glom/web/server/
        Added transformUnknownToActualType(), to parse the unknown string
as a particular type of data. This should correspond with
getStringForData() above.
        * src/main/java/org/glom/web/server/
Add setDataItemType() to set the type of data for primary
        getDetailsData(), getSuitableRecordToViewDetails():
Call it, to have the correctly-typed primary key value.
We do it here, on the server, instead of before, because it
is only here that we can know the field type that is in the
        * src/test/java/org/glom/web/client/place/
        Added testGetPlaceParametersNumericPrimaryKey(),
testGetPlaceParametersBooleanPrimaryKey() and

10 years agoAllow primary keys to be any type, and test it.
Murray Cumming [Fri, 30 Nov 2012 20:41:45 +0000 (21:41 +0100)]
Allow primary keys to be any type, and test it.

        * src/main/java/org/glom/web/shared/
Add overrides for the other set*() methods, to set the type.
        Added getValue() which returns a generic Object.
* src/main/java/org/glom/web/server/
buildSimpleWhereExpression(): Use TypedDataItem.getValue() instead of
        * src/test/java/org/glom/web/server/
Added this test, which is much like SelfHostExampleTest, but which uses this
test file, take from Glom:
        * src/test/resources/org/glom/web/server/test_example_music_collection_text_pk_fields.glom:
which has all the primary keys changes to text instead of numbers.

However, parts of the UI code still assume that primary keys are numbers.

10 years agoAdd missing file.
Murray Cumming [Wed, 28 Nov 2012 22:24:10 +0000 (23:24 +0100)]
Add missing file.

10 years agoSelfHostExampleTest: Move some checks into a utility function.
Murray Cumming [Wed, 28 Nov 2012 08:15:08 +0000 (09:15 +0100)]
SelfHostExampleTest: Move some checks into a utility function.

        * src/test/java/org/glom/web/server/
        Move the data checks into a new file:
* src/test/java/org/glom/web/server/ so we can use it in some other
tests, with different documents.

10 years agoSelfHosting test: Also try using a relationship.
Murray Cumming [Wed, 28 Nov 2012 08:06:42 +0000 (09:06 +0100)]
SelfHosting test: Also try using a relationship.

        * src/main/java/org/glom/web/server/database/
        convertResultSetToDTO(): Move some code into a public
method as:
        * src/main/java/org/glom/web/server/
        fillDataItemFromResultSet(): This takes a DataItem and
sets it from a value from a datbase recordset.
        * src/main/java/org/glom/web/server/libglom/
Make getDocument() public, so we can use it in a test.
        * src/test/java/org/glom/web/server/
Add testExampleMusiccollectionDataRelated() and call it from
        testExampleMusiccollectionData(), to do a basic test of using
a relationship.

10 years agoBuild: Specify the source encoding.
Murray Cumming [Thu, 22 Nov 2012 10:05:26 +0000 (11:05 +0100)]
Build: Specify the source encoding.

        * pom.xml: Set
This should fix this build problem on some systems:
[ERROR] /var/lib/jenkins/workspace/OnlineGlom/src/test/java/org/glom/web/server/libglom/[139,72] error: unmappable character for encoding ASCII

10 years ago1.23.1 1.23.1
Murray Cumming [Tue, 20 Nov 2012 22:12:59 +0000 (23:12 +0100)]

10 years agoUpdate the jasperreports version.
Murray Cumming [Tue, 20 Nov 2012 21:05:48 +0000 (22:05 +0100)]
Update the jasperreports version.

        * pom.xml: This was shown by
mvn versions:display-dependency-updates

10 years agoEclipse: Reorder the Java Build Path to fix the build in Eclipse.
Murray Cumming [Tue, 20 Nov 2012 21:04:53 +0000 (22:04 +0100)]
Eclipse: Reorder the Java Build Path to fix the build in Eclipse.

        * .classpath: This prevents an error saying that getTextContent()
is undefined.

10 years agoExplicitly declare some dependencies (and scopes) that we use.
Murray Cumming [Tue, 20 Nov 2012 20:38:46 +0000 (21:38 +0100)]
Explicitly declare some dependencies (and scopes) that we use.

        * pom.xml: The dependency report showed what we use.

10 years agoUpdate the gwt-test-utils version.
Murray Cumming [Tue, 20 Nov 2012 20:37:55 +0000 (21:37 +0100)]
Update the gwt-test-utils version.

        * pom.xml: gwt-test-utils 0.43 uses GWT 2.5.0, not GWT 2.4.0.
Using both in the same project was causing gwt-log to fail in GWTBrige,
with this error:
(class: com/google/gwt/core/client/GWT, method: setBridge signature: (Lcom/google/gwt/core/client/GWTBridge;)V) Incompatible argument to function

10 years agoAllow generation of a dependency report.
Murray Cumming [Tue, 20 Nov 2012 20:00:44 +0000 (21:00 +0100)]
Allow generation of a dependency report.

10 years agoDocumentTest: testLocales(): Update for the latest example version.
Murray Cumming [Mon, 19 Nov 2012 20:54:35 +0000 (21:54 +0100)]
DocumentTest: testLocales(): Update for the latest example version.

        * src/test/java/org/glom/web/server/libglom/
        The .glom file, updated in the previous commit, now has more translations.

10 years agoUpdate the .glom files used for tests.
Murray Cumming [Mon, 19 Nov 2012 20:37:46 +0000 (21:37 +0100)]
Update the .glom files used for tests.

        * src/test/resources/org/glom/web/server/example_film_manager.glom:
        * src/test/resources/org/glom/web/server/example_music_collection.glom:
        * src/test/resources/org/glom/web/server/libglom/example_film_manager.glom:
        * src/test/resources/org/glom/web/server/libglom/example_music_collection.glom:
Copy them from git master of Glom.

10 years agoUpdate versions of depdencies.
Murray Cumming [Mon, 19 Nov 2012 06:12:36 +0000 (07:12 +0100)]
Update versions of depdencies.

        * pom.xml: Increase some version numbers based on the output of
, using mvn versions:display-dependency-updates.
        * src/test/java/org/glom/web/client/
Use the annotation instead of getModuleName().
        * src/test/java/org/glom/web/server/
        Do not use deprecated assert() classes/methods.

10 years agoDocument: Correct an import to use the correct Log API.
Murray Cumming [Sun, 18 Nov 2012 22:24:50 +0000 (23:24 +0100)]
Document: Correct an import to use the correct Log API.

        * src/main/java/org/glom/web/server/libglom/
Use our Utils.Log API rather than the jfree one that Eclipse
must have suggested at some time.

10 years agoDetails: Get static image data from our images services. images
Murray Cumming [Thu, 15 Nov 2012 22:15:31 +0000 (23:15 +0100)]
Details: Get static image data from our images services.

        * src/main/java/org/glom/web/client/ui/details/
Add constructors for LayoutItemText and LayoutItemImage and
deal with their common type instead of just LayoutItemField.
        * src/main/java/org/glom/web/client/activity/
        * src/main/java/org/glom/web/client/ui/details/
        createChildWidget(): Use the other DetailsCell constructors for
these layout items, and do not add them to the list of
cells with data from the database.
        * src/main/java/org/glom/web/server/
        getValidListViewLayoutGroup(), getDetailsLayoutGroup():
Remove the image data when cloning the layout and storing it in the
cache. Clients will instead get it via the URL, from
our images service.
        * src/main/java/org/glom/web/server/
doGet(): Depending on the URI parameters, optionally get
image data from a layout_item_image in the document,
via its layout path.
        * src/main/java/org/glom/web/server/database/
        convertResultSetToDTO(): Move some URIBuilder code to:
        * src/main/java/org/glom/web/server/
Add buildImageDataUrl() taking the primary key, etc, to
get data from the database.

10 years agoDocument: Static image items: Store an image URL, using the layout path.
Murray Cumming [Thu, 15 Nov 2012 21:59:32 +0000 (22:59 +0100)]
Document: Static image items: Store an image URL, using the layout path.

        * src/main/java/org/glom/web/server/ Add buildImageDataUrl().
        * src/main/java/org/glom/web/server/libglom/
        Add a constructor that takes the documentID, for use in the
LayoutItemImage URL.
loadLayoutNode(): Pass a Path object to the helper methods, so we
can use it to create a URL for LayoutItemImage items.
This seems as good a way as any to specify a layout item in the document.
        * src/main/java/org/glom/web/server/
Pass the documentID to the constructor, for use in the LayoutItemImage

10 years agoDocument: Add getLayoutItemByPath().
Murray Cumming [Thu, 15 Nov 2012 21:46:49 +0000 (22:46 +0100)]
Document: Add getLayoutItemByPath().

        * src/main/java/org/glom/web/server/
Add buildLayoutPath() and parseLayoutPath().
        * src/test/java/org/glom/web/server/ Test that these
utility methods work.
        * src/main/java/org/glom/web/server/libglom/
Add Add getLayoutItemByPath().
* src/test/java/org/glom/web/server/libglom/ Test
that it works.

This will be useful in subsequent commits.

10 years agoDocument: Use a better base64 decoder to read static image data.
Murray Cumming [Thu, 15 Nov 2012 21:33:25 +0000 (22:33 +0100)]
Document: Use a better base64 decoder to read static image data.

        * src/test/java/org/glom/web/server/libglom/
        getNodeTextChildAsValue(): Use the apache commons base64 decoder
instead of the gwt one, because it correctly decodes the strings
from g_base64_encode(). It is probably more correct.
The newlines might be confusing the gwt decoder.

10 years agoDocument: Do not use == to compare strings. Use equals().
Murray Cumming [Wed, 14 Nov 2012 22:43:20 +0000 (23:43 +0100)]
Document: Do not use == to compare strings. Use equals().

* src/main/java/org/glom/web/server/libglom/
== only checks that they are the same object, so it can
seem to fail.

10 years agoDocument: Add and use public constants for layout names.
Murray Cumming [Wed, 14 Nov 2012 19:14:14 +0000 (20:14 +0100)]
Document: Add and use public constants for layout names.

        * src/main/java/org/glom/web/server/libglom/
        * src/main/java/org/glom/web/server/
        * src/main/java/org/glom/web/server/database/
        * src/test/java/org/glom/web/server/
        * src/test/java/org/glom/web/server/libglom/ Use
them here instead of hard-coded the strings repeatedly.

10 years agoDocument: Load static text and image items too.
Murray Cumming [Tue, 13 Nov 2012 23:14:49 +0000 (00:14 +0100)]
Document: Load static text and image items too.

        * src/main/java/org/glom/web/shared/libglom/layout/
        * src/main/java/org/glom/web/shared/libglom/layout/
New LayoutItem classes to represent these layout items.
        * src/main/java/org/glom/web/shared/libglom/layout/ The
main text of a LayoutItemText.
        * src/main/java/org/glom/web/server/libglom/
        load_after_layout_group(): Handle the node types and instantiate the
new classes.
        * src/test/java/org/glom/web/server/libglom/
Add testLayoutItemText() to check that the text is loaded properly.

10 years agoDo not use client.GWT for shared code.
Murray Cumming [Tue, 13 Nov 2012 22:48:21 +0000 (23:48 +0100)]
Do not use client.GWT for shared code.

        * src/main/java/org/glom/web/shared/libglom/layout/
Import shared.GWT instead of client.GWT, which seems to be appropriate.

10 years agoUse image data when recreating databases for testing.
Murray Cumming [Tue, 13 Nov 2012 06:06:34 +0000 (07:06 +0100)]
Use image data when recreating databases for testing.

        * src/main/java/org/glom/web/shared/ Add get/setImageData(),
for use locally (not acrosss the network) when recreating databases
for testing.
getValue(): Use it here instead of getImageDataUrl(), noting that
this method is only for use when recreating databases.
        * src/main/java/org/glom/web/server/libglom/
getNodeTextChildAsValue(): Use it instead of setImageDataUrl().

10 years agoOnlineGlomImages: Detect the mime-type (content type).
Murray Cumming [Fri, 9 Nov 2012 21:28:59 +0000 (22:28 +0100)]
OnlineGlomImages: Detect the mime-type (content type).

        * src/main/java/org/glom/web/server/
doGet(): Instead of hard-coding image/png.

10 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.

10 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/
Move some code into
        * src/main/java/org/glom/web/server/
so it can be used in:
        * src/main/java/org/glom/web/server/ 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/ Added get/setImageDataUrl().
        * src/main/java/org/glom/web/client/ui/details/
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/
        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/
Added getTablePrimaryKeyField().

        * src/main/java/org/glom/web/server/database/
        * src/main/java/org/glom/web/server/database/
        * src/main/java/org/glom/web/server/database/

10 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.

10 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.

10 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/
This is from the new translation in Glom.

10 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/
        * 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.

10 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/
        * src/test/java/org/glom/web/client/place/
        * src/test/java/org/glom/web/client/place/
        * src/test/java/org/glom/web/server/
        * src/test/java/org/glom/web/server/
        * src/test/java/org/glom/web/server/
        * src/test/java/org/glom/web/server/libglom/
        * src/test/java/org/glom/web/server/libglom/
        * src/test/java/org/glom/web/server/libglom/
        * src/test/java/org/glom/web/shared/
Just do
import static org.junit.Assert.*;
which seems fairly common.

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

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

10 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

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

10 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/
Move testGetListViewLayoutGroup() to
        * src/test/java/org/glom/web/server/
because it needs a database connection.

10 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.

10 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/
        * src/test/java/org/glom/web/server/
        This avoids leaking a postgres process in SelfHostExampleTest.

10 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/
        * src/test/java/org/glom/web/server/
       Test titles in the non-default locale.

10 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/ Add getters for the
username and password, for use by ConfiguredDocument.
        * src/test/java/org/glom/web/server/
This tests some of the ConfiguredDocument API that requires a database connection.

10 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/ Load the translations
of titles. I am surprised that we do not do this yet.
        * src/test/java/org/glom/web/server/
        * src/test/java/org/glom/web/server/libglom/
Test translations more.

10 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/
* src/main/java/org/glom/web/server/database/
Set the timeout here too.

10 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/
Disable tests that need a database connection.

10 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.

10 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/ Avoid using null strings.
* src/main/java/org/glom/web/server/database/
Avoid using a null Connection.

10 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/
Add this test.

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

10 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/
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/
testExampleMusiccollectionData): Do not use a TYPE_FORWARD_ONLY statement,
so we can count the rows.

10 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/
Retrieve some data and check it too, as in the regular Glom test.
* src/test/java/org/glom/web/server/
createConnection(): Make this public.

10 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.

10 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/
createAndSelfHostNewEmpty(): Sleep initially, to avoid distracting errors
due to the inevitable need to retry the connection while the database server

10 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/
createConnection(): Use setLoginTimeout() because it otherwise seems to take
ages to actually return when it fails.

10 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/ selfHost():
When we check that the connection works, close the connection. This seems
to not be closed automatically otherwise.

10 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.

10 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/
discoverFirstFreePort(): Close the socket. Eclipse Juno warns about this.

10 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/
Do instanceof checks on the FileUtils.listFiles() result and its

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

10 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

10 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.

10 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/
getNodeTextChildAsValue(), setNodeTextChildAsValue(): Handle the invalid type.
* src/test/java/org/glom/web/server/
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/
Make sure we never return a null string.
* src/test/java/org/glom/web/server/
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/
Move OnlineGlomProperties into its own file to be a regular class:
* src/main/java/org/glom/web/server/
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/
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/
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/
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/ Move
the use of cleanup() to a tearDown() JUnit method.

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

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/
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/
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/
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/
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/
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/
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)

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

11 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/ Load the
database_title attribute if the title attribute is not there.

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

11 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.

11 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/
Add a French translation, using the translation from Glom.

* src/main/resources/org/glom/web/client/ui/
* src/main/resources/org/glom/web/client/ui/
* src/main/resources/org/glom/web/client/ui/
Update these based on the translations from Glom.

11 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/ Add several
System.out.println() lines.

11 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/
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.

11 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/
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/
* src/main/java/org/glom/web/server/database/
* src/test/java/org/glom/web/server/libglom/

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

11 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/ Allow
self-hosting, though we only use it for testing.

* src/main/java/org/glom/web/server/libglom/
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/
testReadTableExampleRows(): Adapted.

* src/main/java/org/glom/web/shared/ 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/ Add getSqlType(),
for use in CREATE TABLE SQL queries.
* src/test/java/org/glom/web/server/ Add this class
to do self-hosting of PostgreSQL databases via its command-line
utilities, based on Glom's C++ code in and
backends/ This is incomplete - it needs more
warnings about failures and it needs to clean up properly when things
* src/test/java/org/glom/web/server/ A simple
test of this new class.

11 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/
DateFormat.parse() and Double.valueOf() can throw exceptions, though
Eclipse did not warn about that.

11 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/ Add get/setDate()
and get/setImage().
* src/main/java/org/glom/web/server/libglom/
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/
Add testReadTableExampleRows() just to check that something is read.

11 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/
Added getTranslationsMap() for use while saving.
* src/main/java/org/glom/web/shared/libglom/layout/
Adedd getUseDefaultFormatting() for use while saving.
* src/main/java/org/glom/web/server/libglom/ 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.

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

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

11 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/
* src/main/java/org/glom/web/client/
* src/main/java/org/glom/web/server/
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/
* src/main/java/org/glom/web/client/ui/list/
* src/main/java/org/glom/web/server/
getListViewData(), getRelatedListData():
* src/main/java/org/glom/web/server/
getListViewData(), getRelatedListData():
* src/main/java/org/glom/web/server/database/
* src/main/java/org/glom/web/server/database/
* src/main/java/org/glom/web/server/database/
getData(): Adapted.