![]() |
Previous | Next |
You can write an HTML document that uses the Producer object model in order to add information about your service to the Windows registry on the user's computer. This Web page (or series of Web pages) can display in the browser window that appears when the user clicks Learn More in the Publish Wizard. This documentation shall refer to this Web page as the "add service" page. For an e-service, the add service page should accomplish at least the following three objectives:
You can use virtually any HTML syntax in the add service page that you would use in Internet Explorer. This means you can also include HTML controls such as BUTTON elements, TEXT and TEXTAREA elements, SELECT elements, and CHECKBOX elements. You can navigate to as many Web pages as you like from the add service page, so you can actually create a series of pages that add a new e-service. The add service page can be resized by the user, and it shows both horizontal and vertical scrollbars if the authored page exceeds the size of the hosted browser window. The default size of the client area of the browser is approximately 570 pixels wide by 400 pixels high.
Following are the basic steps to follow to create the add service page:
<HTML>
<HEAD></HEAD>
<BODY>
<!-- Create the Web page the displays in Producer. -->
Service: Simple Custom WebHost <BR>
<BR>
Thanks for choosing this e-service. <BR>
Please click the button below to add this service <BR>
to the <B>Microsoft Producer Publish Wizard</B> as a <BR>
new <B>Web server</B>. <BR>
<BR>
</BODY>
</HTML>
<INPUT TYPE = "BUTTON" ID = "addWebHost" NAME = "addWebHost" VALUE = "Click to add this service!" onClick = "AddWebHost();">
var Application = window.external;
/* Add a WebHost using the Options.AddWebHost method.
Be sure to specify the HTMLBasedUIURL parameter to set
the Web page that displays when the user selects the new
WebHost from the user interface. */
Application.Options.AddWebHost("Simple Custom WebHost", "http://MyServer/HTMLUI.htm", true);
If you specify an empty string ("") as the second parameter, the Publish Wizard uses the default user interface when the user selects the e-service from the Web server list. For more information, see the section Adding Web Servers Automatically.
The value true for the third parameter permits the new WebHost key to overwrite any existing key having the same name.
alert("Thank you. This service can now be accessed using the Web server list in the Publish Wizard.");
// Use the Windows.FindByName method to get the index
// of the browser window hosted by Producer.
var nWin = Application.Windows.FindByName("EServiceWindow");
// Retrieve the hosted window object.
var pWin = Application.Windows.Item(nWin);
// Test whether the hosted window was successfully retrieved.
if (pWin){
// Close the window.
pWin.Close();
}
For the complete sample that accompanies this topic, see Adding an E-service Using a Learn More Page.
Previous | Next |