Back Base Concepts and Introduction
Back Base Concepts and Introduction
Version: 22-June-2005
Backbase Concepts and Introduction
0. Objectives
I. The Backbase Foundation
A. Understanding BXML and BPC
B. Introducing the BXML-Tree
C. Asynchronous Command Execution
• Initially only the core library of about 30K, that contains the
most frequently used features, is loaded
• Additional features are loaded automatically in separate
modules on demand (to limit download size)
• The <xmp> tag is used to indicate to the BPC where the
BXML area of a web page starts and ends
– Use the <xmp b:backbase=“true”> tag to separate BXML from
(potentially) non valid HTML code.
Example 01 - My First BXML Page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML and
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b" namespace
xmlns:s="http://www.backbase.com/s">
definition
<head>
<title>Example 01 - My First BXML Page</title>
<script type="text/javascript" src="/backbase/3_0/bpc/boot.js"></script>
</head>
Include and
initialize the
<body onload="bpc.boot('/backbase/3_0/');">
<xmp b:backbase="true"> BPC engine
<b:infopane style="border: 1px solid #DDDDDD;">
<b:infonav b:action="select-deselect" style="background-color: #EEEEEE;">
Click to open.
</b:infonav>
<b:infoview style="background-color: #CCCCCC;"> BXML and
Hello <strong>World!</strong> XHMTL tags
</b:infoview>
</b:infopane>
</xmp>
</body>
</html>
I. The Backbase Foundation
A. Understanding BXML and BPC
1. BXML
2. BPC
3. Booting and Initialization
• The look & feel of the Rich User Interface can be defined with
CSS
– W3C standard: http://www.w3.org/Style/CSS/
• Drag & drop and resize are two extremely useful and widely
used ways for users to manipulate UI elements with the
mouse.
<xmp b:backbase="true">
<div b:drag="drag1" style=" …; background:#CF0;">Drag me to drag-receive1</div>
<div
<div
b:drag="drag1 drag2" style=" …; background:#C0C0C0;">Drag me anywhere</div>
style="clear:both;height:20px;"></div>
Drag 1 or 2
<div b:dragreceive="drag1" style=" …; background:#CF0;">drag-receive 1</div>
<div b:dragreceive="drag2" style=" …; background:#0FC;">drag-receive 2</div>
</xmp>
Drag-receive
elements
1 and 2
Example 07 - Resize
<xmp b:backbase="true">
<div b:resize="all" style=" …; background:#CF0;">Resize me</div> Resize to
</xmp> any size
18. Adding Tasks
• Commands are actions making an interface interactive
• Commands are defined as tasks and will be executed when an
event occurs
– <s:task b:action="select-deselect" b:target="." />
<s:behavior b:name="fx-parseq">
<s:event b:on="click"> Color
<s:parallel> effect
<s:sequential>
<s:fxstyle b:background-color="#FF0000" b:time="200"/> with time
<s:fxstyle b:background-color="#FFFF00" b:time="2000"/>
</s:sequential>
<s:sequential>
<s:fxstyle b:left="~100px" />
Position
<s:fxstyle b:left="~-50px" /> effect
</s:sequential>
</s:parallel>
</s:event>
</s:behavior>
21. Adding For- & Backward Support
<s:behavior b:name="b-button">
<s:state b:on="deselect" Behavior
b:normal="b-button-outer-1" b:hover="..." b:press="..."/>
</s:behavior> definitions
<s:htmlstructure b:name="b:buttonbar">
<table class="b-buttonbar" cellspacing="2" cellpadding="0" border="0">
<tbody>
<tr>
<s:innercontent/>
</tr>
</tbody>
</table> Custom control
</s:htmlstructure>
definitions
<s:htmlstructure b:name="b:button"> with HTML
<td>
<div class="b-button-outer-2"> and placeholder
<div class="b-button-inner">
<s:innercontent/>
</div>
</div>
</td>
</s:htmlstructure>
<b:buttonbar>
<b:button> Button A </b:button>
Using the
<b:button> Button B </b:button> new tags
</b:buttonbar>
24. Stylesheets
I. Rich Forms
31. Rich Form Controls
32. Client-Side Validation
25. Loading Data
<s:stylesheet b:name="stylesheet">
<s:template b:match="/">
<div style="border-width: 1px; border-style: solid;">
<s:apply-templates b:select="thing" />
</div> Stylesheet
</s:template>
<s:template b:match="thing"> with two
<div> templates
<s:attribute b:name="innerHTML" b:select="name" />
</div>
</s:template>
</s:stylesheet>
<div id="destination"></div>
<div>
<s:event b:on="construct">
<s:task b:action="transform" b:stylesheet="b:xml('stylesheet')"
Transforming
b:xmldatasource="b:xml('datasource')" datasource
</s:event>
b:destination="id('destination')" b:mode="replacechildren" />
with stylesheet
</div>
27. Sorting
I. Rich Forms
31. Rich Form Controls
32. Client-Side Validation
28. Define Task Execution
• You can declaratively implement client-side business logic
using <s:task>:
– Conditional logic with <s:choose>, <s:when>, <s:otherwise>
– Conditional tests using <b:test>
– Sequences of tasks using <s:tasklist>, <s:parallel>, <s:sequential>
Example 12 – Task Execution
<s:behavior b:name="truefalse">
<s:event b:on="command">
<s:lock b:target="/">
<s:choose>
<s:when b:test="@success='true'">
<s:setatt success="false"/>
<s:task b:action="alert" b:value="Setting success to false"/>
</s:when> Conditional
<s:otherwise>
<s:setatt success="true"/>
logic and tasks
<s:task b:action="alert" b:value="Setting success to true"/>
</s:otherwise>
</s:choose>
</s:lock>
</s:event>
</s:behavior>
I. Rich Forms
31. Rich Form Controls
32. Client-Side Validation
31. Rich Form Controls
• Standard HTML form fields such as text field, text area, select
boxes, etc. are available
– Input type=“…”
K. Debugging Tools
34. BXML Debugging
35. I/O Debugging
33. IDE Integration
• Syntax Highlighting
• Code Completion
IDE Integration
IV. Tools
J. Development Tools
33. Integration
K. Debugging Tools
34. BXML Debugging
35. I/O Debugging
34. BXML Debugging
• BXML Inspector: Show current B-Tree
35. I/O Debugging
• Runtime Tracer: Show BPC actions