2012-05-15 Murray Cumming 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. 2012-05-15 Murray Cumming 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. 2012-05-15 Murray Cumming 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. 2012-05-15 Murray Cumming 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. 2012-05-15 Murray Cumming 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. 2012-05-15 Murray Cumming 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. 2012-05-14 Murray Cumming 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. 2012-05-14 Murray Cumming 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. 2012-05-12 Murray Cumming Added LayoutItemPortalDeepCloneTest. 2012-05-11 Murray Cumming 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. 2012-05-11 Murray Cumming 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. 2012-05-11 Murray Cumming 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. 2012-05-09 Murray Cumming Replace all appearances of Colour with color. Because US English is dominant. 2012-05-09 Murray Cumming 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. 2012-05-09 Murray Cumming 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. 2012-05-07 Murray Cumming 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. 2012-05-07 Murray Cumming 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. 2012-05-07 Murray Cumming 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. 2012-05-07 Murray Cumming 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. 2012-05-07 Murray Cumming 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. 2012-05-07 Murray Cumming LayoutItemPortal: Also override getTitleOriginal(). * src/main/java/org/glom/web/shared/libglom/layout/LayoutItemPortal.java: This lets the base getTitle() with no parameters work. TODO: Test this properly. 2012-05-06 Murray Cumming LayoutItemPortal: getTitle*(): Use the relationship title. 2012-05-06 Murray Cumming LayoutItemField: Fix loading of custom titles. * src/main/java/org/glom/web/server/libglom/Document.java loadDataLayoutItemField(): The title, if any, instead of the field title, is stored in a title_custom node. Load it from there. * src/main/java/org/glom/web/shared/libglom/CustomTitle.java: Add this class. * src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField: Add getCustomTitle() and use it, instead of super.getTitle*(), in the getTitle*() overrides. * src/test/java/org/glom/web/server/libglom/LayoutItemFieldTest.java: Adapt. 2012-05-06 Murray Cumming LayoutItemField: Fall back to field titles, so some are really shown. * src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java: Override getTitleOriginal() and getTitle(), as in java-libglom. * src/test/java/org/glom/web/server/libglom/LayoutItemFieldTest.java: Test this behaviour. 2012-05-06 Murray Cumming Correct use of setExpectedResultSize(). * src/main/java/org/glom/web/server/ConfiguredDocument.java getValidListViewLayoutGroup(), getDetailsLayoutGroup(): Use setExpectedResultSize only on top-level groups (for instance, the list layout) or on child portals (in details views). Use the correct table name for portals to avoid SQL errors. Update the expected counts when returning cached layouts. 2012-05-06 Murray Cumming Document: Interpret no group column count as 1. * src/main/java/org/glom/web/server/libglom/Document.java: Use a sane default, though we now check for this in the UI code anyway. 2012-05-06 Murray Cumming More null checks. 2012-05-06 Murray Cumming Translatable: Use Hashmap instead of Treemap because GWT supports it. * src/main/java/org/glom/web/shared/libglom/Translatable.java: The use of Treemap lead to this error from async methods, with no further clue: "The response could not be deserialized" 2012-05-06 Murray Cumming OnlineGlom.gwt.xml: Add exludes to fix explicit gwt compilation in Eclipse. * src/main/java/org/glom/web/OnlineGlom.gwt.xml: This is necessary when using the Google -> GWT Compile, or g toolbar button -> GWT Compile Project... feature in Eclipse. 2012-05-06 Murray Cumming ListTable.addColumn(): Protect against a null Formatting. * src/main/java/org/glom/web/client/ui/list/ListTable.java: addColumn(): Create a default Formatting if it is null, because that is the simplest way to do this. 2012-05-06 Murray Cumming ConfiguredDocument.updateLayoutGroup(): Protect against a null dereference. * src/main/java/org/glom/web/server/ConfiguredDocument.java updateLayoutGroup(): Check that the field is not null. 2012-05-06 Murray Cumming ListViewImpl: Protected against a bad cast error. * src/main/java/org/glom/web/client/ui/ListViewImpl.java: onEnterKeyDown(): Do not cast without an instanceof check. 2012-05-06 Murray Cumming ListTable: Protect against an out of range error. * src/main/java/org/glom/web/client/ui/list/ListTable.java createCellTable(): This is unlikely, but can happen while debugging. 2012-05-06 Murray Cumming AsyncMessage onFailure() callbacks: Log the exception message. * src/main/java/org/glom/web/client/activity/DetailsActivity.java * src/main/java/org/glom/web/client/activity/DocumentSelectionActivity.java: * src/main/java/org/glom/web/client/activity/ListActivity.java: * src/main/java/org/glom/web/client/activity/ReportActivity.java: * src/main/java/org/glom/web/client/activity/TableSelectionActivity: * src/main/java/org/glom/web/client/ui/details/RelatedListTable.java: * src/main/java/org/glom/web/client/ui/list/ListViewTable.java: These are useful clues when something is wrong. 2012-05-06 Murray Cumming ConfiguredDocument: Avoid a null dereference. * src/main/java/org/glom/web/server/ConfiguredDocument.java TableLayoutsForLocale.getMapWithAdd(): Make sure that the list and details maps are created. 2012-05-06 Murray Cumming Document: Correct the port number parsing. * src/main/java/org/glom/web/server/libglom/Document.java: This lets us actually connect to the database and show the document. 2012-05-05 Murray Cumming Fix mvn gwt:test * pom.xml: Use htmlunit mode for gwt:test, because the default demands user-interaction, asking us to load a temporary URL in a browser.s * src/main/java/org/glom/web/OnlineGlom.gwt.xml: Add a servlet node, which is apparently necessary for testing the service. See the comment. * src/test/java/org/glom/web/client/GwtTestOnlineGlomService.java: Show the exception, if any. This is how I saw the 404 in the HTML in the exception. 2012-05-05 Murray Cumming DocumentTest: Move the .glom files into the resources directory. * src/test/java/org/glom/web/server/libglom/DocumentTest: And get the URI via getResource(). 2012-05-05 Murray Cumming Document: Remove the FieldIdentifies inner class. * src/main/java/org/glom/web/server/libglom/Document.java: We only use the Relationship (though the same function in libglom is maybe used in other ways) and so this removes a compiler warning. 2012-05-05 Murray Cumming Document.load() Remove the error code parameter. * src/main/java/org/glom/web/server/libglom/Document.java: load(): Remove the parameter. We do not set it yet and it could never have worked as an output parameter (though maybe it did in java-libglom). We could use an exception if we really want the failure reason. * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java: init(): * src/test/java/org/glom/web/server/libglom/DocumentTest.java: setUp(), testGetSuitableTableToViewDetails(): Adapt. 2012-05-05 Murray Cumming Make some inner classes static. * src/main/java/org/glom/web/server/ConfiguredDocument.java * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java * src/main/java/org/glom/web/server/ReportGenerator.java * src/main/java/org/glom/web/server/libglom/Document.java Make all inner classes static that can be static. 2012-05-05 Murray Cumming OnlineGlomServiceImpl: Do not load and check for java-libglom. * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java init(): We do not use java-libglom any more. 2012-05-05 Murray Cumming Remove mentions of java-libglom. * README: Remove mention of java-libglom, because it no longer needed. * utils/build-onlineglom-war.sh: * utils/check-and-recover-tomcat.py: * utils/install-onlineglom-war.sh: Remove these as they are no longer useful. Building is now far easier, with no need for jhbuild. 2012-05-05 Murray Cumming Fix the build (mvn package) * src/main/java/org/glom/web/shared/libglom/layout/LayoutGroup.java (LayoutGroup): Make the LayoutItemList inner class static and protected. Otherwise the GWT Java->Javascript compilation fails with just this error, during mvn package or when attempting to view in a browser, in the GWT developer mode in Eclipse. [INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ gwt-glom --- [INFO] auto discovered modules [org.glom.web.OnlineGlom] [INFO] Compiling module org.glom.web.OnlineGlom [INFO] [ERROR] Errors in 'file:/home/murrayc/checkouts/gnome/gwt-glom/src/main/java/org/glom/web/client/OnlineGlomServiceAsync.java' [INFO] [ERROR] Line 46: Failed to resolve 'org.glom.web.client.OnlineGlomService' via deferred binding [INFO] Scanning for additional dependencies: file:/home/murrayc/checkouts/gnome/gwt-glom/src/main/java/org/glom/web/client/ui/details/DetailsCell.java [INFO] [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) [INFO] [WARN] org.glom.web.client.OnlineGlomService_Proxy [INFO] [ERROR] Cannot proceed due to previous errors It has taken me 2 days to find out what was causing that. After reducing the code, the compiler eventually showed me the full error message. 2012-05-04 Murray Cumming ConfiguredDocument: Cache the cloned and stripped layouts. * src/main/java/org/glom/web/server/ConfiguredDocument.java: getValidListViewLayoutGroup(), .getDetailsLayoutGroup(): Store the cloned layout in a map, so we can retrieve it again without rebuilding it. 2012-05-04 Murray Cumming UsesRelationshipImpl: Complete the relationshipEquals() implementation. 2012-05-04 Murray Cumming libglom classes: Implement some auto-generated emthods. 2012-05-04 Murray Cumming Add GwtTestOnlineGlomService. * src/test/java/org/glom/web/client/GwtTestOnlineGlomService.java: However, this (and the other GwtTest*) does not seem to run during mvn test. 2012-05-04 Murray Cumming Remove use of unsupported features from client code. * src/main/java/org/glom/web/client/StringUtils.java: Add equals(). * src/main/java/org/glom/web/shared/libglom/layout/UsesRelationshipImpl.java: * src/main/java/org/glom/web/shared/libglom/layout/reportparts/LayoutItemGroupBy.java: Use our client version of StringUtils instead of the apache commons one. However, the GWT Javascript compliation still fails. 2012-04-25 Murray Cumming Add a Field class and implement some loading of it in Document. 2012-04-25 Murray Cumming Initial Document loading implementation, instead of libglom. * src/test/java/org/glom/web/shared/libglom/: Add Document, Report, and Translatable classes, and adapt the rest of the code to use them. However, this is still missing Layout and Field classes and loading. 2012-04-24 Murray Cumming Use of jOOQ: Move Field creation into a utility method. * src/main/java/org/glom/web/server/SqlUtils.java: This lets us improve it more easily. 2012-04-24 Murray Cumming Use of jOOQ: Improve the code to COUNT a sub-select. * src/main/java/org/glom/web/server/SqlUtils.java: Move initial query creation into build_sql_select_step_with_where_clause(). build_sql_select_count_rows(): Use the jOOQ API instead of concatentating text, because a jOOQ Select*Step is a TableLike, which is what from() takes. 2012-04-23 Murray Cumming Use jOOQ instead of Glom.build_sql*(), to avoid native calls. * pom.xml: Depend on jooq. * src/main/java/org/glom/web/server/SqlUtils.java: Reimplement the methods with jOOQ, based on the C++ implementations in libglom, with some changes to the logic required by jooQ. Take a jOOQ Condition rather than a Glom.SqlExpr (GdaSqlExpr) for the where clause. * src/main/java/org/glom/web/client/ui/TableSelectionViewImpl.java: * src/main/java/org/glom/web/server/ReportGenerator.java: * src/main/java/org/glom/web/server/SqlUtils.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/ListViewDBAccess.java: * src/main/java/org/glom/web/server/database/RelatedListDBAccess.java: * src/main/java/org/glom/web/server/database/RelatedListNavigation: Adapt. In particular, the SqlUtils methods now need to take a Connection, because jOOQ needs that, though it seems unnecessary. This is not quite finished. Ideally jOOQ would help us to build table_name.field_name names, quoting and escaping them properly. See http://stackoverflow.com/questions/10264001/instantiating-a-jooq-field-by-name 2012-04-21 Murray Cumming Move use of Glom.build_sql*() into a new SqlUtils class. * src/main/java/org/glom/web/server/SqlUtils.java: Add static methods to wrap Glom.build_sql*(). The parameter types are still Glom one, but this will make it easier to start using something other than libglom or SqlBuilder. 2012-04-21 Murray Cumming Update the project URL. * pom.xml: Use an OnlineGlom-specific URL for the project URL. 2012-04-21 Murray Cumming Main layout: Use a FlowTable instead of absolute positioning. * src/main/java/org/glom/web/client/OnlineGlom.java: onModuleLoad(): The RootLayoutPanel is a (extends) AbsolutePanel, so each of its child panels/widgets must have an absolute position. But that is annoying, so this adds a FlowTable and puts the child panels in there. 2012-04-21 Murray Cumming GwtTestOnlineGlom: Comment out unused code. * src/test/java/org/glom/web/client/GwtTestOnlineGlom.java: Eclipse has started to say that some code is unused. 2012-04-21 Murray Cumming Update to the latest versions of dependencies. * pom.xml: Update version numbers of dependencies to the latest versions. * src/main/java/org/glom/web/server/ConfiguredDocument.java: * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java: * src/main/java/org/glom/web/server/ReportGenerator.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/test/java/org/glom/web/client/GwtTestOnlineGlom.java: Modify the imports where necessary. 2012-04-17 Murray Cumming Style: Remove overflow:hidden from searchbox * src/main/webapp/style.css: Because this pushes the Back To Link label/link on to the next row, which is then hidden due to the hard-coded (in ems) height. 2012-04-20 Murray Cumming Remove some duplicate code. * src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java getDocumentInfo(): This must have been duplicated during the merge from the reports branch.