Antville Project

Timezone support roundup

Finishing timezone support for Antville was pretty painless - all I had to do was make sure that date parsing and formatting are always done through parseTimestamp() and formatTimestamp() functions, which take in account the local weblog's localisation and timezone, if a weblog object is present in the request path. All dates are still stored in local server time. Both parseTimestamp() and formatTimestamp() are in global now, although weblog.formatTimestamp() is still there for backward compatibility - I didn't want to go through all the code - but all it does now is to forward the call to the global formatTimestamp() function.

The fact that the weblog object for date localization is always taken from the request path (i.e. path.weblog) causes one significant change: If an object from one weblog is used from within a page of another weblog or the application root area, the language and timezone from the embedding environment will be used for rendering dates, not those of the object's home weblog. In my opinion this makes sense because with timezone support, dates would not only be rendered in a strange language, but could also be a few hours off, i.e. you'd see dates in different timezones mixed together in one page. However, if this functionality is needed, it would be possible to format dates according to their home weblog by passing either the weblog or the locale and timezone to the formatTimestamp() function.

Finally, I implemented caching of java.text.SimpleDateFormat objects. These things are pretty expensive to create since the format has to be parsed each time. On the other hand, reuse is difficult because the class is not thread safe and would produce broken output if used by multiple threads at the same time. My solution is to cache them in the res.data object, using the format string such as "short", "yyyyMMdd" etc as key. front page rendering is now about 10% faster, and the gain could be even larger for pages with many dates.

Right now, the changes are still in the hns_timezone branch. I'll test some more and eventually merge changes to the main branch if that's ok.

comment    

 
robert, May 27, 2002 at 11:25:16 AM CEST

great!

i just checked out your branch: everything works fine. defineable timezones are really a very big step for antville, thanks so much for that! reg. weblog.formatTimestamp(): since there is no real backwards-compatibility-issue i'd say we should remove that function (i can do that after you merged hns_timezone into main branch if you want). antville-release is quite near now, i'd say ;-)

regarding UTF-8 encoding: i got some strange behaviour here on my machine (apache/jserv, using ie6): umlauts are not displayed correctly in dropdown-menues (when i switch to western encoding (ISO), it works again). any idea why this happens?

strange umlaut-display using utf8

link  

 
hns, May 27, 2002 at 12:12:18 PM CEST

any idea why this happens?

Dang, this is obviously a bug in Internet Explorer. Looks like we have to encode the choice labels. Since the Helma HTML encoding class is a bit lazy right now I'll also have to rework that so that characters are actually encoded as either numeric or symbolic entities...

link  

 
robert, May 27, 2002 at 12:42:43 PM CEST

fsck, this encoding-stuff is confusing me more and more ... but you're right: this is a bug in ie (can anybody test this with an ie5? i'm just curious if this happens just with ie6). and same with mozilla (1.0 rc2), see:

link  

 
hns, May 27, 2002 at 1:00:32 PM CEST

well I don't get it with Mozilla (1.0 rc3, but I'm pretty sure it also worked with previous versions).

Anyway, time to reactivate entity encoding in Helma - I already know how to do it the right and easy way, and I think we'll also get rid of the "smart quotes" problem this time. www.pemberley.com

link  

 
hns, May 27, 2002 at 7:09:15 PM CEST

Merged!

changes are in the main branch now.

link  

 
hns, May 27, 2002 at 7:52:55 PM CEST

BTW

I don't get the Problem with IE 5 Win and the embedded web server. I had a similar problem with IE 5 on Mac OS X, though (entries with umlauts weren't even displayd in drop down boxes).

link  

 
kris, May 27, 2002 at 8:05:19 PM CEST

it's an ie bug

i noticed it earlier this year on commecial sites such as ltur.de or opodo.de.

link  


... comment


The Antville Server Fund has been a great success. Thanks to everybody who contributed!
online for 8550 Days
last updated: 1/4/11, 10:22 AM
status
Youre not logged in ... Login
menu
November 2024
SunMonTueWedThuFriSat
12
3456789
10111213141516
17181920212223
24252627282930
July
recent
zfuture's house here is zfuture's
house
by zfuture (7/31/03, 2:59 AM)
i understand your concerns however,
i hardly can think of a solution. certainly, if the...
by tobi (7/29/03, 9:47 AM)
Found several more similar sites
listed This is getting to be quite a concern to...
by cobalt123 (7/27/03, 7:56 PM)
Second Post Alert on Referrer
bug livecatz I put this into "help" and now here:...
by cobalt123 (7/26/03, 7:14 PM)
well it's not easy to
find from here, anyway. think we should include a link,...
by tobi (7/24/03, 11:25 AM)
So finally I found
the helma Bugzilla - stupid me.
by mdornseif (7/24/03, 10:28 AM)
clock not that it's particularly
earthshattering but the antclock is running slow by about 15...
by kohlehydrat (7/23/03, 8:25 PM)
but blogosphere.us isn't can't really
be rated as spam can it?
by kohlehydrat (7/23/03, 8:08 PM)
More referrer spam www.webfrost.com
by Irene (7/23/03, 7:55 PM)
How to log skin names
I accessed to console?? Hi, I would like to know...
by winson (7/23/03, 4:12 PM)

Click here to get an XML version of this weblog.

Made with Antville
powered by
Helma Object Publisher