OWA form registration for different browers

OWA form registration for different browers

Post by Mike » Fri, 13 Feb 2004 23:27:36


Hi,

I am trying to use the Exchange 2003 Web Storage System form registration to
create a number of custom view forms to handle different browser types.

All the information I have found says to create a new registration entry
with the "urn:schemas-microsoft-com:office:forms#browser" property set to
the appropriate string. This will be compared with the HTTP User Agent info
sent by the browser and looked up in browscap.ini for the best match. I am
also aware that the 'best match' uses a precedence order when determining
the browser version, i.e. =, <=, >=, <, > and *.

However, I cannot get it to work correctly for IE and Netscape browser
versions no matter what I put in the 'browser' property.

I have two forms 'pview.htm' for Premium OWA access (IE 5 up), and
'bview.asp' for Basic OWA access (Netscape). Both have
'executerurl' set to '/exchweb/bin/excwform.dll' to use the form renderer.

It is trying to render with my pview.htm for both browser types.

For the IE 5+ form I have tried:
browser = '*', 'Any', 'Internet Explorer 5 and above'
formurl = <absolute url path>/pview.htm

For the Netscape form I have tried:
browser = '*', 'Netscape', 'Netscape Navigator', Netscape Navigator 4 and
above'
formurl = <absolute url path>/bview.asp

Some of these strings are offered by the Form Registration wizard, but bear
no resemblance to the actual User Agent string in the HTTP header. I have
also found an article "Web Storage System Forms: The Forms Registry" by
Chris Tyner and Jeff Wierer, which describes setting up a second form for a
Netscape browser, shows a table of suggested settings with browser =
"Netscape Navigator" and then says use browser="Netscape" (Not Netscape
Navigator") !! I am confused.

Is there a definitive list of browser property values that are guaranteed to
work?

Do you need to specify IE5+ for premium view and wildcard for basic view on
all other browser types, or do you need a registration entry and form for
each individual browser type that you want to support? (Surely not!)

Also, does changing a form registration property such as 'browser' require a
restart of Exchange Information Store? (I have tried this and it seems to
make no difference.)

Regards,
Mike
 
 
 

OWA form registration for different browers

Post by Siegfried » Sat, 14 Feb 2004 03:06:00


[snip]


I have had no problem using the following to register a form for Internet
Explorer 5 and above:
urn:schemas-microsoft-com:office:forms#browser = "IE"
urn:schemas-microsoft-com:office:forms#majorver = ">=5"

As for Netscape: which version are you looking for? Any downlevel client
(Netscape 4.x and anything above)?


Nope.

--
Cheers,

Siegfried Weber

If you want a smart answer, ask a smart question
http://www.yqcomputer.com/ ~esr/faqs/smart-questions.html

 
 
 

OWA form registration for different browers

Post by Mike » Sat, 14 Feb 2004 18:59:28


OK, that's interesting. I was thrown by the browser options offered by the
form registration wizard, which don't set the majorver property. Thanks,
I'll give that a go!

I am trying to define a custom view for Primary OWA access for IE5+ and a
custom view for Basic OWA acces for all other browsers. I used Netscape as
an example of a browser which can only handle the Basic OWA service, but I
would prefer to use a wildcard to catch all browsers that are not IE5+. I
don't want to have to keep adding new registrations for every flavour of
browser. Having said that, it's a toss up between having one basic view
form that does its own browser determination to handle the cross browser
compatibility issues, and having several forms that handle specific browser
issues, with the browser determination done by the form registration. On
balance I think I would prefer fewer source files to maintain.

Good.

Many thanks Siegfried,
That has helped a lot.

In view of your comments and the cold light of day, the documentation now
makes more sense.

Cheers,
Mike
 
 
 

OWA form registration for different browers

Post by Siegfried » Sun, 15 Feb 2004 01:53:32

This is a multi-part message in MIME format.




You don't need to worry about too many forms registrations. OWA 2000 and
2003 can out of the box only differentiate properly between IE 3/4/5+ and
Netscape 4/Opera 3.20. Anything beyond would need some tweaks (did that a
while ago to make it possible to detect Mozilla 1.x/Firebird/K-Meleon - my
favorite - and Opera 7.23 but it took me a while to figure that one out ;-)

Since I've tweaked my OWA browser detection I can't say for sure how yours
will look. But to determine the correct browser type all you need to do is
look at the user agent info returned by the browser. Attached is a simple
ASP page I've been using for 5 years now to sniff browser info. Just drop it
into a folder on your server (and make sure ASP is allowed in IIS - might
not be the case in Windows 2003) and hit the page with the browser in
question.


You are always welcome.


:-)

--
Cheers,

Siegfried Weber

If you want a smart answer, ask a smart question
http://www.yqcomputer.com/ ~esr/faqs/smart-questions.html
 
 
 

OWA form registration for different browers

Post by Mike » Sun, 15 Feb 2004 02:50:49

hanks for your reply Siegfried.

I am still tearing my hair out with this one.
I have two test systems that seem to behave differently with the same form
registration properties.
With the previous settings that I mentioned, one seems to detect "Internet
Explorer 5.0 and above" and shows the Premium view for IE and Netscape,
whereas the other system shows the Basic view form for both IE and Netscape.

On the second system (showing Basic for all) I tried setting the browser
property to "IE" and majorver to ">=5" as you suggested, with and without
quotes, and still I get the Basic view for IE 6 and Netscape where it should
be picking up the Premium view page. I have set the browser to "Netscape"
and majorver set to ">=4" and browser set to "*" for the basic form
registration, but it seems to make no difference.

I must be doing something wrong somewhere, or there is some error somewhere
that is defeating the browser detection.

Thanks for the asp script, but unfortunately Outlook Express stripped it
from the message as potentially unsafe (no I know it wasn't really).
However, I did add some asp script to my basic view web page which got the
Request.ServerVariables("HTTP_User_Agent") and updated a SPAN element on my
page using the WSS.Form Update and .render methods and that was showing the
correct (that is different) user agent strings that the two browsers were
returning, so I know that the header info is correct arriving at the server.

Do you know at what point the render process starts parsing the custom
forms? It must have already made the decision about which form page to
load, based on the UA string and registration properties? Or can it change
its decision if the custom form has errors and load the 'next best' form? I
don't believe I have any ASP, HTML or Javascript errors, but it was just a
thought.

Ah well, it will have to wait for Monday now...

Have a good weekend!

Cheers,
Mike

"Siegfried Weber" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
;-)
it


 
 
 

OWA form registration for different browers

Post by Siegfried » Thu, 19 Feb 2004 11:08:28


:-(


Don't include quotes. I did it because I cut & paste it out of a code piece.


Try to leave the version empty when using Netscape. As I mentioned in a
previosy post OWA 2000 and 2003 doesn't detect anything else than Netscape
up to version 4 anyways.


Hmmm. I thought I renamed it to .TXT...


The forms registration info AFAIK will be handled by the store itself before
any Web form, no matter if ASP, ASPX or HTML, will be executed.

--
Cheers,

Siegfried Weber

If you want a smart answer, ask a smart question
http://www.yqcomputer.com/ ~esr/faqs/smart-questions.html

Why tables are bad: http://www.yqcomputer.com/

Note: Please do not send any e-mail to XXXX@XXXXX.COM because I am
no longer connected with this organization. The current owner does not
return NDRs (non delivery reports - aka bounce messages) hence you will
not get any confirmation what happend to the e-mail.
 
 
 

OWA form registration for different browers

Post by Mike » Sat, 21 Feb 2004 01:23:12

gt; :-(
Too right! Still no joy. I must be missing something fundamental.
:-(


piece.
I only included quotes in the last attempt because I was getting desperate.


By empty do you mean version = * or don't specify the version property at
all (which effectively = null)?
I've tried both. They both behave the same.

My current registration form entries are as shown below.
I still get the basic view for both, in other words the Netscape entry.

Property (for IE web form registration) Datatype
Value
--------
-------- -----
urn:schemas-Microsoft-com:office:forms#binding (string) server
urn:schemas-Microsoft-com:office:forms#browser (string) IE
urn:schemas-Microsoft-com:office:forms#cmd (string)
contents
urn:schemas-Microsoft-com:office:forms#contentclass (string)
urn:content-classes:mailfolder
urn:schemas-Microsoft-com:office:forms#contentstate (string) *
urn:schemas-Microsoft-com:office:forms#executeurl (string)
http://localhost/exchweb/bin/exwform.dll
urn:schemas-Microsoft-com:office:forms#formurl (string)
http://localhost/exchange/SystemMailbox{62EE9C49-C450-4A9C-9E0F-2336778E4219}/non_ipm_subtree/schema-root/microsoft/exchangeV1/AFPEx/asp/frm_PView.htm
urn:schemas-Microsoft-com:office:forms#request (string) *
urn:schemas-Microsoft-com:office:forms#version (string) >5


Property (for Netscape web form registration) Datatype Value
--------
-------- -----
urn:schemas-Microsoft-com:office:forms#binding (string) server
urn:schemas-Microsoft-com:office:forms#browser (string) Netscape
urn:schemas-Microsoft-com:office:forms#cmd (string)
contents
urn:schemas-Microsoft-com:office:forms#contentclass (string)
urn:content-classes:mailfolder
urn:schemas-Microsoft-com:office:forms#contentstate (string) *
urn:schemas-Microsoft-com:office:forms#executeurl (string)
http://localhost/exchweb/bin/exwform.dll
urn:schemas-Microsoft-com:office:forms#formurl (string)
http://localhost/exchange/SystemMailbox{62EE9C49-C450-4A9C-9E0F-2336778E4219}/non_ipm_subtree/schema-root/microsoft/exchangeV1/AFPEx/asp/frm_BView.asp
urn:schemas-Microsoft-com:office:forms#request (string) *
urn:schemas-Microsoft-com:office:forms#version (string) *


Yes, you did. I see a warning in your message in Outlook Express, with a
yellow background, below the toolbar which says, "OE removed access to the
following unsafe attachments in your mail: browser.asp.txt". In the preview
pane, clicking on the attachment icon shows "browser.asp.txt (2.98KB)", but
it is grayed out and I can't retrieve it.

As I mentioned, I have managed to display the browser version from my basic
view page "frm_BView.asp", but in order to get the ASP script to execute I
had to set the 'executeurl' to the same as the 'formurl' and invoke the form
renderer from the script.

If anyone has any ideas I'd love to hear them.

Thanks for your help so far Siegfried!

Cheers,
Mike


 
 
 

OWA form registration for different browers

Post by Mike » Sun, 22 Feb 2004 02:08:07


A bit of a breakthrough, but I don't know why!

I have deleted the Netscape form registrations and IE now pick ups the
Premium View registration and displays the correct page.
I have manually recreated the Netscape Basic View registration entry using
the Exchange Explorer form registration wizard, setting the browser =
Netscape and version=* and it now works as I expected. IE gets the Premium
View and Netscape gets the Basic view!

:o)
 
 
 

OWA form registration for different browers

Post by Siegfried » Tue, 24 Feb 2004 20:10:51


I don't know why either ;-) But it sounds like it works for you now. Thanks
for sharing!

--
Cheers,

Siegfried Weber

If you want a smart answer, ask a smart question
http://www.yqcomputer.com/ ~esr/faqs/smart-questions.html

Why tables are bad: http://www.yqcomputer.com/

Note: Please do not send any e-mail to XXXX@XXXXX.COM because I am
no longer connected with this organization. The current owner does not
return NDRs (non delivery reports - aka bounce messages) hence you will
not get any confirmation what happened to the e-mail.
 
 
 

OWA form registration for different browers

Post by Mike » Fri, 27 Feb 2004 01:27:14


Thanks



Oh dear! I feel like I am getting closer to knowing how but not why!!

One apology I have to make is that I omitted to mention that I have been
attempting to set these properties from script.
When I deleted and recreated the registration entries, it was using the
Exchange Explorer wizard.

I modified the script to set exactly the same entries that I had set through
the wizard, and lo and behold it failed!
IE was getting the wrong view again.

I then saved all the properties to an XML file and used the properties /
right-click / Modify Form Registration Wizard to allow me to change the
registration. I accept all the values unchanged, except where it mistakenly
suggests client instead of server binding.
On finishing the wizard and refreshing my browser I now have the correct
Premium view again!?!

I then saved the registration's properties to another XML file. I now have
two XML files, one 'before' and one 'after' running the wizard. Using the
Visual Studio 'windiff' tool, I compared the two files and they are
identical.

So, the problem with browser detection appears to occur when the properties
are set through ADO using script as per the sample code in the Exchange SDK.
When the registration properties are set manually through Exchange Explorer,
it all works fine!!

That's the 'how'! What's the 'why'??

The script is writing the values OK, as reg property values changed via
script can be viewed through Exchange Explorer.
The ADO oRec.Fields.Update and oRec.Fields.Close methods are called at the
end of each property change, otherwise the changes wouldn't be visible.

It is as if Exchange Explorer does something else or something different to
cause a refresh of the exwform.dll Forms Registry cache.

For now I can live with using Exchange Explorer to 'refresh' the properties,
but for a production system it would be nice to find a 'script only' method.

Thanks again for your help.
I apologise again for inadvertently withholding evidence.

Cheers,
Mike C
 
 
 

OWA form registration for different browers

Post by Mike » Fri, 05 Mar 2004 00:12:46


I do now!!
It turns out that the "urn:schemas-microsoft-com:office:forms#..."
properties are case sensitive.

I had copied/pasted an example from MSDN which used
"urn:schemas-Microsoft-com:office:forms#binding" with a capital 'M' for
Microsoft and replicated it for the 'browser' and 'majorver' properties. I
happened to notice that having used the form registration or modify wizard
that I ended up with two properties for each of binding, browser and
majorver, one with 'M' for Microsoft and one with 'm'. When I deleted the
'M' entries and changed my script to make sure they all used 'm', it all
worked fine. IE 5+ gets premium view and Netscape gets basic view.

Problem solved!