summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-09-19 09:52:09 (EDT)
committerpelder2006-09-19 09:52:09 (EDT)
commit74a775108b034dc8118f1c72e97d4fe71e834394 (patch)
tree80f3f2e87bc04beabbd5b191c17a17d0fb11f080
parent15e2ceb41dfca571f07577ad04734673f38eda2a (diff)
downloadorg.eclipse.jet-74a775108b034dc8118f1c72e97d4fe71e834394.zip
org.eclipse.jet-74a775108b034dc8118f1c72e97d4fe71e834394.tar.gz
org.eclipse.jet-74a775108b034dc8118f1c72e97d4fe71e834394.tar.bz2
[157811] Add additional JET documentation.
-rw-r--r--doc/org.eclipse.jet.doc/build.xml2
-rw-r--r--doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml68
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml68
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml50
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml63
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml184
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml57
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml54
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml61
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml108
-rw-r--r--doc/org.eclipse.jet.doc/tasks/images/forceXMLLoader.pngbin0 -> 18223 bytes
-rw-r--r--doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml220
-rw-r--r--doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml141
-rw-r--r--doc/org.eclipse.jet.doc/toc.xml34
14 files changed, 1105 insertions, 5 deletions
diff --git a/doc/org.eclipse.jet.doc/build.xml b/doc/org.eclipse.jet.doc/build.xml
index 1e502ea..efe3cb9 100644
--- a/doc/org.eclipse.jet.doc/build.xml
+++ b/doc/org.eclipse.jet.doc/build.xml
@@ -6,7 +6,7 @@
<property name="plugin" value="org.eclipse.jet"/>
<property name="docPlugin" value="org.eclipse.jet.doc"/>
- <property name="filesToInclude" value="META-INF/**,images/**,gettingStarted/**,references/**,tutorials/**,notices.html,about.*,eclipse*.gif,eclipse*.png,eclipse_lg.gif,plugin.*,book.css,toc*.xml,topics_*.xml,index/**"/>
+ <property name="filesToInclude" value="META-INF/**,images/**,tasks/**,gettingStarted/**,references/**,tutorials/**,notices.html,about.*,eclipse*.gif,eclipse*.png,eclipse_lg.gif,plugin.*,book.css,toc*.xml,topics_*.xml,index/**"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="false"/>
diff --git a/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml b/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml
new file mode 100644
index 0000000..0474f8c
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml
@@ -0,0 +1,68 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>Ant Tasks provided by JET</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Ant Tasks Provided by JET</h2>
+
+ <p>JET provides several ant tasks to faciliate the compilation of
+ JET templates and execution of JET transformations in an Eclipse
+ headless environment. These can be used with buildfiles that are
+ set to build within the same JRE as the workspace.</p>
+
+ <h3><a name="jet.compile"/>jet.compile</h3>
+
+ <p>This task wraps the JET compiler
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/compiler/JET2Compiler.html">
+ JET2Compiler</a>. Typical usage is:</p>
+
+ <pre>&lt;jet.compile project=&quot;myProject&quot; destDir=&quot;src-gen&quot; srcDir=&quot;templates&quot;&gt;
+ &lt;srcdir dir=&quot;templates&quot;/&gt;
+&lt;/jet.compile&gt;</pre>
+ <ul>
+
+ <li><b>project</b> is the name of the Eclipse project containing
+ the compiled output.</li>
+
+ <li><b>destDir</b> is the project relative directory where the
+ Java code for the templates will be written. Package directories
+ will be created under this directory.</li>
+
+ <li><b>srcDir</b> is an Ant
+ <a href="http://ant.apache.org/manual/CoreTypes/fileset.html">
+ Fileset</a>, allowing specification template locations and file
+ match rules.</li>
+
+ </ul>
+
+ <h3><a name="jet.transform"/>jet.transform</h3>
+
+ <p>This task wraps the method
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/JET2Platform.html#runTransformOnResource(java.lang.String, org.eclipse.core.resources.IResource, org.eclipse.core.runtime.IProgressMonitor)">
+ JET2Platform.runTransformationOnResource()</a>. Typical usage
+ is:</p>
+
+ <pre>&lt;jet.transform transformid=&quot;my.transform.id&quot; resource=&quot;myProject/myfile.ext&quot;/&gt;</pre>
+ <ul>
+
+ <li><b>transformid</b> is the id of the transformation to run</li>
+
+ <li><b>resource</b> is a workspace relative path to the transform
+ input.</li>
+
+ </ul>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml b/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml
new file mode 100644
index 0000000..c9b8845
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml
@@ -0,0 +1,68 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>Implicit JET Objects Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Implicit JET Objects Reference</h2>
+
+ <p>JET implicitly creates a number of Java objects that accessible
+ to Java Expressions and Java Scriptlets. The table below summarizes
+ their names, Java types and purpose.</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Object</th>
+
+ <th>Java type</th>
+
+ <th>Purpose</th>
+
+ </tr>
+
+ <tr>
+
+ <td><code>context</code></td>
+
+ <td>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/JET2Context.html"><code>org.eclipse.jet.JET2Context</code></a></td>
+
+ <td>Provide access to template invocation information.</td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>out</code></td>
+
+ <td>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/JET2Writer.html"><code>org.eclipse.jet.JET2Writer</code></a></td>
+
+ <td>The writer to which the template output is being
+ written.</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ <ul />
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml
new file mode 100644
index 0000000..908905d
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Comment Reference Syntax</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Comment Syntax Reference</h2>
+
+ <p>JET templates may contain comments between the characters
+ <code>&lt;%--</code> and <code>--%&gt;</code>. JET ignores all
+ content in a comment. </p>
+
+ <h3>Valid comments</h3>
+
+ <p>Comments may span several lines, and may contain any text. The
+ following are examples of a JET comments:</p>
+
+ <pre>&lt;%-- This comment will not appear in the template output --%&gt;
+&lt;%-- This directive is not used
+&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;
+--%&gt;</pre>
+ <h3>Invalid comments</h3>
+
+ <p>Comments may not appear within other JET elements. The following
+ are illegal comments:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; &lt;%-- illegal comment --%&gt;
+ prefix=&quot;cc&quot; %&gt;</pre>
+ <h3>Escaping comment characters</h3>
+
+ <p>To emit the characters <code>&lt;%--</code> in a templates
+ output, enter <code>&lt;\%--</code>. To emit <code>--%&gt;</code>,
+ enter <code>--%\&gt;</code>.</p>
+
+ <p>The following is an example of an escaped JET comments:</p>
+
+ <pre>&lt;\%-- this will show in the template output --%\&gt;</pre>
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml
new file mode 100644
index 0000000..7b252df
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml
@@ -0,0 +1,63 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Java Declaration Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Java Declaration Syntax Reference</h2>
+
+ <p>JET templates may declare Java methods or fields by enclosing it
+ within the characters <code>&lt;%!</code> and <code>%&gt;</code>.
+ </p>
+
+ <h3>Valid Declarations</h3>
+
+ <p>Each declaration may contain one or more syntactically correct
+ Java method or field declarations. The following are examples of
+ valid declarations:</p>
+
+ <pre>&lt;%!
+/**
+ * Say hello the the addressee passed to the method
+ */
+public String hello(String addressee) {
+ return &quot;Hello &quot; + addresseee + &quot;!&quot;;
+}
+%&gt;
+
+&lt;%!
+// Declarations may contain multiple Java declarations
+private int min(int a, int b) {
+ return Math.min(a, b);
+}
+
+private int max(int a, int b) {
+ return Math.max(a, b);
+}
+%&gt;</pre>
+ <h3>Invalid Declarations</h3>
+
+ <p>If a declaration contains an syntax error, the generated Java
+ code for the containing template will have a syntax error. The JET
+ compile does not attempt to correlate the Java compile error back
+ to the JET template.</p>
+
+ <h3>Escaping Declaration characters</h3>
+
+ <p>To emit the characters <code>&lt;%!</code> in a templates
+ output, enter <code>&lt;\%!</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code>.</p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml
new file mode 100644
index 0000000..8fc6ca1
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml
@@ -0,0 +1,184 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Derective Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Syntax Reference</h2>
+
+ <p>JET has the following directives</p>
+
+ <ul>
+
+ <li><a href="#jet">@jet</a> - affects Java code created by the
+ JET compiler.</li>
+
+ <li><a href="#taglib">@taglib</a> - imports a tag library into
+ the template for use, and assigns it a unique namespace
+ prefix.</li>
+
+ </ul>
+
+ <p>JET recognizes the following &quot;Classic&quot; JET directives,
+ but does not yet implement them. An error message is issued if any
+ of the following directives are recognized:</p>
+
+ <ul>
+
+ <li>@include</li>
+
+ <li>@start</li>
+
+ <li>@end</li>
+
+ </ul>
+
+ <p>To emit the characters <code>&lt;%@</code> in a templates
+ output, enter <code>&lt;\%@</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code></p>
+
+ <h3><a name="jet"/>The @jet directive</h3>
+
+ <p>The @jet directive controls the name of the generated Java
+ class, its containing package and the Java classes it imports.</p>
+
+ <p>All attributes are optional.The following tag summarizes the
+ available attributes.</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Attribute</th>
+
+ <th>Usage</th>
+
+ </tr>
+
+ </tbody>
+
+ <tbody>
+
+ <tr>
+
+ <td>package</td>
+
+ <td>Name of package into which the template will be compiled.
+ May be used only once per template.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>class</td>
+
+ <td>Name of Java class to be generated. May be used only once
+ per template.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>imports</td>
+
+ <td>A space separated list of Java import locations.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>startTag</td>
+
+ <td>A two character replacement for &lt;% in subsequent JET
+ elements.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>endTag</td>
+
+ <td>A two character replacement for %&gt; in subsequent JET
+ elements.</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ <h3><a name="taglib"/>The @taglib directive</h3>
+
+ <p>The @taglib directive imports an XML tag library, or renames the
+ taglibrary namespace prefix. Example:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;</pre>
+ <p>The value for prefix must be value XML NCName, namely, it must
+ start with letter or underscore (_), and then contain letters,
+ digits or the characters underscore (_), hyphen (-) or dot (.).</p>
+
+ <p>The id for the Standard JET tag libaries are:</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Tag Library</th>
+
+ <th>ID</th>
+
+ </tr>
+
+ <tr>
+
+ <td>Control Tags</td>
+
+ <td>org.eclipse.jet.controlTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Workspace Tags</td>
+
+ <td>org.eclipse.jet.workspaceTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Java Tags</td>
+
+ <td>org.eclipse.jet.javaTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Format Tags</td>
+
+ <td>org.eclipse.jet.formatTags</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
new file mode 100644
index 0000000..34b69cd
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
@@ -0,0 +1,57 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Expressions Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Expressions Syntax Reference</h2>
+
+ <p>JET Templates may emit the result of a Java expression by
+ enclosing the Java expression between the characers
+ <code>&lt;%=</code> and <code>%&gt;</code>.</p>
+
+ <h3>Valid Expressions</h3>
+
+ <p>Expressions contain valid Java expressions. Java expressions are
+ not complete statements, and in particular, they do not include a
+ semi-colon (;). Expressions may access any Java element inscope
+ Java elemement, including fields and methods declared in
+ <a href="jetSyntaxDeclarations.xhtml">Java declarations</a>, or in
+ <a href="jetSyntaxScriptlets.xhtml">Java scriptlets</a>, or
+ <a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a>.</p>
+
+ <p>The emitted Java code for the template will evaluate the Java
+ expression and convert the result to a string (if necessary). The
+ following are examples of Java expressions:</p>
+
+ <pre>The name of the class executing is: &lt;%= this.getClass().getName() %&gt;
+
+Although slightly silly, expression may be constant, like &lt;%= 5 %&gt; and &lt;%= &quot;hello&quot; %&gt;.</pre>
+ <h3>Invalid Expressions</h3>
+
+ <p>Any syntax error in the Java expression will result errors in
+ the emitted Java code. The JET compiler does not attempt to
+ correlate the Java compile error back to the JET template. Some
+ examples:</p>
+
+ <pre>&lt;%= 3 + 4; %&gt; &lt;%-- semicolon not allowed in Java expressions --%&gt;</pre>
+ <h3>Escaping Expression characters</h3>
+
+ <p>To emit the characters <code>&lt;%=</code> in a templates
+ output, enter <code>&lt;\%=</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code></p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml
new file mode 100644
index 0000000..eeda399
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml
@@ -0,0 +1,54 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Syntax Reference</h2>
+
+ <p>JET Templates composed of text plus the following syntactic
+ elements:</p>
+
+ <ul>
+
+ <li><a href="jetSyntaxComments.xhtml">Comments</a> - &lt;%-- ...
+ --%&gt;</li>
+
+ <li><a href="jetSyntaxXMLTags.xhtml">Custom XML Tags</a></li>
+
+ <li><a href="jetSyntaxDirectives.xhtml">Directives</a> - &lt;%@
+ ... %&gt;</li>
+
+ <li><a href="jetSyntaxDeclarations.xhtml">Java declarations</a> -
+ &lt;%! ...%&gt;</li>
+
+ <li><a href="jetSyntaxExpressions.xhtml">Java Expressions</a> -
+ &lt;%= ... %&gt;</li>
+
+ <li><a href="jetSyntaxScriptlets.xhtml">Java Scriptlets</a> -
+ &lt;% ... %&gt;</li>
+
+ </ul>
+
+ <p>Other reference information:</p>
+
+ <ul>
+
+ <li><a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a> available to JET templates</li>
+
+ </ul>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml
new file mode 100644
index 0000000..d180d90
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml
@@ -0,0 +1,61 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Java Scriptlet Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Scriptlet Syntax Reference</h2>
+
+ <p>JET Templates may contain sections Java statements by enclosing
+ the Java expression between the characers <code>&lt;%</code> and
+ <code>%&gt;</code>.</p>
+
+ <h3>Valid scriptlets</h3>
+
+ <p>Scripts may contain one more more valid Java statements or
+ blocks. A scriptlet may also include a partial Java block, so long
+ as a subsequent scriptlet completes it. Scriplets may reference any
+ Java elements in scope, including variables declared in other
+ scriptlets, and methods and fields declared in
+ <a href="jetSyntaxDeclarations.xhtml">Java declarations</a> or
+ <a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a>. Some examples of valid scriplets:</p>
+
+ <pre>&lt;%
+int x = 3;
+%&gt;
+&lt;%
+int y = x * 6;
+%&gt;
+&lt;% if(y &gt;= 18) { %&gt;
+&lt;%-- The above scriptlet opens a block which is closed in the next scriptlet --%&gt;
+ Y is &gt;= 18
+&lt;% } %&gt;</pre>
+ <p>The emitted Java code for the template will contain the Java
+ statements in the generatation method.</p>
+
+ <h3>Invalid scriptlets</h3>
+
+ <p>Any syntax error in the Java statements will result in errors in
+ the emitted Java code. The JET compiler does not attempt to
+ correlate the Java compile error back to the JET template.</p>
+
+ <h3>Escaping Scriplet characters</h3>
+
+ <p>To emit the characters <code>&lt;%</code> in a templates output,
+ enter <code>&lt;\%</code>. To emit <code>%&gt;</code>, enter
+ <code>%\&gt;</code></p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml
new file mode 100644
index 0000000..5f69af3
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml
@@ -0,0 +1,108 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET XML Tag Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET XML Tag Syntax Reference</h2>
+
+ <p>JET XML Tags are of two forms:</p>
+
+ <ul>
+
+ <li>Empty elements: &lt;<i>tagname</i>
+ [<i>attributes</i>]/&gt;</li>
+
+ <li>Content elements: &lt;<i>tagname</i>
+ [<i>attributes</i>]*&gt;<i>content</i>&lt;/<i>tagname</i>&gt;</li>
+
+ </ul>
+
+ <p>Attributes are of the form: <i>name</i>=&quot;<i>value</i>&quot;
+ or <i>name</i>=&apos;<i>value</i>&apos;. Attribute values may
+ contain any character other than the enclosing quote characters.</p>
+
+ <p>Typically, JET XML tag names include a namespace and a tag name
+ (<i>namespace</i>:<i>name</i>). JET will recognize an XML elements
+ if it recognizes the namespace. If it does not recognize the
+ namespace, or if the tag has no namespace, and the tagname is not
+ recognized, then JET will treat the tag as text.</p>
+
+ <h3>Standard JET Tags</h3>
+
+ <p>JET includes standard tag libraries for the following
+ purposes:</p>
+
+ <ul>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html"
+ >Control tags</a> - used for template control</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html"
+ >Workspace tags</a> - used to create workspace elements such as
+ projects, folders and files</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html"
+ >Java tags</a> - used for created Java workspace elements such as
+ Java classes and resources</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html"
+ >Format tags</a> - used for reformatting text.</li>
+
+ </ul>
+
+ <h3>Defining and changing Tag namespace prefixes</h3>
+
+ <p>The standard tags have default namespace prefixes of
+ <code>c</code>, <code>ws</code>, <code>java</code> and
+ <code>format</code> for the control, workspace, java and format
+ tags, respectively. By default, the control, java and format tags
+ are imported into every template.</p>
+
+ <p>Tag namespace prefixes may be changed for a single template by
+ using the <a href="jetSyntaxDirectives.xhtml#taglib">@taglib</a>
+ directive. For example, the following directive changes the
+ namespace prefix for the control tags to cc:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;</pre>
+ <p>Individual templates may change a tag libraries namespace to
+ avoid conflicts with static text being generated by the
+ template.</p>
+
+ <p>To change the default prefixes for a transform requires editing
+ the JET Transformations plugin.xml file. See the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/extensionpoints/org_eclipse_jet_transform.html"
+ ><code>org.eclipse.jet.transform</code></a> extension point
+ documentation for details.</p>
+
+ <h3>Importing Tag namespaces</h3>
+
+ <p>Tag namespaces may be imported by the &lt;%@taglib%&gt;
+ directive on individual templates, or in plugin.xml for all
+ transformation templates.</p>
+
+ <h3>Declaring custom tags</h3>
+
+ <p>Users may define custom tags by creating an Eclipse plug-in
+ project, adding a dependency to the <code>org.eclipse.jet</code>
+ plug-in, and then implementing the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/extensionpoints/org_eclipse_jet_tagLibraries.html"
+ ><code>org.elcipse.jet.tagLibrairies</code></a> extension point.</p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/tasks/images/forceXMLLoader.png b/doc/org.eclipse.jet.doc/tasks/images/forceXMLLoader.png
new file mode 100644
index 0000000..f2c1e8d
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/tasks/images/forceXMLLoader.png
Binary files differ
diff --git a/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml b/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml
new file mode 100644
index 0000000..d4a4ba8
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml
@@ -0,0 +1,220 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>Using JET Transformations with EMF Documents</title>
+
+ <link charset="ISO-8859-1" href="../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Using JET Transformations with EMF Documents</h2>
+
+ <p>By default, JET transformations expect an XML documents as
+ input. However, transformations can be modified to load EMF-based
+ models as input. This section describes how to load EMF documents
+ with JET and how JET accesses the models.</p>
+
+ <h3>Loading EMF Documents</h3>
+
+ <p>To force JET to load an EMF document, the transformation
+ information must be modified in the transformations plugin.xml.
+ Follow the following steps:</p>
+
+ <ul>
+
+ <li>Open the plugin.xml file in the root of the JET
+ transformation project.</li>
+
+ <li>Switch to the &apos;Extensions&apos; tab.</li>
+
+ <li>Find the &apos;org.eclipse.jet.transform&apos; extension in
+ the &apos;All Extensions&apos; tree, and expand it to reveal the
+ &apos;transform&apos; child element.</li>
+
+ <li>Select the &apos;transform&apos; element, and enter
+ <code>org.eclipse.jet.xml</code> in the &apos;modelLoader&apos;
+ field.</li>
+
+ </ul>
+
+ <h3>XPath expressions against EMF documents</h3>
+
+ <p>The JET XPath processor handles EMF documents by mapping the EMF
+ meta-model to the XPath infoset model as follows:</p>
+
+ <ul>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/resource/Resource.html"
+ >Resource</a> objects map to the infoset &apos;root&apos; object.
+ The XPath expression <code>/</code> refers to the Resource
+ containing the input model.</li>
+
+ <li>The Resource
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/resource/Resource.html#getContents()"
+ >getContents()</a> method maps to an element
+ &apos;contents&apos;. The XPath expression <code>/contents</code>
+ returns the results of this method.</li>
+
+ <li>Each
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EReference.html"
+ >EReference</a> feature on an object is mapped to an element with
+ the same name.</li>
+
+ <li>Each
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EAttribute.html"
+ >EAttribute</a> feature on an object is mapped to an attribute
+ with the same name.</li>
+
+ <li>When evaluating XPath child-axis expressions, JET will first
+ attempt to identify an feature with the requested name. If no
+ feature is found, then the contained children of the element are
+ searched for instances of an EClass with the specified name.</li>
+
+ </ul>
+
+ <p>If a JET transform loads an ECore model, then the following
+ XPath expressions would return the following results:</p>
+
+ <table>
+
+ <thead>
+
+ <tr>
+
+ <th>XPath expression</th>
+
+ <th>Java equivalent</th>
+
+ </tr>
+
+ </thead>
+
+ <tbody>
+
+ <tr>
+
+ <td><code>/contents</code></td>
+
+ <td><code>Resource.getContents()</code></td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>/EPackage</code></td>
+
+ <td>subset of <code>Resource.getContents()</code> of type
+ <code>EPackage</code></td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>$ePackage/eClassifiers</code> (ePackage is an
+ EPackage instance)</td>
+
+ <td><code>ePackage.getEClassifiers()</code></td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>$ePackage/EClass</code></td>
+
+ <td>subset of <code>ePackage.eContents()</code> of type
+ <code>EClass</code></td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>$ePackage/@name</code></td>
+
+ <td><code>ePackage.getName()</code></td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ <h3>Accessing XPath Variables from Java code</h3>
+
+ <p>JET templates may contain Java code, and this Java code may
+ access XPath variables. This is particularly valuable when the
+ input model is EMF-based. The following examples handles
+ hypothetical ECORE model loaded by a JET transform, and accesses
+ the model with both XPath and Java expressions</p>
+
+ <pre>&lt;%-- contents of main.jet that reads handles a .ecore file --%&gt;
+&lt;%-- import the ecore namespace --%&gt;
+&lt;%@jet imports=&quot;org.eclipse.emf.ecore.*&quot;%&gt;
+
+&lt;c:setVariable var=&quot;ePackage&quot; select=&quot;/contents&quot;/&gt;
+
+&lt;%-- write to the JET execution console --%&gt;
+&lt;c:log&gt;
+EPackage: &lt;c:get select=&quot;$ePackage/@name&quot;/&gt;
+&lt;c:iterate select=&quot;$ePackage/eClassifiers&quot; var=&quot;eClassifier&quot;&gt;
+&lt;%
+EClassifier ec = (EClassifier)context.getVariable(&quot;eClassifier&quot;);
+%&gt;
+ EClassifier: &lt;c:get select=&quot;$eClassifier/@name&quot;/&gt;. Really it&apos;s &lt;%= ec.getName() %&gt;
+&lt;/c:iterate&gt;
+&lt;/c:log&gt;</pre>
+ <h3>Details of EMF Document loading</h3>
+
+ <p>JET uses EMF EMF&apos;s ResourceSetImpl createResource() method
+ to determine EMF-based models. JET requires the model&apos;s
+ EPackage is registered with EMF in order to load model
+ instances.</p>
+
+ <p>The Model loader id for EMF document loading is
+ <code>org.eclipse.jet.emf</code>.</p>
+
+ <h3>Loading EMF documents during transformation execution</h3>
+
+ <p>EMF documents my by loaded using the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html"
+ >&lt;c:load&gt;</a> and
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html"
+ >&lt;c:loadContent&gt;</a> tags. The former loads a document from
+ an file, while the second loads the document by parsing a text
+ string.</p>
+
+ <p>The following loads the mymodel.ecore file from the
+ transformation:</p>
+
+ <p><code>&lt;c:load url=&quot;mymodel.ecore&quot;
+ var=&quot;myEcore&quot;/&gt;</code></p>
+
+ <p>This is equivalent to:</p>
+
+ <p><code>&lt;c:load url=&quot;mymodel.ecore&quot;
+ urlContext=&quot;transform&quot;
+ loader=&quot;org.eclipse.jet.emf&quot;
+ var=&quot;myEcore&quot;/&gt;</code></p>
+
+ <p>The following example loads the plugin.xml document from a
+ project &apos;myproject&apos; in the Eclipse workspace.</p>
+
+ <p><code>&lt;c:load url=&quot;myproject/mymodel.ecore&quot;
+ urlContext=&quot;workspace&quot;
+ var=&quot;myEcore&quot;/&gt;</code></p>
+
+ <p>Finally, while it is possible to load ecore models with
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html">
+ &lt;c:loadContent&gt;</a>, the format of Ecore models often makes
+ this impractical to embed a document within a JET template.</p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml b/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
new file mode 100644
index 0000000..72cc43f
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
@@ -0,0 +1,141 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>Using JET Transformations with XML Documents</title>
+
+ <link charset="ISO-8859-1" href="../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Using JET Transformations with XML Documents</h2>
+
+ <p>By default, JET transformations expect an XML documents as
+ input. XML documents are loaded into memory using the Eclipse
+ Modeling Framework (EMF) XML document support</p>
+
+ <h3>XPath expressions against XML documents</h3>
+
+ <p>The JET XPath processor handles XML documents according to the
+ XPath 1.0 specification, with the following exception:</p>
+
+ <ul>
+
+ <li>The XPath processor matches expressions containing
+ unqualified names with elements and attributes that use include a
+ namespace prefix. XPath expressions can still determine the
+ namespace URI of an element or attribute via the
+ <a href="http://www.w3.org/TR/xpath#function-namespace-uri">
+ namespace-uri</a> XPath function.</li>
+
+ </ul>
+
+ <h3>Details of XML Document loading</h3>
+
+ <p>JET uses EMF&apos;s
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xml/type/util/XMLTypeResourceImpl.html"
+ >XMLTypeResoureImpl</a> to load XML documents. Documents are loaded
+ as follows:</p>
+
+ <ul>
+
+ <li>If the document contains an XML schema declaration, and the
+ Eclipse XSD feature is installed (org.eclipse.xsd), and the XSD
+ location can be located, then the document is loaded according to
+ the XSD.</li>
+
+ <li>When loading with an XSD, EMF will use the Java classes
+ registered against the schema, if they exist. Otherwise, Dynamic
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EClass.html"
+ >EClasses</a> will be generated, and loaded objects will be of
+ type
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EObject.html"
+ >EObject</a>.</li>
+
+ <li>If no XSD schema is supplied, or the schema cannot be located
+ and there are no registered EMF Java classes for the schema, then
+ XML elements are loaded as instances of
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xml/type/AnyType.html"
+ >AnyType</a>.</li>
+
+ </ul>
+
+ <p>The Model loader id for XML document loading is
+ <code>org.eclipse.jet.emfxml</code>.</p>
+
+ <h3>Loading XML documents during transformation execution</h3>
+
+ <p>XML documents my by loaded using the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html"
+ >&lt;c:load&gt;</a> and
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html"
+ >&lt;c:loadContent&gt;</a> tags. The former loads a document from
+ an file, while the second loads the document by parsing a text
+ string.</p>
+
+ <p>The following loads the plugin.xml file from the
+ transformation:</p>
+
+ <p><code>&lt;c:load url=&quot;plugin.xml&quot;
+ var=&quot;pluginXML&quot;/&gt;</code></p>
+
+ <p>This is equivalent to:</p>
+
+ <p><code>&lt;c:load url=&quot;plugin.xml&quot;
+ urlContext=&quot;transform&quot;
+ loader=&quot;org.eclipse.jet.emfxml&quot;
+ var=&quot;pluginXML&quot;/&gt;</code></p>
+
+ <p>The following example loads the plugin.xml document from a
+ project &apos;myproject&apos; in the Eclipse workspace.</p>
+
+ <p><code>&lt;c:load url=&quot;myproject/plugin.xml&quot;
+ urlContext=&quot;workspace&quot;
+ var=&quot;pluginXML&quot;/&gt;</code></p>
+
+ <p>Finally, this example loads the contents of the c:loadContent
+ tag as an XML document:</p>
+
+ <pre>&lt;c:loadContent var=&quot;myDoc&quot;&gt;
+ &lt;parts&gt;
+ &lt;item sku=&quot;123&quot; price=&quot;1.55&quot;&gt;Widget A&lt;/item&gt;
+ &lt;item sku=&quot;456&quot; price=&quot;2.99&quot;&gt;Widget B&lt;/item&gt;
+ &lt;/parts&gt;
+&lt;/c:loadContent&gt;</pre>
+ <h3>Loading XML documents with non-standard extensions</h3>
+
+ <p>The XML model loader is only associated with the &apos;xml&apos;
+ file extension. To load documents with other extensions as XML
+ documents, configure the transformation as follows:</p>
+
+ <ul>
+
+ <li>Open the plugin.xml file in the root of the JET
+ transformation project.</li>
+
+ <li>Switch to the &apos;Extensions&apos; tab.</li>
+
+ <li>Find the &apos;org.eclipse.jet.transform&apos; extension in
+ the &apos;All Extensions&apos; tree, and expand it to reveal the
+ &apos;transform&apos; child element.</li>
+
+ <li>Select the &apos;transform&apos; element, and enter
+ <code>org.eclipse.jet.emfxml</code> in the
+ &apos;modelLoader&apos; field, and <code>xml</code> in the
+ &apos;modelExtension&apos; field.</li>
+
+ </ul>
+
+ <p>
+ <img alt="Image of plug-in editor showing setting of &apos;modelLoader&apos; and &apos;modelExtension&apos; attributes."
+ src="images/forceXMLLoader.png"/></p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/toc.xml b/doc/org.eclipse.jet.doc/toc.xml
index ede79a0..d05d62d 100644
--- a/doc/org.eclipse.jet.doc/toc.xml
+++ b/doc/org.eclipse.jet.doc/toc.xml
@@ -6,30 +6,56 @@
<anchor id="whatsnew"/>
</topic>
<topic label="Getting Started" href="gettingStarted/index.xhtml">
- <anchor id="gettingstarted"/>
<topic label="Create a JET Project" href="gettingStarted/newProject.xhtml"/>
<topic label="JET Transformation Structure" href="gettingStarted/transformStructure.xhtml"/>
<topic label="Common JET Tags" href="gettingStarted/commonTags.xhtml"/>
<topic label="Essential XPath" href="gettingStarted/essentialXPath.xhtml"/>
<topic label="Run a JET Transformations" href="gettingStarted/runningTransforms.xhtml"/>
<topic label="Deploy a JET Transformations" href="gettingStarted/deployingTransforms.xhtml"/>
+ <anchor id="gettingstarted"/>
</topic>
<topic label="Concepts">
<anchor id="concepts"/>
</topic>
<topic label="Tasks">
+ <topic label="Using JET Transformations with XML Documents" href="tasks/usingJetWithXML.xhtml"/>
+ <topic label="Using JET Transformations with EMF Documents" href="tasks/usingJetWithEMF.xhtml"/>
<anchor id="tasks"/>
</topic>
<topic label="Reference">
- <anchor id="reference"/>
- <link toc="topics_Reference.xml"/>
+ <topic label="JET Syntax" href="references/syntax/jetSyntaxReference.xhtml">
+ <topic label="Comments" href="references/syntax/jetSyntaxComments.xhtml"/>
+ <topic label="Custom XML Tags" href="references/syntax/jetSyntaxXMLTags.xhtml"/>
+ <topic label="Directives" href="references/syntax/jetSyntaxDirectives.xhtml"/>
+ <topic label="Java Declarations" href="references/syntax/jetSyntaxDeclarations.xhtml"/>
+ <topic label="Java Expressions" href="references/syntax/jetSyntaxExpressions.xhtml"/>
+ <topic label="Java Scriptlets" href="references/syntax/jetSyntaxScriptlets.xhtml"/>
+ <topic label="Implicit Java Objects" href="references/syntax/implicitJavaObjectsReference.xhtml"/>
+ </topic>
<topic label="Tag Reference" href="references/taglibs/index.xhtml">
<anchor id="tagReference"/>
</topic>
<topic label="XPath Function Reference">
+ <topic label="Additional XPath Functions" href="references/xpathFunctions/overview.html">
+ <topic label="camelCase" href="references/xpathFunctions/camelCaseFunction.html"/>
+ <topic label="cardinality" href="references/xpathFunctions/cardinalityFunction.html"/>
+ <topic label="className" href="references/xpathFunctions/classNameFunction.html"/>
+ <topic label="escapeJavaWhitespace" href="references/xpathFunctions/escapeJavaWhitespaceFunction.html"/>
+ <topic label="lower-case" href="references/xpathFunctions/lower_caseFunction.html"/>
+ <topic label="lowercaseFirst" href="references/xpathFunctions/lowercaseFirstFunction.html"/>
+ <topic label="packageName" href="references/xpathFunctions/packageNameFunction.html"/>
+ <topic label="removeWhitespace" href="references/xpathFunctions/removeWhitespaceFunction.html"/>
+ <topic label="trimWhitespace" href="references/xpathFunctions/trimWhitespaceFunction.html"/>
+ <topic label="upper-case" href="references/xpathFunctions/upper_caseFunction.html"/>
+ <topic label="uppercaseFirst" href="references/xpathFunctions/uppercaseFirstFunction.html"/>
+ <topic label="xmlEncode" href="references/xpathFunctions/xmlEncodeFunction.html"/>
+ </topic>
<anchor id="xpathFunctions"/>
- <topic label="Additional XPath Functions" href="references/xpathFunctions/overview.html"/>
</topic>
+ <topic label="Ant Tasks Provided by JET" href="references/ant/antTasks.xhtml"/>
+ <link toc="topics_Reference.xml"/>
+ <anchor id="reference"/>
+
</topic>
<topic label="Legal" href="notices.html"/>
</toc>