Re: Display Timezone in Mid-Tier after Login
Roney, That is an excellent solution. Thank you very much, -Geoff Endresen Amazon.com On 5/24/07, Roney Samuel Varghese [EMAIL PROTECTED] wrote: ** Dear Geoffrey, In login.jsp we generate a html script tag, script src=%= request.getContextPath()%/shared/TimezoneFinder.js defer=1/script, which references our TimezoneFinder.js file located in /shared under the Mid-Tier web application install directory. Because we're running on the client side we can create a new JavaScript Date object and figure out the timezone on the local client, for example on a PDT(Pacific Daylight Time) PC the timezone is determined by the TimezoneFinder.js file to be America/Dawson, this value is sent to Mid-Tier. As Mid-Tier begins constructing the user's SessionData it performs the following checks: Does the user logging in have a entry in the AR System User Preferences form? If yes then overwrite the timezone value sent, such as America/Dawson, with whatever value that is found in the preferences form on the Locale tab in the Timezone field. Is there no entry in the AR System User Preference form for this user? If there is not then is there a value from passing through login.jsp/login_common.js and the TimezoneFinder.js file, such as the America/Dawson value? If yes, then use this value as the timezone for the user. If neither of these is true then default to the timezone of the Mid-Tier host machine. Now, once the form starts generating we enter a class in Mid-Tier which is responsible for emitting the file userdata.js and it's contents, in particular the value for var timezoneRules. The file userdata.js is auto generated by Mid-Tier as each user logs in to the system. The variable timezoneRules has a structure containing values which helps the client side code know what offsets should be used when determining the correct display values for AR System Date and Date/Time fields. How is the value for this variable determined? Using the passed in Timezone name determined from one of the above steps, running TimezoneFinder.js or the existence of a AR System User preference entry, Mid-Tier looks in the /resources/standard/javascript/timezone directory for a .js file that it can match up to the passed in timezone name. For example if the passed in value is America/Dawson, Mid-Tier loads America_Dawson.js, inside of which is the var timezoneRule declaration and value, which is put into the generated userdata.js file. Hope this helps, Regards, Roney Samuel Varghese On 5/22/07, Geoffrey Endresen [EMAIL PROTECTED] wrote: ** We have a request from our users to show Pacific Timezone on everything instead of the local timezone of the user for a mid-tier application. I want to display the current timezone of the user on the forms after login to show the user what timezone applies to all dates on the form. Any ideas? Thanks, -Geoff Endresen Amazon.com __20060125___This posting was submitted with HTML in it___ __20060125___This posting was submitted with HTML in it___ -- -Geoff Endresen Amazon.com ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Display Timezone in Mid-Tier after Login
Dear Geoffrey, In login.jsp we generate a html script tag, script src=%= request.getContextPath()%/shared/TimezoneFinder.js defer=1/script, which references our TimezoneFinder.js file located in /shared under the Mid-Tier web application install directory. Because we're running on the client side we can create a new JavaScript Date object and figure out the timezone on the local client, for example on a PDT(Pacific Daylight Time) PC the timezone is determined by the TimezoneFinder.js file to be America/Dawson, this value is sent to Mid-Tier. As Mid-Tier begins constructing the user's SessionData it performs the following checks: Does the user logging in have a entry in the AR System User Preferences form? If yes then overwrite the timezone value sent, such as America/Dawson, with whatever value that is found in the preferences form on the Locale tab in the Timezone field. Is there no entry in the AR System User Preference form for this user? If there is not then is there a value from passing through login.jsp/login_common.js and the TimezoneFinder.js file, such as the America/Dawson value? If yes, then use this value as the timezone for the user. If neither of these is true then default to the timezone of the Mid-Tier host machine. Now, once the form starts generating we enter a class in Mid-Tier which is responsible for emitting the file userdata.js and it's contents, in particular the value for var timezoneRules. The file userdata.js is auto generated by Mid-Tier as each user logs in to the system. The variable timezoneRules has a structure containing values which helps the client side code know what offsets should be used when determining the correct display values for AR System Date and Date/Time fields. How is the value for this variable determined? Using the passed in Timezone name determined from one of the above steps, running TimezoneFinder.js or the existence of a AR System User preference entry, Mid-Tier looks in the /resources/standard/javascript/timezone directory for a .js file that it can match up to the passed in timezone name. For example if the passed in value is America/Dawson, Mid-Tier loads America_Dawson.js, inside of which is the var timezoneRule declaration and value, which is put into the generated userdata.js file. Hope this helps, Regards, Roney Samuel Varghese On 5/22/07, Geoffrey Endresen [EMAIL PROTECTED] wrote: ** We have a request from our users to show Pacific Timezone on everything instead of the local timezone of the user for a mid-tier application. I want to display the current timezone of the user on the forms after login to show the user what timezone applies to all dates on the form. Any ideas? Thanks, -Geoff Endresen Amazon.com __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Display Timezone in Mid-Tier after Login
Using the User Preference form is a good idea. We don't require that yet. Our highest number of users are still on Perl CGI scripts. Even if I set it using the preferences form, I want to display it to the users. I know that I can set the timezone to America/Los_Angeles in the mid-tier login page to make sure all web apps now show Pacific times. I was just hoping there was a new run process command or keyword to actually display the text (America/Los_Angeles) on the form. I guess I'll just compare the client time with the server time and see that they are close and display the text ( you are viewing using the Pacific Timezone) Thanks, -Geoff On 5/22/07, Robert Molenda [EMAIL PROTECTED] wrote: ** Force user preferences to all be US-EN and PST Timezone. That should work. *Thanks-n-advance*; *HDT Platform Incident / Problem Manager Architect* Robert Molenda *IT OS PA* Tel: +1 408 503 2701 Fax: +1 408 503 2912 Mobile: +1 408 472 8097 [EMAIL PROTECTED] Quality begins with your actions. -- *From:* Action Request System discussion list(ARSList) [mailto: [EMAIL PROTECTED] *On Behalf Of *Geoffrey Endresen *Sent:* Tuesday, May 22, 2007 3:30 PM *To:* arslist@ARSLIST.ORG *Subject:* Display Timezone in Mid-Tier after Login ** We have a request from our users to show Pacific Timezone on everything instead of the local timezone of the user for a mid-tier application. I want to display the current timezone of the user on the forms after login to show the user what timezone applies to all dates on the form. Any ideas? Thanks, -Geoff Endresen Amazon.com __20060125___This posting was submitted with HTML in it___ __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Display Timezone in Mid-Tier after Login
We have a request from our users to show Pacific Timezone on everything instead of the local timezone of the user for a mid-tier application. I want to display the current timezone of the user on the forms after login to show the user what timezone applies to all dates on the form. Any ideas? Thanks, -Geoff Endresen Amazon.com ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Display Timezone in Mid-Tier after Login
Force user preferences to all be US-EN and PST Timezone. That should work. Thanks-n-advance; HDT Platform Incident / Problem Manager Architect Robert Molenda IT OS PA Tel: +1 408 503 2701 Fax: +1 408 503 2912 Mobile: +1 408 472 8097 [EMAIL PROTECTED] Quality begins with your actions. From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Endresen Sent: Tuesday, May 22, 2007 3:30 PM To: arslist@ARSLIST.ORG Subject: Display Timezone in Mid-Tier after Login ** We have a request from our users to show Pacific Timezone on everything instead of the local timezone of the user for a mid-tier application. I want to display the current timezone of the user on the forms after login to show the user what timezone applies to all dates on the form. Any ideas? Thanks, -Geoff Endresen Amazon.com __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are