|
|
|||||
|
|
|||||
|
|
sunBow plug-in documentation
sunBow Plug-inCOPYRIGHT (c) 2000-2002 by s&n AG Document detailsAuthorMartin Dulisch, s&n AG VersionThis document conforms to the sunBow preview version 5
1. IntroductionThe 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:
2. XML Development2.1. XML EditorThe plug-in contributes a XML editor with the following features:
2.1.1. Completition proposalsThe 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. 2.2. XML ValidationThe 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. 2.3. XSLT TransformationTransforming of 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 been 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 been 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. 2.3.1. Tracing the transformationThe 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. 3. Cocoon3.1. Sitemap EditorThe 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.
3.1.1. Keybindings in the editor
3.1.2. Icon bar
These icons in the action bar from the sitemap editor have the following functions:
3.1.3. Insert element dialogTo 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 dependant 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. 3.1.4. Edit attributes dialogIn 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:
3.1.5. Sitemap fragmentsThe 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. 3.1.6. Drag and Drop supportThe 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. 3.2. Editing the configurationsunBow 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.
4. DeploymentIn 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. 5. TestingsunBow 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. 5.1. Cocoon TestIn 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. 5.2. Apache Latka testsWith 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: Montag, 22. Juli 2002 14:18:58 |