Mashup Designer for Opera Widgets
Mashups
It’s been called the essence of Web 2.0. It’s the ability to combine pieces of different web sites to create something new, something meaningful. Something for you and the people who have your tastes. Your social network. Not some mass market portal built by corporate programmers who think that they know you and your personal tastes.
Referred to as a composite web site by some and Mashup site by others, we call it amalgamating web data through the process of transcoding. Whatever. It’s about giving you the data that you want on your mobile phone or desktop browser. It’s Web 2.0. It’s about you.
Widgets
Floating on your desktop, they provide you with easy access to important information. Any piece of web data, it’s there at a glance. No need to launch your browser. No need to scroll a web page to find that chunk of important data. No clicking. It’s always there. No need to refresh. It constantly updates itself. It’s your Opera Widget powered by <alt> Mashup technologies and infused with a bit of AJAX.
Opera Widget Designer Features
The Mashup Designer for Opera Widgets extends the reach of our Mashup development tools to include Opera Widgets as deployment clients.
Leveraging the StableDOM and code generation technologies, our Mashup Designer for Opera Widgets provides the following major capabilities:
1.An Opera browser-based design tool.
2.Fill-in-the-blank form to define your Mashup content properties.
3.Fill-in-the-blank form to define your Widget layout styles.
4.Fill-in-the-blank form to define your Widget properties.
5.Fill-in-the-blank form to define your AJAX properties.
6.Testing a prototype of your Widget accessing live data.
7.Generation of your Widget files.
The following is a screen shot of the Mashup Designer for Opera Widgets when first launched:
Defining Content Style Properties
The Mashup Designer for Opera Widgets allows you to define the following content properties:
1.Background color.
2.Foreground color.
3.Background image color.
4.Font family.
5.Font size.
6.Text-To-Speech options.
The following screen shot shows the content properties section of Mashup Designer:
Defining Widget Layout Styles
The Mashup Designer for Opera Widgets allows you to define the following Widget layout styles:
1.No footer. This option will remove the CSS property border-top of the footer. The “flip” icon will remain and is unchanged.
2.Footer updated with time stamp. On each update from the Mashup server, a JavaScript will update the footer with the local time. This ensures that the Widget user will know when the last content update took place.
3.Footer with static HTML. This will default to the following HTML:
<a href='http://altmobile.com'>ALT</a> mashup technologies and <a href='http://opera.com'>Opera</a> widgets
You should probably place your company support information or the Widget name and version.
The following screen shot shows the Widget layout styles section of the Designer:
Defining Widget Properties
The Mashup Designer for Opera Widgets allows you to define the following Widget properties:
1.Widget name.
2.Widget description.
3.Widget width.
4.Widget height.
5.Web link to Widget.
6.Author’s name.
7.Author’s email address.
8.Author’s organization name.
9.Widget download domain. If you leave this field blank, the domain will be generated from the AJAX Mashup server URL property.
10.Widget security name.
11.Widget creation date.
Defining AJAX Properties
The Mashup Designer for Opera Widgets allows you to define the following AJAX properties:
1.Mashup server URL. This field is auto-populated with the value of the Opera Widget Object Server URL. This is a special Object Server as is discussed later. This specified URL is used in the JavaScript source code generation to support AJAX calls to the Mashup server.
2.Widget content refresh specified in minutes. This field is auto-populated with the value of one minute. It is important to specify a realistic value as not to overwhelm the Mashup server’s resources and consequently the servers from which it fetches its data. This number is used in the JavaScript source code generation to support a JavaScript timer used by AJAX calls to the Mashup server.
3.The AJAX JavaScript source code to access the Mashup Server, update the content area of the Widget, and set a JavaScript timer. This allows you to quickly change any of XMLHTTP properties such as setting any custom headers.
Testing Your Mashup Widget
As a Widget provides a fixed size canvas, it is important to correctly size your Widget to contain all your data. Rather than delaying testing the fit of your content until deployment, the Mashup Designer for Opera Widgets provides a resizable Widget Prototype which displays the Mashup content. Another added benefit of interactive testing is that you can launch different versions of the Opera browser to ensure compatibility. While this is less of a concern for HTML-based Mashups, we feel that SVG-based Mashups will probably require additional testing as it is a newer technology in the browser and as a W3C specification.
To fetch the Mashup content and place it into the Widget Prototype, select the “Fetch Content” link as highlighted in this screen shot:
You can then resize the Widget Prototype to ensure your content fits. The width and height data – expressed in pixels—is placed in the title bar of the Widget Prototype for easy reference. The Widget Prototype is highlighted in this screen shot:
And a resized Widget Prototype is displayed in this screen shot:
Generating Your Mashup Widget Files
The Mashup Designer for Opera Widgets generates a unique directory containing:
1.The config.xml file specifying your Mashup Widget properties.
2.An images directory containing the images for the “switch” button. These are reused from the Opera HelloWorld sample and are assumed to be in the public domain.
3.A JavaScript file named mashupWorld.js containing the AJAX code needed to fetch and display the Mashup data. It also contains the behavior needed to change the configuration information.
4.A CSS file named mashupWorld.css containing rules for the generic Mashup Widget such as colors, fonts and layout.
5.A CSS file named designer-generated.css containing the size information calculated from the Widget Prototype size. It also sets the body CSS properties for the font-size, font-family, color, and background-color as specified in the Designer.
6.The index.html file containing the static portions of the Mashup Widget.
7.The mashup.zip file containing the previously mentioned files ready for deployment.
This service is accessed through the “Generate Widget” link as highlighted in this screen shot:
Here is a screen shot of the directory with the Mashup Widget files:
To view your newly created Mashup widget, you can drag and drop the config.xml file onto the Opera browser. Or, you can open the Mashup.zip file with Opera. A screen shot of the “front” of a sample Mashup Widget is seen here:
And, the "back" of the Mashup Widget looks like this:
The sample Mashup Widget demonstrates several important concepts and provides the skeleton needed for you to create aesthetically pleasing Mashup Widgets:
1.The segmentation of the Widget into two visual areas: the content area and the status/control area.
In the sample Mashup Widget, the status/control area contains marketing information and the configuration “switch”. The importance of the “switch” is discussed in the Opera Widget tutorial.
Rather than static marketing information, e-commerce Widgets might fetch a banner ad. The web advertisement association or Google/Yahoo will probably define a special banner ad size for Widgets much as they have done for mobile ads.
More importantly it’s best to specify Mashup related data such as the last time data was fetched, for example, or perhaps the Mashup title or version.
2.A configuration “panel”. In addition to the reasons mentioned in the Opera Widget tutorial, enterprise users will want to define a standard configuration look and feel. With cross-domain scripting restrictions removed in Widgets, a generic Mashup Widget can be deployed and remotely administered.
3.A start and stop capability. The generic Mashup Widget internally uses a JavaScript timer to invoke the AJAX code to fetch the Mashup data. The generated JavaScript code will remove any previously set timers.
4.The URL of the Mashup server providing content to this Widget. Internally, the generated Mashup Widget internally will store this URL as a Widget preference enabling persistence and customization.
5.The interval to refresh the content. As mentioned earlier, it is important to fetch at reasonable intervals. Internally, the generated Mashup Widget internally will store the refresh increment as a Widget preference enabling persistence and customization.
Launching the Mashup Designer for Opera Widgets
As mentioned earlier, the Mashup Designer for Opera Widgets extends the reach of our Mashup development tools to include Opera Widgets as deployment clients. To launch the Designer, you should have already created a Mashup and generated the Dynamic XSL.
Once a Dynamic XSL has been created, you should launch an Opera Widget Object Server by selecting the menu item “Opera Widget Object Server…” from the popup menu as seen in the following screen shot:
Much like a normal Object Server provides a micro web server enabling remote access to the XML or XSL content of the text editor—transcoding as needed from remote sites—the Opera Widget Object Server also allows you to launch a micro web server. This is seen in this screen shot:
In the above screen shot, you see how to launch an Object Server on a specific port. Unix users will be alerted about using restricted ports.
In addition to all the features, HTTP debugging/monitoring, and manageability of a standard Object Server, the Opera Widget Object Server provides the following additional capabilities:
1.Generates the Mashup Designer for Opera Widgets web page customized to support Widget development.
2.Launches Opera 9—which should be your default web browser—to view the Mashup Designer web page using the Opera command line API.
3.Implements the previously described “Fetch Content” service which is accessible through the Mashup Designer for Opera Widgets. The Fetch Content service returns the first child element of the BODY element generated by the Dynamic XSL. As such, it is important that your deployment Mashup server performs a similar element stripping or your JavaScript client does this. This is also a concern for any global CSS rules that your Mashup defines.
To reinforce this concept, let’s visualize a hypothetical XHTML document that was generated by a Dynamic XSL Mashup:
Since we want to dynamically update just the Widget’s content area and not the entire canvas, the Opera Widget Object Server will just return the highlighted elements. Also note that the table element defines its border explicitly rather than defining a global CSS rule. This is highlighted in this screen shot:
Of course, an inline CSS rule would also work.
4.Implements the previously described “Generate Widget” service which is accessible through the Mashup Designer for Opera Widgets.
The Mashup Development Process for Opera Widgets
To create Mashup Widgets, you should follow these steps:
1.If you are a web developer who prefers to use WYSIWYG HTML editors such as found in popular blog tools, then
a.Define your Mashup content by launching the StableDOM Browser from the "Mashup" menu as seen here:

This will launch the StableDOM browser enabling you to navigate to the remote URL just as you would with a traditional desktop web browser. Here is a screen shot of the StableDOM Browser:
The StableDOM Browser differs than the HTML Transformation Browser-- which is described later in the enterprise XML developer section-- in that the HTML Transformation Browser extracts remote HTML content and transforms that content to the target document language. So for example, if the remote content is an HTML table and the target document is a WML document, then the HTML Transformation Browser and its engine will dynamically create a WML table. The StableDOM Browser and its engine will not perform any node or content adaptation and will only extract the remote HTML content. Both browsers use a similar user interface, though.
b.Generate the semantic metadata for the remote HTML element by selecting the menu item "Display Transcoding Metadata for xxx" (where xxx will be the element name) from the popup menu as seen here:

A window will be displayed containing the metadata as seen here:

You may tweak the XPath statement defined in the RDF metadata to best locate the HTML element.
c.Launch the Mashup Monitor from the "Mashups" menu as seen here:

d.Drag and drop the RDF metadata onto the Mashup Monitor as seen here:
e.Construct your target HTML document in the WYSIWYG Mashup Designer by launching it from the Mashup menu as seen here:
f.You will be prompted to specify a port to run a special object server that is used to communicate with the WYSIWYG Mashup Designer. The WYSIWYG Mashup Designer will be launched in your default browser, as seen here:
The <alt> WYSIWYG Mashup Designer is based on TinyMCE, the industry leading HTML blog editor. We have created several TinyMCE plug-ins supporting the creation of Mashup content for blogs, web sites, and widget systems. For information TinyMCE, visit http://tinymce.moxiecode.com/.
g.Create your static content as you normally would. When you want to add dynamic content, select the "Mash" button to select previously defined Mashup content, as seen here:
h.The Mashup plug-in will launch a list of monitored Mashups, as seen here:
allowing you to view the remote content and insert it either as static or dynamic HTML content as seen here:
The option to view the remote content in the "Content Viewer" is only available when using the latest version of the Opera web browser.
i.Insert the remote content either as static or dynamic content by selecting the appropriate hyperlink which will fetch the remote content and place it into the WYSIWYG Mashup Designer as seen here:
If you use a browser other than the latest Opera web browser, you will need to subsequently click on the Monitored Mashup dialog to close it. This seems to be a bug in the underlying TinyMCE plug-in code.
j.You can now save the Mashup as a Dynamic XSL by selecting the "XSLT" button as seen here:
This invokes the Dynamic XSLT plug-in which makes AJAX calls to save the HTML content and in the process convert it to an XSLT document. The XSLT is displayed in a window as seen here:
k.And then use the popup from the new "XSL Source" window to launch the Mashup Designer for Opera Widgets as was described earlier in this document.
In addition, you can use the various popup menus to interactively test this Mashup in a browser, publish it as an RSS feed perhaps as a data source for a Yahoo! Pipe, or use it as the content for a different widget system… among a few other options as seen here:
l.Or invoke the Mashup Designer for Opera Widgets plug-in as seen here:
which is a short cut to saving first as an XSLT and then manually launching the Opera Widget Object Server. A new window or tab will be created to contain the Mashup Designer for Opera Widgets.
2.If you are an enterprise XML developer who requires fine-grained node level control—down to the attribute—of the target XML/XHTML output document, then