In the UI, allow primary keys to be any type, and test it.
authorMurray Cumming <murrayc@murrayc.com>
Sun, 2 Dec 2012 20:52:07 +0000 (21:52 +0100)
committerMurray Cumming <murrayc@murrayc.com>
Sun, 2 Dec 2012 20:53:44 +0000 (21:53 +0100)
commit56c496224537605df15ff48f8237145c5e6655e2
tree05b324ddc58ce85ec152d311b0bc8db9aabd60db
parentd778a980d57acb673e17d2c218d1f835410a6eca
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).
ChangeLog
src/main/java/org/glom/web/client/place/DetailsPlace.java
src/main/java/org/glom/web/server/ConfiguredDocument.java
src/main/java/org/glom/web/server/Utils.java
src/main/java/org/glom/web/server/database/RelatedListNavigation.java
src/main/java/org/glom/web/server/libglom/Document.java
src/main/java/org/glom/web/shared/TypedDataItem.java
src/test/java/org/glom/web/client/place/DetailsPlaceTest.java