|
|
The Power Of Notes - Part 15: DXL
Peter Presnell
Those of you who have started development using IBM XPages will
know of the power that come from having both a Visual and Source Code
perspective of their XPages and Custom Controls. The Visual editor is
familiar to those of us with a Note Classic background. Its a
(somewhat) WYSWYG approach to designing an application. The source code
editor is made for those of us that prefer to see an application laid
out as code. We are free to switch from one perspective to another as
circumstances (or desperation) demands. As an XPage novice I found
myself inclined to work in the familiar visual editor. Over time I used
the visual editor less and less for XPages and now rely almost
exclusively on the source code view. Perhaps the biggest use I make of
the visual editor is to quickly navigate around a large form (oops
XPage). In many ways DXL (Domino XML) represents
the "Source Code" view of Notes classic applications. It is truly one
of the hidden gems in Notes development. One of the reasons it has not
been more widely adopted is that IBM never finished the job.
Improvements continue to be made but as of Notes 8.5.2 there were still
features of a Notes application that are still not able to be expressed
via DXL. The following is a random collection of
some of the key capabilities of DXL along with some of the more obscure
and not so well known capabilities it possesses:- - Since
Notes 6 a set of DXL Utilities have been available in the Designer
Client (under Tools) providing a quick way to View, Export, and
Transform a selected design element. This utility provides a way to
view Notes Classic design elements as DXL. To understand the complex
structure of the DXL requires learning new concepts unique to DXL. For
example the rich text content of Form, Subform, or Page includes the
following DXL elements:
- A form can be broken into
two FormRegions that represent the "Header" and "Body" components of a
form. Not used very often, Notes allows a developer to define an area
at the top of the Form referred to as the "Header".
- Each Paragraph of text is referred to as "Par"
- Paragraphs
with common styling/formatting are assigned to a "ParDef". The actual
styling/formatting is then defined once inside a separate Paredf
element.
- When text inside a paragraph is assigned distinct
styling. this is done through the creation of a "Run" tag. Runs can be
nested inside other runs based upon how you use the editor to assign
styling to the text.
- When an element such as a hotspot is
associated with a group of text that spans multiple paragraphs, but not
necessarily all the text in each paragraph, this is represented as a
"Region". Each paragraph is assigned to a RegionID, the hotspot (or
other element) is assigned to the region. The beginning of the region
is marked inside the first paragraph and the end of the region marked
inside the last paragraph.
- There is a section on DXL in the on-lone help for Domino Designner.
- You
can also find the DXL structures for each version of Notes in the
xmlschemas folder where you have Notes installed. This contains largely
the same documentation found online but it can be a lot easier to
navigate. Note: The standard Eclipse editor (not DDE) has a better DTD/XSD viewer to navigate around the schema.
- The
new Eclipse editor now provides a DXL editor (under Tools) allowing
developers to not only view the contents of design elements as DXL but
to actually make changes to the code and save those. Amongst the many
useful things the DXL editor can be used are:-
- Making
large scale changes to attributes such as font, color etc. using a Text
find/replace instead of manually locating the elements in the visual
editor and replacing them one at a time.
- Quickly locating all the LotusScript code in a design element. e.g. searching for a call to a particular Function.
- Tracking down (and removing) all those hotspots that no longer surround any text
- Locating (and fixing) Hide-When formula
- As
mentioned in the introduction, DXL still remains incomplete. The
following are some of the features found in design element that are
either represented as binary data (CData) or completely missing from the
DXL code.
- Composite Application, Components and Wiring Properties
- Sametime Status
- Spacing for Checkbooxes and Radio Buttons
- Thumbnail sizes for RichtextLite fields
- Layout Regions
- Navigators (Workaround available)
- Most of the Notes Standard only properties such as Java Views, Split Actions, Outline Entry separators
- Margin below view header
- Currency Symbol for Number Fields
- Unusual Unicode characters such as ∙ or ∩
- A
large number of DOM (Notes) classes exist that facilitate access to the
DXL for both data and design elements. This includes the necessary
components to export the code as DL, navigate/modify the DXL elements,
and then import the new DXL code. These can be invoked from both
LotusScript and Java and form the basis by which a great many Notes
utilities have been developed. This includes Evolution Transformer, my
current project at GBS in which we rely heavily on the use of DXL to
transform Notes Classic applications into XPage applications.
- Being
XML it is possible to use XSLT as a way to transform DXL. XSLT can be
used as a way of imposing coding standards to an application or even as a
way of applying a stanard UI style/skin to a portfolio of applications.
- Care
must always be taken when importing any DXL transformed using XSLT as
gaps in DXL support can result in some features being lost.
- DXL provides a way to generate code factories to build all (or a part) of any application. It forms a major part of how GBS's Evoloution Transformer transforms Notes Classic applications to XPages. It was also used by Nathan Freeman and Tim Tripconny to develop Innova (demoed at #Ls10).
- To
get around the issue that DXL does not support Navigators, create a new
page and then import that Navigator onto the page. This creates an
Image map from the navigator which can now be exported into DXL.
The Power Of Lotus Notes
|