Jelly: Executable XML

Colorado Software Summit: October 26 – 31, 2003 © Copyright 2003, Multitask Consulting Pty. Ltd. Jelly: Executable XML dIon Gillard Multitask Consul...
Author: Alban Cobb
13 downloads 0 Views 648KB Size
Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Jelly: Executable XML dIon Gillard Multitask Consulting Pty. Ltd.

dIon Gillard — Jelly: Executable XML

Page 1

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Agenda ƒ ƒ ƒ ƒ ƒ ƒ

What is Jelly? Anatomy of a Jelly script Jelly 'Core' Tag Library Other supplied tag libraries Scripting languages in Jelly Embedding Jelly

dIon Gillard — Jelly: Executable XML

Page 2

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

What Is Jelly? ƒ ƒ ƒ ƒ ƒ ƒ ƒ

Java and XML based scripting engine Executes XML and produces XML, HTML, etc. Front end to other XML tools such as Ant Borrows heavily from JSP and JSTL Comes with many tag libraries for common tasks Uses Jexl for expression support Extensible via Java or Jelly tag libraries

dIon Gillard — Jelly: Executable XML

Page 3

© Copyright 2003, Multitask Consulting Pty. Ltd.

Colorado Software Summit: October 26 – 31, 2003

Jelly Architecture XMLParser Context Tags

Script XMLOutput

TagLibrary

dIon Gillard — Jelly: Executable XML

Page 4

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Key classes ƒ XMLParser ¾ Takes XML document and creates a script

ƒ Context ¾ Variables available to the Jelly script at run time

ƒ Script ¾ Executable 'code' made up of text and tags

ƒ TagLibrary ¾ Group of tags with a registered name

dIon Gillard — Jelly: Executable XML

Page 5

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Agenda ƒ ƒ ƒ ƒ ƒ ƒ

What is Jelly? Anatomy of a Jelly script Jelly 'Core' Tag Library Other supplied tag libraries Scripting languages in Jelly Embedding Jelly

dIon Gillard — Jelly: Executable XML

Page 6

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

A Jelly Script Hello World! Demo: aJellyScript-1.jelly, aJellyScript-2.jelly, aJellyScript-3.jelly dIon Gillard — Jelly: Executable XML

Page 7

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Jelly Script – Details ƒ ƒ ƒ ƒ ƒ ƒ

It's an XML Document Namespaces used to refer to tag libraries Text is passed straight through Trimming? (Sample 1) Encoding? (Sample 2) jelly:core where is that defined?

dIon Gillard — Jelly: Executable XML

Page 8

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Jelly Script – variables Properties -----------${iter.key} = ${iter.value} Demo: aJellyScript-4.jelly dIon Gillard — Jelly: Executable XML

Page 9

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Jelly Script – variables ƒ ƒ ƒ ƒ ƒ

(Continued)

Default namespace forEach from core tag library systemScope predefined variable Accessing iterators and objects Text output formatting

dIon Gillard — Jelly: Executable XML

Page 10

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Agenda ƒ ƒ ƒ ƒ ƒ ƒ

What is Jelly? Anatomy of a Jelly script Jelly 'Core' Tag Library Other supplied tag libraries Scripting languages in Jelly Embedding Jelly

dIon Gillard — Jelly: Executable XML

Page 11

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Core TagLibrary ƒ Jelly was originally one big jar with all the tag libraries included ƒ Too many dependencies were difficult to track ƒ Split into core and ant, antlr, avalon, bean, beanshell, betwixt, bsf, define, dynabean, email, fmt, html, http, interaction, jetty, jface, jms, jmx, jsl, junit, log, ojb, quartz, soap, sql, swing, swt, threads, util, validate, velocity, xml, xmlunit

dIon Gillard — Jelly: Executable XML

Page 12

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Core TagLibrary vs. Others ƒ These were the tags that will most always be used ƒ We will not cover all tag libraries during the session ƒ If you become familiar with core, the documentation and a bit of reading between the lines will allow you to easily understand the others

dIon Gillard — Jelly: Executable XML

Page 13

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Core – set ƒ ¾ Or ${stringExpr}

ƒ Assignment operator ƒ Not like Ant properties ƒ value can be any jexl expression

dIon Gillard — Jelly: Executable XML

Page 14

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Core – set Example Properties ----------- ${name} = "${value}"

Demo: core1.jelly dIon Gillard — Jelly: Executable XML

Page 15

Colorado Software Summit: October 26 – 31, 2003

© Copyright 2003, Multitask Consulting Pty. Ltd.

Core – if ƒ ƒ ...more tags... ƒ ƒ Evaluates its body if the expression is true ƒ No else tag! ƒ operators supported >, >=,