Murray Cumming [Tue, 17 Mar 2015 12:10:43 +0000 (13:10 +0100)]
Replace deprecated DOM.setElementAttribute().
With Element.setAttribute().
Murray Cumming [Tue, 17 Mar 2015 12:08:50 +0000 (13:08 +0100)]
Replace deprecated gwt.client.Element.
Replcace com.google.gwt.user.client.Element with
com.google.gwt.dom.client.Element .
Murray Cumming [Tue, 17 Mar 2015 12:08:28 +0000 (13:08 +0100)]
pom.xml: Update gwt and associated plugin versions.
Murray Cumming [Tue, 17 Mar 2015 12:03:53 +0000 (13:03 +0100)]
Remove useless checks for null this.
Maybe this was left over after a refactoring.
Murray Cumming [Tue, 17 Mar 2015 11:50:05 +0000 (12:50 +0100)]
pom.xml: Add <pluginExecution> to avoid a warning.
To avoid this warning:
maven-enforcer-plugin (goal ”enforce“) is ignored by m2e
as suggested here:
http://stackoverflow.com/a/
13043842/1123654
Murray Cumming [Tue, 17 Mar 2015 11:39:48 +0000 (12:39 +0100)]
README: Mention necessary Eclipse plugins and how to import.
Murray Cumming [Thu, 20 Jun 2013 19:56:18 +0000 (21:56 +0200)]
pom.xml: Update the guava version.
Murray Cumming [Thu, 20 Jun 2013 19:47:10 +0000 (21:47 +0200)]
pom.xml: Update plugin versions.
Murray Cumming [Thu, 20 Jun 2013 19:35:39 +0000 (21:35 +0200)]
pom.xml: Require a revent maven version.
This lets us use later plugin versions, as suggested by
mvn versions:display-plugin-updates
Murray Cumming [Thu, 20 Jun 2013 19:23:21 +0000 (21:23 +0200)]
pom.xml: Update more dependency version numbers.
Murray Cumming [Thu, 20 Jun 2013 19:16:17 +0000 (21:16 +0200)]
pom.xml: Update versions of some gwt stuff.
Murray Cumming [Wed, 3 Apr 2013 15:23:28 +0000 (17:23 +0200)]
Fix minor comment typos
Murray Cumming [Wed, 3 Apr 2013 13:12:05 +0000 (15:12 +0200)]
Another Eclipse files Quick Fix
* .settings/com.google.gdt.eclipse.core.prefs:
Eclipse suggested and did this change.
Murray Cumming [Wed, 3 Apr 2013 13:10:36 +0000 (15:10 +0200)]
Stop using a ChangeLog
Murray Cumming [Wed, 3 Apr 2013 13:09:51 +0000 (15:09 +0200)]
Build: Eclipse file updates done by Eclipse.
* .classpath:
* settings/com.google.gwt.eclipse.core.prefs:
Eclipse Quick Fix changes apparently to make these
up to date for the latest maven eclipse plugin.
Murray Cumming [Mon, 18 Mar 2013 10:25:53 +0000 (11:25 +0100)]
Build: Update to gwt 2.5.1
* pom.xml: Update the gwt and gwt-maven-plugin to 2.5.1.
Murray Cumming [Fri, 15 Feb 2013 14:24:16 +0000 (15:24 +0100)]
SelfHoster: Actually escape SQL IDs using JOOQ.
* src/test/java/org/glom/web/server/SelfHoster.java:
Added quoteAndEscapeSqlId(), wrapping the use of JOOQ's
Factory.render() to escape and quote the SQL ID.
* src/test/java/org/glom/web/server/SelfHosterPostgreSQL.java:
* src/test/java/org/glom/web/server/SelfHosterMySQL.java:
escapeSqlId(): Rename to quoteAndEscapeSqlId(),
calling the quoteAndEscapeSqlId() in the base class, passing
the SQL dialect. We no longer need to do the quoting
here because JOOQ does it.
* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
Add testSelfHosterEscapeIDSame() and
testSelfHosterEscapeIDNotSame(), to test the SQL escaping,
though it is only used in the test code anyway.
See https://groups.google.com/d/msg/jooq-user/8_zd3b07yh4/sXG0aYy8XsAJ
about the JOOQ usage.
Murray Cumming [Fri, 15 Feb 2013 11:15:51 +0000 (12:15 +0100)]
Test MySQL via self-hosting too, instead of just PostgreSQL.
* pom.xml: Depend on the MYSQL JDBC driver.
* src/main/java/org/glom/web/server/SqlUtils.java:
Make getJdbcConnectionDetails() public, for use in tests.
* src/main/java/org/glom/web/shared/libglom/Field.java: getSqlType():
Take the SQL Dialect to support both MySQL and PostgreSQL.
* src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
Test MySQL too.
* src/test/java/org/glom/web/server/SelfHostExampleNonNumericPrimaryKeysTest.java:
* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
Test MYSQL too.
* src/test/java/org/glom/web/server/SelfHoster.java:
* src/test/java/org/glom/web/server/SelfHosterMySQL.java:
* src/test/java/org/glom/web/server/SelfHosterPostgreSQL.java:
Abstract some code into the base SelfHoster and finish implementing
the MYSQL version.
Murray Cumming [Fri, 15 Feb 2013 11:06:46 +0000 (12:06 +0100)]
SqlUtils: Do not hard-code the PostgreSQL SQL dialect.
* src/main/java/org/glom/web/server/SqlUtils.java: Take
the JOOQ SQLDialect as a parameter to these utility
functions.
* src/main/java/org/glom/web/server/libglom/Document.java:
Add getSqlDialect().
* src/main/java/org/glom/web/server/: Use getSqlDialect()
to provide the new parameter.
Murray Cumming [Sun, 3 Feb 2013 20:52:10 +0000 (21:52 +0100)]
SelfHostExampleTest: Use the generic SelfHoster base class.
* src/test/java/org/glom/web/server/SelfHostTestUtils.java:
Take a SelfHoster parameter rather than a SelfHosterPostgreSQL.
* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
Use the base class type where possible.
Murray Cumming [Thu, 31 Jan 2013 21:40:42 +0000 (22:40 +0100)]
SelfHosterPostgreSQL: Avoid some copy/pasting.
* src/main/java/org/glom/web/server/SqlUtils.java:
Added getJdbcConnectionDetails() and used it in
createAndSetupDataSource(). Also support MySQL here.
* src/test/java/org/glom/web/server/SelfHosterPostgreSQL.java:
createConnection(): Use getJdbcConnectionDetails() instead of
repeating the start of the jdbc URI and the default database name.
Murray Cumming [Thu, 31 Jan 2013 20:32:56 +0000 (21:32 +0100)]
Avoid some copy/pasted connection/statement code.
* src/main/java/org/glom/web/server/SqlUtils.java: Add executeQuery(),
which does the getting of the Connection and the creation of the Statement,
so the caller does not have to.
* src/main/java/org/glom/web/server/OnlineGlomImagesServlet.java
* 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
* src/test/java/org/glom/web/server/SelfHoster.java: Use the new method
instead of doing all the work each time.
Murray Cumming [Wed, 16 Jan 2013 20:25:27 +0000 (21:25 +0100)]
Document: Read and write the other hosting modes.
* src/main/java/org/glom/web/server/libglom/Document.java:
Add to the hosting mode enum and handle all when loading
and saving a document. Also add constants for the XML
attribute values.
Murray Cumming [Mon, 14 Jan 2013 12:52:00 +0000 (13:52 +0100)]
tests: Move more methods down to SelfHoster.
Murray Cumming [Tue, 29 Jan 2013 12:40:02 +0000 (13:40 +0100)]
Improve a comment with a link
Murray Cumming [Fri, 25 Jan 2013 09:24:40 +0000 (10:24 +0100)]
Change a translatable string slightly.
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants.properties:
Do not mention PostgreSQL, so we can support other database backends,
and other login systems in future.
Murray Cumming [Fri, 25 Jan 2013 09:23:29 +0000 (10:23 +0100)]
Added a Hungarian translation.
* src/main/java/org/glom/web/OnlineGlom.gwt.xml:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_hu.properties:
This is from the new translation in Glom.
Murray Cumming [Fri, 25 Jan 2013 09:17:49 +0000 (10:17 +0100)]
Update translations 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:
Take the translations from the Glom .po files.
Murray Cumming [Mon, 14 Jan 2013 12:17:38 +0000 (13:17 +0100)]
tests: Split SelfHoster into SelfHoster and SelfHosterPostgreSQL.
This should let me add MySQL hosting too.
Murray Cumming [Sat, 5 Jan 2013 10:37:02 +0000 (11:37 +0100)]
Add a comment
Murray Cumming [Wed, 19 Dec 2012 21:26:39 +0000 (22:26 +0100)]
Prevent client code from reading our client cookie.
* pom.xml: Use a later javax.servlet version than we seem to
get automatically, probably via GWT, so we have the
Cookie.setSecure() method, though I cannot find out when it
was added.
* src/main/java/org/glom/web/server/OnlineGlomLoginServlet.java:
checkAuthentication(): Call setSecure() on the Cookie, so it
can only be retrieved via HTTP(S), not by client code,
making it harder for Javascript to hijack the session.
Murray Cumming [Wed, 19 Dec 2012 21:22:04 +0000 (22:22 +0100)]
OnlineGlomServlet(): Simplify getting the request in all cases.
* src/main/java/org/glom/web/server/OnlineGlomServlet.java:
getConnection(), getSessionIdFromCookie(): Move some code into
getRequest(), which lets us not worry about whether it is called
via GWT-RPC or as a regular servlet.
Murray Cumming [Wed, 19 Dec 2012 21:17:25 +0000 (22:17 +0100)]
DocumentLoginViewImpl: Refuse to try if not using HTTPS.
* src/main/java/org/glom/web/client/ui/DocumentLoginViewImpl.java:
Show an error message, and disable the login button, if we are not using
HTTPS.
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants.properties:
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_*.properties:
Add the translatable string for the error message.
Murray Cumming [Wed, 19 Dec 2012 21:14:42 +0000 (22:14 +0100)]
OnlineGlomLoginServlet.checkAuthentication(): Require HTTPS.
* pom.xml: Use HTTPS when running jetty for testing via mvn gwt:run.
This annoys us with a security warning about the self-signed certificate,
but it's better than the risk of deactivating the checks.
* src/main/java/org/glom/web/server/OnlineGlomLoginServlet.java:
checkAuthentication(): Refuse to check if the servlet is not running via
HTTPS.
* src/main/webapp/WEB-INF/web.xml: Add a comment about why we do
not require HTTPS for the login servlet in all cases.
Murray Cumming [Wed, 19 Dec 2012 20:14:06 +0000 (21:14 +0100)]
Do not attempt connections for empty usernames and passwords.
* src/main/java/org/glom/web/server/SqlUtils.java:
tryUsernameAndPassword(): Do not try if the username and
password are empty, to avoid useless warnings.
Murray Cumming [Mon, 17 Dec 2012 19:26:29 +0000 (20:26 +0100)]
Use the configuration file's username and password again.
* src/main/java/org/glom/web/server/OnlineGlomProperties.java:
Move Credentials to:
* src/main/java/org/glom/web/server/Credentials.java.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Use Credentials here too, instead of its own Credentials class.
This keeps an open connection around for a while.
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
* src/main/java/org/glom/web/server/ConfiguredDocumentSet.java:
* src/main/java/org/glom/web/server/SessionListener.java:
* src/main/java/org/glom/web/server/UserStore.java:
* src/test/java/org/glom/web/server/OnlineGlomPropertiesTest.java:
Adapted.
* src/main/java/org/glom/web/server/OnlineGlomServlet.java:
Rename getConnectionForCookie() to getConnection() and also try the
ConfiguredDocument.getConnection().
* src/main/java/org/glom/web/server/OnlineGlomImagesServlet.java:
* src/main/java/org/glom/web/server/OnlineGlomLoginServlet.java:
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Adapted.
Murray Cumming [Mon, 17 Dec 2012 15:22:49 +0000 (16:22 +0100)]
DocumentLoginViewImpl: Make this look like the document selector page.
* src/main/java/org/glom/web/client/ui/DocumentLoginViewImpl.ui.xml:
This new UIBinder file is based on DocumentSelectionViewImpl.
* src/main/webapp/style.css: Add the style.
* src/main/java/org/glom/web/client/ui/DocumentLoginViewImpl.java:
Use UIBinder.
Murray Cumming [Mon, 17 Dec 2012 13:59:06 +0000 (14:59 +0100)]
OnlineGlomImagesServlet: Make authentication work.
* src/main/java/org/glom/web/server/OnlineGlomImagesServlet.java:
(OnlineGlomImagesServlet.doGet(): Pass the request to
isAuthenticated(), getImageFromDocument() and getImageFromDatabase()
because getThreadLocalRequest() will not work if the servlet was
not called via GWT-RPC.
* src/main/java/org/glom/web/server/OnlineGlomLoginServlet.java:
isAuthenticated() take a request.
* src/main/java/org/glom/web/server/OnlineGlomServlet.java:
Add an isAuthenticated() and a getConnectionForCookie() that take
a request.
getSessionIdFromCookie(): take a request, only trying
getThreadLocalRequest() if the request is null.
We probably should not be using a GWT base class for this service anyway,
but it simplifies the multiple-inheritance. We should try containment
instead.
Murray Cumming [Mon, 17 Dec 2012 13:02:56 +0000 (14:02 +0100)]
Really use the shared configuredDocumentSet and shared userStore
Murray Cumming [Mon, 17 Dec 2012 13:01:10 +0000 (14:01 +0100)]
Add a test for Utils.buildImageDataUrl().
* src/test/java/org/glom/web/server/UtilsTest.java:
Add this tests because this method has started failing with this
exception, and maybe this will help to debug it:
java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.encPath(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
Murray Cumming [Mon, 17 Dec 2012 10:03:07 +0000 (11:03 +0100)]
Move configuredDocumentSet into the base OnlineGlomServlet.
This leaves just one place where we can change the implementation
so we retrieve a shared document set instead.
Murray Cumming [Mon, 17 Dec 2012 09:53:21 +0000 (10:53 +0100)]
Move authentication to a separate login servlet.
* 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:
Move checkAuthentication() and isAuthenticated() to:
* src/main/java/org/glom/web/client/OnlineGlomLoginService.java
* src/main/java/org/glom/web/client/OnlineGlomLoginServiceAsync.java
* src/main/java/org/glom/web/server/OnlineGlomLoginServlet.java
* src/main/webapp/WEB-INF/web.xml: Mention the new servlet.
* src/main/java/org/glom/web/client/activity/DocumentLoginActivity.java:
* src/main/java/org/glom/web/client/activity/HasDocumentActivity.java:
Adapted.
We already have to (but do not yet) share the login details between
the regular and images servlets, so we might as well separate it
competely. This assumes that I will find a way to share the data
between servlets.
Murray Cumming [Mon, 17 Dec 2012 09:12:19 +0000 (10:12 +0100)]
Renamed OnlineGlomImages to OnlineGlomImagesServlet.
Murray Cumming [Mon, 10 Dec 2012 22:28:41 +0000 (23:28 +0100)]
Experimenting with per-user access.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Remove the connection, adding it as a parameter to public methods.
Moved setUsernameAndPassword() to
* src/main/java/org/glom/web/server/SqlUtils.java:
as tryUsernameAndPassword().
* src/main/java/org/glom/web/server/ConfiguredDocumentSet.java:
Adapted.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
checkAuthentication(): Store a cookie if the authentication was
successful. Also create the database connection and store that too,
for later use.
* src/main/java/org/glom/web/server/OnlineGlomImages.java:
* src/main/java/org/glom/web/server/OnlineGlomServlet.java: Share
a base class, which gets the existing connection based on
the cookie.
* src/main/java/org/glom/web/server/SessionListener.java:
Used to invalidate the connection when the browser session
ends. However, this probably needs to be declared in our web.xml.
* src/main/java/org/glom/web/server/UserStore.java:
An in-memory store of the remembered credentials (and connections).
This is just a test: It never discards old unused credentials
and loses everything when the server stops.
* src/test/java/org/glom/web/server/ConfiguredDocumentTest.java:
* src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
Adapted.
Murray Cumming [Mon, 17 Dec 2012 13:01:10 +0000 (14:01 +0100)]
Add a test for Utils.buildImageDataUrl().
* src/test/java/org/glom/web/server/UtilsTest.java:
Add this tests because this method has started failing with this
exception, and maybe this will help to debug it:
java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.encPath(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
Murray Cumming [Wed, 12 Dec 2012 10:09:48 +0000 (11:09 +0100)]
DocumentLoginViewImpl: Make the strings translatable.
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants.properties:
Add translatable strings needed for the login UI.
* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_*.properties:
Add them here as placeholders, using the English text.
* src/main/java/org/glom/web/client/ui/DocumentLoginViewImpl.java: Use
the translated constants instead of hard-coding the strings.
Murray Cumming [Fri, 7 Dec 2012 20:52:53 +0000 (21:52 +0100)]
OnlineGlomServiceImpl: Check for authentication in all service methods.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Call checkAuthentication() before doing anything.
Murray Cumming [Thu, 6 Dec 2012 21:20:22 +0000 (22:20 +0100)]
Add a comment
Murray Cumming [Thu, 6 Dec 2012 21:19:08 +0000 (22:19 +0100)]
Use a custom PlaceController to go to the previous page after login.
* src/main/java/org/glom/web/client/PlaceControllerExt.java:
A derived PlaceController that knows the previous, and default,
places, and can take us to the appropriate one.
* src/main/java/org/glom/web/client/ClientFactoryImpl.java:
Instantiate the custom PlaceController instead of the regular one.
* src/main/java/org/glom/web/client/OnlineGlom.java:
Use the defaultPlace from the PlaceControllerExt, to avoid
duplication.
* src/main/java/org/glom/web/client/activity/DocumentLoginActivity.java:
Add goToPrevious() and goToDefault(), using the custom PlaceController.
Use these instead of the hard-coded goTo() calls.
Murray Cumming [Wed, 5 Dec 2012 22:47:22 +0000 (23:47 +0100)]
Some checks for nulls.
* src/main/java/org/glom/web/client/activity/TableSelectionActivity.java:
fillView():
* src/main/java/org/glom/web/client/ui/TableSelectionViewImpl.java:
setLocaleList(), setReportList()):
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
getReportsList(): Avoid using null objects.
* src/main/java/org/glom/web/server/Utils.java:
transformUnknownToActualType(): Try to avoid or catch
failures to parse the string as a double.
Murray Cumming [Wed, 5 Dec 2012 22:45:44 +0000 (23:45 +0100)]
Turn the authenication popup into a real Place.
* src/main/java/org/glom/web/client/place/HasTablePlace.java:
Moved some of this into a base class:
* src/main/java/org/glom/web/client/place/HasDocumentPlace.java:
for use by:
* src/main/java/org/glom/web/client/place/DocumentLoginPlace.java
* src/main/java/org/glom/web/client/ui/AuthenticationPopup.java:
Removed this, moving its UI into:
* src/main/java/org/glom/web/client/ui/DocumentLoginView.java
* src/main/java/org/glom/web/client/ui/DocumentLoginViewImpl.java
* src/main/java/org/glom/web/client/ClientFactory.java:
* src/main/java/org/glom/web/client/ClientFactoryImpl.java:
Added getDocumentLoginView() to return this view.
* src/main/java/org/glom/web/client/activity/HasTableActivity.java:
Move some of this into a base class:
* src/main/java/org/glom/web/client/activity/HasDocumentActivity.java
checkAuthentication(): If the user is not authenticated,
instead of showing the popup, go to the login place.
* src/main/java/org/glom/web/client/activity/DocumentLoginActivity.java
A new activity for the DocumentLoginPlace. This checks if the
user is authenticated and either moves to the appropriate page or
waits for the user to enter credentials.
* src/main/java/org/glom/web/client/activity/ListActivity.java:
* src/main/java/org/glom/web/client/activity/ReportActivity.java:
Remove mentions of the authentication popup.
* src/main/java/org/glom/web/client/mvp/AppPlaceHistoryMapper.java:
Tell this about DocumentLoginPlace.
* src/main/java/org/glom/web/client/mvp/DocumentSelectionActivityMapper.java:
getActivity(): Also handle DocumentLoginPlace, returning DocumentLoginActivity.
The login screen is not pretty, and it does not yet attempt to take the use
back to the correct place.
Murray Cumming [Tue, 4 Dec 2012 22:22:53 +0000 (23:22 +0100)]
DetailsActivity: Check for authentication here too.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
Call checkAuthentication to deal with a TODO here.
Murray Cumming [Tue, 4 Dec 2012 22:11:56 +0000 (23:11 +0100)]
Authentication: Reduce some copy/paste by moving code to base class.
* src/main/java/org/glom/web/client/activity/HasTableActivity.java:
Add checkAuthentication().
* src/main/java/org/glom/web/client/activity/ListActivity.java:
* src/main/java/org/glom/web/client/activity/ReportActivity.java:
Call it here instead of copy/pasting the code.
Murray Cumming [Tue, 4 Dec 2012 21:44:16 +0000 (22:44 +0100)]
Add some comments
Murray Cumming [Tue, 4 Dec 2012 20:51:11 +0000 (21:51 +0100)]
GwtTestOnlineGlomService: Add some assertions.
* src/test/java/org/glom/web/client/GwtTestOnlineGlomService.java:
However, these assertions will never be run because we have no
way to set up the test conditions (specifying documents and their
databases) for the OnlineGlom service.
See https://groups.google.com/forum/?hl=en&fromgroups=#!topic/google-web-toolkit/Z6rPWG4kcKQ
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/GwtTestStringUtils.java: Added.
* src/test/java/org/glom/web/client/GwtTestUtils.java: Added.
This is mostly just to catch java->javascript compilation problems.
Murray Cumming [Tue, 4 Dec 2012 05:30:55 +0000 (06:30 +0100)]
tests: Add client-side test for StringUtils.
Murray Cumming [Sun, 2 Dec 2012 21:53:36 +0000 (22:53 +0100)]
Add GwtTestReportPlace.
* src/test/java/org/glom/web/client/place/GwtTestReportPlace.java:
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.
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/GwtTestDetailsPlace.java:
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.
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/GwtTestDetailsPlace.java:
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.
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/DataItemTest.java:
Add testdate(). See the comment about the awkward server-side-only
Date API.
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/DetailsPlace.java:
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/DetailsPlaceTest.java: Rename to
GwtTestDetailsPlace.
* src/test/java/org/glom/web/client/place/ListPlaceTest.java: 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.
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/TypedDataItem.java:
Added isUnknownType() for convenience.
* src/main/java/org/glom/web/client/place/DetailsPlace.java:
getToken(): Move some code into getStringForData() and handle
other data types.
* src/main/java/org/glom/web/server/Utils.java:
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/ConfiguredDocument.java:
Add setDataItemType() to set the type of data for primary
keys.
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
document.
* src/test/java/org/glom/web/client/place/DetailsPlaceTest.java:
Added testGetPlaceParametersNumericPrimaryKey(),
testGetPlaceParametersBooleanPrimaryKey() and
testGetPlaceParametersDatePrimaryKey).
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/TypedDataItem.java:
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/SqlUtils.java:
buildSimpleWhereExpression(): Use TypedDataItem.getValue() instead of
getNumber().
* src/test/java/org/glom/web/server/SelfHostExampleNonNumericPrimaryKeysTest.java:
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.
Murray Cumming [Wed, 28 Nov 2012 22:24:10 +0000 (23:24 +0100)]
Add missing file.
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/SelfHostExampleTest.java:
Move the data checks into a new file:
* src/test/java/org/glom/web/server/SelfHostTestUtils.java:
SelfHostTestUtils.java: so we can use it in some other
tests, with different documents.
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/DBAccess.java:
convertResultSetToDTO(): Move some code into a public
method as:
* src/main/java/org/glom/web/server/SqlUtils.java:
fillDataItemFromResultSet(): This takes a DataItem and
sets it from a value from a datbase recordset.
* src/main/java/org/glom/web/server/libglom/Document.java:
Make getDocument() public, so we can use it in a test.
* src/test/java/org/glom/web/server/SelfHostExampleTest.java:
Add testExampleMusiccollectionDataRelated() and call it from
testExampleMusiccollectionData(), to do a basic test of using
a relationship.
Murray Cumming [Thu, 22 Nov 2012 10:05:26 +0000 (11:05 +0100)]
Build: Specify the source encoding.
* pom.xml: Set project.build.sourceEncoding
This should fix this build problem on some systems:
[ERROR] /var/lib/jenkins/workspace/OnlineGlom/src/test/java/org/glom/web/server/libglom/DocumentTest.java:[139,72] error: unmappable character for encoding ASCII
Murray Cumming [Tue, 20 Nov 2012 22:12:59 +0000 (23:12 +0100)]
1.23.1
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
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.
See http://mergetag.com/the-method-gettextcontent-is-undefined-for-the-type-node/
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.
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:
testOutOfBounds(org.glom.web.server.libglom.DocumentLayoutPathTest):
(class: com/google/gwt/core/client/GWT, method: setBridge signature: (Lcom/google/gwt/core/client/GWTBridge;)V) Incompatible argument to function
Murray Cumming [Tue, 20 Nov 2012 20:00:44 +0000 (21:00 +0100)]
Allow generation of a dependency report.
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/DocumentTest.java:
The .glom file, updated in the previous commit, now has more translations.
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.
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/GwtTestOnlineGlom.java:
Use the annotation instead of getModuleName().
* src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
Do not use deprecated assert() classes/methods.
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/Document.java:
Use our Utils.Log API rather than the jfree one that Eclipse
must have suggested at some time.
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/DetailsCell.java:
Add constructors for LayoutItemText and LayoutItemImage and
deal with their common type instead of just LayoutItemField.
setData():
* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
Adapted.
* src/main/java/org/glom/web/client/ui/details/Group.java:
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/ConfiguredDocument.java:
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/OnlineGlomImages.java:
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/DBAccess.java:
convertResultSetToDTO(): Move some URIBuilder code to:
* src/main/java/org/glom/web/server/Utils.java:
Add buildImageDataUrl() taking the primary key, etc, to
get data from the database.
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/Utils.java: Add buildImageDataUrl().
* src/main/java/org/glom/web/server/libglom/Document.java:
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/ConfiguredDocumentSet.java:
Pass the documentID to the constructor, for use in the LayoutItemImage
URL.
Murray Cumming [Thu, 15 Nov 2012 21:46:49 +0000 (22:46 +0100)]
Document: Add getLayoutItemByPath().
* src/main/java/org/glom/web/server/Utils.java:
Add buildLayoutPath() and parseLayoutPath().
* src/test/java/org/glom/web/server/LayoutPathTest.java: Test that these
utility methods work.
* src/main/java/org/glom/web/server/libglom/Document.java:
Add Add getLayoutItemByPath().
* src/test/java/org/glom/web/server/libglom/DocumentLayoutPathTest.java: Test
that it works.
This will be useful in subsequent commits.
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/DocumentTest.java:
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.
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/Document.java:
== only checks that they are the same object, so it can
seem to fail.
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/Document.java:
Make LAYOUT_NAME_DETAILS and LAYOUT_NAME_LIST public.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
* src/test/java/org/glom/web/server/SelfHostConfiguredDocumentTest.java:
* src/test/java/org/glom/web/server/libglom/DocumentTest.java: Use
them here instead of hard-coded the strings repeatedly.
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/LayoutItemImage.java:
* src/main/java/org/glom/web/shared/libglom/layout/LayoutItemText.java:
New LayoutItem classes to represent these layout items.
* src/main/java/org/glom/web/shared/libglom/layout/StaticText.java: The
main text of a LayoutItemText.
* src/main/java/org/glom/web/server/libglom/Document.java:
load_after_layout_group(): Handle the node types and instantiate the
new classes.
* src/test/java/org/glom/web/server/libglom/DocumentTest.java:
Add testLayoutItemText() to check that the text is loaded properly.
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/Formatting.java:
Import shared.GWT instead of client.GWT, which seems to be appropriate.
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/DataItem.java: 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/Document.java:
getNodeTextChildAsValue(): Use it instead of setImageDataUrl().
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/OnlineGlomImages.java:
doGet(): Instead of hard-coding image/png.
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.
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.
Murray Cumming [Sun, 22 Jul 2012 19:29:08 +0000 (21:29 +0200)]
Attempting to use base64 data URL for images.
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.
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.
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.
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.
Murray Cumming [Sun, 22 Jul 2012 11:12:41 +0000 (13:12 +0200)]
1.21.10
Murray Cumming [Sat, 21 Jul 2012 22:56:34 +0000 (00:56 +0200)]
Remove unused imports
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
Murray Cumming [Sat, 21 Jul 2012 22:34:26 +0000 (00:34 +0200)]
Remove an outdated FIXME comment
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.