Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Mashup Center wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM Mashup Center 3.0.0.1 Documentation Custom Search Scope...
Search
Community Articles > IBM Mashup Center > Best Practices > Best practices for creating widgets
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Anna G O'Neal
Contribution Summary:
  • Articles authored: 175
  • Articles edited: 274
  • Comments Posted: 34

Recent articles by this author

Maintaining page IDs when importing spaces

After exporting a space to one server and then importing that space to another server, you might notice that the original IDs for that space and all its pages and widgets change. In cases where you do not want the IDs to change, you can run a stableid import command to import the space ZIP file ...

Adding a custom widget to the mashup builder

You can add a custom widget to the mashup build directly from the Add to Mashup Builder window in the catalog. Do the following steps: 1. Open the catalog.xml file for the widget in edit mode, and add the line in italic font: definition ...

IBM Mashup Center Trial Edition, Version 3.0.0.1

This is an evaluation version of IBM Mashup Center, version 3.0.0.1. The product media contains all the functionality of a fully licensed version of IBM Mashup Center, except for the following limitations: This software is valid for 60 days from installation. This software is only available for ...

Date formats do not match browser settings for language

When browser settings for language are set to engb, certain widgets that display start and end dates of events might incorrectly display the dates in American English format ((MMDDYYYY)) instead of United Kingdom English format (DDMMYYYY). For example, when you view a series of events in the ...

Connecting to the Mashup Center WebDAV when working with themes and skins

This topic provides information on WebDAV, including how to connect to the file store to work with Page Builder 2 static resources.

Community articleBest practices for creating widgets

Added by Anna G O'Neal | Edited by IBM contributor Anna G O'Neal on May 26, 2009 | Version 19
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: best_practices, mashups, product, documentation
Original IBM content
English
Brazilian Portuguese
German
Italian
Japanese
Korean
Spanish
As a widget developer, you should be familiar with the following best practices for creating and configuring widgets. If you want to contribute your own best practice, simply log in to the wiki and add it to this page!

Understanding the various tools for creating widgets


As a widget developer, you can use a couple of different tools to create widgets for your mashup pages.

First, the #1-recommended tool is IBM Lotus Widget Factory. If you have used Portlet Factory to create portlets for other projects, then you are already familiar with the basic concepts for creating widgets. Widget Factory is based entirely on the same stack as Portlet Factory, but Widget Factory is more tailored to creating widgets. For more information about Lotus Widget Factory, see Widget Factory section of the IBM WebSphere Portlet Factory wiki.

Second, if you are familiar with dynamic scripting platforms such as Groovy, Ruby on Rails, and PHP, then you may want to check out the emerging new product called WebSphere sMash. For more information, see this article from Project Zero.

Finally, you can create your own custom widgets using an Eclipse-based development environment for creating WAR files, such as WAS Toolkit or Rational Application Development. See the Creating and deploying a simple widget article in this wiki to see steps for creating and deploying a widget using the WAS Toolkit.

Working with themes and styles


As a developer, you will most likely be interested in the themes and styles that are provided with Lotus Mashups. When you create mashup pages, each page is attached to a theme that dictates the look and feel of the page as well as the widgets that are contained in that page. These styles are defined by a set of style classes included in a style sheet file that is located within each theme directory. For more information about where you can locate the Lotus Mashups themes and style sheets, see Working with themes and skins (V1.1).

Structuring widget WAR files


When creating your own widget WAR files using an Eclipse-based application such as WAS Toolkit or Rational Application Development, you need to be sure that the files and folders contained in the WAR package are structured properly. For information about how to use the WAS Toolkit to create and structure a WAR file, including how to create and structure the required widget files, see Creating and deploying a simple widget. This topic teaches you how to create a WAR file and add it to an Eclipse project, add image files, create the catalog definition file that defines the widgets in the WAR package, create a PROPERTIES file that defines the context root and component name, and more. It teaches you exactly where to place these files so that your widget runs successfully in a mashup page.

Understanding payload (data) types

When you wire two widgets together, they need a common payload type in order to communicate. In response, Lotus Mashups has defined a list of common types. Most of these payload types are simpletypes, for example text, person, phone, and address. For more complicated data, such as data in XML format, Lotus Mashups supports complex payload types, for example xml, atom, and json. Lotus Mashups payload types are defined and associated with events in the widget definition file that is located inside each widget's WAR package.

For details about Lotus Mashups payload types, including which ones are compatible with each other, see Working with payload types. This article also explains how you can implement a public API to create and customize your own payload type.

Defining widget modes


When developing widgets, you may want to implement the ability to switch between multiple modes, for example edit and view modes. For suggestions about how to accomplish this, see Defining custom widget modes.  

Creating multiple instances of a widget in a single mashup page


You can place multiple instances of a single mashup widget in a single page. In order to do this, you must properly encapsulate each widget instance. To see a set of guidelines for doing this, see section 4:3 Common widget practice in the Widget Programming Guide.




IBM original content


Click the following links to download the original IBM-authored content in various languages. All documents are in PDF format.
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (7)
collapsed Versions (7)
Version Comparison     
VersionDateChanged by              Summary of changes
21Aug 17, 2009 12:33:24 PMAnna G O'Neal  IBM contributor
20Aug 12, 2009 11:38:07 AMAnna G O'Neal  IBM contributor
This version (19)May 26, 2009 10:13:46 AMAnna G O'Neal  IBM contributor
18Dec 31, 2008 9:29:15 AMAnna G O'Neal  IBM contributor
17Dec 7, 2008 11:11:38 AMAnna G O'Neal  IBM contributor
16Dec 7, 2008 11:09:25 AMAnna G O'Neal  IBM contributor
14Nov 21, 2008 11:45:06 AMAnna G O'Neal  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use