cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

xMII Browser Detect

Former Member
0 Kudos
451

Hello All,

I am reading through the sdn doc "How to configure the xmii server and xmii pages for mobile devices" I am trying to incorporate the logic which detects the kind of browser and displays the appropriate page for mobile device. I am a little confused about how to use the client.ini entry to acomplish this. The document just states: "from this string the keyword can be extracted as the identifier....." but does not give any details.

Does anyone have a step by step on how to display the page specifically for a mobile web browser.

Thanks,

Mahwish

Message was edited by:

Mahwish De Silva

Accepted Solutions (1)

Accepted Solutions (1)

salvatore_castro
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mahwish,

It is not possible to use an applet on a mobile device as they are to computationally intensive for them to handle. As a result Servlet calls are needed to display data. You can use a build in Stylesheet call IlluminatorRowsetsHTML.xsl to display data in table format from xMII. Here is a sample call:

<SERVLET NAME="Illuminator">

<PARAM name="QueryTemplate" value="Your xMII Query Template Path">

<PARAM NAME="Content-Type" VALUE="text/xml">

<PARAM NAME="StyleSheet" VALUE="http://localhost/Illuminator/StyleSheets/IllumRowsetHTML.xsl">

<PARAM name="Param.1" value="030000004203">

</SERVLET>

The Query Template specification is the same as with an applet. Hope this helps.

Regards,

Salvatore Castro

xMII Consulting & Field Enablement

Former Member
0 Kudos

Salvatore,

I am still not seeing any outpt on the page. Do I have to make any changes to the query itself? I have an SQL Query (is there a output parameter which I need to set to xml?). I have the below html code but when I go to the webpage I cannot see any output.

<html>

<body>

<SERVLET NAME="Illuminator">

<PARAM name="QueryTemplate" value="UserTemplates/TESTQUERY">

<PARAM NAME="Content-Type" VALUE="text/xml">

<PARAM NAME="StyleSheet" VALUE="http://localhost/Illuminator/StyleSheets/IllumRowsetHTML.xsl">

</SERVLET>

</body>

</html>

Former Member
0 Kudos

Hello Mahwish,

Make sure that the extension for your webpage is .irpt and not .htm or .html.

xMII Servlets will only render on .irpt pages.

Thanks,

Joe

Former Member
0 Kudos

Thanks Joe, that was my issue. Now I can at least see the query output. Will the servlet's allow user interaction and parameter passing (as we did with the applets, on click, the details were displayed).

Thanks,

Mahwish

Former Member
0 Kudos

Hello Mahwish,

No, servlets are not like applets, they are not interactive.

Typically to pass parameters into a servlet you can use a session variable or pass it in the URL for the irpt page.

Thanks,

Joe

Former Member
0 Kudos

Joe/Salvatore,

I tried using the <param name = "Param.1" value="xyz"> in the servlet but it did not return anyting from the query even though xyz was a valid equipment number. In the query I have Equipment = '[Param.1]'

Also, how can I call the servlet page from an html webpage and pass the Param.1 in a url. I have a simple webpage which has a text box and a button, on click I want to open the servlet webpage and pass it the value from the text box.

I will open this as a new post since it does not have anything to do with the browser detect.

Thanks for your help!!

Mahwish

Former Member
0 Kudos

Hi Mahwish,

For this you have two option one is sending the params from one page to another page

1. Through URL : for this your pop up page should be a .irpt page. While saving the page you need to give the extension .irpt. You can send the parameters in the following format.

var URL = PopupPage.irpt?KeyValue=+ "250" ;

window.open(URL);

Then in the next page you can use this variable KeyValue as a Illuminator variable.

in the servlet you can use this one as

<param name = "Param.1" value="">

The value will automatically come into the place in servlet.

The main advantage in this methos is you value will not store in the browser. It stroes in the Illuminator engine.

2. Session variable concept : You can create session variable in the parent screen using the following method.

applet1.setPropertyValue(keyValue, "250");

now this variable value keyValue stroes in the browser. Now if you open the child page you can get the ouput with the same code as above in the method 1.

If you have any queries regarding the same please let me know.

Thanks,

Rajesh.

PS : Please award points if answer is useful.

Answers (4)

Answers (4)

salvatore_castro
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mahwish,

It is not possible to use an applet on a mobile device as they are to computationally intensive for them to handle. As a result Servlet calls are needed to display data. You can use a build in Stylesheet call IlluminatorRowsetsHTML.xsl to display data in table format from xMII. Here is a sample call:

<SERVLET NAME="Illuminator">

<PARAM name="QueryTemplate" value="Your xMII Query Template Path">

<PARAM NAME="Content-Type" VALUE="text/xml">

<PARAM NAME="StyleSheet" VALUE="http://localhost/Illuminator/StyleSheets/IllumRowsetHTML.xsl">

<PARAM name="Param.1" value="030000004203">

</SERVLET>

The Query Template specification is the same as with an applet. Hope this helps.

Regards,

Salvatore Castro

xMII Consulting & Field Enablement

salvatore_castro
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mahwish,

It is not possible to use an applet on a mobile device as they are to computationally intensive for them to handle. As a result Servlet calls are needed to display data. You can use a build in Stylesheet call IlluminatorRowsetsHTML.xsl to display data in table format from xMII. Here is a sample call:

<SERVLET NAME="Illuminator">

<PARAM name="QueryTemplate" value="Your xMII Query Template Path">

<PARAM NAME="Content-Type" VALUE="text/xml">

<PARAM NAME="StyleSheet" VALUE="http://localhost/Illuminator/StyleSheets/IllumRowsetHTML.xsl">

<PARAM name="Param.1" value="030000004203">

</SERVLET>

The Query Template specification is the same as with an applet. Hope this helps.

Regards,

Salvatore Castro

xMII Consulting & Field Enablement

salvatore_castro
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mahwish,

Most likely you will not have to add an entry into the client.ini file to detect your mobile device unless it is a BlackBerry. In that case just use the entry contained in the document. Be sure that you restart the xMII service once you make this change so that it is detected by the webapp.

Regards,

Salvatore Castro

xMII Consulting & Field Enablement

Former Member
0 Kudos

Thanks Salvatore,

The device is not a blackberry. I am very new to xmii thats why I'm having trouble following the document. Basically all I want is to display a SQL query with a simple output (lets say equipment number and a button) on a mobile device. When the button is clicked it should retrieve some more details about the selected equipment. I was able to acheive this using applets.

I am guessing I need to use the <SERVLET> tag instead of the applet tag from the document. But I'm not sure about the xsl syntax needed to create the stylesheet to display the query output and pass parameters to fetch the details records.

Thanks,

Mahwish

Former Member
0 Kudos

All browsers have a unique identifier describing them, called HTTP_USER_AGENT ID string. This information is usually sent by the browser when making the HTTP request to the server and makes part of the transmission headers. Browser IDs (more correctly User Agent IDs) appear, among other places, as the environmental variable HTTP_USER_AGENT in Apache).

You need this information to make the fewest checks possible for the browser environment - or how to optimize the display or ... to know who and what is crawling around your site. In our case, it's to set up the display capabilities of xMII for your mobile devices.

To give you an idea of how varied the UA strings are (even for a single device type), here’s a sampling of “Windows CE” agent ID strings:

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; 320x240)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; O2 Xda 2mini; PPC; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; O2 Xda 2s;PPC;240x320; PPC; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; O2 Xda II;PPC;240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PIEPlus 1.2; PPC; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PIEPlus 1.2; PPC; 240x320; SPV M2000; OpVer 5.12.2.141)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PIEPlus 1.3; PPC; 240x320; PIEPlus 1.2)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320) 4.01

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; 240x320)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; PIEPlus 1.1)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; PIEPlus 1.2)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; MDA Compact/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1)

Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; Smartphone; 176x220)

The article/author can NOT give any details about selecting the right word which uniquely identifies your mobile device due to their variety, but it gives you an example.

First you need to test your mobile device ID string by visiting a web site which will display this information. Then you have to find the right "filter" and include it in the "client.ini" file together with the information about what to display (e.g. <i>Token=SIMPLEHTML, Mime-Type=text/html</i> to avoid applets).

If you want specific information, please tell us specifics of the mobile devices you use.