Murray Cumming [Sun, 1 Jan 2012 00:58:56 +0000 (01:58 +0100)]
Improve the ChangeLog
Murray Cumming [Sun, 1 Jan 2012 00:58:26 +0000 (01:58 +0100)]
Tests: Added the beginnings of a test using gwt-test-utils.
* pom.xml: Add dependencies on gwt-test-utils and easymock.
* src/test/resources/META-INF/gwt-test-utils.properties: Add this file
which tells gwt-test-utils what class will be tested.
* src/test/java/org/glom/web/client/GwtTestOnlineGlom.java:
Add a simple (but empty) test case. One class, used by the OnlineGlom
class, is mocked so that it can be created. However, I am not sure
why only this class needs to be mocked.
Note that mockito seems more popular, and clearer, than easymock,
but I have not got that working yet. It might be a matter of the
mockito version.
Murray Cumming [Sat, 31 Dec 2011 22:13:23 +0000 (23:13 +0100)]
Tests: Use junit4-style syntax instead of junit3-style.
* 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/shared/DataItemTest.java:
Use the @Test annotation rather than relying on the test*() prefix.
Also no longer implement TestCase, to avoid triggering support for
the junit3-way, which stops the annotations from working.
Change the imports from import junit.framework.* to
import org.junit.*, which is apparently the new way.
Murray Cumming [Sat, 31 Dec 2011 20:28:49 +0000 (21:28 +0100)]
Added a test for ListPlace token parsing and creation.
* src/test/java/org/glom/web/client/place/ListPlaceTest.java:
This is much the same as DetailsPlaceTest.
I wonder how we could test the other parts of the *Place API
Murray Cumming [Fri, 30 Dec 2011 22:34:26 +0000 (23:34 +0100)]
whitespace cleanup
Murray Cumming [Fri, 30 Dec 2011 22:27:09 +0000 (23:27 +0100)]
DetailsPlace test: Also test getToken() and recreation via getPlace().
* src/test/java/org/glom/web/client/place/DetailsPlaceTest.java:
testGetPlaceParameters(): Get the tokens from the DetailsPlace and
recreate it, testing the recreated DetailsPlace for the same parameter
values.
Murray Cumming [Fri, 30 Dec 2011 22:13:50 +0000 (23:13 +0100)]
Use the surefire-report plugin.
* pom.xml: This generates a HTML report about the tests in
target/site/surefire-report.html
when you do mvn surefire-report:report. It seems to be popular/normal.
Murray Cumming [Fri, 30 Dec 2011 22:12:14 +0000 (23:12 +0100)]
Added a test for DetailsPlace.
* src/test/java/org/glom/web/client/place/DetailsPlaceTest.java:
Test the getPlace() token parsing.
Murray Cumming [Fri, 30 Dec 2011 14:01:07 +0000 (15:01 +0100)]
Added a first unit test.
* pom.xml: Add a test goal, and a dependency on junit in that scope.
* src/test/java/org/glom/web/shared/DataItemTest.java:
This is a silly test but it is just to get things started. Note that
maven/junit finds the test because it looks in src/test by default.
Murray Cumming [Fri, 30 Dec 2011 13:26:03 +0000 (14:26 +0100)]
Update a URL in a comment
Murray Cumming [Fri, 30 Dec 2011 13:25:54 +0000 (14:25 +0100)]
Update a URL in a comment
Ben Konrath [Thu, 22 Dec 2011 22:37:34 +0000 (23:37 +0100)]
Change charsetName to "UTF-8" when replacing line breaks.
JavaScript requires the charsetName to be "UTF-8". CharsetName values
that work in Java (such as "UTF8") will not work when compiled to
JavaScript.
This fixes a problem with multi-line details view fields that have hard
line breaks. The "License Text" field on this page demonstrates the
problem:
http://onlineglom.openismus.com/OnlineGlom/#details:document=debian_repository_analyzer&table=licenses&value=197
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java:
Ben Konrath [Thu, 22 Dec 2011 22:20:27 +0000 (23:20 +0100)]
Fix another bug with related list navigation.
I've tested all the navigation buttons in all of the related lists
so things should be good now.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Thu, 22 Dec 2011 14:05:04 +0000 (15:05 +0100)]
Fix a crasher when refreshing the list view with the default table.
This crash will also happen when loading the list view with the default
table from a link or bookmark.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java: Go
to the main document selection page when the document id hasn't been
set.
* src/main/java/org/glom/web/client/activity/ListActivity.java: Go to
the main document selection page when the document id hasn't been
set.
* src/main/java/org/glom/web/client/place/DetailsPlace.java: Use empty
values for the details place when the document id hasn't been set.
* src/main/java/org/glom/web/client/place/ListPlace.java: Use empty
values for the list place when the document id hasn't been set.
Ben Konrath [Wed, 21 Dec 2011 17:23:07 +0000 (18:23 +0100)]
Protect against NPE when glom.document.locale is not in config.
This patch protects against an NPE when glom.document.locale is not in
the config file. This NPE will also happen if glom.document.locale is
commented out.
The patch also updates the error message to display the class name when
the getMessage() returns null. This was happening when the NPE was
thrown and I had "Configuration Error: null". If an NPE is encountered
with this patch, "Configuration Error: NullPointerException " will be
displayed.
This commit closes this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=666669
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Murray Cumming [Tue, 20 Dec 2011 09:12:14 +0000 (10:12 +0100)]
Rename onlineglom.properties to onlineglom.properties.sample.
* src/main/resources/onlineglom.properties: Rename to:
* src/main/resources/onlineglom.properties.sample:
* src/main/resources/README: And add this file explaining that people
should rename it back when deploying.
Murray Cumming [Tue, 20 Dec 2011 08:56:21 +0000 (09:56 +0100)]
Allow choosing the translation in the .properties file.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java
init(): Read a glom.document.locale value from the configuration file
and call Glom's TransatableItem::set_current_locale() method.
* src/main/resources/onlineglom.properties: Add a commented-out
example of this new setting.
It would be better to add &lang=de_DE to the URL, but the current
libglom API does not allow us to do this easily. I am working on that.
Murray Cumming [Tue, 20 Dec 2011 08:11:25 +0000 (09:11 +0100)]
Revert unwanted change.
Murray Cumming [Mon, 19 Dec 2011 18:20:26 +0000 (19:20 +0100)]
Avoid a crash in parsing of token parameters.
* src/main/java/org/glom/web/client/place/HasSelectableTablePlace.j
ava: getTokenParams(): Do not crash if a parameter has a key but no
value, and ignore parameters with neither.
Murray Cumming [Sat, 17 Dec 2011 22:23:58 +0000 (23:23 +0100)]
History token building/handling: Improve use of token parameters.
* src/main/java/org/glom/web/client/place/HasSelectableTablePlace.java
(HasSelectableTablePlace.Tokenizer): Add getTokenParams(String)
and buildParamsToken(HashMap), for use by derived classes.
Make the separator private because it is no longer be needed.
* src/main/java/org/glom/web/client/place/DetailsPlace.java
(DetailsPlace.Tokenizer.getToken): Use buildParamsToken()
instead of manual string concatenation.
(DetailsPlace.Tokenizer.getPlace): Use getTokenParams() instead
of hardcoded indices and awkward splitting code.
* src/main/java/org/glom/web/client/place/ListPlace.java
(ListPlace.Tokenizer.getToken): Use buildParamsToken()
instead of manual string concatenation.
(ListPlace.Tokenizer.getPlace): Use getTokenParams() instead
of hardcoded indices and awkward splitting code.
This should fix bug #666420
Murray Cumming [Sat, 17 Dec 2011 12:40:32 +0000 (13:40 +0100)]
Update a URL in a comment
Murray Cumming [Fri, 16 Dec 2011 20:39:42 +0000 (21:39 +0100)]
Fix a Navgiation->Navigation typo in the code.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java
Rename processNavgiation() to processNavigation().
Murray Cumming [Fri, 16 Dec 2011 19:41:28 +0000 (20:41 +0100)]
Fix a seperator->separator typo in the code.
* src/main/java/org/glom/web/client/place/DetailsPlace.java
* src/main/java/org/glom/web/client/place/HasSelectableTablePlace.java
* src/main/java/org/glom/web/client/place/ListPlace.java: Just a
misspelling.
Ben Konrath [Thu, 15 Dec 2011 13:50:32 +0000 (14:50 +0100)]
Cleanup some comments.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Ben Konrath [Wed, 14 Dec 2011 16:28:03 +0000 (17:28 +0100)]
Replace \n with <br/> for multiline text in the details view.
Vertical scrollbars are added when needed as well.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java:
Ben Konrath [Wed, 14 Dec 2011 11:21:28 +0000 (12:21 +0100)]
Specify the font for document selection links.
* src/main/webapp/style.css:
Ben Konrath [Wed, 14 Dec 2011 10:45:31 +0000 (11:45 +0100)]
Fix bouncy CellTable while paging.
This doesn't currently work with related list tables in unselected
Notebook tabs.
* src/main/java/org/glom/web/client/ui/list/ListTable.java
Ben Konrath [Wed, 14 Dec 2011 10:01:20 +0000 (11:01 +0100)]
Revamp the appearance of the document selection page.
* src/main/java/org/glom/web/client/ui/DocumentSelectionViewImpl.java:
* src/main/java/org/glom/web/client/ui/DocumentSelectionViewImpl.ui.xml:
* src/main/webapp/style.css:
Ben Konrath [Tue, 13 Dec 2011 19:34:36 +0000 (20:34 +0100)]
Set navigation button column to the smallest size possible.
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
Ben Konrath [Tue, 13 Dec 2011 09:22:43 +0000 (10:22 +0100)]
Change OpenButton nomenclature to NavigationButton.
Using NavigtionButton makes things more generic. Classes, methods and
variables have been changed.
This is a rename-only refactor.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
* src/main/java/org/glom/web/client/ui/ListViewImpl.java:
* src/main/java/org/glom/web/client/ui/cell/NavigationButtonCell.java:
Renamed from OpenButtonCell.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
Ben Konrath [Mon, 12 Dec 2011 20:08:40 +0000 (21:08 +0100)]
Remove unnecessary String argument in RelatedListTable and ListViewTable.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
* src/main/java/org/glom/web/client/ui/ListViewImpl.java:
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
Ben Konrath [Mon, 12 Dec 2011 15:15:13 +0000 (16:15 +0100)]
Update variable names and comments.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
Ben Konrath [Mon, 12 Dec 2011 11:44:53 +0000 (12:44 +0100)]
Properly initialize numNonEmptyRows variable to zero.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
Ben Konrath [Mon, 5 Dec 2011 13:42:02 +0000 (14:42 +0100)]
Add latest mockup with HTML tables.
Features of this mockup:
-> HTML table for flowtable
-> HTML table for flowtable column
-> Example of how related lists would look
-> Not using text entries for data items
The current version of Online Glom doesn't use HTML tables for the
flowtable columns.
This mockup has been sent to the glom-devel mailing list but it's good
to have it here as well.
* mockups/details-view-html-tables.html:
Ben Konrath [Mon, 5 Dec 2011 13:23:55 +0000 (14:23 +0100)]
Remove unnecessary getPrimaryKeyField() method.
getPrimaryKeyFieldForTable(String) has been renamed to
getPrimaryKeyField(String).
* src/main/java/org/glom/web/server/database/DBAccess.java:
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Ben Konrath [Mon, 5 Dec 2011 13:14:47 +0000 (14:14 +0100)]
Add string representation of TypedDataItem value to conversion error message.
* src/main/java/org/glom/web/server/Utils.java: Logging the error
message was extracted into its own method to avoid duplication.
Ben Konrath [Mon, 5 Dec 2011 12:59:03 +0000 (13:59 +0100)]
Add type checking to navigation primary key value creation.
Create navigation primary key only if the expected type from the Glom
document matches the type returned by the SQL query.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Ben Konrath [Mon, 5 Dec 2011 12:29:59 +0000 (13:29 +0100)]
Rename a couple of variables in RelatedListNavigation.
This is a rename-only refactor.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Ben Konrath [Mon, 5 Dec 2011 12:26:29 +0000 (13:26 +0100)]
Move getListLayoutGroup() into getListViewLayoutGroup().
This removes getListLayoutGroup(). It was only being called by
getListViewLayoutGroup().
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Mon, 5 Dec 2011 12:15:14 +0000 (13:15 +0100)]
Remove check for LayoutItem_Portal in list table method.
This check is no longer necessary because the method isn't being used
to create the LayoutItemPortal DTO.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Mon, 5 Dec 2011 12:10:44 +0000 (13:10 +0100)]
Properly support related list navigation.
Navigation from the "Repository Analyzer -> Package Scans ->
Dependencies" related table wasn't working because the primary key for
related tables wasn't being set properly. This commit fixes the
problem.
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Don't use
getListLayoutGroup() to create the LayoutItemPortal DTO. This method
doesn't set the primary key properly for related list tables.
* src/main/java/org/glom/web/server/database/DBAccess.java: Add table
name parameter to getPrimaryKeyLayoutItemField(). This makes the method
useful for getting the primary key for list view tables and for related
list tables.
* src/main/java/org/glom/web/server/database/ListDBAccess.java:
* src/main/java/org/glom/web/server/database/ListViewDBAccess.java:
Move code to set the primary key for the table from the abstract
ListDBAccess class to ListViewDBAccess as it's only correct for list
view tables.
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
Properly add primary key to related list tables.
Ben Konrath [Fri, 2 Dec 2011 13:35:30 +0000 (14:35 +0100)]
Properly set the horizontal alignment of fields.
This fix is for both the list tables and the details view.
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Use
LayoutItem_WithFormatting.get_formatting_used_horizontal_alignment(boolean)
to set the horizontal alignment of fields.
Ben Konrath [Fri, 2 Dec 2011 12:51:16 +0000 (13:51 +0100)]
Revert "Align TYPE_NUMERIC with AUTO alignment to the right in list tables."
This reverts commit
551ec2a81ab5b7df0f4ce97262cdc3b64b360f05.
Ben Konrath [Fri, 2 Dec 2011 12:23:06 +0000 (13:23 +0100)]
Align TYPE_NUMERIC with AUTO alignment to the right in list tables.
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
Ben Konrath [Fri, 2 Dec 2011 12:04:27 +0000 (13:04 +0100)]
Display currency codes in the details view.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java:
Ben Konrath [Fri, 2 Dec 2011 11:23:32 +0000 (12:23 +0100)]
Avoid duplicate JNI call.
JNI is not as efficient as pure Java and this is an easy (and small)
optimization.
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
Use previously retrieved value for whereClauseToTableName instead of
getting it again.
Ben Konrath [Fri, 2 Dec 2011 11:16:53 +0000 (12:16 +0100)]
Rename a couple of variables in RelatedListNavigation.
This is a rename-only refactor.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Ben Konrath [Fri, 2 Dec 2011 11:07:30 +0000 (12:07 +0100)]
Indicate clearly that a mismatched primary key type is a bug.
* src/main/java/org/glom/web/server/Utils.java: Change log level from
warning to error. Add 'This is a bug.' to message.
Ben Konrath [Fri, 2 Dec 2011 11:01:30 +0000 (12:01 +0100)]
Update / fix some comments.
* src/main/java/org/glom/web/client/OnlineGlomService.java: Remove old
comments.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java: Fix
comment.
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
Fix comments. Add some TODOs.
Ben Konrath [Fri, 2 Dec 2011 10:54:06 +0000 (11:54 +0100)]
Enable navigation to details view with string primary key from related list.
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Create a text primary key value when return type of result is
java.sql.Types.VARCHAR.
Ben Konrath [Fri, 2 Dec 2011 10:01:42 +0000 (11:01 +0100)]
Use checkboxes for booleans in the details view.
* src/main/java/org/glom/web/client/ui/details/DetailsCell.java:
Ben Konrath [Thu, 1 Dec 2011 17:27:18 +0000 (18:27 +0100)]
Improve performance of related list height calculation.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
Put code to calculate the expected height in a static initializer so
that that it's only called once.
Ben Konrath [Thu, 1 Dec 2011 16:41:35 +0000 (17:41 +0100)]
Show related list tables in notebooks (again).
Calculate the height of the related list tables so the Notebook can be
set the correct height. The height of the related list table is also needed by
FlowTable to be able decide how to create the layout.
* src/main/java/org/glom/web/client/ui/details/Portal.java: Calculate
and set the Portal height based on the height of the related list
table and the Portal container.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
Add method to calculate the height of the related list tables.
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
* src/main/webapp/style.css: Add css class for Pager. This is needed to
calculate the height of the Pager widget.
Ben Konrath [Thu, 1 Dec 2011 15:02:19 +0000 (16:02 +0100)]
Use CellTable API for table property instead of setting style on Element.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
Ben Konrath [Thu, 1 Dec 2011 12:02:55 +0000 (13:02 +0100)]
Make ListViewTable and RelatedListTable a consistent height.
The tables are now a consistent height regardless of the contents of
the table. A hidden button is added to empty rows to ensure that the
height of these rows will match the height of rows with data.
A navigation button column is now added to every table. The width of
the navigation column is set to 0px when a RelatedListTable shouldn't
have navigation buttons. This maintains the a consistent row height in
tables that don't show the navigation buttons.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java: Hide
navigation column when not needed.
* src/main/java/org/glom/web/client/ui/ListViewImpl.java: Move method
arguments for navigation button to constructor of ListViewTable.
* src/main/java/org/glom/web/client/ui/cell/OpenButtonCell.java: Render
hidden button for empty data rows.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java: Add method
arguments for navigation button to constructor.
* src/main/java/org/glom/web/client/ui/list/ListTable.java: Always
create navigation buttons. Add hideNavigationButtons() method.
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java: Add method
arguments for navigation button to constructor.
Ben Konrath [Thu, 1 Dec 2011 10:50:29 +0000 (11:50 +0100)]
Use 'visibility: hidden' in Utils.getWidgetHeight().
This is better choice because hidden elements are invisible, don't
respond to events and are not part of the tab order. They will,
however, take up space which is required to be able to calculate the
height of the widget.
* src/main/java/org/glom/web/client/Utils.java:
Ben Konrath [Thu, 1 Dec 2011 10:30:31 +0000 (11:30 +0100)]
Use Utils.getWidgetHeight() in FlowTable.
* src/main/java/org/glom/web/client/Utils.java: Remove TODO item about
this.
* src/main/java/org/glom/web/client/ui/details/FlowTable.java:
Ben Konrath [Thu, 1 Dec 2011 02:02:18 +0000 (03:02 +0100)]
Put the details css class name on the correct table column.
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
Ben Konrath [Wed, 30 Nov 2011 13:38:56 +0000 (14:38 +0100)]
Update for java-libglom API change.
The getters and setters on FieldFormatting and NumericFormat were
changed to remove the 'M'.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Tue, 29 Nov 2011 19:42:01 +0000 (20:42 +0100)]
Only allow RelatedListTables in Portals.
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Tue, 29 Nov 2011 19:32:49 +0000 (20:32 +0100)]
Only create a contents panel for Portals when title is being set.
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Tue, 29 Nov 2011 14:29:20 +0000 (15:29 +0100)]
Set TabLayoutPanel height based on calculated height its widgets.
This is a potential fix for this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=665133
* src/main/java/org/glom/web/client/ui/details/Notebook.java:
Ben Konrath [Tue, 29 Nov 2011 14:10:02 +0000 (15:10 +0100)]
Align details field labels and data with the Open buttons.
* src/main/webapp/style.css:
Ben Konrath [Tue, 29 Nov 2011 10:08:29 +0000 (11:08 +0100)]
Remove unnecessary <div> in the Notebook widget.
* src/main/java/org/glom/web/client/ui/details/Group.java: Remove
method to get container FlowPanel (<div>).
* src/main/java/org/glom/web/client/ui/details/Notebook.java: Run the
initWidget() method directly on the TabLayoutPanel widget instead of
Group's container widget.
Ben Konrath [Tue, 29 Nov 2011 09:49:35 +0000 (10:49 +0100)]
Don't add group titles for Portals in Notebooks.
This reverts the previous patch and fixes a bug I introduced with
commit
b1753fd27bd2c4ea189c4c353e0ece92dcc66c2c .
* src/main/java/org/glom/web/client/ui/details/Group.java:
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Mon, 28 Nov 2011 19:44:56 +0000 (20:44 +0100)]
Remove unused boolean argument in Portal constructor.
Just a code cleanup.
* src/main/java/org/glom/web/client/ui/details/Group.java:
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Mon, 28 Nov 2011 18:15:06 +0000 (19:15 +0100)]
Remove hack for glom 1.18 style glom files.
* src/main/java/org/glom/web/client/ui/details/Group.java:
* src/main/java/org/glom/web/client/ui/details/Notebook.java:
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Mon, 28 Nov 2011 14:46:26 +0000 (15:46 +0100)]
Use Gda Value version of primary key to log result too large error.
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
Ben Konrath [Mon, 28 Nov 2011 14:17:46 +0000 (15:17 +0100)]
Don't use TypedDataItem.getText() for Unknown types from the URL.
* src/main/java/org/glom/web/client/place/DetailsPlace.java:
* src/main/java/org/glom/web/server/Utils.java: Use getUnknown()
instead of getText().
* src/main/java/org/glom/web/shared/TypedDataItem.java: Add unknown
String field and getUnknown() method.
Ben Konrath [Mon, 28 Nov 2011 13:14:40 +0000 (14:14 +0100)]
Log an error message when the java-libglom .so is not present.
The error message was being set in the exception but not logged.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Ben Konrath [Mon, 28 Nov 2011 12:40:01 +0000 (13:40 +0100)]
Ignore LayoutItem_CalendarPortals.
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Don't
create the LayoutItemPortal DTO for LayoutItem_CanendarPortals.
Ben Konrath [Mon, 28 Nov 2011 12:25:13 +0000 (13:25 +0100)]
Extract method for creating the LayoutItemPortal DTO.
Just breaking the code up into smaller chunks.
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Mon, 28 Nov 2011 08:09:54 +0000 (09:09 +0100)]
Add TypedDataItem.
This should have been added with the refactor. Oops!
* src/main/java/org/glom/web/shared/TypedDataItem.java:
Ben Konrath [Mon, 28 Nov 2011 08:02:29 +0000 (09:02 +0100)]
Create primary key value from URL string using type from Glom document.
See this bug, comments 19 - 25:
https://bugzilla.gnome.org/show_bug.cgi?id=662376#c19
* src/main/java/org/glom/web/client/place/DetailsPlace.java: Don't
create a TypeDataItem for the primary key here when loading from a
URL. Show the same string for the primary key value as was received
from the URL string (when loading from a URL).
* src/main/java/org/glom/web/server/Utils.java: Update method for
creating the Gda Value from the TypeDataItem to properly deal with
creating a Gda Value based on the Glom document type for the primary
key value string when loading from a URL.
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Update for changed method name.
Ben Konrath [Sun, 27 Nov 2011 14:50:37 +0000 (15:50 +0100)]
Rename PrimaryKeyItem to TypedDataItem.
The name PrimaryKeyItem suggests what the class should be used for.
TypedDataItem is a neutral name that describes the class better.
This is a rename-only refactor.
* src/main/java/org/glom/web/client/OnlineGlomService.java:
* src/main/java/org/glom/web/client/OnlineGlomServiceAsync.java:
* src/main/java/org/glom/web/client/Utils.java:
* src/main/java/org/glom/web/client/activity/DetailsActivity.java:
* src/main/java/org/glom/web/client/place/DetailsPlace.java:
* src/main/java/org/glom/web/client/ui/ListViewImpl.java:
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
* 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/Utils.java:
* src/main/java/org/glom/web/server/database/DetailsDBAccess.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/shared/NavigationRecord.java:
Ben Konrath [Fri, 25 Nov 2011 21:37:51 +0000 (22:37 +0100)]
Improve Gda Value conversion from PrimaryKeyItem.
The value from the PrimaryKeyItem is only used if its type match the
type from the glom document.
* src/main/java/org/glom/web/server/Utils.java:
Ben Konrath [Fri, 25 Nov 2011 20:41:16 +0000 (21:41 +0100)]
Manually check if the java-liblgom .so is visible to the JVM.
It seems that Tomcat has problems when a static initializer throws an
exception. This check is done before the first method call into
java-libglom so that execution doesn't continue if the .so is not
found.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Ben Konrath [Fri, 25 Nov 2011 15:06:52 +0000 (16:06 +0100)]
Improve browser configuration error messages.
This fixes:
https://bugzilla.gnome.org/show_bug.cgi?id=662792
* src/main/java/org/glom/web/client/OnlineGlomService.java:
* src/main/java/org/glom/web/client/OnlineGlomServiceAsync.java: Add
getConfigurationErrorMessage() method.
* src/main/java/org/glom/web/client/activity/DocumentSelectionActivity.java:
Get and display a specific configuration error message when no Glom
documents are found.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java:
Implement getConfigurationErrorMessage() method. Surround configuration
code in the init() method with a try/catch block. This allows the
errors to be caught while keeping the servlet available to retrieve the
configuration error message.
Ben Konrath [Fri, 25 Nov 2011 11:14:06 +0000 (12:14 +0100)]
Don't use Strings to hold primary key values.
The primary key values are now held in a new data object
(PrimaryKeyItem) that holds type information and the primary key value
using the correct type.
* 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: Use
PrimaryKeyItem instead of String to hold the primary key value.
* src/main/java/org/glom/web/client/Utils.java: Remove
getKeyValueStringForQuery(). Add getPrimaryKeyItem() which creates a
PrimaryKeyItem based on the GlomFieldType and the DataItem.
* src/main/java/org/glom/web/client/activity/DetailsActivity.java: Use
PrimaryKeyItem instead of String to hold the primary key value. Load
document selection page when the documentID has not been set correctly.
* src/main/java/org/glom/web/client/place/DetailsPlace.java: Re-work
DetailsPlace -> URL and URL -> DetailsPlace conversion with
PrimaryKeyItem.
* src/main/java/org/glom/web/client/place/DocumentSelectionPlace.java:
Return empty string for URL instead of "null".
* src/main/java/org/glom/web/client/ui/ListViewImpl.java:
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
* src/main/java/org/glom/web/client/ui/list/ListTable.java:
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Use
PrimaryKeyItem instead of String to hold primary key values.
* src/main/java/org/glom/web/server/Utils.java: New method to convert a
PrimaryKeyValue to a Gda Value.
* src/main/java/org/glom/web/server/database/DetailsDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListDBAccess.java:
* src/main/java/org/glom/web/server/database/RelatedListNavigation.java:
Replace temporary database access code that uses the PrimaryKeyValue to
Gda Value conversion.
* src/main/java/org/glom/web/shared/DataItem.java: Add comment.
* src/main/java/org/glom/web/shared/NavigationRecord.java: Use
PrimaryKeyItem instead of String.
* src/main/java/org/glom/web/shared/PrimaryKeyItem.java: New class to
hold primary key values.
Ben Konrath [Thu, 24 Nov 2011 18:20:03 +0000 (19:20 +0100)]
Use newly added java-libglom API to create queries.
This isn't finished. I still need to stop using Strings for primary key
values in the client code.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java: Tell
libglom to use fake connections so that retrieving the query string will
work.
* 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:
Use the newly added libglom sql methods and classes to create the
query. Add temporary hack to convert primary value strings to Gda
Value.
Ben Konrath [Wed, 23 Nov 2011 14:45:43 +0000 (15:45 +0100)]
Don't explicitly set the height of Portals.
See comments 6 - 10 of this bug for details:
https://bugzilla.gnome.org/show_bug.cgi?id=662930#c6
* src/main/java/org/glom/web/client/ui/details/Portal.java:
Ben Konrath [Wed, 23 Nov 2011 14:37:34 +0000 (15:37 +0100)]
Use an HTML table instead of CSS for the FlowTable layout.
* src/main/java/org/glom/web/client/ui/details/FlowTable.java: Use
GWT's FlexTable to implement the FlowTable.
* src/main/webapp/style.css: Adjust CSS for the change to FlexTable.
Ben Konrath [Fri, 18 Nov 2011 21:13:50 +0000 (22:13 +0100)]
Add boolean example to HTML table mockup.
* mockups/details-view-html-tables-text-entries.html:
Ben Konrath [Thu, 17 Nov 2011 14:51:30 +0000 (15:51 +0100)]
Ensure the pager buttons are always visible for related lists.
To accomplish this, I've turned off text wrapping in the list view and
related list tables for both the header and data text. The related list
table now has a fixed layout so the it doesn't overflow its container.
This is required to ensure that the cell text is clipped when it
overflows the cell and an ellipsis is added to the right side of the
cell when text is clipped.
A fixed table layout for the related list table in the details view
seems what we want for the details view anyway, so the side-effect is
desirable.
The ellipsis will only be displayed in Firefox >= 7.
This fixes bug:
https://bugzilla.gnome.org/show_bug.cgi?id=662930
* src/main/java/org/glom/web/client/ui/cell/NumericCell.java:
* src/main/java/org/glom/web/client/ui/cell/TextCell.java: Add
'overflow: hidden; text-overflow: ellipsis;' CSS properties to the table
cell text.
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
Set the 'table-layout: fixed' CSS property to the related list table.
* src/main/java/org/glom/web/client/ui/list/ListTable.java: Set the
'white-space: nowrap;' CSS property on both the list view and the
related list tables.
Ben Konrath [Wed, 16 Nov 2011 16:38:10 +0000 (17:38 +0100)]
Rework the fix for empty notebook tab labels.
Setting the empty group titles with its name caused problems for the
details layout. Instead of using libglom's
LayoutItem.get_title_or_name(), the LayoutItem name is explicitly sent
to the client when the title is empty. This allows the Notebook to use
the name when the title is empty without affecting anything else.
* src/main/java/org/glom/web/client/ui/details/Notebook.java:
* src/main/java/org/glom/web/server/ConfiguredDocument.java:
Ben Konrath [Wed, 16 Nov 2011 16:03:52 +0000 (17:03 +0100)]
Set group titles with name when title is empty.
This fixes a problem with an empty notebook tab label in the Lesson
Planner document. The forth tab in the notebook should be "Internet":
http://bagu.org:8080/OnlineGlom/#details:document=lesson-planner&table=teachers&value=0
* src/main/java/org/glom/web/server/ConfiguredDocument.java: Use
libglom's LayoutItem.get_title_or_name() to fill in the LayoutGroup
DTO title.
Ben Konrath [Wed, 16 Nov 2011 13:31:33 +0000 (14:31 +0100)]
Remove whitespace from the configured username properties.
This assumes that usernames won't have whitespace at the beginning
or end. But I think this is a reasonable assumption.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java: Use
String.trim() to remove the whitespace from the username properties.
Ben Konrath [Tue, 15 Nov 2011 22:39:11 +0000 (23:39 +0100)]
Add details view mockup with HTML tables and text entries.
This is from the attachment on this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=663109
* mockups/details-view-html-tables-text-entries.html:
Ben Konrath [Tue, 15 Nov 2011 21:39:49 +0000 (22:39 +0100)]
Add space between the columns of the flow table.
This fixes:
https://bugzilla.gnome.org/show_bug.cgi?id=662918
* src/main/java/org/glom/web/client/ui/details/FlowTable.java: Add a 1%
space between columns in the flow table.
Ben Konrath [Tue, 15 Nov 2011 16:19:53 +0000 (17:19 +0100)]
Add backup files to the .gitignore.
* .gitignore: Ignore files that end with ~.
Ben Konrath [Wed, 9 Nov 2011 20:23:23 +0000 (21:23 +0100)]
Use latest release of gwt-log.
Gwt-log releases are now being submitted to the maven central
repository so manual installation of the jar is no longer required.
* pom.xml: Update version and groupId of gwt-log dependency.
Ben Konrath [Mon, 31 Oct 2011 15:16:36 +0000 (16:16 +0100)]
Don't use GWT numeric formatting to override the glom currency formatting.
Currencies are now displayed like they are in Glom. See this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=646216
* src/main/java/org/glom/web/client/Utils.java: Remove GWT currency
formatting.
* src/main/java/org/glom/web/client/ui/cell/NumericCell.java: Add
currency code to constructor and set it when the cell is rendered.
* src/main/java/org/glom/web/client/ui/list/ListTable.java: Add the
currency code to the constructor of the NumericCell.
Murray Cumming [Mon, 24 Oct 2011 13:39:15 +0000 (15:39 +0200)]
Use the master branch of java-libglom
* pom.xml: Depend on java-libglom 1.19 instead.
This is the master branch. See also the libglom-1-18 branch.
Ben Konrath [Thu, 27 Oct 2011 13:31:10 +0000 (15:31 +0200)]
Require the latest release of java-libglom (1.17.4).
* pom.xml:
Ben Konrath [Wed, 26 Oct 2011 20:37:51 +0000 (22:37 +0200)]
Add style to Notebook that matches current theme.
It's not the best style in the world but it's better than the default.
* src/main/java/org/glom/web/client/ui/details/Notebook.java: Add some
padding at the bottom of the child widgets.
* src/main/webapp/style.css: Add style for the Notebook.
Ben Konrath [Wed, 26 Oct 2011 18:55:29 +0000 (20:55 +0200)]
Move servlet initialization code to overridden init method.
This is half of the solution to getting proper error messages
displayed when configuration errors occur. Here's the relevant bug:
https://bugzilla.gnome.org/show_bug.cgi?id=662792
The rest of the solution involves surrounding the init method with a
try/catch block and setting a global variable with the error /
exception. A new async method should be created to retrieve and display
the error message / exception.
* src/main/java/org/glom/web/server/OnlineGlomServiceImpl.java: Move
code from constructor to init method adding exceptions as needed.
Ben Konrath [Wed, 26 Oct 2011 18:22:50 +0000 (20:22 +0200)]
Add script to monitor and restart tomcat if required.
* utils/check-and-recover-tomcat.py: New file.
Ben Konrath [Wed, 26 Oct 2011 15:31:34 +0000 (17:31 +0200)]
Display the correct number of data items in the pager.
This commit fixes:
https://bugzilla.gnome.org/show_bug.cgi?id=661441
* src/main/java/org/glom/web/client/ui/list/ListViewTable.java:
* src/main/java/org/glom/web/client/ui/details/RelatedListTable.java:
The implementation is the same for both tables: Keep track of the
number of non-empty rows and fire and RowCountChangeEvent after the data has
been updated.
* src/main/java/org/glom/web/client/ui/list/ListTable.java: Add a
custom Pager class that subclasses SimplePager to handle displaying
the correct number when empty rows have been added.
Ben Konrath [Wed, 26 Oct 2011 15:19:31 +0000 (17:19 +0200)]
Correct error in previous commit.
* src/main/java/org/glom/web/client/activity/ListActivity.java: Remove
eventBus parameter from listView.setCellTable().
Ben Konrath [Wed, 26 Oct 2011 14:27:34 +0000 (16:27 +0200)]
Fix error in TODO comment.
* src/main/java/org/glom/web/client/activity/ListActivity.java: