Sharon Thompson

Subscribe to Sharon Thompson: eMailAlertsEmail Alerts
Get Sharon Thompson: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: XML Magazine

XML: Article

WebSphere Studio Leverages XML to Empower Web Developers

WebSphere Studio Leverages XML to Empower Web Developers

A good Web development tool should be easy to use, yet robust enough to create and edit static and dynamic pages, organize and publish files, and help the developer properly maintain the site. IBM's WebSphere Studio is a total project management workbench with several integrated tools that assist developers in all stages of Web development.

Studio may be used in conjunction with some of the more common version control software (VCS). But even without an integrated VCS, Studio allows multiple users to access a project and check files in and out. Throughout the development process, Studio assists with link management that maintains links even while users move the source files around within the project.

Wizards Help Nonprogrammers, Too
Studio's various editors and wizards are particularly helpful for nonprogrammers. Wizards can enable even novice users to generate server-side logic and add powerful functions to Web sites. They also leverage XML technology to make it easy for users to create Java servlets or JavaServer Pages that access databases and implement JavaBeans. When the development process is complete, or when the team is ready, Studio's powerful publishing feature enables them to easily publish files to a local server for review or to a live production server. Studio assists developers from page creation through editing and finally to publishing.

WebSphere Studio includes three powerful wizards: SQL, Database, and JavaBean. These help developers easily create dynamic content for Web sites through a simple step-by-step procedure. Studio's SQL wizard generates a SQL file that specifies the query and information needed for the Database wizard so it can produce pages that access the database. The JavaBean wizard creates Web pages that utilize any JavaBeans you may have in your project.

The JavaBean and Database wizards have similar steps and options. Both enable the user to select the code-generation style, generate markup languages, create error pages and specify display fields in the input and output pages, as well as choose which JavaBean methods to invoke, and in which order.

This article introduces you to Studio's wizards, editors, and publishing functions and exposes some of Studio's weaknesses as well.

Studio's SQL wizard produces an .sql file that contains your SQL statement and other information required by the Database wizard. Once your SQL statement is complete, the Database wizard uses this statement to query, insert, update, or delete data from your relational databases. Studio's Database wizard lets you create servlets that can query, insert, update, and delete data in relational databases live from the Web.

When launching the Database wizard, select the SQL file the generated pages will be based on (see Figure 1). Then choose the code generation style and markup languages (see Figure 2). This allows you to display your pages in more than one type of device. Select the markup language based on the type of device you'll be serving your page to. You can generate your pages using:

The Database wizard allows you to generate code based on the servlet or JSP model. The servlet model produces a Java servlet that reads the input data and instantiates the JavaBean. The JSP model creates an input form and a JSP page that formats the returned data.

After selecting the markup languages, specify which Web pages you'd like the wizard to generate (see Figure 3). In addition to the input and results page, the Database wizard can create error pages to notify the user of any problems or allow users to update retrieved data and commit changes to the returned data. After specifying which fields to display on the input and results page, the wizard will also create a JavaBean that encapsulates the required database operations and results. You may select the JavaBean method you'd like to use, and store the resulting JavaBean in your user's session for reuse.

When you reach the end of the process, the wizard displays the list of files to be generated for your review (see Figure 4). Once you're satisfied with your list, submit your choices and the files are generated.

After generating your pages through Studio's wizards, use PageDesigner, Studio's built-in WYSIWYG HTML/JSP editor to customize the pages (see Figure 5). PageDesigner includes many functions such as the ability to easily create tables and frames, drag-and-drop multimedia and JavaBeans from your project, insert JSP tags, check syntax, and many other functions common to most HTML editors. However, Page Designer does not provide "code assist."

Studio has a built-in editor for VoiceXML files that includes a code assist feature to guide you as you add or change code and tags. Code assist helps ensure that your VoiceXML files will be syntactically correct. Whether you add a new VoiceXML file to your project, import or copy an existing one, or create one with the Studio wizards, you can edit it with the default VoiceXML editor.

While WebSphere Studio includes many helpful tools, it lacks others, such as a WML editor. However, Studio allows you to register other editing tools, so you can use your preferred WML editor. Once a tool is registered, you may launch it from the Studio workbench. Studio's tool registration feature enables you to add, remove, or edit supported file extensions and select the editors associated with the extensions.

Once you've edited your pages to your liking, you can use WebSphere Studio's deployment function to publish from one file to your whole project. WebSphere Studio was designed explicitly as a tool for the WebSphere Application Server. When you select the servlet model in the Database and JavaBean wizard, Studio produces a servlet descriptor file intended for the Application Server. The tight integration with the Application Server allows Studio to expose the server's special functions and to stay in sync with the Application Server's latest features. For instance, Studio currently supports publishing to WebSphere Application Server's "Web application" structure, allowing you to easily deploy a Web application from Studio by specifying the correct Web app and publishing paths.

Utilize Custom Tags
The Application Server's latest feature is the support of JSP 1.1 and Servlet 2.2, enabling you to utilize custom tags and Web Application Archives (WAR). Studio supports JSP 1.1 and Servlet 2.2 as well. You can use Page Designer to insert custom tags and Studio to create the files needed to deploy a WAR file to the Application Server. Once the WAR file is created, you're able to publish it directly from WebSphere Studio to your Application Server.

Studio's wizards help developers overcome the challenges of creating Web applications that meet the needs of pervasive computing devices. These devices have limited resources (screen size, memory, and bandwidth) and often require markup languages other than HTML, such as WML, CompactHTML, and VoiceXML.

Web application development for pervasive computing devices requires device-specific consideration for content, page layout, and markup language. In this context, Studio's wizards are valuable tools since they provide the ability to generate up to four markup languages simultaneously. Even though Studio does not provide built-in editors for these languages, the tool registration feature enables users to continue using familiar tools while benefiting from Studio's other robust features. And the added integration with WebSphere Application Server makes publishing simple and reliable.

More Stories By Sharon Thompson

Sharon Thompson is a software developer for IBM's WebSphere Studio.

More Stories By Amy Wu

Amy Wu is a software developer for IBM's WebSphere Studio.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.