Académique Documents
Professionnel Documents
Culture Documents
March 2008
This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR
STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording or otherwise), or for
any purpose, without the express written permission of Microsoft Corp.
Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights
covering subject matter in this document. Except as expressly provided in any written license agreement from
Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights
or other intellectual property.
Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos,
people, places and events depicted herein are fictitious, and no association with any real company, organization,
product, domain name, email address, logo, person, place or event is intended or should be inferred.
Microsoft, Windows, Windows Vista, Windows Server, ActiveX, Active Directory, Internet Explorer, the Internet Explorer logo, MSN and the
MSN logo are either registered trademarks or trademarks of Microsoft Corp. in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
OVERVIEW
Activities are contextual menu options which quickly access a service from any Web page. Users typically
copy and paste from one Web page to another. Internet Explorer 8 Activities make this common pattern
easier to do.
Activities typically involve two types of scenarios: "look up" of information within a Web page, and
"send" of Web content to a Web application. Consider the example of a user who is interested in a
restaurant and wants to see its location. This is the form of a "look up" Activity, where the user selects
the address and views an in-place view of the map using a favorite map service.
In an example of a "send" Activity, a user reads an interesting article and wants to blog about it. The
user can select a portion of the article and use the blog Activity. This navigates to the user's blog site
with the selection already available in the edit field.
Users can access an Activity by selecting content on the page. For example, users can select an address
on a Web page and the Activity button appears. Alternatively, you can access Activities by bringing up
the context menu. Activities are also available for the current Web page in the Page Command bar and
for links within a page in the context menu for the link.
Activities are services that user can install and manage. Users can install them from the Internet Explorer
8 Service Guide or through any Web site that advertises Activities.
Activities are described using an XML file that provides the interface of how the browser should
communicate with the service through URL templates. Web-based services should take advantage of
the XML-based Activities since they are easier to create, test, and deploy to users.
FEATURE DETAILS
1 XML Format: An Activity is specified using an XML format called Open Service
Description.
2 Category: Activities are grouped based on the category to the user. Internet Explorer 8
Beta 1 for Developers ships with a known set of categories. A service can promote a new
category if necessary.
3 HTTP Submission: XML-based Activities are driven off of HTTP GET/POST requests.
4 Preview: An Activity can provide an in-context preview. This is like a miniature Web
page that the user can effortlessly view to get a better idea of what the service has to
offer.
6 Deployment: Activities can be made available from your Web site for users to install.
http://www.microsoft.com/schemas/openservicedescription/1.0
- homepageUrl
- display
- activity
homepageUrl
The homepage URL along with the category is used as the identity of the Activity.
homepageUrl element required The main URL of the Activity where the user can access the
service through browsing. All URLs expressed in this format
must match the domain of the homepageUrl.
display
This is how the Activity is presented to the user.
display element required The container element for the following elements.
name element required The name of the Activity that is displayed to the user. The
convention is to lead with the verb followed by the application.
Example: "Map on Windows Live" or "Define with Encarta."
icon element optional The URL to the 16x16 pixel icon of the Activity.
activity
This section describes the functionality of the Activity.
Please read the section on Category for assigning the right one
for your Activity.
activityAction element required An Activity can act on one or more data types. Each
activityAction specifies the functionality based on a data type.
It contains the preview element and execute element.
preview element optional The Activity HTML window that displays when the user has
the Activity selected. Please read the section on Preview for
more details.
execute element required The main functionality when the user invokes the Activity.
method attribute optional An attribute for the preview and execute elements.
action attribute required An attribute for the preview and execute elements.
enctype attribute optional An attribute for the preview and execute elements.
accept-charset attribute optional An attribute for the preview and execute element.
The following are several categories that Internet Explorer promotes, along with examples of existing
services.
If your Activity doesn't fit a recommended category, you can define your own. The following example
defines the category "share":
<activity category="share">
Your category should be a verb that users can recognize. It also should not tied to a specific brand or
application, so that other Activities of similar functionality can use the category.
3. HTTP Submission
Content that the user selects is "sent" to the Activity through HTTP GET/POST submissions. A service can
obtain properties of the document and the user selection as variables. These variables are expressed in
the Activity XML file as part of the action URL or through form-based parameters.
As part of the HTTP request, cookies can be used to store state and user credentials.
documentDomain
documentTitle
documentUrl
link
linkDomain
linkRel
linkText
linkType
selection
A variable is enclosed in brackets, as in {documentUrl}. A variable can be specified as optional by using a
"?" after the variable name; for example, {documentUrl?}. To specify that the value of an optional
variable is empty, use an empty text string.
Inline Parameters: These specify the inputs to a service through the URI template.
<execute method="get"
action="http://example.com/done.aspx?url={documentUrl}&title={documentTitle?}" />
Form-Based Parameters: These specify the inputs to a service through name-value pairs, similar
to HTTP form submissions. This is useful for making HTTP POST requests, or if the HTTP GET
request could be longer than the URL character limit.
If a variable is indicated as optional and the value is empty, the value of the optional variable is
an empty string. If a variable is required and the value of the variable is empty, the entire name-
value pair is omitted from the form submission.
You can also use the action attribute and parameter elements to track the usage of your service. You do
this by adding a special parameter with a value that indicates it is from Internet Explorer 8:
<execute method="post" action="http://example.com/done.aspx>
<parameter name="url" value="{documentUrl}" />
<parameter name="source" value="IE8" />
</execute>
4.Preview
An Activity can optionally provide a HTML preview that displays when a user hovers over an Activity.
This can be useful to quickly obtain a map, in-place definition or translation, and even ratings or links to
related content.
The preview window should be used for lightweight interaction. The goal is to send users to your site, so
that they view a full Web page for more information. This can be done by users clicking on the Activity
menu item or through links that you provide within the preview window.
Preview functionality is expressed through the Activity XML within the preview element. During the
hover, Internet Explorer makes an HTTP GET/POST request and displays the resulting HTML within the
HTML preview window.
Size: The preview window resolution is limited to 320 × 240 on a 96 DPI display. All content
outside of this region is cut off. We recommend that you not insert content that would display
controls with scrollbars. The preview functionality is intended to let users quickly view
information that does not involve too much interaction.
Hosted Content: The preview supports JavaScript sandboxed to the domain of the Activity. It
also supports ActiveX controls if the controls are already installed and opted-in by the user for
the given domain. Controls that take focus do not work in this window:
<select>
<input type="text">
<text area>
Navigation within the Preview Window: User can navigate within the preview window through
hyperlinks.
Navigation to a Full Web Page: To send user to a full Web page, set the link to open in a new
window. This can be done in two ways:
Set the target attribute to be "_blank" as part of the hyperlink. When invoked by the
user, Internet Explorer 8 will open this as a new tab.
Use the open method and set the input URL to the site that you would like the user to
navigate to.
<FORM>
<INPUT
type="button"
value="view full site"
onClick="window.open('gotosite.html')" />
</FORM>
5. Localization
A single Activity XML file maps to a single locale. If your service supports multiple locales, you will need
to have a separate XML file for each locale. From the Web page that you use to advertise Activities, you
should use a user's locale to display the correct XML file for the user to install.
The value of the category element should be localized. For example, in English the category for an
Activity that supports mapping service is "map" but in Spanish it is "mapa."
English Example
Spanish Example
A user can have Activities from multiple locales installed, and all of them are displayed.
6. Deployment
You can also promote Activities from your own Web page. Internet Explorer 8 Beta 1 for Developers
handles the installation of an OpenService Activity file through a new browser API that is accessible by
Web pages.
The first step is to have the OpenService Activity XML file published on a server that your users can
access. The next step is to add an "Install" button from a Web page that your users visit often. You can
check to see if a user currently has your Activity installed:
window.external.IsServiceInstalled("http://maps.live.com/GetMap.xml", "map");
For the check to succeed, the domain of the Web page must match the domain of the URLs specified in
the OpenService Activity XML file. If the check fails, the Web page displays the "Install" button:
window.external.AddService("http://maps.live.com/GetMap.xml");
Internet Explorer 8 also promotes popular Activities through the Service Guide Web page. Please work
with your Internet Explorer 8 contact to see if your Activity meets the requirements to be on this Web
page.
7. Sample
This is a simple sample that shows map Activity that you can host on a Web site.
Activity XML File: Copy the following sample code to a text editor and save it as GetMap.xml. This code
describes the functionality of the Activity, as specified in the OpenService Activity Format section.
Hosting the Install Button: To advertise the Activity, add this code snippet to your Web site:
To test
1. Install the Activity by clicking on the "Install" button on your Web site. This launches the
installation dialog.
2. Select the Make this my default provider checkbox. This sets the Activity to appear in the top
listing for Activities.
3. Go to a site that contains a street address.
4. Select the address and click on the button that appears next the mouse cursor. (Alternatively,
you can right-click to get the context menu.)
5. Hover over the "Map with Live Maps" Activity. This displays the preview of the map Activity.
6. Click on the "Map with Live Maps" Activity. This navigates to the map Web site in a new tab.
8. Known Issues
The Activities button does not appear if the Web page is in IE8 Standards mode. Users need
to access the selection Activities by bringing up the context menu.