You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2012/02/16 00:53:44 UTC

change to config file names

for security; rather than security_file.passwords and security_file.allow,
these will instead be authentication_file.passwords and
authorization_file.allow.

See ISIS-192

Dan

RE: Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I was out of the office for last week, I'll create a ticket in jira,

I was using the HTML viewer,  so far I haven't found out a way to enable the scimpi viewer, which I prefer.




Jason Richardson
National Payments Service (NPS) Technical Lead
USDA/FSA/AFAO/SCADG
(Administrative and Financial Applications Office)
(Service Center Accounting & Debt Group)
Office Ph: (816) 823-5296
Cubicle:  3NW024
NPS I.T. Matrix (JIRA)
NPS Email Groups Listing



-----Original Message-----
From: Robert Matthews [mailto:rmatthews@nakedobjects.org] 
Sent: Thursday, May 10, 2012 2:18 PM
To: isis-users@incubator.apache.org
Subject: Re: Problem with Date fields on my Domain Objects

Try using the ISO format as a test to see if will accept any date, so enter 2012-09-05.  If that doesn't work then it's not just formatting.  
If that works then try 05/09/12.

What UI are you using the HTML, Scimpi or Wicket viewers?

Rob


On 09/05/12 17:34, Richardson, Jason - FSA, Kansas City, MO wrote:
> I have a domain object that has a java.util.Date.
> When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
> isis.value.format.date=dd/MM/yyyy
>
> My DOM has this for the code:
> It's a java.util.Date.
>
>
>          private Date shiftDate;
>
>          @MemberOrder(sequence = "1")
>          public Date getShiftDate() {
>                  return shiftDate;
>          }
>
>          public void setShiftDate(Date shiftDate) {
>                  this.shiftDate = shiftDate;
>          }
>
>
> Example return on my webpage:
> * Not recognised as a date: 05/09/2012
>
>
> Jason Richardson
>
>
>
>
> This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
>



Re: Problem with Date fields on my Domain Objects

Posted by Robert Matthews <rm...@nakedobjects.org>.
Try using the ISO format as a test to see if will accept any date, so 
enter 2012-09-05.  If that doesn't work then it's not just formatting.  
If that works then try 05/09/12.

What UI are you using the HTML, Scimpi or Wicket viewers?

Rob


On 09/05/12 17:34, Richardson, Jason - FSA, Kansas City, MO wrote:
> I have a domain object that has a java.util.Date.
> When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
> isis.value.format.date=dd/MM/yyyy
>
> My DOM has this for the code:
> It's a java.util.Date.
>
>
>          private Date shiftDate;
>
>          @MemberOrder(sequence = "1")
>          public Date getShiftDate() {
>                  return shiftDate;
>          }
>
>          public void setShiftDate(Date shiftDate) {
>                  this.shiftDate = shiftDate;
>          }
>
>
> Example return on my webpage:
> * Not recognised as a date: 05/09/2012
>
>
> Jason Richardson
>
>
>
>
> This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
>

Re: Problem with Date fields on my Domain Objects

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Hi Jason,

You have uncovered a fault in the SQL-OS.

Please can you create a JIRA ticket and assign to me?

"SQL-OS java.util.Date value not correctly detected" or something.

I thought that I had an assignment into java.util.Date in my tests... ah 
well.

Regards,
Kevin


On 9 May 2012 at 20:17, Dan Haywood wrote:

> Hmm, Kevin's the expert on this, but as a workaround, if you convert to
> using the applib Datetime in your POJO rather than a java.util.Date, then
> maybe that would work?
> 
> Dan
> 
> 
> On 9 May 2012 19:49, Richardson, Jason - FSA, Kansas City, MO <
> jason.richardson@kcc.usda.gov> wrote:
> 
> > Using today,  I got this exception.
> >
> > java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
> > java.lang.ClassCastException: java.util.Date cannot be cast to
> > org.apache.isis.applib.value.DateTime
> >        at
> > org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.JdbcDateTimeMapper.preparedStatementObject(JdbcDateTimeMapper.java:51)
> >        at
> > org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping.appendInsertValues(AbstractJdbcFieldMapping.java:59)

> >
> > On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:
> >
> > > I have a domain object that has a java.util.Date.
> > > When running my app, I can't get a date to be accepted.  I have tried
> > multiple date formats.  And I even put in a property.
> > > isis.value.format.date=dd/MM/yyyy
> > >
> > > My DOM has this for the code:
> > > It's a java.util.Date.
> > >
> > >
> > >         private Date shiftDate;
> > >
> > >         @MemberOrder(sequence = "1")
> > >         public Date getShiftDate() {
> > >                 return shiftDate;
> > >         }
> > >
> > >         public void setShiftDate(Date shiftDate) {
> > >                 this.shiftDate = shiftDate;
> > >         }
> > >
> > >
> > > Example return on my webpage:
> > > * Not recognised as a date: 05/09/2012
> > >
> > >
> > > Jason Richardson


RE: Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I created two tickets:

https://issues.apache.org/jira/browse/ISIS-230
https://issues.apache.org/jira/browse/ISIS-229



Jason Richardson
National Payments Service (NPS) Technical Lead
USDA/FSA/AFAO/SCADG
(Administrative and Financial Applications Office)
(Service Center Accounting & Debt Group)
Office Ph: (816) 823-5296
Cubicle:  3NW024
NPS I.T. Matrix (JIRA)
NPS Email Groups Listing



-----Original Message-----
From: Kevin Meyer - KMZ [mailto:kevin@kmz.co.za]
Sent: Thursday, May 10, 2012 1:59 AM
To: isis-users@incubator.apache.org
Subject: Re: Problem with Date fields on my Domain Objects

Sounds like the (notorious) Time Zone bug again... it's been a source of endless grief for me. It's either the "Today" parser, or in the database table/Isis interface.

Again, could you raise a JIRA ticket?

Thanks,
Kevin


On 9 May 2012 at 19:59, Richardson, Jason - FSA, Kans wrote:

> I changed the date class to be org.apache.isis.applib.value.Date
>
> I was able to create the instance, and I used "Today",  however, it saved the date with yesterday's date.
>
> My dom field "shift_date" was set to: 2012-05-08 Isis did set its
> "modified_on" field correctly: 2012-05-09 14:52:09.265
>






This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.


Re: Problem with Date fields on my Domain Objects

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Sounds like the (notorious) Time Zone bug again... it's been a source 
of endless grief for me. It's either the "Today" parser, or in the 
database table/Isis interface.

Again, could you raise a JIRA ticket?

Thanks,
Kevin


On 9 May 2012 at 19:59, Richardson, Jason - FSA, Kans wrote:

> I changed the date class to be org.apache.isis.applib.value.Date
> 
> I was able to create the instance, and I used "Today",  however, it saved the date with yesterday's date.
> 
> My dom field "shift_date" was set to: 2012-05-08
> Isis did set its "modified_on" field correctly: 2012-05-09 14:52:09.265
> 


RE: Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I the date class to be org.apache.isis.applib.value.Date

I was able to create the instance, and I used "Today",  however, it saved the date with yesterday's date.

My dom field "shift_date" was set to: 2012-05-08
Isis did set its "modified_on" field correctly: 2012-05-09 14:52:09.265


Jason Richardson



-----Original Message-----
From: Richardson, Jason - FSA, Kansas City, MO [mailto:jason.richardson@kcc.usda.gov] 
Sent: Wednesday, May 09, 2012 2:23 PM
To: isis-users@incubator.apache.org
Subject: RE: Problem with Date fields on my Domain Objects

I'm going to try that next.



Jason Richardson
National Payments Service (NPS) Technical Lead USDA/FSA/AFAO/SCADG (Administrative and Financial Applications Office) (Service Center Accounting & Debt Group) Office Ph: (816) 823-5296
Cubicle:  3NW024
NPS I.T. Matrix (JIRA)
NPS Email Groups Listing



-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
Sent: Wednesday, May 09, 2012 2:17 PM
To: isis-users@incubator.apache.org
Subject: Re: Problem with Date fields on my Domain Objects

Hmm, Kevin's the expert on this, but as a workaround, if you convert to using the applib Datetime in your POJO rather than a java.util.Date, then maybe that would work?

Dan


On 9 May 2012 19:49, Richardson, Jason - FSA, Kansas City, MO < jason.richardson@kcc.usda.gov> wrote:

> Using today,  I got this exception.
>
> java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
> java.lang.ClassCastException: java.util.Date cannot be cast to 
> org.apache.isis.applib.value.DateTime
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.JdbcDateTimeMapper.preparedStatementObject(JdbcDateTimeMapper.java:51)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping.appendInsertValues(AbstractJdbcFieldMapping.java:59)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AbstractAutoMapper.values(AbstractAutoMapper.java:315)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AutoMapper.createObject(AutoMapper.java:134)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore$1.execute(SqlObjectStore.java:152)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore.execute(SqlObjectStore.java:287)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransaction.doFlush(ObjectStoreTransaction.java:130)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionAbstract.commit(IsisTransactionAbstract.java:107)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransactionManager.endTransaction(ObjectStoreTransactionManager.java:97)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManagerAbstract.executeWithinTransaction(IsisTransactionManagerAbstract.java:154)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:52)
>        at
> org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:404)
>        at
> org.apache.isis.viewer.html.task.MethodTask.completeTask(MethodTask.java:103)
>        at
> org.apache.isis.viewer.html.task.TaskStep.execute(TaskStep.java:203)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.runAction(WebController.java:382)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.generatePage(WebController.java:285)
>        at
> org.apache.isis.viewer.html.servlet.ControllerServlet.processRequest(C
> ontrollerServlet.java
>
>
>
> Jason Richardson
>
>
> -----Original Message-----
> From: Kevin Meyer - KMZ [mailto:kevin@kmz.co.za]
> Sent: Wednesday, May 09, 2012 1:03 PM
> To: isis-users@incubator.apache.org
> Subject: Re: Problem with Date fields on my Domain Objects
>
> Hi Jason,
>
> Here's a quick test:
>
> In the date field, enter "today" and see how it formats the date. You 
> might be up against Java regionalisation affected which date formats 
> it considers are valid.
>
> "Today" is a special text value, and ought to be accepted.
>
> After that, see if you can reverse engineer the date format?
>
> Regards,
> Kevin
>
> On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:
>
> > I have a domain object that has a java.util.Date.
> > When running my app, I can't get a date to be accepted.  I have 
> > tried
> multiple date formats.  And I even put in a property.
> > isis.value.format.date=dd/MM/yyyy
> >
> > My DOM has this for the code:
> > It's a java.util.Date.
> >
> >
> >         private Date shiftDate;
> >
> >         @MemberOrder(sequence = "1")
> >         public Date getShiftDate() {
> >                 return shiftDate;
> >         }
> >
> >         public void setShiftDate(Date shiftDate) {
> >                 this.shiftDate = shiftDate;
> >         }
> >
> >
> > Example return on my webpage:
> > * Not recognised as a date: 05/09/2012
> >
> >
> > Jason Richardson
>
>
>
>
>
>
> This electronic message contains information generated by the USDA 
> solely for the intended recipients. Any unauthorized interception of 
> this message or the use or disclosure of the information it contains 
> may violate the law and subject the violator to civil or criminal 
> penalties. If you believe you have received this message in error, 
> please notify the sender and delete the email immediately.
>
>




RE: Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I'm going to try that next.



Jason Richardson
National Payments Service (NPS) Technical Lead
USDA/FSA/AFAO/SCADG
(Administrative and Financial Applications Office)
(Service Center Accounting & Debt Group)
Office Ph: (816) 823-5296
Cubicle:  3NW024
NPS I.T. Matrix (JIRA)
NPS Email Groups Listing



-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk] 
Sent: Wednesday, May 09, 2012 2:17 PM
To: isis-users@incubator.apache.org
Subject: Re: Problem with Date fields on my Domain Objects

Hmm, Kevin's the expert on this, but as a workaround, if you convert to using the applib Datetime in your POJO rather than a java.util.Date, then maybe that would work?

Dan


On 9 May 2012 19:49, Richardson, Jason - FSA, Kansas City, MO < jason.richardson@kcc.usda.gov> wrote:

> Using today,  I got this exception.
>
> java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
> java.lang.ClassCastException: java.util.Date cannot be cast to 
> org.apache.isis.applib.value.DateTime
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.JdbcDateTimeMapper.preparedStatementObject(JdbcDateTimeMapper.java:51)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping.appendInsertValues(AbstractJdbcFieldMapping.java:59)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AbstractAutoMapper.values(AbstractAutoMapper.java:315)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AutoMapper.createObject(AutoMapper.java:134)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore$1.execute(SqlObjectStore.java:152)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore.execute(SqlObjectStore.java:287)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransaction.doFlush(ObjectStoreTransaction.java:130)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionAbstract.commit(IsisTransactionAbstract.java:107)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransactionManager.endTransaction(ObjectStoreTransactionManager.java:97)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManagerAbstract.executeWithinTransaction(IsisTransactionManagerAbstract.java:154)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:52)
>        at
> org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:404)
>        at
> org.apache.isis.viewer.html.task.MethodTask.completeTask(MethodTask.java:103)
>        at
> org.apache.isis.viewer.html.task.TaskStep.execute(TaskStep.java:203)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.runAction(WebController.java:382)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.generatePage(WebController.java:285)
>        at
> org.apache.isis.viewer.html.servlet.ControllerServlet.processRequest(C
> ontrollerServlet.java
>
>
>
> Jason Richardson
>
>
> -----Original Message-----
> From: Kevin Meyer - KMZ [mailto:kevin@kmz.co.za]
> Sent: Wednesday, May 09, 2012 1:03 PM
> To: isis-users@incubator.apache.org
> Subject: Re: Problem with Date fields on my Domain Objects
>
> Hi Jason,
>
> Here's a quick test:
>
> In the date field, enter "today" and see how it formats the date. You 
> might be up against Java regionalisation affected which date formats 
> it considers are valid.
>
> "Today" is a special text value, and ought to be accepted.
>
> After that, see if you can reverse engineer the date format?
>
> Regards,
> Kevin
>
> On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:
>
> > I have a domain object that has a java.util.Date.
> > When running my app, I can't get a date to be accepted.  I have 
> > tried
> multiple date formats.  And I even put in a property.
> > isis.value.format.date=dd/MM/yyyy
> >
> > My DOM has this for the code:
> > It's a java.util.Date.
> >
> >
> >         private Date shiftDate;
> >
> >         @MemberOrder(sequence = "1")
> >         public Date getShiftDate() {
> >                 return shiftDate;
> >         }
> >
> >         public void setShiftDate(Date shiftDate) {
> >                 this.shiftDate = shiftDate;
> >         }
> >
> >
> > Example return on my webpage:
> > * Not recognised as a date: 05/09/2012
> >
> >
> > Jason Richardson
>
>
>
>
>
>
> This electronic message contains information generated by the USDA 
> solely for the intended recipients. Any unauthorized interception of 
> this message or the use or disclosure of the information it contains 
> may violate the law and subject the violator to civil or criminal 
> penalties. If you believe you have received this message in error, 
> please notify the sender and delete the email immediately.
>
>


Re: Problem with Date fields on my Domain Objects

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hmm, Kevin's the expert on this, but as a workaround, if you convert to
using the applib Datetime in your POJO rather than a java.util.Date, then
maybe that would work?

Dan


On 9 May 2012 19:49, Richardson, Jason - FSA, Kansas City, MO <
jason.richardson@kcc.usda.gov> wrote:

> Using today,  I got this exception.
>
> java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
> java.lang.ClassCastException: java.util.Date cannot be cast to
> org.apache.isis.applib.value.DateTime
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.JdbcDateTimeMapper.preparedStatementObject(JdbcDateTimeMapper.java:51)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping.appendInsertValues(AbstractJdbcFieldMapping.java:59)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AbstractAutoMapper.values(AbstractAutoMapper.java:315)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.auto.AutoMapper.createObject(AutoMapper.java:134)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore$1.execute(SqlObjectStore.java:152)
>        at
> org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore.execute(SqlObjectStore.java:287)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransaction.doFlush(ObjectStoreTransaction.java:130)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionAbstract.commit(IsisTransactionAbstract.java:107)
>        at
> org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransactionManager.endTransaction(ObjectStoreTransactionManager.java:97)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManagerAbstract.executeWithinTransaction(IsisTransactionManagerAbstract.java:154)
>        at
> org.apache.isis.runtimes.dflt.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:52)
>        at
> org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:404)
>        at
> org.apache.isis.viewer.html.task.MethodTask.completeTask(MethodTask.java:103)
>        at
> org.apache.isis.viewer.html.task.TaskStep.execute(TaskStep.java:203)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.runAction(WebController.java:382)
>        at
> org.apache.isis.viewer.html.servlet.internal.WebController.generatePage(WebController.java:285)
>        at
> org.apache.isis.viewer.html.servlet.ControllerServlet.processRequest(ControllerServlet.java
>
>
>
> Jason Richardson
>
>
> -----Original Message-----
> From: Kevin Meyer - KMZ [mailto:kevin@kmz.co.za]
> Sent: Wednesday, May 09, 2012 1:03 PM
> To: isis-users@incubator.apache.org
> Subject: Re: Problem with Date fields on my Domain Objects
>
> Hi Jason,
>
> Here's a quick test:
>
> In the date field, enter "today" and see how it formats the date. You
> might be up against Java regionalisation affected which date formats it
> considers are valid.
>
> "Today" is a special text value, and ought to be accepted.
>
> After that, see if you can reverse engineer the date format?
>
> Regards,
> Kevin
>
> On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:
>
> > I have a domain object that has a java.util.Date.
> > When running my app, I can't get a date to be accepted.  I have tried
> multiple date formats.  And I even put in a property.
> > isis.value.format.date=dd/MM/yyyy
> >
> > My DOM has this for the code:
> > It's a java.util.Date.
> >
> >
> >         private Date shiftDate;
> >
> >         @MemberOrder(sequence = "1")
> >         public Date getShiftDate() {
> >                 return shiftDate;
> >         }
> >
> >         public void setShiftDate(Date shiftDate) {
> >                 this.shiftDate = shiftDate;
> >         }
> >
> >
> > Example return on my webpage:
> > * Not recognised as a date: 05/09/2012
> >
> >
> > Jason Richardson
>
>
>
>
>
>
> This electronic message contains information generated by the USDA solely
> for the intended recipients. Any unauthorized interception of this message
> or the use or disclosure of the information it contains may violate the law
> and subject the violator to civil or criminal penalties. If you believe you
> have received this message in error, please notify the sender and delete
> the email immediately.
>
>

RE: Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
Using today,  I got this exception.

java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
java.lang.ClassCastException: java.util.Date cannot be cast to org.apache.isis.applib.value.DateTime
        at org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.JdbcDateTimeMapper.preparedStatementObject(JdbcDateTimeMapper.java:51)
        at org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping.appendInsertValues(AbstractJdbcFieldMapping.java:59)
        at org.apache.isis.runtimes.dflt.objectstores.sql.auto.AbstractAutoMapper.values(AbstractAutoMapper.java:315)
        at org.apache.isis.runtimes.dflt.objectstores.sql.auto.AutoMapper.createObject(AutoMapper.java:134)
        at org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore$1.execute(SqlObjectStore.java:152)
        at org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore.execute(SqlObjectStore.java:287)
        at org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransaction.doFlush(ObjectStoreTransaction.java:130)
        at org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionAbstract.commit(IsisTransactionAbstract.java:107)
        at org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.ObjectStoreTransactionManager.endTransaction(ObjectStoreTransactionManager.java:97)
        at org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManagerAbstract.executeWithinTransaction(IsisTransactionManagerAbstract.java:154)
        at org.apache.isis.runtimes.dflt.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:52)
        at org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:404)
        at org.apache.isis.viewer.html.task.MethodTask.completeTask(MethodTask.java:103)
        at org.apache.isis.viewer.html.task.TaskStep.execute(TaskStep.java:203)
        at org.apache.isis.viewer.html.servlet.internal.WebController.runAction(WebController.java:382)
        at org.apache.isis.viewer.html.servlet.internal.WebController.generatePage(WebController.java:285)
        at org.apache.isis.viewer.html.servlet.ControllerServlet.processRequest(ControllerServlet.java



Jason Richardson


-----Original Message-----
From: Kevin Meyer - KMZ [mailto:kevin@kmz.co.za]
Sent: Wednesday, May 09, 2012 1:03 PM
To: isis-users@incubator.apache.org
Subject: Re: Problem with Date fields on my Domain Objects

Hi Jason,

Here's a quick test:

In the date field, enter "today" and see how it formats the date. You might be up against Java regionalisation affected which date formats it considers are valid.

"Today" is a special text value, and ought to be accepted.

After that, see if you can reverse engineer the date format?

Regards,
Kevin

On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:

> I have a domain object that has a java.util.Date.
> When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
> isis.value.format.date=dd/MM/yyyy
>
> My DOM has this for the code:
> It's a java.util.Date.
>
>
>         private Date shiftDate;
>
>         @MemberOrder(sequence = "1")
>         public Date getShiftDate() {
>                 return shiftDate;
>         }
>
>         public void setShiftDate(Date shiftDate) {
>                 this.shiftDate = shiftDate;
>         }
>
>
> Example return on my webpage:
> * Not recognised as a date: 05/09/2012
>
>
> Jason Richardson






This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.


Re: Problem with Date fields on my Domain Objects

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Hi Jason,

Here's a quick test:

In the date field, enter "today" and see how it formats the date. You 
might be up against Java regionalisation affected which date formats it 
considers are valid.

"Today" is a special text value, and ought to be accepted.

After that, see if you can reverse engineer the date format?

Regards,
Kevin

On 9 May 2012 at 16:34, Richardson, Jason - FSA, Kans wrote:

> I have a domain object that has a java.util.Date.
> When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
> isis.value.format.date=dd/MM/yyyy
> 
> My DOM has this for the code:
> It's a java.util.Date.
> 
> 
>         private Date shiftDate;
> 
>         @MemberOrder(sequence = "1")
>         public Date getShiftDate() {
>                 return shiftDate;
>         }
> 
>         public void setShiftDate(Date shiftDate) {
>                 this.shiftDate = shiftDate;
>         }
> 
> 
> Example return on my webpage:
> * Not recognised as a date: 05/09/2012
> 
> 
> Jason Richardson


Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I have a domain object that has a java.util.Date.
When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
isis.value.format.date=dd/MM/yyyy

My DOM has this for the code:
It's a java.util.Date.


        private Date shiftDate;

        @MemberOrder(sequence = "1")
        public Date getShiftDate() {
                return shiftDate;
        }

        public void setShiftDate(Date shiftDate) {
                this.shiftDate = shiftDate;
        }


Example return on my webpage:
* Not recognised as a date: 05/09/2012


Jason Richardson




This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.


Problem with Date fields on my Domain Objects

Posted by "Richardson, Jason - FSA, Kansas City, MO" <ja...@kcc.usda.gov>.
I have a domain object that has a java.util.Date.
When running my app, I can't get a date to be accepted.  I have tried multiple date formats.  And I even put in a property.
isis.value.format.date=dd/MM/yyyy

My DOM has this for the code:
It's a java.util.Date.


        private Date shiftDate;

        @MemberOrder(sequence = "1")
        public Date getShiftDate() {
                return shiftDate;
        }

        public void setShiftDate(Date shiftDate) {
                this.shiftDate = shiftDate;
        }


Example return on my webpage:
* Not recognised as a date: 05/09/2012


Jason Richardson




This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.