public Date parse(String s)
throws ParseException
{
Date date = null;
if (s == null)
{
throw new ParseException("Input string was null", -1);
}
for (int i = 0; i < dateFormats.size(); i++)
{
sdf.applyPattern((String)dateFormats.get(i));
try
{
date = sdf.parse(s);
}
catch (ParseException e)
{
// ignore
e.printStackTrace();
}
if (date != null)
{
break;
}
}
if ((date == null) && (df != null))
{
date = df.parse(s);
}
if (date == null)
{
throw new ParseException("Could not match to any format", -1);
}
return date;
}
Quinton McCombs wrote:
The only way that you will get that functionality right now is to switch
to the fulcrum version. Within the next few days, it will should be
available in T 2.2 HEAD. I have completed my work on the service. I am
just waiting for scarab to become available so that I can post the
patches.
If you can wait, the new version will have updated docs (including an
updated and commented DTD). Exception handling and reporting has also
been improved. A few bug fixes have also been implemented. If you look
through the messages on the list over the past 2 - 3 days, you will find
a more complete list of the changes being made.
-----Original Message-----
From: Jake Fear [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 11:33 AM
To: Turbine Users List
Subject: Re: turbine 2.2 in CVS
I am not seeing this behavior in my own application. I checked out from the branch names TURBINE_2_2_BRANCH and the DateStringField does not override the toString() method in that code line. Perhaps I am "barking up the wrong branch." ;-) Thinking this might be the case I also grabbed the HEAD tag to see if it lived there. No such luck. Can you please tell me where I can grab this functionality. It does sound like I would be reinventing the wheel for the most part.
Cheers,
Jake
Quinton McCombs wrote:
There is something close to this for the DateString field. Thewhich I have
toString() method will use the first format rule for the field to format the date. This is actually in the Fulcrum version
just completed back porting to T2.2.is used for
What would be ideal is one definition (formatter/mask) that
both validation and display. This is what I really likeabout the way
that the DatString field is implemented. It used the firstformat mask
for display. You can still have other masks that will allow other formats for the input.appear like it
-----Original Message-----
From: Jake Fear [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 2:09 AM
To: Turbine Users List
Subject: Re: turbine 2.2 in CVS
I'm considering adding the capability to specify a formatter for a
field. I don't want to dupliate any effort. Can you tell me if anyone else is working on such a feature already? It does not
significantlywould be difficult, provided a few assumptions.
1.) There is no need to have several formatters for a field, one should always suffice.
2.) Specifying a formatter is optional.
3.) If a formatter is specified, it will be used in the toString() call of the Field class. If not formatter is specified, the current behavior will be used.
I think this is a good way to remain backward compatible and have
minimum impact on the API, while at the same time allow those who want to leverage the solution to do so with little or now code change (they may need to rip out any existing solutions to use this one). The implementation would be similar to that for rules, only
abstraction, andsimpler. I think this really completes the "Field"
<mailto:turbine-user-> [EMAIL PROTECTED]>simplifies the writing of templates that must deal with dates, currencies and the like.--
Cheers,
Jake
Quinton McCombs wrote:
The DTD is out of date.me why the
-----Original Message-----
From: Jake Fear [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 1:55 AM
To: Turbine Users List
Subject: turbine 2.2 in CVS
I am building from the 2.2 branch in CVS. Can anyone tell
concerned itdisplayName attribute of an intake group does not appear in the
intake.dtd? I actually rely on this attribute, and I am
added itmay be removed from future versions of the product. Perhaps
it is very new and only appears in the code. In any instance, I have
<mailto:turbine-user-> [EMAIL PROTECTED]>myself, and the implementing code seems to work fine.--
Jake
--
To unsubscribe, e-mail: <mailto:turbine-user-> [EMAIL PROTECTED]>
For
additional commands,
e-mail: <mailto:[EMAIL PROTECTED]>
To unsubscribe, e-mail:
Foradditional commands,
e-mail:
<mailto:[EMAIL PROTECTED]>--
To unsubscribe, e-mail: <mailto:turbine-user-> [EMAIL PROTECTED]>
For
additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
To unsubscribe, e-mail:
Foradditional commands, e-mail:
<mailto:[EMAIL PROTECTED]>--
To unsubscribe, e-mail: <mailto:turbine-user-> [EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
