COPYRIGHT (c) 2000-2002 by s&n AG
Martin Dulisch, s&n AG
sunbow-support@s-und-n.de
This document conforms to the sunBow version 1.0
1. | Introduction |
2. | XML Development |
2.1. | XML Editor |
2.1.1. | Completition proposals |
2.2. | XML Validation |
2.3. | XSLT Transformation |
2.3.1. | Tracing the transformation |
3. | Cocoon |
3.1. | Cocoon Debugger |
3.2. | Sitemap Editor |
3.2.1. | Keybindings in the editor |
3.2.2. | Icon bar |
3.2.3. | Insert element dialog |
3.2.4. | Edit attributes dialog |
3.2.5. | Sitemap fragments |
3.2.6. | Drag and Drop support |
3.2.7. | Editing sub-sitemaps |
3.3. | Editing the configuration |
4. | Deployment |
5. | Testing |
5.1. | Cocoon Test |
5.2. | Apache Latka tests |
The sunBow Plug-in is an extension for the Eclipse-Platform (www.eclipse.org). It contributes additional functionality to Eclipse for building web applications with s&n sunShine or Apache Cocoon. The following features are included in the plug-in:
The plug-in contributes a XML editor with the following features:
The proposals are listed when the user starts a new tag with the '<' character or types the ':' character in a tag. The shortcut CTRL+Space also opens the list with possible tags.
Tags are generated from XML schema files. These are defined in the preferences of the editor.
Schema files are associated with file extensions. For each schema a namespace prefix can be defined. When the proposals are listed in the editor, this prefix is catenated with the tag names from the schema definition. sunBow comes with schemas for Cocoon sitemaps and for XSLT stylesheets. These are called internal. You can also associate a file from any location.
sunBow also allows to set up special schemas for each file in the project. This association can be edited in the properties of the file resource.
The sunBow plug-in provides two ways to check XML documents to see if they are well-formed.
In addition to the XML editor you can select the menu "XML Validator" from the context menu of a XML file in the navigator view. Errors will be assigned as tasks to the file resource.
Transforming of an XML Document can be done with the sunBow plug-in. For this task the plug-in uses the Apache Xalan stylesheet processor. Transformation can be started from the context menu of a file in the navigator view.
After the transformation has been finished the result can be opened in the standard system browser. The result can also be saved in the project. The filename must be defined relative to the project root folder. Errors that occur during the transformation are assigned as resource tasks either to the XML source file or to the stylesheet file.
Settings in the transformer dialog are stored for each XML file. The stylesheet can also be selected in the Eclipse navigator view. To do this, in the resources tree, select an XML file and a stylesheet and than call the transformer from the context menu of the stylesheet or the XML file.
The sunBow plug-in also contributes the possibility to trace the transformation process. To start the tracer select one XML and one XSL file in the resource navigator and call "XSLT Trace" from the context menu. After this a new perspective will be opened.
The perspective shows three views: XSLT stylesheet, XML source file and the output of the transformation. Tracing can be controlled with the action icons in the toolbar from the stylesheet view. The other two view will be updated and synchronized after each step. To interrupt the transformation process you can define breakpoints. The tracer stops when a breakpoint is reached. Now you can continue the transformation step by step or choose Resume. Resume processes the transformation to the next breakpoint or to the end.
The Cocoon Debugger is only included in the professional version of sunBow. It enables the tracing through the processing of sitemap statements. For each statement the outgoing XML stream and the sitemap-variables are displayed. To use the debugger an additional library for Cocoon is required. sunBow adds a "Cocoon Debugger Perspective" to the platform. The perspective has the following layout:
The debugger consists of three views. In the main view the sitemap is displayed. It offers actions to control the debugger. The selection in this view affects the two other views.
The second view shows the outgoing XML stream of the selected sitemap statement. In the properties view sitemap-variables are listed in real-time during the processing.
Debugging is based on a socket communication with Cocoon. So before starting the debugger the first time you should define a port where the debugger can wait for Cocoon requests. The corresponding dialog can be opened from the views menu. When you have defined the port the debugger can be started from the menu of the main view. In the opening dialog you must select a URL for the request to the Cocoon instance and choose if the URL should be opened in a browser or if the debugger should perform the request internaly.
The debugger can run in two modes which can be toggled by the action "Stop on first processed statement" from the main views toolbar or menu. If the action is checked the debugger stops on the first sitemap statement that is visited by cocoon. This is mostly the pipelines statement. In the other case the debugger stops on the first statement that is processed by cocoon. This could be a fitting match for example. After the debugger stops the following statements can be traced step by step.
The sitemap editor is a dialog orientated editor to edit the sitemap. It shows the sitemap structure as a tree. Changes can be done in dialogs. These have pre-defined input fields for the attributes that can be edited.
The editor is based on a XML schema definition for the sitemap. Modifications are validated against the schema.
File resources, that are referenced from sitemap elements, can be openend directly from the editor. Select an element with a src attribute. Now the file, that is referenced in the src attribute, can be openend with the 'Open file in editor' context menu. The sitemap editor only allows to open files, that are contained within the same project as the sitemap.
Key | Action |
---|---|
F2, Enter | Edit element attributes |
Insert | Insert new element |
Delete | Delete element |
These icons in the action bar from the sitemap editor have the following functions:
To insert a new element to the sitemap press either the Insert-Key or click on the insert icon. The following dialog opens:
The new element will be added to the position relative to the currently selected element in the tree. The elements presented in the list are depending on the selected position. They are determined regarding the XML schema. The defined sequence and the maxOccurence attribute are validated to calculate the set of allowed elements.
In this dialog you can edit the attributes of the selected element. For each attribute that is defined in the XML schema one input field is created. The dialog is opened after a double-click on the element, pressing the Enter-Key or selecting the edit action from the tool bar.
The editor supports the following attribute data types from the XML schema:
Required attributes are marked with an asterisk ('*') after the label of the input field.
Additional to the supported schema types the following special types are offered from the editor:
The sitemap editor has a built in management of sitemap fragments. You can add any elements of the sitemap to the collection of fragments. For this select the menu Store Fragment from the context menu in the sitemap editor. In the following dialog define the name and the category where the fragment should be stored.
To insert a fragment into your sitemap select Insert Fragment from the context menu. In the following dialog you can browse your stored fragments. The fragment will be added as a child under the currently selected element in the sitemap editor.
The sitemap editor supports Drag and Drop to move or copy elements of the sitemap. If you want to copy an element, hold the SHIFT-Key before dragging the element. Each element can be dropped to three destination positions relative to the destination element. When you move the mousepointer on an element, the element will be highlighted. At this position the dropped element is assigned as a child of the destination element. You can also drop an element before or after a destination element. In that case the dropped element will be assigned as a sibling element. The resulting drop action is described in the status line of the workbench.
The drop operation is validated against the sitemap schema. Only valid positions are allowed as drop destinations. The mouse pointer indicates if the destination position is valid or not.
Editing of sub-sitemaps is also supported. Components that are defined in the parent sitemap are listed in the edit element dialog. The association to the parent sitemap can be done in the properties of the sub-sitemap on the "Sitemap Editor" page.
sunBow provides a simple way to manipulate the categories log level defined in the logkit.xconf file. In the project properties window sunBow adds a new category Cocoon Log Level. All categories form the logkit.xconf file are listed. The log level of each category can be modified by selecting a level form the context menu.
In the current release, deployment is processed by copying or deleting files in a specified directory. The deployment directory can be specified in the project properties category sunBow Web Application. This destination corresponds to the root directory of the project. Subdirectories are handled relative to these locations.
Files can be selected explicit in the resource navigator view. Then deployment can be started from the context-menu by choosing the menu 'sunBow/Copy File'. When necessary directories are created in the destination.
The sunBow plug-in also contributes an automatic tracking of changes. Changes are only logged for files that belong to projects with a defined deployment directory. All changes that occur before setting the deployment directory are not handled.
From the context menu (sunBow/Deployment) of a project you can open the deployment dialog. Here all changed, added and deleted files are presented. In the list you can select the files you want to be deployed. Deleted files will be deleted in the deployment directory.
sunBow contributes two ways to test your web application. You can define requests with parameters in the Cocoon Test view. Requests can be performed alone or as a sequence in the same context. Another possibility to run tests is the Apache Latka plug-in.
In the Cocoon Test view you can define requests with parameters. Requests are defined relative to a base URL. To define a request you first have to add a base URL item, that collects requests as child items.
Every request can be performed alone. To do this select the Perform Request menu from the context menu of a request item. You can also execute a sequence of requests. This is done by the Perform Request menu from the context menu of as Base URL item. All requests that belong to that base will be performed in the same context. This feature makes it possible to first call a login page and than other pages that can only be called after an authentication.
In the properties for each request you can define if the response should be opened in a browser. Otherwise a message is displayed which indicates if the request was successful.
With this feature Latka XML test suites can be executed in the workbench. To run the test select the menu Run Latka from the context menu of your XML file, in that the test is defined. A view will be opened where the test events will be logged.
For more information about Latka and the definition of test suites please refer to the Apache Latka home page.
Last Modified Date: Freitag, 8. November 2002 12:07:46