Issue Details (XML | Word | Printable)

Key: BEEHIVE-206
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: matt c
Reporter: James Song
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Beehive

control property constraint:AnnotationMemberTypes.Date accept one format

Created: 29/Jan/05 12:41 AM   Updated: 20/Jul/06 03:51 PM
Return to search
Component/s: Controls
Affects Version/s: V1Beta
Fix Version/s: 1.0.2

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works diff-BEEHIVE-206.txt 2006-06-27 02:40 AM Andrew McCulloch 1 kB
Java Source File Licensed for inclusion in ASF works MemberTypeTest.java 2005-06-18 02:27 AM James Song 3 kB
Java Source File Licensed for inclusion in ASF works MemberTypeTest.java 2005-06-18 02:19 AM James Song 3 kB
Java Source File Licensed for inclusion in ASF works PersonControl.java 2005-06-18 02:30 AM James Song 4 kB
Java Source File Licensed for inclusion in ASF works PersonControl.java 2005-06-18 02:19 AM James Song 4 kB

Resolution Date: 28/Jun/06 12:28 AM


 Description  « Hide
Currently, AnnotationMemberTypes.Date only accept YYYY/MM/DD.
There will be cases when user would like to specify the HH:MM, or other input format, such as long date format.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Hoi Lam added a comment - 03/Mar/05 06:39 AM
The member "format" has been added to the ControlMemberTypes.Date annotation. Users can use it to specify the date format they want to use.

James Song added a comment - 18/Jun/05 02:11 AM
I see the folloowing error when running "ant build" from trunk/controls/test:
      [apt] D:\beehive\controls\test\src\units\org\apache\beehive\controls\test\java\property\Member
TypeTest.java:67: A value assigned to a control property does not satisfy its constraints. Cause: Va
lue assigned to a date property is not in the specified format.
      [apt] private PersonControlBean thisPerson;

Repro:
1. Copy the attached PersonControl.java into trunk\controls\test\src\controls\org\apache\beehive\controls\test\controls\property\constraint;
2. Copy the attached MemberTypeTest.java into trunk\controls\test\src\units\org\apache\beehive\controls\test\java\property
3. from trunk\controls\test, run "ant build"

James Song added a comment - 18/Jun/05 02:27 AM
Update the java test to overwrite the previous one.

James Song added a comment - 18/Jun/05 02:30 AM
Update PersonControl.java to overwrite the previous one.

James Song added a comment - 18/Jun/05 02:40 AM
OK, JIRA doesn't allow me to delete previously attached, nor overwriting.
Please ignore the PersonControl.java and MemberTypeTest.java attached at 17/Jun/05 07:19 PM.

You could find the time of attached by clicking "Manage Attachment".

Chad Schoettger added a comment - 11/Oct/05 06:40 AM
The issue here was that the maxValue constraint for the AnnotationMemberTypes.Date annotation was not in the proper date format. minValue and maxValue must be in the format specified by the format attribute.

I have resolved this issue by added more detailed error messages, which explain which date was not in the right format.

The resolution is part of the patch for BEEHIVE-957.

matt c added a comment - 12/Apr/06 07:08 AM
The above issue failed b/c the maxValue was set to an improper format. Set it to "Sun, Jul 4, '04", for example, and the code will work.

!!The error message is erroneous though!! - even though the maxValue is wrong, it prints out the value set in the client, for the above code the error is:

Cause: The value, Wed, Jul 4, '01, assigned to maxValue date constraint property is not in the specified format of: EEE, MMM d, ''yy

Where the value - Wed, Jul 4, '01 - is not the maxValue (and not the problem), but it is instead the value being sent by the client.

Verified fixed using local beehive build synced to SVN 393036 by running the test case:
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/src/units/org/apache/beehive/controls/test/java/property/MemberTypeTest.java

This bug can be closed, though I think the error message should be changed.

matt c added a comment - 12/Apr/06 07:09 AM
James, could you assign this back to Chad, and he can comment on whether or not the message needs to be changed.

Thanks -
Matt

Chad Schoettger added a comment - 13/Apr/06 03:40 AM
It appears the error message is incorrect, I'll take another look at this one.

Andrew McCulloch added a comment - 27/Jun/06 02:40 AM
Chad, this is a simple patch that changes the value displayed in the error messages for AnnotationMemberTypes.Date maxValue and minValue constraint violations. It seemed to be a simple change so I thought I would take a crack at it. Can you take a second to review the diff and submit it to svn if you find it useful?

Thanks,
--Andrew

Andrew McCulloch added a comment - 27/Jun/06 02:43 AM
When I use the test attached by James against the attached patch the new error message is...

      [apt] /dev/svn/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/MemberTypeTest.java:69: A value assigned to a control property does not satisfy its constraints. Cause: The value, 2007/01/31, assigned to maxValue date constraint property is not in the specified format of: EEE, MMM d, ''yy
      [apt] private PersonControlBean thisPerson;
      [apt] ^
      [apt] 1 error


I believe this is the expected error for the attached version of this testcase.

Chad Schoettger added a comment - 28/Jun/06 12:28 AM
Patch applied svn rev 417526. Assiging to matt for verification / closure.

matt c added a comment - 20/Jul/06 03:51 PM
Verified as closed, the error now reads:

A value assigned to a control property does not satisfy its constraints. Cause: The value, Wed, Jul 4, '04, assigned to a date property is not in the specified format of: yyyy/MM/dd

After changing to the proper format, code compiles.

Verified with version: 417573M