summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-11-21 15:35:08 (EST)
committerpelder2006-11-21 15:35:08 (EST)
commit0ff861880316a067249750eba5530b799194e002 (patch)
treeb4f902403bd17c5d83037679179c2aa248be2d51
parent85e924faca7becbb1ce6bc080e8a4c2784d69587 (diff)
downloadorg.eclipse.jet-0ff861880316a067249750eba5530b799194e002.zip
org.eclipse.jet-0ff861880316a067249750eba5530b799194e002.tar.gz
org.eclipse.jet-0ff861880316a067249750eba5530b799194e002.tar.bz2
[163849] Merge in 0.7.x maintenance fixes
-rw-r--r--doc/org.eclipse.jet.doc-feature/feature.properties2
-rw-r--r--doc/org.eclipse.jet.doc-feature/feature.xml7
-rw-r--r--doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF2
-rw-r--r--doc/org.eclipse.jet.doc/gettingStarted/commonTags.xhtml4
-rw-r--r--doc/org.eclipse.jet.doc/gettingStarted/essentialXPath.xhtml2
-rw-r--r--doc/org.eclipse.jet.doc/gettingStarted/index.xhtml2
-rw-r--r--doc/org.eclipse.jet.doc/plugin.properties2
-rw-r--r--doc/org.eclipse.jet.doc/plugin.xml6
-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/references/taglibs/controlTags/addElementTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/addTextElementTag.html8
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/caseTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/chooseTag.html35
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/copyElementTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/dumpTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/getTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/ifTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/includeTag.html18
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/initialCodeTag.html34
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/invokeTransformTag.html10
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/iterateTag.html7
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html14
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/logTag.html18
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/markerTag.html16
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/nodeAttributesTag.html1
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/otherwiseTag.html18
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/overrideTag.html8
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html197
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/removeElementTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/replaceStringsTag.html8
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/setTag.html8
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/setVariableTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/stringTokensTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/userRegionTag.html32
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitTag.html16
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitorTag.html11
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/controlTags/whenTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/formatNowTag.html6
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/lcTag.html15
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/millisecondsTag.html11
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html44
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/replaceAllTag.html13
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/stripTag.html13
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/ucTag.html15
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/uniqueTag.html14
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/formatTags/uuidTag.html13
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/classTag.html32
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/impliedImportTag.html9
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/importTag.html18
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/importsLocationTag.html8
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/mergeTag.html21
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html36
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/packageTag.html16
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/javaTags/resourceTag.html27
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/copyFileTag.html13
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/fileTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/folderTag.html10
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html30
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/projectTag.html26
-rw-r--r--doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/rebuildWorkspaceTag.html12
-rw-r--r--doc/org.eclipse.jet.doc/references/xpath/predefinedVariables.xhtml162
-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.xml40
-rw-r--r--doc/org.eclipse.jet.doc/toccontrolTags.xml39
-rw-r--r--doc/org.eclipse.jet.doc/tocformatTags.xml6
-rw-r--r--doc/org.eclipse.jet.doc/tocjavaTags.xml6
-rw-r--r--doc/org.eclipse.jet.doc/tocworkspaceTags.xml6
-rw-r--r--examples/org.eclipse.jet.examples-feature/feature.properties2
-rw-r--r--examples/org.eclipse.jet.examples-feature/feature.xml18
-rw-r--r--examples/org.eclipse.jet.examples/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.jet.examples/plugin.properties2
-rw-r--r--examples/org.eclipse.jet.examples/plugin.xml2
-rw-r--r--plugins/org.eclipse.jet-feature/feature.xml30
-rw-r--r--plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.properties2
-rw-r--r--plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.xml12
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java311
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java50
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java72
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java19
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java3
-rw-r--r--plugins/org.eclipse.jet/.options2
-rw-r--r--plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETCompileTask.java1
-rw-r--r--plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETTransformTask.java6
-rw-r--r--plugins/org.eclipse.jet/plugin.xml1248
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java3
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java49
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java58
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java5
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java6
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java10
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerErrorUtil.java90
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java10
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/ErrorRedirectingCoreElementDelegate.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/TextTrimmingVisitor.java (renamed from plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextTrimmingVisitor.java)22
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java26
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java100
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/ModelLoaderExtManager.java9
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/PluginProjectMonitor.java6
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties1
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java33
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java7
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/AdditionalBundleLocationProvider.java231
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleJarInfo.java87
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleManifest.java5
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DeployedJETBundleProvider.java24
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DirectoryBundleProvider.java188
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/InstalledJETBundleProvider.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleDescriptor.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManager.java48
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManifest.java3
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/NotABundleException.java49
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectJETBundleProvider.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java3
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/DumpTag.java122
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java5
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadContentTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/NodeAttributesTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ReplaceStringsTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java21
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java20
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/FormatNowTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/MillisecondsTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UniqueTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UuidTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaPackageAction.java8
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java11
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/RebuildWorkspaceTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java9
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java9
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CamelCaseFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CardinalityFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/ClassNameFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/EscapeJavaWhitespaceFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Lower_caseFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/LowercaseFirstFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/PackageNameFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/RemoveWhitespaceFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/TrimWhitespaceFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Upper_caseFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/UppercaseFirstFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/XmlEncodeFunction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java53
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java55
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java7
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java9
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java15
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java44
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java68
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/java/JavaActionsUtil.java119
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java149
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java19
-rw-r--r--plugins/org.eclipse.jet/templates/jet2transform.jet55
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jarbin34006 -> 28419 bytes
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jarbin36264 -> 34061 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF17
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xmlbin0 -> 150 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xmlbin0 -> 150 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet6
-rw-r--r--tests/org.eclipse.jet.tests/data/bug147714.jet11
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected2
-rw-r--r--tests/org.eclipse.jet.tests/data/textTrimmingTests.jet70
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet4
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet4
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java1
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java1
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java212
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java15
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java226
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java3
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java47
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java83
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java70
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java116
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java17
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java1
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java58
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java50
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/plugin.xml1
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet3
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet29
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet10
208 files changed, 5518 insertions, 1812 deletions
diff --git a/doc/org.eclipse.jet.doc-feature/feature.properties b/doc/org.eclipse.jet.doc-feature/feature.properties
index 896f0e2..b353d58 100644
--- a/doc/org.eclipse.jet.doc-feature/feature.properties
+++ b/doc/org.eclipse.jet.doc-feature/feature.properties
@@ -1,7 +1,7 @@
# /**
# * <copyright>
# *
-# * Copyright (c) 2004-2005 IBM Corporation and others.
+# * Copyright (c) 2004, 2005 IBM Corporation and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
diff --git a/doc/org.eclipse.jet.doc-feature/feature.xml b/doc/org.eclipse.jet.doc-feature/feature.xml
index a4f1a54..2d0bc9e 100644
--- a/doc/org.eclipse.jet.doc-feature/feature.xml
+++ b/doc/org.eclipse.jet.doc-feature/feature.xml
@@ -21,10 +21,15 @@
<update label="%updateSiteName" url="http://download.eclipse.org/technology/emft/updates/"/>
</url>
+ <requires>
+ <import plugin="org.eclipse.help" version="3.2.0" match="compatible"/>
+ </requires>
+
<plugin
id="org.eclipse.jet.doc"
download-size="0"
install-size="0"
- version="0.0.0"/>
+ version="0.0.0"
+ unpack="false"/>
</feature>
diff --git a/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF b/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
index a43305c..252a470 100644
--- a/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
+++ b/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
@@ -5,5 +5,5 @@ Bundle-SymbolicName: org.eclipse.jet.doc; singleton:=true
Bundle-Version: 0.7.100.qualifier
Bundle-Vendor: %Provider.name
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.help
+Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)"
Eclipse-LazyStart: true
diff --git a/doc/org.eclipse.jet.doc/gettingStarted/commonTags.xhtml b/doc/org.eclipse.jet.doc/gettingStarted/commonTags.xhtml
index 51da6fc..c9e5912 100644
--- a/doc/org.eclipse.jet.doc/gettingStarted/commonTags.xhtml
+++ b/doc/org.eclipse.jet.doc/gettingStarted/commonTags.xhtml
@@ -26,8 +26,8 @@ extracted from the input model. The control tags access the input model via <b>X
Three control tags are used frequently:
<ul>
<li> <code><a href="../references/taglibs/controlTags/getTag.html">c:get</a></code> - Write a value from the input model into the expanded template.</li>
- <li> <code><a href="../references/taglibs/controlTags/getTag.html">c:iterate</a></code> - Traverse elements in the input model and evaluate the contained template text once for each element. </li>
- <li> <code><a href="../references/taglibs/controlTags/getTag.html">c:set</a></code> - create or set an attribute on a model element. This is frequently used to store the result of a calculation. </li>
+ <li> <code><a href="../references/taglibs/controlTags/iterateTag.html">c:iterate</a></code> - Traverse elements in the input model and evaluate the contained template text once for each element. </li>
+ <li> <code><a href="../references/taglibs/controlTags/setTag.html">c:set</a></code> - create or set an attribute on a model element. This is frequently used to store the result of a calculation. </li>
</ul>
</p>
diff --git a/doc/org.eclipse.jet.doc/gettingStarted/essentialXPath.xhtml b/doc/org.eclipse.jet.doc/gettingStarted/essentialXPath.xhtml
index 14060cd..d761d19 100644
--- a/doc/org.eclipse.jet.doc/gettingStarted/essentialXPath.xhtml
+++ b/doc/org.eclipse.jet.doc/gettingStarted/essentialXPath.xhtml
@@ -33,7 +33,7 @@ JET supports XML documents and any model that is represented by EMF.
<p>JET tags that use XPath expressions have common characteristics:
<ul>
<li>Variables are defined by several JET tags - look for a <code>var</code> attribute. They may also be defined by
- the <code><a href="../taglibs/controlTags/setVariableTag.html">c:setVariable</a></code> tag.</li>
+ the <code><a href="../references/taglibs/controlTags/setVariableTag.html">c:setVariable</a></code> tag.</li>
<li> JET tags requiring a path expresion have a <code>select</code> attribute.</li>
<li> JET tags requiring a boolean expression have a <code>test</code>.</li>
<li> Any tag attribute may include a dynamic XPath expression - an XPath expression surrounded by braces ({ and }).</li>
diff --git a/doc/org.eclipse.jet.doc/gettingStarted/index.xhtml b/doc/org.eclipse.jet.doc/gettingStarted/index.xhtml
index 2a7e046..b4038f2 100644
--- a/doc/org.eclipse.jet.doc/gettingStarted/index.xhtml
+++ b/doc/org.eclipse.jet.doc/gettingStarted/index.xhtml
@@ -17,7 +17,7 @@ template. JET then writes the expanded template to the Eclipse workspace. A coll
understanding the <a href="transformStructure.xhtml">structure of a JET project</a>
and learning the <a href="commonTags.xhtml">most common JET tags</a>.
JET transformations extract information from an input model via XPath expressions. You can learn the basics of XPath
-by reading <a href="essentialXpath.xhtml">Essential XPath</a> </p>
+by reading <a href="essentialXPath.xhtml">Essential XPath</a> </p>
<p>In order to test your JET transformation, see <a href="runningTransforms.xhtml">Running JET Transformations</a></p>
<p>Once completed, you can share your transformation with others. See <a href="deployingTransforms.xhtml">Deploying Transformations</a>.</p>
</body>
diff --git a/doc/org.eclipse.jet.doc/plugin.properties b/doc/org.eclipse.jet.doc/plugin.properties
index ab771ba..98b3fa8 100644
--- a/doc/org.eclipse.jet.doc/plugin.properties
+++ b/doc/org.eclipse.jet.doc/plugin.properties
@@ -1,7 +1,7 @@
# /**
# * <copyright>
# *
-# * Copyright (c) 2002-2004 IBM Corporation and others.
+# * Copyright (c) 2002, 2004 IBM Corporation and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
diff --git a/doc/org.eclipse.jet.doc/plugin.xml b/doc/org.eclipse.jet.doc/plugin.xml
index 539e91a..b986e20 100644
--- a/doc/org.eclipse.jet.doc/plugin.xml
+++ b/doc/org.eclipse.jet.doc/plugin.xml
@@ -4,7 +4,7 @@
/**
* <copyright>
*
- * Copyright (c) 2004-2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,7 +45,9 @@
<!-- Define Javadoc locations -->
<!-- ============================= -->
<extension point="org.eclipse.pde.core.javadoc">
- <javadoc path="references/javadoc"> <!-- defaults to reference/api -->
+ <javadoc path="references/javadoc">
+ <plugin id="org.eclipse.jet"/>
+ <plugin id="org.eclipse.jet.ui"/> <!-- defaults to reference/api -->
</javadoc>
</extension>
</plugin>
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/references/taglibs/controlTags/addElementTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addElementTag.html
index 2477367..3191f99 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addElementTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addElementTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -76,8 +74,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin addElement example -->
-
- &lt;c:addElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- Insert an element 'foo' under $myElement. $new refers to 'foo' --%&gt;<br>
+ &lt;c:addElement select=&quot;$myElement&quot; name=&quot;foo&quot; var=&quot;new&quot;/&gt;<br>
<!-- End addElement example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addTextElementTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addTextElementTag.html
index c167c9f..b1e9687 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addTextElementTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/addTextElementTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -84,9 +82,9 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin addTextElement example -->
-
- &lt;c:addTextElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;%-- insert a text element 'foo' under $root. $newText refers to it --%&gt;<br>
+ &lt;c:addTextElement select=&quot;$root&quot; name=&quot;foo&quot; var=&quot;newText&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;This is the content of foo<BR>
&lt;/c:addTextElement&gt;
<!-- End addTextElement example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/caseTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/caseTag.html
index c0dcf55..ea67391 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/caseTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/caseTag.html
@@ -44,7 +44,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +55,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -66,11 +64,13 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin case example -->
-
- &lt;c:case test=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ &lt;c:choose&gt;<br>
+ &lt;c:case test=&quot;$myVar/@kind = 'FIELD'&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if test condition is
satisfied</I><BR>
- &lt;/c:case&gt;
+ &lt;/c:case&gt;<BR>
+ <I>... other &lt;c:when&gt; and &lt;c:otherwise&gt; tags ...</I><BR>
+ &lt;/c:choose&gt;
<!-- End case example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/chooseTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/chooseTag.html
index bec3372..3bb0466 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/chooseTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/chooseTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -72,10 +63,32 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin choose example -->
-
+ &lt;%-- evaluate one of a number alternatives --%&gt;<BR>
&lt;c:choose&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;c:when test="$var/@value = 1"&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle case 1</I><BR>
+ &lt;/c:when&gt;<BR>
+ &lt;c:when test="$var/@value >= 2"&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle case 2</I><BR>
+ &lt;/c:when&gt;<BR>
+ &lt;c:otherwise&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle other cases</I><BR>
+ &lt;/c:otherwise&gt;<BR>
+ &lt;/c:choose&gt;<BR><BR>
+
+ &lt;%-- evaluate an expression against constances --%&gt;<BR>
+ &lt;c:choose select="$var/@num"&gt;<br>
+ &lt;c:when test=" 'one' "&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle case 'one' </I><BR>
+ &lt;/c:when&gt;<BR>
+ &lt;c:when test=" 'two' "&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle case 'two' </I><BR>
+ &lt;/c:when&gt;<BR>
+ &lt;c:otherwise&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>handle other cases</I><BR>
+ &lt;/c:otherwise&gt;<BR>
&lt;/c:choose&gt;
+
<!-- End choose example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/copyElementTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/copyElementTag.html
index e1185f3..af4158a 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/copyElementTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/copyElementTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -84,8 +82,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin copyElement example -->
-
- &lt;c:copyElement select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- copy element $orig to a new element 'copy' under $dest --%&gt;<BR>
+ &lt;c:copyElement select=&quot;$orig&quot; toSelect=&quot;$dest&quot; name=&quot;copy&quot;/&gt;<br>
<!-- End copyElement example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/dumpTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/dumpTag.html
index 58a1ecb..a14eb00 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/dumpTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/dumpTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -76,8 +74,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin dump example -->
-
- &lt;c:dump select=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- dump the input model as an XML document --%&gt;<BR>
+ &lt;c:dump select=&quot;/*&quot;/&gt;<br>
<!-- End dump example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/getTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/getTag.html
index 72c1911..62a6c00 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/getTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/getTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -72,8 +70,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin get example -->
-
- &lt;c:get select=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- Return the string value of 'name' attribute of element refered to by $var --%&gt;<BR>
+ &lt;c:get select=&quot;$var/@name&quot;/&gt;<br>
<!-- End get example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/ifTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/ifTag.html
index 37650bd..a8bdf2a 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/ifTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/ifTag.html
@@ -44,7 +44,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +55,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -78,8 +76,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin if example -->
-
- &lt;c:if test=&quot;<I>value</I>&quot;&gt;<br>
+ &lt;%-- process contents if 'name' attribute is equal to JET --%&gt;<BR>
+ &lt;c:if test=&quot;$var/@name = 'JET'&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
satisfied</I><BR>
&lt;/c:if&gt;
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/includeTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/includeTag.html
index 6231439..620c0f6 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/includeTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/includeTag.html
@@ -33,12 +33,11 @@
<TR>
<TD width="10%">full tag</TD>
<TD><SPAN style="font-family: monospace">
- &lt;c:include template=&quot;<I>value</I>&quot; restoreNames=&quot;<I>value</I>&quot; passVariables=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;c:include template=&quot;<I>value</I>&quot; restoreNames=&quot;<I>value</I>&quot; passVariables=&quot;<I>value</I>&quot; super=&quot;<I>value</I>&quot;/&gt;<br>
</SPAN></TD>
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -65,6 +63,10 @@
<TD width="10%">passVariables</TD>
<TD><BR> A comma separated list of variable names (without the $ sign). Mutually exclusive with 'restoreNames'.<BR> </TD>
</TR>
+ <TR>
+ <TD width="10%">super</TD>
+ <TD><BR> If set to 'true', the template loader attempts to load directly from the overriden transformation (as specified by the 'override' tag or by the 'overrides' attribute of the 'transform' element of the 'org.eclipse.jet.transform' extension in the transforms plugin.xml). If no 'super' template can be found, an error occurs. The default is 'false', indicating normal template loading.<BR> </TD>
+ </TR>
</TBODY>
</TABLE>
<HR>
@@ -76,8 +78,14 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin include example -->
-
- &lt;c:include template=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;c:include template=&quot;templates/myInclude.jet&quot;/&gt;<br><BR>
+
+ &lt;%-- include myInclude.jet from overriden transformation--%&gt;<BR>
+ &lt;c:include template=&quot;templates/myInclude.jet&quot; super=&quot;true&quot;/&gt;<br><BR>
+
+ &lt;%-- pass only the variables $foo and $bar to myInclude.jet--%&gt;<BR>
+ &lt;c:include template=&quot;templates/myInclude.jet&quot; passVariables=&quot;foo,bar&quot;/&gt;<br>
+
<!-- End include example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/initialCodeTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/initialCodeTag.html
index 85fefc2..191b627 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/initialCodeTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/initialCodeTag.html
@@ -35,22 +35,25 @@
<TR>
<TD width="10%">full tag</TD>
<TD><SPAN style="font-family: monospace">
- &lt;c:initialCode&gt;<br>
+ &lt;c:initialCode unmodifiedMarker=&quot;<I>value</I>&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
&lt;/c:initialCode&gt;
</SPAN></TD>
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
<TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">unmodifiedMarker</TD>
+ <TD><BR> A string that when present in the content of the existing code indicates that the code has not been modified by the user, and should be replace with the contents of this initial code block.<BR> </TD>
+ </TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,10 +63,25 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin initialCode example -->
-
- &lt;c:initialCode&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/c:initialCode&gt;
+ &lt;%-- Define user region 101. Code in block will never be updated by subsequent executions --%&gt;<BR>
+ &lt;c:userRegion&gt;<BR>
+ // BEGIN region 101<BR>
+ &nbsp;&nbsp;&lt;c:initialCode&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>default code</I><BR>
+ &nbsp;&nbsp;&lt;/c:initialCode&gt;<BR>
+ // END region 101<BR>
+ &lt;/c:userRegion&gt;<BR><BR>
+
+ &lt;%-- Define user region 102. Code in block will be updated by subsequent
+ executions only if @generated is found in block --%&gt;<BR>
+ &lt;c:userRegion&gt;<BR>
+ // BEGIN region 102<BR>
+ &nbsp;&nbsp;&lt;c:initialCode unmodifiedMarker="@generated"&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;// @generated<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>default code</I><BR>
+ &nbsp;&nbsp;&lt;/c:initialCode&gt;<BR>
+ // END region 102<BR>
+ &lt;/c:userRegion&gt;<BR>
<!-- End initialCode example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/invokeTransformTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/invokeTransformTag.html
index 02a5291..0947f3c 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/invokeTransformTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/invokeTransformTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -76,8 +74,12 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin invokeTransform example -->
-
- &lt;c:invokeTransform transformId=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- invoke transform 'foo.bar' against the current input model --%&gt;<BR>
+ &lt;c:invokeTransform transformId=&quot;foo.bar&quot;/&gt;<br><BR>
+
+ &lt;%-- invoke transform 'foo.bar' against the current input model,
+ and pass only the variables $a, $b and $c --%&gt;<BR>
+ &lt;c:invokeTransform transformId=&quot;foo.bar&quot; passVariables="a,b,c"/&gt;<br>
<!-- End invokeTransform example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/iterateTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/iterateTag.html
index 4949b6d..b1e1f68 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/iterateTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/iterateTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -80,9 +78,10 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin iterate example -->
-
- &lt;c:iterate select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &lt;%-- Iterate over child 'a' elements of $root. $curA refers to each instance --%&gt;<BR>
+ &lt;c:iterate select=&quot;$root/a&quot; var=&quot;curA&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;Value of name: &lt;c:get select="$curA/@name"/&gt;<BR>
&lt;/c:iterate&gt;
<!-- End iterate example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html
index e161a7e..5808092 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -80,9 +78,13 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin loadContent example -->
-
- &lt;c:loadContent var=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;%-- Load an in memory XML document. $myXML is the document root,
+ $myXML/root is the root element --%&gt;<BR>
+ &lt;c:loadContent var=&quot;myXML&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;root&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a name="one"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a name="two"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;/root&gt;<BR>
&lt;/c:loadContent&gt;
<!-- End loadContent example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html
index 69086ea..8235e4f 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -84,8 +82,18 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin load example -->
+ &lt;%-- Load plugin.xml from transformation as an XML model, $pluginDoc refers to the
+ loaded document. $pluginDoc/* (or $pluginDoc/plugin) refers to the root element --%&gt;<BR>
+ &lt;c:load url=&quot;plugin.xml&quot; var=&quot;pluginDoc&quot;/&gt;<br><BR>
+
+ &lt;%-- same action as above, but with defaults specified --%&gt;<BR>
+ &lt;c:load url=&quot;plugin.xml&quot; var=&quot;pluginDoc&quot; urlContext=&quot;transform&quot;
+ loader=&quot;org.eclipse.jet.emfxml&quot; /&gt;<br><BR>
+
+ &lt;%-- Load sample.appdef from project myProject as an XML document --%&gt;<BR>
+ &lt;c:load url=&quot;myProject/sample.appdef&quot; var=&quot;sampleDoc&quot; urlContext=&quot;workspace&quot;
+ loader=&quot;org.eclipse.jet.emfxml&quot; type="xml" /&gt;<br>
- &lt;c:load url=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
<!-- End load example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/logTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/logTag.html
index beadac7..5c407a3 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/logTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/logTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -72,9 +63,14 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin log example -->
-
+ &lt;%-- Write a message to the JET execution console --%&gt;<BR>
&lt;c:log&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;Hello from my template<BR>
+ &lt;/c:log&gt;<BR><BR>
+
+ &lt;%-- Write an ERROR message to the JET execution console --%&gt;<BR>
+ &lt;c:log severity="error"&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;Error from my template<BR>
&lt;/c:log&gt;
<!-- End log example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/markerTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/markerTag.html
index abc00b6..56b3fd4 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/markerTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/markerTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -72,10 +63,11 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin marker example -->
+ &lt;%-- Create a task marker on the generated text 'This text is marked!'--%&gt;<BR>
+ &lt;c:marker&gt;This text is marked!&lt;/c:marker&gt;<BR><BR>
- &lt;c:marker&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/c:marker&gt;
+ &lt;%-- Create a task marker on the generated text 'This text is marked with a description!'--%&gt;<BR>
+ &lt;c:marker description=&quot;Do something about this&quot;&gt;This text is marked with a description!&lt;/c:marker&gt;<BR><BR>
<!-- End marker example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/nodeAttributesTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/nodeAttributesTag.html
index 02825b5..e971e63 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/nodeAttributesTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/nodeAttributesTag.html
@@ -80,7 +80,6 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin nodeAttributes example -->
-
&lt;c:nodeAttributes node=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
&lt;/c:nodeAttributes&gt;
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/otherwiseTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/otherwiseTag.html
index c66d307..2a02cf3 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/otherwiseTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/otherwiseTag.html
@@ -44,15 +44,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -62,11 +53,12 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin otherwise example -->
-
+ &lt;c:choose&gt;<br>
+ <I>... a sequence of &lt;c:when&gt; tags ...</I><BR>
&lt;c:otherwise&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
- satisfied</I><BR>
- &lt;/c:otherwise&gt;
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if no when tags were statisfied</I><BR>
+ &lt;/c:otherwise&gt;<BR>
+ &lt;/c:choose&gt;
<!-- End otherwise example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overrideTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overrideTag.html
index 44501c3..916acba 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overrideTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overrideTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,8 +58,10 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin override example -->
-
- &lt;c:override transformId=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- Declare that this transformation over rides 'foo.bar'--%&gt;<BR>
+ &lt;%-- When resolving templates, JET will first look in this transformation,
+ and then in foo.bar. --%&gt;<BR>
+ &lt;c:override transformId=&quot;foo.bar&quot;/&gt;<br>
<!-- End override example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html
index 813469c..2b15aa8 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html
@@ -25,24 +25,24 @@
<TR>
<TH colspan="2" align="left">Tag Summary</TH></TR>
<TR>
- <TD width="10%"><A href="iterateTag.html">&lt;c:iterate&gt;</A></TD>
- <TD><!-- Begin iterate description -->
- <P> Write the tag contents for each in the template input model identified by an XPath expression
- <!-- End iterate description -->
+ <TD width="10%"><A href="addElementTag.html">&lt;c:addElement&gt;</A></TD>
+ <TD><!-- Begin addElement description -->
+ <P> Create a new model element under the selected node
+ <!-- End addElement description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="ifTag.html">&lt;c:if&gt;</A></TD>
- <TD><!-- Begin if description -->
- <P> Process the tag contents if a test condition is satisfied
- <!-- End if description -->
+ <TD width="10%"><A href="addTextElementTag.html">&lt;c:addTextElement&gt;</A></TD>
+ <TD><!-- Begin addTextElement description -->
+ <P> Create a new model element node under the selected element, and whose text content is the content of this tag
+ <!-- End addTextElement description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="getTag.html">&lt;c:get&gt;</A></TD>
- <TD><!-- Begin get description -->
- <P> Write a the result of an XPath expression
- <!-- End get description -->
+ <TD width="10%"><A href="caseTag.html">&lt;c:case&gt;</A></TD>
+ <TD><!-- Begin case description -->
+ <P> *** DEPRECATED - use 'when' tag instead
+ <!-- End case description -->
</TD>
</TR>
<TR>
@@ -53,38 +53,31 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="caseTag.html">&lt;c:case&gt;</A></TD>
- <TD><!-- Begin case description -->
- <P> *** DEPRECATED - use 'when' tag instead
- <!-- End case description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="otherwiseTag.html">&lt;c:otherwise&gt;</A></TD>
- <TD><!-- Begin otherwise description -->
- <P> Define a default case for a 'choose' tag
- <!-- End otherwise description -->
+ <TD width="10%"><A href="copyElementTag.html">&lt;c:copyElement&gt;</A></TD>
+ <TD><!-- Begin copyElement description -->
+ <P> Copy the selected node to the selected location
+ <!-- End copyElement description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="visitorTag.html">&lt;c:visitor&gt;</A></TD>
- <TD><!-- Begin visitor description -->
- <P> *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal
- <!-- End visitor description -->
+ <TD width="10%"><A href="dumpTag.html">&lt;c:dump&gt;</A></TD>
+ <TD><!-- Begin dump description -->
+ Writes out the DOM subtree under a specified model node
+ <!-- End dump description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="visitTag.html">&lt;c:visit&gt;</A></TD>
- <TD><!-- Begin visit description -->
- <P> Define content to process for an object found by the parent 'visitor' tag, provided a condition is met
- <!-- End visit description -->
+ <TD width="10%"><A href="getTag.html">&lt;c:get&gt;</A></TD>
+ <TD><!-- Begin get description -->
+ <P> Write a the result of an XPath expression
+ <!-- End get description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="userRegionTag.html">&lt;c:userRegion&gt;</A></TD>
- <TD><!-- Begin userRegion description -->
- <P> Define a region in the generated text where users may write customized code
- <!-- End userRegion description -->
+ <TD width="10%"><A href="ifTag.html">&lt;c:if&gt;</A></TD>
+ <TD><!-- Begin if description -->
+ <P> Process the tag contents if a test condition is satisfied
+ <!-- End if description -->
</TD>
</TR>
<TR>
@@ -95,13 +88,6 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="logTag.html">&lt;c:log&gt;</A></TD>
- <TD><!-- Begin log description -->
- <P> Write a message to the transformation log
- <!-- End log description -->
- </TD>
- </TR>
- <TR>
<TD width="10%"><A href="initialCodeTag.html">&lt;c:initialCode&gt;</A></TD>
<TD><!-- Begin initialCode description -->
<P> A child tag of the 'userRegion' tag containing the initial code to write
@@ -109,38 +95,17 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="setVariableTag.html">&lt;c:setVariable&gt;</A></TD>
- <TD><!-- Begin setVariable description -->
- <P> Create a variable whose value is set to the result of the provided XPath expression
- <!-- End setVariable description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="addElementTag.html">&lt;c:addElement&gt;</A></TD>
- <TD><!-- Begin addElement description -->
- <P> Create a new model element under the selected node
- <!-- End addElement description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="addTextElementTag.html">&lt;c:addTextElement&gt;</A></TD>
- <TD><!-- Begin addTextElement description -->
- <P> Create a new model element node under the selected element, and whose text content is the content of this tag
- <!-- End addTextElement description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="removeElementTag.html">&lt;c:removeElement&gt;</A></TD>
- <TD><!-- Begin removeElement description -->
- <P> Remove the selected node from the document tree
- <!-- End removeElement description -->
+ <TD width="10%"><A href="invokeTransformTag.html">&lt;c:invokeTransform&gt;</A></TD>
+ <TD><!-- Begin invokeTransform description -->
+ <P> Invoke the another transformation, passing it the current transformation's source model and context variables
+ <!-- End invokeTransform description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="copyElementTag.html">&lt;c:copyElement&gt;</A></TD>
- <TD><!-- Begin copyElement description -->
- <P> Copy the selected node to the selected location
- <!-- End copyElement description -->
+ <TD width="10%"><A href="iterateTag.html">&lt;c:iterate&gt;</A></TD>
+ <TD><!-- Begin iterate description -->
+ <P> Write the tag contents for each in the template input model identified by an XPath expression
+ <!-- End iterate description -->
</TD>
</TR>
<TR>
@@ -151,17 +116,17 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="whenTag.html">&lt;c:when&gt;</A></TD>
- <TD><!-- Begin when description -->
- <P> Define a one of the mutually exclusive cases of a 'choose' tag
- <!-- End when description -->
+ <TD width="10%"><A href="loadContentTag.html">&lt;c:loadContent&gt;</A></TD>
+ <TD><!-- Begin loadContent description -->
+ Extends the model by parsing its contents as XML
+ <!-- End loadContent description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="setTag.html">&lt;c:set&gt;</A></TD>
- <TD><!-- Begin set description -->
- <P> Set an attribute on an object selected by an XPath expression
- <!-- End set description -->
+ <TD width="10%"><A href="logTag.html">&lt;c:log&gt;</A></TD>
+ <TD><!-- Begin log description -->
+ <P> Write a message to the transformation log
+ <!-- End log description -->
</TD>
</TR>
<TR>
@@ -172,6 +137,13 @@
</TD>
</TR>
<TR>
+ <TD width="10%"><A href="otherwiseTag.html">&lt;c:otherwise&gt;</A></TD>
+ <TD><!-- Begin otherwise description -->
+ <P> Define a default case for a 'choose' tag
+ <!-- End otherwise description -->
+ </TD>
+ </TR>
+ <TR>
<TD width="10%"><A href="overrideTag.html">&lt;c:override&gt;</A></TD>
<TD><!-- Begin override description -->
<P> *** Deprecated: Use the 'overrides' attribute on 'transform' extension in plugin
@@ -179,38 +151,31 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="invokeTransformTag.html">&lt;c:invokeTransform&gt;</A></TD>
- <TD><!-- Begin invokeTransform description -->
- <P> Invoke the another transformation, passing it the current transformation's source model and context variables
- <!-- End invokeTransform description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="dumpTag.html">&lt;c:dump&gt;</A></TD>
- <TD><!-- Begin dump description -->
- Writes out the DOM subtree under a specified model node
- <!-- End dump description -->
+ <TD width="10%"><A href="removeElementTag.html">&lt;c:removeElement&gt;</A></TD>
+ <TD><!-- Begin removeElement description -->
+ <P> Remove the selected node from the document tree
+ <!-- End removeElement description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="loadContentTag.html">&lt;c:loadContent&gt;</A></TD>
- <TD><!-- Begin loadContent description -->
- Extends the model by parsing its contents as XML
- <!-- End loadContent description -->
+ <TD width="10%"><A href="replaceStringsTag.html">&lt;c:replaceStrings&gt;</A></TD>
+ <TD><!-- Begin replaceStrings description -->
+ Replaces one set of strings in its content with another set of strings and writes out the result
+ <!-- End replaceStrings description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="nodeAttributesTag.html">&lt;c:nodeAttributes&gt;</A></TD>
- <TD><!-- Begin nodeAttributes description -->
- Iterates over the attributes for a given node
- <!-- End nodeAttributes description -->
+ <TD width="10%"><A href="setTag.html">&lt;c:set&gt;</A></TD>
+ <TD><!-- Begin set description -->
+ <P> Set an attribute on an object selected by an XPath expression
+ <!-- End set description -->
</TD>
</TR>
<TR>
- <TD width="10%"><A href="replaceStringsTag.html">&lt;c:replaceStrings&gt;</A></TD>
- <TD><!-- Begin replaceStrings description -->
- Replaces one set of strings in its content with another set of strings and writes out the result
- <!-- End replaceStrings description -->
+ <TD width="10%"><A href="setVariableTag.html">&lt;c:setVariable&gt;</A></TD>
+ <TD><!-- Begin setVariable description -->
+ <P> Create a variable whose value is set to the result of the provided XPath expression
+ <!-- End setVariable description -->
</TD>
</TR>
<TR>
@@ -220,6 +185,34 @@
<!-- End stringTokens description -->
</TD>
</TR>
+ <TR>
+ <TD width="10%"><A href="userRegionTag.html">&lt;c:userRegion&gt;</A></TD>
+ <TD><!-- Begin userRegion description -->
+ <P> Define a region in the generated text where users may write customized code
+ <!-- End userRegion description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="visitTag.html">&lt;c:visit&gt;</A></TD>
+ <TD><!-- Begin visit description -->
+ <P> Define content to process for an object found by the parent 'visitor' tag, provided a condition is met
+ <!-- End visit description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="visitorTag.html">&lt;c:visitor&gt;</A></TD>
+ <TD><!-- Begin visitor description -->
+ <P> *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal
+ <!-- End visitor description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="whenTag.html">&lt;c:when&gt;</A></TD>
+ <TD><!-- Begin when description -->
+ <P> Define a one of the mutually exclusive cases of a 'choose' tag
+ <!-- End when description -->
+ </TD>
+ </TR>
</TBODY>
</TABLE>
<HR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/removeElementTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/removeElementTag.html
index e7291aa..735af0d 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/removeElementTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/removeElementTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,8 +58,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin removeElement example -->
-
- &lt;c:removeElement select=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- Remove element a as a child of $root--%&gt;<BR>
+ &lt;c:removeElement select=&quot;$root/a&quot;/&gt;<br>
<!-- End removeElement example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/replaceStringsTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/replaceStringsTag.html
index a94a762..ab93aac 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/replaceStringsTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/replaceStringsTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -68,9 +66,9 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin replaceStrings example -->
-
- &lt;c:replaceStrings replace=&quot;<I>value</I>&quot; with=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;%-- Replace %name with 'Jim' and %age with '47' --%&gt;<BR>
+ &lt;c:replaceStrings replace=&quot;%name,%age&quot; with=&quot;Jim,47&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;My name is %name. My age is %age.<BR>
&lt;/c:replaceStrings&gt;
<!-- End replaceStrings example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setTag.html
index 83edfe2..75cc55a 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -68,9 +66,9 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin set example -->
-
- &lt;c:set select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;%-- create or update an attribute name-length on element $var --%&gt;
+ &lt;c:set select=&quot;$var&quot; name=&quot;name-length&quot;&gt;<br>
+ &lt;c:get select="string-length(local-name($var))"/&gt;<BR>
&lt;/c:set&gt;
<!-- End set example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setVariableTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setVariableTag.html
index 86d2692..e49a5be 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setVariableTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/setVariableTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -64,8 +62,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin setVariable example -->
-
- &lt;c:setVariable select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- define $root as pointing to the root element in the mode --%&gt;<BR>
+ &lt;c:setVariable select=&quot;/*&quot; var=&quot;root&quot;/&gt;<br>
<!-- End setVariable example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/stringTokensTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/stringTokensTag.html
index 69d97f8..a71e977 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/stringTokensTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/stringTokensTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -92,9 +90,13 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin stringTokens example -->
-
- &lt;c:stringTokens string=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;%-- break a,bc,cde into tokens, and iterate over them --%&gt;<BR>
+ &lt;c:stringTokens string=&quot;a,bc,cde&quot; name=&quot;curStr&quot; delimitedBy=&quot;,&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;value: &lt;c:get select="$curStr/@value"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;index: &lt;c:get select="$curStr/@index"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;delimiter: &lt;c:get select="$curStr/@delimiter"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;first: &lt;c:get select="$curStr/@first"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;last: &lt;c:get select="$curStr/@last"/&gt;<BR>
&lt;/c:stringTokens&gt;
<!-- End stringTokens example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/userRegionTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/userRegionTag.html
index 1d302a5..6fc52db 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/userRegionTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/userRegionTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,10 +51,25 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin userRegion example -->
-
- &lt;c:userRegion&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/c:userRegion&gt;
+ &lt;%-- Define user region 101. Code in block will never be updated by subsequent executions --%&gt;<BR>
+ &lt;c:userRegion&gt;<BR>
+ // BEGIN region 101<BR>
+ &nbsp;&nbsp;&lt;c:initialCode&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>default code</I><BR>
+ &nbsp;&nbsp;&lt;/c:initialCode&gt;<BR>
+ // END region 101<BR>
+ &lt;/c:userRegion&gt;<BR><BR>
+
+ &lt;%-- Define user region 102. Code in block will be updated by subsequent
+ executions only if @generated is found in block --%&gt;<BR>
+ &lt;c:userRegion&gt;<BR>
+ // BEGIN region 102<BR>
+ &nbsp;&nbsp;&lt;c:initialCode unmodifiedMarker="@generated"&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;// @generated<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>default code</I><BR>
+ &nbsp;&nbsp;&lt;/c:initialCode&gt;<BR>
+ // END region 102<BR>
+ &lt;/c:userRegion&gt;<BR>
<!-- End userRegion example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitTag.html
index 6563e0c..69f5bec 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitTag.html
@@ -44,7 +44,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -52,11 +51,10 @@
<TH colspan="2" align="left">Required Attributes</TH></TR>
<TR>
<TD width="10%">test</TD>
- <TD>TODO Define description of test</TD>
+ <TD><BR> An expression expression, that, if true, causes the tag contents to be evaluated.<BR> </TD>
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -66,11 +64,13 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin visit example -->
-
- &lt;c:visit test=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
- satisfied</I><BR>
- &lt;/c:visit&gt;
+ &lt;%-- traverse a model starting at $root. $cur refers to current node --%>
+ &lt;c:visitor select=&quot;$root&quot; var=&quot;cur&quot;&gt;<br>
+ &lt;c:visit test=&quot;local-name($cur) = 'a'&quot;&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process of test is true</I><BR>
+ &lt;/c:visit&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>... other &lt;c:visit&gt; tags ...</I><BR>
+ &lt;/c:visitor&gt;
<!-- End visit example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitorTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitorTag.html
index 22ef3ef..09f90f4 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitorTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/visitorTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -68,9 +66,12 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin visitor example -->
-
- &lt;c:visitor select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;%-- traverse a model starting at $root. $cur refers to current node --%>
+ &lt;c:visitor select=&quot;$root&quot; var=&quot;cur&quot;&gt;<br>
+ &lt;c:visit test=&quot;local-name($cur) = 'a'&quot;&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process of test is true</I><BR>
+ &lt;/c:visit&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>... other &lt;c:visit&gt; tags ...</I><BR>
&lt;/c:visitor&gt;
<!-- End visitor example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/whenTag.html b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/whenTag.html
index 0e55532..782e4ab 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/controlTags/whenTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/controlTags/whenTag.html
@@ -44,7 +44,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +55,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -66,11 +64,13 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin when example -->
-
- &lt;c:when test=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ &lt;c:choose&gt;<br>
+ &lt;c:when test=&quot;$myVar/@kind = 'FIELD'&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if test condition is
satisfied</I><BR>
- &lt;/c:when&gt;
+ &lt;/c:when&gt;<BR>
+ <I>... other &lt;c:when&gt; and &lt;c:otherwise&gt; tags ...</I><BR>
+ &lt;/c:choose&gt;
<!-- End when example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/formatNowTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/formatNowTag.html
index abed0f9..74e190b 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/formatNowTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/formatNowTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,8 +58,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin formatNow example -->
-
- &lt;f:formatNow pattern=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;f:formatNow pattern=&quot;<I>MM/dd/yyyy : EEE</I>&quot; /&gt;<br>
+ <P>This formatNow tag would write out a time formatted like "01/29/2006 : Sun"</P>
<!-- End formatNow example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/lcTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/lcTag.html
index 738c661..ae77067 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/lcTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/lcTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -76,10 +67,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin lc example -->
-
- &lt;f:lc&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/f:lc&gt;
+ &lt;%-- This will result in 'upper' --%&gt;<BR>
+ &lt;f:lc&gt;UPPER&lt;/f:lc&gt;
<!-- End lc example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/millisecondsTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/millisecondsTag.html
index 01fd962..eb1d828 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/millisecondsTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/millisecondsTag.html
@@ -38,15 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +47,7 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin milliseconds example -->
-
+ &lt;%-- this will produce something like 1138570287475 --%&gt;
&lt;f:milliseconds/&gt;<br>
<!-- End milliseconds example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html
index e5b988e..986a5f3 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html
@@ -25,6 +25,27 @@
<TR>
<TH colspan="2" align="left">Tag Summary</TH></TR>
<TR>
+ <TD width="10%"><A href="formatNowTag.html">&lt;f:formatNow&gt;</A></TD>
+ <TD><!-- Begin formatNow description -->
+ Formats and writes out the current date and time
+ <!-- End formatNow description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="lcTag.html">&lt;f:lc&gt;</A></TD>
+ <TD><!-- Begin lc description -->
+ <P> Convert the tag contents to lower case
+ <!-- End lc description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="millisecondsTag.html">&lt;f:milliseconds&gt;</A></TD>
+ <TD><!-- Begin milliseconds description -->
+ Writes out a current system milliseconds value
+ <!-- End milliseconds description -->
+ </TD>
+ </TR>
+ <TR>
<TD width="10%"><A href="replaceAllTag.html">&lt;f:replaceAll&gt;</A></TD>
<TD><!-- Begin replaceAll description -->
<P> Replace all instances of a value in the tag's content with a new value
@@ -46,27 +67,6 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="lcTag.html">&lt;f:lc&gt;</A></TD>
- <TD><!-- Begin lc description -->
- <P> Convert the tag contents to lower case
- <!-- End lc description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="formatNowTag.html">&lt;f:formatNow&gt;</A></TD>
- <TD><!-- Begin formatNow description -->
- Formats and writes out the current date and time
- <!-- End formatNow description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="millisecondsTag.html">&lt;f:milliseconds&gt;</A></TD>
- <TD><!-- Begin milliseconds description -->
- Writes out a current system milliseconds value
- <!-- End milliseconds description -->
- </TD>
- </TR>
- <TR>
<TD width="10%"><A href="uniqueTag.html">&lt;f:unique&gt;</A></TD>
<TD><!-- Begin unique description -->
Writes out a unique integer value
@@ -76,7 +76,7 @@
<TR>
<TD width="10%"><A href="uuidTag.html">&lt;f:uuid&gt;</A></TD>
<TD><!-- Begin uuid description -->
- Default description for tag uuid
+ Generate a universally unique identifier (UUID)
<!-- End uuid description -->
</TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/replaceAllTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/replaceAllTag.html
index 442a318..2a2ff06 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/replaceAllTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/replaceAllTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -58,7 +57,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -80,10 +78,15 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin replaceAll example -->
+ &lt;%-- This will result in a/b/c--%&gt;<BR>
+ &lt;f:replaceAll value=&quot;.&quot; replacement=&quot;/&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;a.b.c</I><BR>
+ &lt;/f:replaceAll&gt;<BR><BR>
- &lt;f:replaceAll value=&quot;<I>value</I>&quot; replacement=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/f:replaceAll&gt;
+ &lt;%-- This will result in ///// --%&gt;<BR>
+ &lt;f:replaceAll value=&quot;.&quot; replacement=&quot;/&quot; regex=&quot;true&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;a.b.c</I><BR>
+ &lt;/f:replaceAll&gt;<BR><BR>
<!-- End replaceAll example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/stripTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/stripTag.html
index 77ca584..ee5e4b0 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/stripTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/stripTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,9 +51,9 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin strip example -->
-
+ &lt;%-- This will result 'abc' --%&gt;<BR>
&lt;f:strip&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;a b c <BR>
&lt;/f:strip&gt;
<!-- End strip example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/ucTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/ucTag.html
index 593bde2..9348cfe 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/ucTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/ucTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -76,10 +67,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin uc example -->
-
- &lt;f:uc&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/f:uc&gt;
+ &lt;%-- This will result in 'LOWER' --%&gt;<BR>
+ &lt;f:uc&gt;lower&lt;/f:uc&gt;
<!-- End uc example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uniqueTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uniqueTag.html
index c8fe134..3245381 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uniqueTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uniqueTag.html
@@ -38,15 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +47,10 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin unique example -->
-
+ &lt;%-- if this is the first time this is used, 1 will be returned --%&gt;<BR>
+ &lt;f:unique/&gt;<br><BR>
+
+ &lt;%-- if the above retuned 1 this will return 2 --%&gt;<BR>
&lt;f:unique/&gt;<br>
<!-- End unique example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uuidTag.html b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uuidTag.html
index 9682459..5d34e2a 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uuidTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/formatTags/uuidTag.html
@@ -18,7 +18,7 @@
</TABLE>
<HR>
<P><B>uuid</B></P>
-<P>Default description for tag uuid</P>
+<P>Generate a universally unique identifier (UUID).</P>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -38,15 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +47,7 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin uuid example -->
-
+ &lt;%-- This will return a unique string something like: _e_GS4EgEEdugkoUy0CmRoA --%&gt;<BR>
&lt;f:uuid/&gt;<br>
<!-- End uuid example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/classTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/classTag.html
index 8cd5e30..85355f6 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/classTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/classTag.html
@@ -18,7 +18,7 @@
</TABLE>
<HR>
<P><B>class</B></P>
-<P><P> Create a Java class with the specified name.<P> </P>
+<P><P> Create a Java class with the specified name and write its contents by evaluating the supplied template.<P> </P>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -33,12 +33,11 @@
<TR>
<TD width="10%">full tag</TD>
<TD><SPAN style="font-family: monospace">
- &lt;java:class name=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot; package=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot; project=&quot;<I>value</I>&quot; replace=&quot;<I>value</I>&quot; encoding=&quot;<I>value</I>&quot; derived=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;java:class name=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot; package=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot; replace=&quot;<I>value</I>&quot; encoding=&quot;<I>value</I>&quot; derived=&quot;<I>value</I>&quot;/&gt;<br>
</SPAN></TD>
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,11 +49,10 @@
</TR>
<TR>
<TD width="10%">template</TD>
- <TD>TODO Define description of template</TD>
+ <TD><BR> A project-relative path of a JET template to execute. The template provides the class file's contents.<BR> </TD>
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -70,20 +68,16 @@
<TD><BR> The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.<BR> </TD>
</TR>
<TR>
- <TD width="10%">project</TD>
- <TD>TODO Define description of project</TD>
- </TR>
- <TR>
<TD width="10%">replace</TD>
- <TD>TODO Define description of replace</TD>
+ <TD><BR> A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.<BR> </TD>
</TR>
<TR>
<TD width="10%">encoding</TD>
- <TD>TODO Define description of encoding</TD>
+ <TD><BR> The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.<BR> </TD>
</TR>
<TR>
<TD width="10%">derived</TD>
- <TD>TODO Define description of derived</TD>
+ <TD><BR> A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.<BR> </TD>
</TR>
</TBODY>
</TABLE>
@@ -96,8 +90,18 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin class example -->
-
- &lt;java:class name=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- create class Foo in package org.example in source folder myProject/src --%&lt;<BR>
+ &lt;java:class name=&quot;Foo&quot; package="org.example" srcFolder="myProject/src" template=&quot;myJava.jet&quot;/&gt;<br><BR>
+
+ &lt;%-- create classes Foo &amp; Bar in package org.example in source folder myProject/src --%><BR>
+ &lt;ws:project name="myProject"&gt;<BR>
+ &nbsp;&nbsp;&lt;ws:folder path=&quot;src&quot;&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;java:package name="org.example"&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;java:class name="Foo" template="myFoo.jet"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;java:class name="Bar" template="myBar.jet"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;/java:package&gt;<BR>
+ &nbsp;&nbsp;&lt;/ws:folder&gt;<BR>
+ &lt;/ws:project&gt;<BR>
<!-- End class example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/impliedImportTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/impliedImportTag.html
index 0ea003a..117d829 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/impliedImportTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/impliedImportTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,8 +58,11 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin impliedImport example -->
-
- &lt;java:impliedImport name=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- setup implied import of org.example.List class --%&gt;<BR>
+ package org.example;<BR><BR>
+ &lt;java:importsLocation package="org.example"&gt;<BR>
+ &lt;java:impliedImport name=&quot;org.example.List&quot;/&gt;<br>
+
<!-- End impliedImport example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importTag.html
index 50854d6..879aa50 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importTag.html
@@ -42,15 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,10 +51,11 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin import example -->
-
- &lt;java:import&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/java:import&gt;
+ &lt;%-- generates List and in import java.util.List import if another List is not imported --%&gt;<BR>
+ package org.example;<BR><BR>
+ &lt;java:importsLocation package=&quot;org.example&quot;/&gt;<BR><BR>
+ <I>... later in the template ...</I><BR><BR>
+ &lt;java:import&gt;java.util.List&lt;/java:import&gt; myList;
<!-- End import example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importsLocationTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importsLocationTag.html
index e0ec7ff..67c34ab 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importsLocationTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/importsLocationTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,7 +49,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -60,8 +58,10 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin importsLocation example -->
-
- &lt;java:importsLocation package=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- setup location for automatical import statement insertion --%&gt;<BR>
+ package org.example;<BR><BR>
+
+ &lt;java:importsLocation package=&quot;org.example&quot;/&gt;<br>
<!-- End importsLocation example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/mergeTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/mergeTag.html
index ab5e977..1fb457f 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/mergeTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/mergeTag.html
@@ -38,15 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -72,8 +63,16 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin merge example -->
-
- &lt;java:merge/&gt;<br>
+ <i>... template generating a .java or .properties file ...</i><BR><BR>
+ &lt;%-- Merge the generated contents with any existing file, using the standard JMerge rules --%&gt;<BR>
+ &lt;java:merge/&gt;<br><br>
+
+ &lt;%-- Merge using custom JMerge rules --%&gt;<BR>
+ &lt;java:merge rules=&quot;myMergeRules.xml&quot; rulesContext=&quot;transform&quot;/&gt;<br><br>
+
+ &lt;%-- Explicit use of EMF Codegen merge rules (same as first) --%&gt;<BR>
+ &lt;java:merge rules=&quot;platform:/plugin/org.eclipse.emf.codegen.ecore/templates/emf-merge.xml&quot;/&gt;<br><br>
+
<!-- End merge example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html
index 1240c74..41b3da9 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html
@@ -25,10 +25,10 @@
<TR>
<TH colspan="2" align="left">Tag Summary</TH></TR>
<TR>
- <TD width="10%"><A href="importsLocationTag.html">&lt;java:importsLocation&gt;</A></TD>
- <TD><!-- Begin importsLocation description -->
- <P> Identify the location for Java import statement generation
- <!-- End importsLocation description -->
+ <TD width="10%"><A href="classTag.html">&lt;java:class&gt;</A></TD>
+ <TD><!-- Begin class description -->
+ <P> Create a Java class with the specified name and write its contents by evaluating the supplied template
+ <!-- End class description -->
</TD>
</TR>
<TR>
@@ -46,6 +46,20 @@
</TD>
</TR>
<TR>
+ <TD width="10%"><A href="importsLocationTag.html">&lt;java:importsLocation&gt;</A></TD>
+ <TD><!-- Begin importsLocation description -->
+ <P> Identify the location for Java import statement generation
+ <!-- End importsLocation description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="mergeTag.html">&lt;java:merge&gt;</A></TD>
+ <TD><!-- Begin merge description -->
+ <P> Cause the template contents to be merged with the existing Java file using the EMF JMerge engine
+ <!-- End merge description -->
+ </TD>
+ </TR>
+ <TR>
<TD width="10%"><A href="packageTag.html">&lt;java:package&gt;</A></TD>
<TD><!-- Begin package description -->
<P> Create a Java package
@@ -59,20 +73,6 @@
<!-- End resource description -->
</TD>
</TR>
- <TR>
- <TD width="10%"><A href="classTag.html">&lt;java:class&gt;</A></TD>
- <TD><!-- Begin class description -->
- <P> Create a Java class with the specified name
- <!-- End class description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="mergeTag.html">&lt;java:merge&gt;</A></TD>
- <TD><!-- Begin merge description -->
- <P> Cause the template contents to be merged with the existing Java file using the EMF JMerge engine
- <!-- End merge description -->
- </TD>
- </TR>
</TBODY>
</TABLE>
<HR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/packageTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/packageTag.html
index 408d960..4ca8b87 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/packageTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/packageTag.html
@@ -35,14 +35,13 @@
<TR>
<TD width="10%">full tag</TD>
<TD><SPAN style="font-family: monospace">
- &lt;java:package name=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot; project=&quot;<I>value</I>&quot;&gt;<br>
+ &lt;java:package name=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
&lt;/java:package&gt;
</SPAN></TD>
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -63,11 +61,7 @@
<TR>
<TR>
<TD width="10%">srcFolder</TD>
- <TD></TD>
- </TR>
- <TR>
- <TD width="10%">project</TD>
- <TD>TODO Define description of project</TD>
+ <TD><BR> The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.<BR> </TD>
</TR>
</TBODY>
</TABLE>
@@ -80,9 +74,9 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin package example -->
-
- &lt;java:package name=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;%-- Create a package in myProject/src folder --%&gt;<BR>
+ &lt;java:package name=&quot;org.example&quot; srcFolder=&quot;myProject/src&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>... java:class and java:resource tags here will be relative to org.example ...</I><BR>
&lt;/java:package&gt;
<!-- End package example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/resourceTag.html b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/resourceTag.html
index 1a22a64..b0c152e 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/javaTags/resourceTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/javaTags/resourceTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -50,11 +49,10 @@
</TR>
<TR>
<TD width="10%">template</TD>
- <TD>TODO Define description of template</TD>
+ <TD><BR> <BR> A project-relative path of a JET template to execute. The template provides the resource file's contents.<BR> <BR> A project-relative path of a JET template to execute. The template provides the resource file's contents.<BR> </TD>
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -63,23 +61,23 @@
<TR>
<TR>
<TD width="10%">package</TD>
- <TD></TD>
+ <TD><BR> The name of the java package. If not specified, then the name of the containing 'java:package' tag is used, otherwise, the default package is used.<BR> </TD>
</TR>
<TR>
<TD width="10%">srcFolder</TD>
- <TD></TD>
+ <TD><BR> The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.<BR> </TD>
</TR>
<TR>
<TD width="10%">replace</TD>
- <TD>TODO Define description of replace</TD>
+ <TD><BR> A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.<BR> </TD>
</TR>
<TR>
<TD width="10%">encoding</TD>
- <TD>TODO Define description of encoding</TD>
+ <TD><BR> The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.<BR> </TD>
</TR>
<TR>
<TD width="10%">derived</TD>
- <TD>TODO Define description of derived</TD>
+ <TD><BR> A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.<BR> </TD>
</TR>
</TBODY>
</TABLE>
@@ -92,8 +90,17 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin resource example -->
-
- &lt;java:resource name=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- create resource Messages.properties in package org.example in source folder myProject/src --%><BR>
+ &lt;java:resource name=&quot;Messages.properties&quot; package="org.example" srcFolder="myProject/src" template=&quot;myprops.jet&quot;/&gt;<br><BR>
+
+ &lt;%-- resource Messages.properties in package org.example in source folder myProject/src --%><BR>
+ &lt;ws:project name="myProject"&gt;<BR>
+ &nbsp;&nbsp;&lt;ws:folder path=&quot;src&quot;&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;java:package name="org.example"&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;java:resource name="Messages.properties" template="myprops.jet"/&gt;<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;/java:package&gt;<BR>
+ &nbsp;&nbsp;&lt;/ws:folder&gt;<BR>
+ &lt;/ws:project&gt;<BR>
<!-- End resource example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/copyFileTag.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/copyFileTag.html
index f795f89..e5496e9 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/copyFileTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/copyFileTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -92,8 +90,15 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin copyFile example -->
-
- &lt;ws:copyFile src=&quot;<I>value</I>&quot; target=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- copy a transformation supplied file to the project myProject --%&gt;<BR>
+ &lt;ws:copyFile src=&quot;logo.gif&quot; target=&quot;myproject/logo.gif&quot; binary=&quot;true&quot;/&gt;<br><br>
+
+ &lt;%-- this is equivalent to --%gt;<BR>
+ &lt;ws:copyFile src=&quot;logo.gif&quot; srcContext=&quot;transform&quot; target=&quot;myproject/logo.gif&quot; binary=&quot;true&quot;/&gt;<br><br>
+
+ &lt;%-- copy a workspace file from yourProject to myProject --%gt;<br>
+ &lt;ws:copyFile src=&quot;yourProject/plugin.xml&quot; srcContext="workspace" target=&quot;myproject/plugin.xml&quot; /&gt;<br>
+
<!-- End copyFile example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/fileTag.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/fileTag.html
index 32e1d25..212c417 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/fileTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/fileTag.html
@@ -38,7 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -84,8 +82,14 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin file example -->
-
- &lt;ws:file path=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot;/&gt;<br>
+ &lt;%-- write a file about.html to myProject after evaluating template about.html.jet--%&gt;<br>
+ &lt;ws:file path=&quot;myProject/about.html&quot; template=&quot;templates/about.html.jet&quot;/&gt;<br><br>
+
+ &lt;%-- alternative way of doing the about--%&gt;<br>
+ &lt;ws:project name="myProject"&gt;<br>
+ &nbsp;&nbsp;&lt;ws:file path=&quot;about.html&quot; template=&quot;templates/about.html.jet&quot;/&gt;<br>
+ &nbsp;&nbsp;<i>... other ws:file tags writing to the same project ...</i><br>
+ &lt;/ws:project&gt;<br>
<!-- End file example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/folderTag.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/folderTag.html
index cfb7abf..ba717f6 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/folderTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/folderTag.html
@@ -42,7 +42,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,6 @@
</TR>
</TBODY>
</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -64,9 +62,11 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin folder example -->
-
- &lt;ws:folder path=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;%-- Create a folder src in myProjet--%&gt;<br>
+ &lt;ws:folder path=&quot;myProject/src&quot;/&gt;<br><br>
+ &lt;%-- Create a folder src in myProjet, with nested actions--%&gt;<br>
+ &lt;ws:folder path=&quot;myProject/src&quot;/&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>... nested ws:folder and ws:file tags are relative to myProject/src ...</I><BR>
&lt;/ws:folder&gt;
<!-- End folder example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html
index 6ebbb7a..dcbbac0 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html
@@ -25,17 +25,10 @@
<TR>
<TH colspan="2" align="left">Tag Summary</TH></TR>
<TR>
- <TD width="10%"><A href="projectTag.html">&lt;ws:project&gt;</A></TD>
- <TD><!-- Begin project description -->
- <P> Ensure the existence of an Eclipse Project of a given name
- <!-- End project description -->
- </TD>
- </TR>
- <TR>
- <TD width="10%"><A href="folderTag.html">&lt;ws:folder&gt;</A></TD>
- <TD><!-- Begin folder description -->
- <P> Ensure the existence on an Eclipse Workspace Folder
- <!-- End folder description -->
+ <TD width="10%"><A href="copyFileTag.html">&lt;ws:copyFile&gt;</A></TD>
+ <TD><!-- Begin copyFile description -->
+ <P> Copy the file refered to by 'url' to the location refered to by 'path'
+ <!-- End copyFile description -->
</TD>
</TR>
<TR>
@@ -46,10 +39,17 @@
</TD>
</TR>
<TR>
- <TD width="10%"><A href="copyFileTag.html">&lt;ws:copyFile&gt;</A></TD>
- <TD><!-- Begin copyFile description -->
- <P> Copy the file refered to by 'url' to the location refered to by 'path'
- <!-- End copyFile description -->
+ <TD width="10%"><A href="folderTag.html">&lt;ws:folder&gt;</A></TD>
+ <TD><!-- Begin folder description -->
+ <P> Ensure the existence on an Eclipse Workspace Folder
+ <!-- End folder description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="projectTag.html">&lt;ws:project&gt;</A></TD>
+ <TD><!-- Begin project description -->
+ <P> Ensure the existence of an Eclipse Project of a given name
+ <!-- End project description -->
</TD>
</TR>
<TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/projectTag.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/projectTag.html
index f6143bf..af3b84b 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/projectTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/projectTag.html
@@ -35,14 +35,13 @@
<TR>
<TD width="10%">full tag</TD>
<TD><SPAN style="font-family: monospace">
- &lt;ws:project name=&quot;<I>value</I>&quot;&gt;<br>
+ &lt;ws:project name=&quot;<I>value</I>&quot; location=&quot;<I>value</I>&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
&lt;/ws:project&gt;
</SPAN></TD>
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -54,7 +53,18 @@
</TR>
</TBODY>
</TABLE>
-</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">location</TD>
+ <TD><BR> An optional absolute file-system location for the new project. If not specified, the project is created in a directory under the workspace directory.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -64,10 +74,12 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin project example -->
-
- &lt;ws:project name=&quot;<I>value</I>&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/ws:project&gt;
+ &lt;%-- Create project myProjet (or ensure it exists) --%&gt;<br>
+ &lt;ws:project name=&quot;myProject&quot;/&gt;<br><br>
+ &lt;%-- Create project myProjet (or ensure it exists), with nested actions--%&gt;<br>
+ &lt;ws:project name=&quot;myProject&quot;/&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>... nested ws:folder and ws:file tags are relative to myProject ...</I><BR>
+ &lt;/ws:folder&gt;
<!-- End project example -->
</SPAN></TD>
</TR>
diff --git a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/rebuildWorkspaceTag.html b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/rebuildWorkspaceTag.html
index 61093e9..030d00a 100644
--- a/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/rebuildWorkspaceTag.html
+++ b/doc/org.eclipse.jet.doc/references/taglibs/workspaceTags/rebuildWorkspaceTag.html
@@ -38,15 +38,6 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
- </TBODY>
-</TABLE>
-</exists>
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -56,7 +47,8 @@
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
<!-- Begin rebuildWorkspace example -->
-
+ &lt;%-- Broadcast change events for Eclipse workspace changes already made,
+ allowing Eclipse to build before to continuing --%&gt;
&lt;ws:rebuildWorkspace/&gt;<br>
<!-- End rebuildWorkspace example -->
</SPAN></TD>
diff --git a/doc/org.eclipse.jet.doc/references/xpath/predefinedVariables.xhtml b/doc/org.eclipse.jet.doc/references/xpath/predefinedVariables.xhtml
new file mode 100644
index 0000000..919ccf5
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/xpath/predefinedVariables.xhtml
@@ -0,0 +1,162 @@
+<?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>Predefined XPath Variables</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Predefined XPath Variables</h2>
+
+ <p>When a JET transformation loads a model from an Eclipse
+ resource, the following XPath variables are set.</p>
+
+ <table border="1">
+
+ <tr>
+
+ <th>Variable</th>
+
+ <th>Contents</th>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.name</td>
+
+ <td>the name of the loaded resource</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.type</td>
+
+ <td>the resource type (file, folder, project)</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.location</td>
+
+ <td>the resource location (absolute file system path)</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.rawLocation</td>
+
+ <td>the resource raw location. See
+ <a href="PLUGINS_ROOT/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/resources/IResource.html#getRawLocation()">
+ IResource.getRawLocation()</a>.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.fullPath</td>
+
+ <td>the Eclipse workspace relative path of the resource.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.projectRelativePath</td>
+
+ <td>the Eclipse project relative path of the resource.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.fileExtension</td>
+
+ <td>the resource file extension</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.fileName</td>
+
+ <td>the resource file name (without path).</td>
+
+ </tr>
+
+ </table>
+
+ <p>The following variables are defined if the loaded resource is a
+ file or folder.</p>
+
+ <table border="1">
+
+ <tr>
+
+ <th>Variable</th>
+
+ <th>Contents</th>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.parent.name</td>
+
+ <td>The resource&apos;s parent name (files and folders
+ only)</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.parent.location</td>
+
+ <td>The resource&apos;s parent location (files and folders
+ only).</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.parent.rawLocation</td>
+
+ <td>the resource&apos;s parent raw location (files and folders
+ only).</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.parent.fullPath</td>
+
+ <td>the resource&apos;s parent full path (files and folders
+ only).</td>
+
+ </tr>
+
+ <tr>
+
+ <td>org.eclipse.jet.resource.parent.projectRelativePath</td>
+
+ <td>the resource&apos;s parent project relative path (files and
+ folders only).</td>
+
+ </tr>
+
+ </table>
+
+ </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..5f790d7
--- /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.emf</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 4f1cd29..89883c6 100644
--- a/doc/org.eclipse.jet.doc/toc.xml
+++ b/doc/org.eclipse.jet.doc/toc.xml
@@ -1,32 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
-<toc label="JET Developer Guide">
+<toc label="EMFT JET Developer Guide">
<topic label="What's New">
<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="Additional XPath Functions" href="references/xpathFunctions/overview.html"/>
+ <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>
+ <topic label="Ant Tasks Provided by JET" href="references/ant/antTasks.xhtml"/>
+ <topic label="Predefine XPath Variables" href="references/xpath/predefinedVariables.xhtml"/>
+ <link toc="topics_Reference.xml"/>
+ <anchor id="reference"/>
+
</topic>
<topic label="Legal" href="notices.html"/>
</toc>
diff --git a/doc/org.eclipse.jet.doc/toccontrolTags.xml b/doc/org.eclipse.jet.doc/toccontrolTags.xml
index 40cc2de..71a66e2 100644
--- a/doc/org.eclipse.jet.doc/toccontrolTags.xml
+++ b/doc/org.eclipse.jet.doc/toccontrolTags.xml
@@ -3,33 +3,32 @@
<toc label="Standard JET2 Control Tags" link_to="toc.xml#tagReference">
<topic label="Standard JET2 Control Tags" href="references/taglibs/controlTags/overview.html" >
- <topic label="c:iterate" href="references/taglibs/controlTags/iterateTag.html"/>
- <topic label="c:if" href="references/taglibs/controlTags/ifTag.html"/>
- <topic label="c:get" href="references/taglibs/controlTags/getTag.html"/>
- <topic label="c:choose" href="references/taglibs/controlTags/chooseTag.html"/>
- <topic label="c:case" href="references/taglibs/controlTags/caseTag.html"/>
- <topic label="c:otherwise" href="references/taglibs/controlTags/otherwiseTag.html"/>
- <topic label="c:visitor" href="references/taglibs/controlTags/visitorTag.html"/>
- <topic label="c:visit" href="references/taglibs/controlTags/visitTag.html"/>
- <topic label="c:userRegion" href="references/taglibs/controlTags/userRegionTag.html"/>
- <topic label="c:include" href="references/taglibs/controlTags/includeTag.html"/>
- <topic label="c:log" href="references/taglibs/controlTags/logTag.html"/>
- <topic label="c:initialCode" href="references/taglibs/controlTags/initialCodeTag.html"/>
- <topic label="c:setVariable" href="references/taglibs/controlTags/setVariableTag.html"/>
<topic label="c:addElement" href="references/taglibs/controlTags/addElementTag.html"/>
<topic label="c:addTextElement" href="references/taglibs/controlTags/addTextElementTag.html"/>
- <topic label="c:removeElement" href="references/taglibs/controlTags/removeElementTag.html"/>
+ <topic label="c:case" href="references/taglibs/controlTags/caseTag.html"/>
+ <topic label="c:choose" href="references/taglibs/controlTags/chooseTag.html"/>
<topic label="c:copyElement" href="references/taglibs/controlTags/copyElementTag.html"/>
+ <topic label="c:dump" href="references/taglibs/controlTags/dumpTag.html"/>
+ <topic label="c:get" href="references/taglibs/controlTags/getTag.html"/>
+ <topic label="c:if" href="references/taglibs/controlTags/ifTag.html"/>
+ <topic label="c:include" href="references/taglibs/controlTags/includeTag.html"/>
+ <topic label="c:initialCode" href="references/taglibs/controlTags/initialCodeTag.html"/>
+ <topic label="c:invokeTransform" href="references/taglibs/controlTags/invokeTransformTag.html"/>
+ <topic label="c:iterate" href="references/taglibs/controlTags/iterateTag.html"/>
<topic label="c:load" href="references/taglibs/controlTags/loadTag.html"/>
- <topic label="c:when" href="references/taglibs/controlTags/whenTag.html"/>
- <topic label="c:set" href="references/taglibs/controlTags/setTag.html"/>
+ <topic label="c:loadContent" href="references/taglibs/controlTags/loadContentTag.html"/>
+ <topic label="c:log" href="references/taglibs/controlTags/logTag.html"/>
<topic label="c:marker" href="references/taglibs/controlTags/markerTag.html"/>
+ <topic label="c:otherwise" href="references/taglibs/controlTags/otherwiseTag.html"/>
<topic label="c:override" href="references/taglibs/controlTags/overrideTag.html"/>
- <topic label="c:invokeTransform" href="references/taglibs/controlTags/invokeTransformTag.html"/>
- <topic label="c:dump" href="references/taglibs/controlTags/dumpTag.html"/>
- <topic label="c:loadContent" href="references/taglibs/controlTags/loadContentTag.html"/>
- <topic label="c:nodeAttributes" href="references/taglibs/controlTags/nodeAttributesTag.html"/>
+ <topic label="c:removeElement" href="references/taglibs/controlTags/removeElementTag.html"/>
<topic label="c:replaceStrings" href="references/taglibs/controlTags/replaceStringsTag.html"/>
+ <topic label="c:set" href="references/taglibs/controlTags/setTag.html"/>
+ <topic label="c:setVariable" href="references/taglibs/controlTags/setVariableTag.html"/>
<topic label="c:stringTokens" href="references/taglibs/controlTags/stringTokensTag.html"/>
+ <topic label="c:userRegion" href="references/taglibs/controlTags/userRegionTag.html"/>
+ <topic label="c:visit" href="references/taglibs/controlTags/visitTag.html"/>
+ <topic label="c:visitor" href="references/taglibs/controlTags/visitorTag.html"/>
+ <topic label="c:when" href="references/taglibs/controlTags/whenTag.html"/>
</topic>
</toc>
diff --git a/doc/org.eclipse.jet.doc/tocformatTags.xml b/doc/org.eclipse.jet.doc/tocformatTags.xml
index c793e45..0e70708 100644
--- a/doc/org.eclipse.jet.doc/tocformatTags.xml
+++ b/doc/org.eclipse.jet.doc/tocformatTags.xml
@@ -3,12 +3,12 @@
<toc label="Standard JET2 Format Tags" link_to="toc.xml#tagReference">
<topic label="Standard JET2 Format Tags" href="references/taglibs/formatTags/overview.html" >
+ <topic label="f:formatNow" href="references/taglibs/formatTags/formatNowTag.html"/>
+ <topic label="f:lc" href="references/taglibs/formatTags/lcTag.html"/>
+ <topic label="f:milliseconds" href="references/taglibs/formatTags/millisecondsTag.html"/>
<topic label="f:replaceAll" href="references/taglibs/formatTags/replaceAllTag.html"/>
<topic label="f:strip" href="references/taglibs/formatTags/stripTag.html"/>
<topic label="f:uc" href="references/taglibs/formatTags/ucTag.html"/>
- <topic label="f:lc" href="references/taglibs/formatTags/lcTag.html"/>
- <topic label="f:formatNow" href="references/taglibs/formatTags/formatNowTag.html"/>
- <topic label="f:milliseconds" href="references/taglibs/formatTags/millisecondsTag.html"/>
<topic label="f:unique" href="references/taglibs/formatTags/uniqueTag.html"/>
<topic label="f:uuid" href="references/taglibs/formatTags/uuidTag.html"/>
</topic>
diff --git a/doc/org.eclipse.jet.doc/tocjavaTags.xml b/doc/org.eclipse.jet.doc/tocjavaTags.xml
index 00a0944..902a614 100644
--- a/doc/org.eclipse.jet.doc/tocjavaTags.xml
+++ b/doc/org.eclipse.jet.doc/tocjavaTags.xml
@@ -3,12 +3,12 @@
<toc label="Standard JET2 Java Tags" link_to="toc.xml#tagReference">
<topic label="Standard JET2 Java Tags" href="references/taglibs/javaTags/overview.html" >
- <topic label="java:importsLocation" href="references/taglibs/javaTags/importsLocationTag.html"/>
+ <topic label="java:class" href="references/taglibs/javaTags/classTag.html"/>
<topic label="java:impliedImport" href="references/taglibs/javaTags/impliedImportTag.html"/>
<topic label="java:import" href="references/taglibs/javaTags/importTag.html"/>
+ <topic label="java:importsLocation" href="references/taglibs/javaTags/importsLocationTag.html"/>
+ <topic label="java:merge" href="references/taglibs/javaTags/mergeTag.html"/>
<topic label="java:package" href="references/taglibs/javaTags/packageTag.html"/>
<topic label="java:resource" href="references/taglibs/javaTags/resourceTag.html"/>
- <topic label="java:class" href="references/taglibs/javaTags/classTag.html"/>
- <topic label="java:merge" href="references/taglibs/javaTags/mergeTag.html"/>
</topic>
</toc>
diff --git a/doc/org.eclipse.jet.doc/tocworkspaceTags.xml b/doc/org.eclipse.jet.doc/tocworkspaceTags.xml
index 811e550..1691272 100644
--- a/doc/org.eclipse.jet.doc/tocworkspaceTags.xml
+++ b/doc/org.eclipse.jet.doc/tocworkspaceTags.xml
@@ -3,10 +3,10 @@
<toc label="Standard JET2 Workspace Tags" link_to="toc.xml#tagReference">
<topic label="Standard JET2 Workspace Tags" href="references/taglibs/workspaceTags/overview.html" >
- <topic label="ws:project" href="references/taglibs/workspaceTags/projectTag.html"/>
- <topic label="ws:folder" href="references/taglibs/workspaceTags/folderTag.html"/>
- <topic label="ws:file" href="references/taglibs/workspaceTags/fileTag.html"/>
<topic label="ws:copyFile" href="references/taglibs/workspaceTags/copyFileTag.html"/>
+ <topic label="ws:file" href="references/taglibs/workspaceTags/fileTag.html"/>
+ <topic label="ws:folder" href="references/taglibs/workspaceTags/folderTag.html"/>
+ <topic label="ws:project" href="references/taglibs/workspaceTags/projectTag.html"/>
<topic label="ws:rebuildWorkspace" href="references/taglibs/workspaceTags/rebuildWorkspaceTag.html"/>
</topic>
</toc>
diff --git a/examples/org.eclipse.jet.examples-feature/feature.properties b/examples/org.eclipse.jet.examples-feature/feature.properties
index 68cd72a..8331e56 100644
--- a/examples/org.eclipse.jet.examples-feature/feature.properties
+++ b/examples/org.eclipse.jet.examples-feature/feature.properties
@@ -1,7 +1,7 @@
# /**
# * <copyright>
# *
-# * Copyright (c) 2004-2005 IBM Corporation and others.
+# * Copyright (c) 2004, 2005 IBM Corporation and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
diff --git a/examples/org.eclipse.jet.examples-feature/feature.xml b/examples/org.eclipse.jet.examples-feature/feature.xml
index c3fd138..17331c1 100644
--- a/examples/org.eclipse.jet.examples-feature/feature.xml
+++ b/examples/org.eclipse.jet.examples-feature/feature.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ */
+-->
<feature
id="org.eclipse.jet.examples"
label="%featureName"
@@ -22,7 +38,7 @@
</url>
<requires>
- <import plugin="org.eclipse.jet"/>
+ <import plugin="org.eclipse.jet" version="0.7.0" match="compatible"/>
</requires>
<plugin
diff --git a/examples/org.eclipse.jet.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.jet.examples/META-INF/MANIFEST.MF
index 4e556fa..7e7b944 100644
--- a/examples/org.eclipse.jet.examples/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.jet.examples/META-INF/MANIFEST.MF
@@ -6,5 +6,5 @@ Bundle-Version: 0.7.100.qualifier
Bundle-ClassPath: examples.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jet
+Require-Bundle: org.eclipse.jet;bundle-version="[0.7.0,1.0.0)"
Eclipse-LazyStart: true
diff --git a/examples/org.eclipse.jet.examples/plugin.properties b/examples/org.eclipse.jet.examples/plugin.properties
index 5eb8632..34d9f57 100644
--- a/examples/org.eclipse.jet.examples/plugin.properties
+++ b/examples/org.eclipse.jet.examples/plugin.properties
@@ -1,7 +1,7 @@
# /**
# * <copyright>
# *
-# * Copyright (c) 2004-2005 IBM Corporation and others.
+# * Copyright (c) 2004, 2005 IBM Corporation and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
diff --git a/examples/org.eclipse.jet.examples/plugin.xml b/examples/org.eclipse.jet.examples/plugin.xml
index 44d7f2b..d4e820c 100644
--- a/examples/org.eclipse.jet.examples/plugin.xml
+++ b/examples/org.eclipse.jet.examples/plugin.xml
@@ -5,7 +5,7 @@
/**
* <copyright>
*
- * Copyright (c) 2004-2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet-feature/feature.xml b/plugins/org.eclipse.jet-feature/feature.xml
index 9ee0e85..88cb14f 100644
--- a/plugins/org.eclipse.jet-feature/feature.xml
+++ b/plugins/org.eclipse.jet-feature/feature.xml
@@ -22,20 +22,22 @@
</url>
<requires>
- <import plugin="org.eclipse.ant.core"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.emf.codegen"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.emf.ecore.xmi"/>
- <import plugin="org.eclipse.text"/>
- <import plugin="org.eclipse.core.expressions"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.jdt.core"/>
+ <import plugin="org.eclipse.ant.core" version="3.1.100" match="compatible"/>
+ <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.debug.core" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.codegen" version="2.2.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.common" version="2.2.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.ecore.xmi" version="2.2.0" match="compatible"/>
+ <import plugin="org.eclipse.text" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.core.filebuffers" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.jdt.core" version="3.2.0" match="compatible"/>
+ <import plugin="org.apache.ant" version="1.6.5" match="compatible"/>
+ <import plugin="org.eclipse.debug.ui" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/>
</requires>
<plugin
diff --git a/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.properties b/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.properties
index d86b82e..ec042e2 100644
--- a/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.properties
+++ b/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.properties
@@ -1,7 +1,7 @@
# /**
# * <copyright>
# *
-# * Copyright (c) 2004-2005 IBM Corporation and others.
+# * Copyright (c) 2004, 2005 IBM Corporation and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.xml b/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.xml
index c12b52f..1b5910f 100644
--- a/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.xml
+++ b/plugins/org.eclipse.jet-feature/org.eclipse.jet.sdk/feature.xml
@@ -23,23 +23,19 @@
<includes
id="org.eclipse.jet.source"
- version="0.0.0"
- match="compatible"/>
+ version="0.0.0"/>
<includes
id="org.eclipse.jet"
- version="0.0.0"
- match="compatible"/>
+ version="0.0.0"/>
<includes
id="org.eclipse.jet.doc"
- version="0.0.0"
- match="compatible"/>
+ version="0.0.0"/>
<includes
id="org.eclipse.jet.examples"
- version="0.0.0"
- match="compatible"/>
+ version="0.0.0"/>
<requires>
<import plugin="org.eclipse.emf.edit"/>
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java
new file mode 100644
index 0000000..2fe324c
--- /dev/null
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java
@@ -0,0 +1,311 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.ui.launch;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.ui.l10n.Messages;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
+import org.eclipse.jet.transform.JETLaunchConstants;
+import org.eclipse.jet.ui.Activator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+public class JETLaunchHelper {
+
+ private static ILaunchConfigurationType jetLaunchType = getConfigurationType();
+ /**
+ * @param resource
+ * @param mode
+ */
+ public static ILaunchConfiguration createConfig(String id,
+ IResource resource) {
+ try {
+ final ILaunchConfigurationWorkingCopy wConfig = jetLaunchType
+ .newInstance(null, generateLaunchName(id, resource,
+ Messages.LaunchShortcut_DefaultLaunchName));
+ wConfig.setAttribute(JETLaunchConstants.ID, id);
+ wConfig.setAttribute(JETLaunchConstants.SOURCE,
+ resource != null
+ ? resource.getFullPath().toString()
+ : ""); //$NON-NLS-1$
+ final ILaunchConfiguration config = wConfig.doSave();
+ return config;
+ } catch (CoreException e) {
+ throw convertToRuntimeException(e);
+ }
+ }
+
+ public static void findAndLaunchForTransformAndResource(Shell shell, String mode, String transformId, IResource resource) {
+ ILaunchConfiguration[] configs = findConfigsForTransformAndResource(mode, transformId, resource);
+ ILaunchConfiguration configToLaunch;
+ switch(configs.length) {
+ case 0:
+ configToLaunch = createConfig(transformId, resource);
+ break;
+ case 1:
+ configToLaunch = configs[0];
+ break;
+ default:
+ configToLaunch = chooseExistingConfig(shell, configs);
+ break;
+ }
+ if(configToLaunch != null) {
+ DebugUITools.launch(configToLaunch, mode);
+ }
+ }
+
+ public static boolean findAndLaunchForTransform(Shell shell, String mode, String transformId, boolean showConfigFirst) {
+ ILaunchConfiguration[] configs = findConfigsForTransform(transformId);
+ ILaunchConfiguration configToLaunch = null;
+ switch(configs.length) {
+ case 0:
+ IResource resource = chooseResource(shell);
+ if(resource != null) {
+ configToLaunch = createConfig(transformId, resource);
+ }
+ break;
+ case 1:
+ configToLaunch = configs[0];
+ break;
+ default:
+ configToLaunch = chooseExistingConfig(shell, configs);
+ break;
+ }
+ if(configToLaunch != null) {
+ boolean doLaunch = true;
+ if(showConfigFirst) {
+ int dialogResult = DebugUITools.openLaunchConfigurationDialog(shell, configToLaunch,
+ IDebugUIConstants.ID_RUN_LAUNCH_GROUP, null);
+ doLaunch = dialogResult != Window.CANCEL;
+ }
+ if(doLaunch) {
+ DebugUITools.launch(configToLaunch, mode);
+ }
+ }
+ return configToLaunch != null;
+ }
+
+ private static IResource chooseResource(Shell shell) {
+ IResource resource = null;
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
+ shell, new WorkbenchLabelProvider(),
+ new WorkbenchContentProvider());
+
+ dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ dialog.setAllowMultiple(false);
+ dialog.setTitle(Messages.JETTransformMainTab_SelectResourceDialogTitle);
+ dialog.setMessage(Messages.JETTransformMainTab_SelectResourceDialogTitle);
+ dialog.setValidator(new ISelectionStatusValidator() {
+ public IStatus validate(Object[] selection) {
+ if (selection.length > 0) {
+ return new Status(IStatus.OK, Activator.getDefault()
+ .getBundle().getSymbolicName(), IStatus.OK,
+ "", null); //$NON-NLS-1$
+ }
+
+ return new Status(IStatus.ERROR, Activator.getDefault()
+ .getBundle().getSymbolicName(), IStatus.ERROR, "", null); //$NON-NLS-1$
+ }
+ });
+ if (dialog.open() == ElementTreeSelectionDialog.OK) {
+ resource = (IResource) dialog.getFirstResult();
+ }
+ return resource;
+ }
+
+ public static boolean findAndLauchForResource(Shell shell, String mode, IResource resource) {
+ ILaunchConfiguration[] configs = findConfigsForResource(mode, resource);
+ ILaunchConfiguration configToLaunch = null;
+ switch(configs.length) {
+ case 0:
+// MessageDialog.openError(shell, "Run JET Transform", "No JET transforms found.");
+ IJETBundleDescriptor jetBundleDesc = JET2Platform.getProjectDescription(resource.getProject().getName());
+ if(jetBundleDesc != null) {
+ configToLaunch = createConfig(jetBundleDesc.getId(), resource);
+ } else {
+ configToLaunch = createConfig("", resource); //$NON-NLS-1$
+ if(configToLaunch != null) {
+ int dialogResult = DebugUITools.openLaunchConfigurationPropertiesDialog(shell, configToLaunch,
+ IDebugUIConstants.ID_RUN_LAUNCH_GROUP, null);
+ if(dialogResult == Window.CANCEL) {
+ try {
+ configToLaunch.delete();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ configToLaunch = null;
+ } else {
+ configs = findConfigsForResource(mode, resource);
+ configToLaunch = configs.length > 0 ? configs[0] : null;
+ }
+ }
+ }
+ break;
+ case 1:
+ configToLaunch = configs[0];
+ break;
+ default:
+ configToLaunch = chooseExistingConfig(shell, configs);
+ break;
+ }
+ if(configToLaunch != null) {
+ DebugUITools.launch(configToLaunch, mode);
+ }
+ return configToLaunch != null;
+ }
+
+ private static ILaunchConfiguration chooseExistingConfig(Shell shell,
+ ILaunchConfiguration[] configs) {
+ ILabelProvider labelProvider = new LabelProvider() {
+
+ public String getText(Object element) {
+ return ((ILaunchConfiguration)element).getName();
+ } };
+
+ ElementListSelectionDialog dlg = new ElementListSelectionDialog(shell, labelProvider);
+ dlg.setElements(configs);
+ dlg.setTitle(Messages.LaunchShortcut_DefaultLaunchName);
+ dlg.setMessage(Messages.LaunchShortcut_DefaultLaunchName);
+ dlg.setMultipleSelection(false);
+ int result = dlg.open();
+ labelProvider.dispose();
+ if (result == Window.OK) {
+ return (ILaunchConfiguration) dlg.getFirstResult();
+ }
+ return null;
+ }
+
+ public static ILaunchConfiguration[] findConfigsForResource(String mode, IResource resource) {
+ final List finds = new ArrayList();
+ final ILaunchConfiguration[] configs = getJETLaunchConfigs();
+ final IPath fullPath = resource.getFullPath().makeRelative();
+ for (int i = 0; i < configs.length; i++) {
+ if(fullPath.equals(new Path(getSource(configs[i])).makeRelative())){
+ finds.add(configs[i]);
+ }
+ }
+ return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
+ }
+
+ public static ILaunchConfiguration[] findConfigsForTransformAndResource(String mode, String transformId, IResource resource) {
+ final List finds = new ArrayList();
+ final ILaunchConfiguration[] configs = getJETLaunchConfigs();
+ final String fullPath = resource.getFullPath().toString();
+ for (int i = 0; i < configs.length; i++) {
+ if(fullPath.equals(getSource(configs[i]))
+ && transformId.equals(getTransformID(configs[i]))){
+ finds.add(configs[i]);
+ }
+ }
+
+ return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
+ }
+
+ public static ILaunchConfiguration[] findConfigsForTransform(String transformId) {
+ final ILaunchConfiguration[] configs = getJETLaunchConfigs();
+ List finds = new ArrayList();
+ for (int i = 0; i < configs.length; i++) {
+ if(transformId.equals(getTransformID(configs[i]))){
+ finds.add(configs[i]);
+ }
+ }
+ return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
+ }
+
+
+ private static String getSource(ILaunchConfiguration config) {
+ try {
+ return config.getAttribute(JETLaunchConstants.SOURCE, (String)null);
+ } catch (CoreException e) {
+ throw convertToRuntimeException(e);
+ }
+ }
+
+ private static String getTransformID(ILaunchConfiguration config) {
+ try {
+ return config.getAttribute(JETLaunchConstants.ID, (String)null);
+ } catch (CoreException e) {
+ throw convertToRuntimeException(e);
+ }
+ }
+
+ private static RuntimeException convertToRuntimeException(CoreException e) {
+ return new RuntimeException("Unexpected exception", e); //$NON-NLS-1$
+ }
+
+ private static ILaunchConfiguration[] getJETLaunchConfigs() {
+ try {
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ return lm.getLaunchConfigurations(jetLaunchType);
+ } catch (CoreException e) {
+ throw convertToRuntimeException(e);
+ }
+ }
+
+ private static ILaunchConfigurationType getConfigurationType() {
+ ILaunchManager lm= DebugPlugin.getDefault().getLaunchManager();
+ return lm.getLaunchConfigurationType(JETLaunchConstants.CONFIG_ID);
+ }
+
+ public static String generateLaunchName(String id, IResource input, String defaultName)
+ {
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ String prefix;
+ if (id == null && input == null) {
+ prefix = defaultName;
+ } else if(input == null) {
+ prefix = id;
+ } else if(id == null)
+ {
+ prefix = input.getName();
+ } else {
+ prefix = id + " (" + input.getName() + ")"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ return lm.generateUniqueLaunchConfigurationNameFrom(prefix);
+ }
+
+ public static ILaunchConfiguration[] findAllConfigs() {
+ return getJETLaunchConfigs();
+ }
+
+}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
index 83649f7..4d38ae7 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
@@ -23,6 +23,8 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -52,9 +54,13 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ResourceSelectionDialog;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* Main tab for JET Launch Configuraitons
@@ -231,22 +237,42 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
workspaceLocationButton= createPushButton(buttonComposite, Messages.JETTransformMainTab_BrowseButtonLabel, null);
workspaceLocationButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- ResourceSelectionDialog dialog;
- dialog = new ResourceSelectionDialog(getShell(),
- ResourcesPlugin.getWorkspace().getRoot(),
- Messages.JETTransformMainTab_SelectResourceDialogTitle);
- dialog.open();
- Object[] results = dialog.getResult();
- if (results == null || results.length < 1) {
- return;
+
+ IResource resource = chooseResource(getShell());
+ if(resource != null) {
+ sourceField.setText(resource.getFullPath().makeRelative().toString());
}
- IResource resource = (IResource)results[0];
- sourceField.setText(resource.getFullPath().makeRelative().toString());
}
});
}
-
+
+ private static IResource chooseResource(Shell shell) {
+ IResource resource = null;
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
+ shell, new WorkbenchLabelProvider(),
+ new WorkbenchContentProvider());
+
+ dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ dialog.setAllowMultiple(false);
+ dialog.setTitle(Messages.JETTransformMainTab_SelectResourceDialogTitle);
+ dialog.setMessage(Messages.JETTransformMainTab_SelectResourceDialogTitle);
+ dialog.setValidator(new ISelectionStatusValidator() {
+ public IStatus validate(Object[] selection) {
+ if (selection.length > 0)
+ return new Status(IStatus.OK, Activator.getDefault().getBundle().getSymbolicName(),
+ IStatus.OK, "", null); //$NON-NLS-1$
+
+ return new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(),
+ IStatus.ERROR, "", null); //$NON-NLS-1$
+ }
+ });
+ if (dialog.open() == ElementTreeSelectionDialog.OK) {
+ resource = (IResource) dialog.getFirstResult();
+ }
+ return resource;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
index 8673cc4..7c0cd0c 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
@@ -18,21 +18,13 @@
package org.eclipse.jet.internal.ui.launch;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jet.JET2Platform;
import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.JETLaunchConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
/**
* Launch shortcut for launching JET transforms on an XML document.
@@ -57,74 +49,22 @@ public class LaunchShortcut implements ILaunchShortcut {
return;
}
IResource resource = (IResource) ((IStructuredSelection)selection).getFirstElement();
- findAndLaunch(resource, mode);
+ JETLaunchHelper.findAndLauchForResource(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ ILaunchManager.RUN_MODE, resource);
}
- /**
- * @param resource
- * @param mode
- */
- private void findAndLaunch(IResource resource, String mode) {
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- try {
- final ILaunchConfigurationType configurationType = getConfigurationType();
- final ILaunchConfiguration[] configs = lm.getLaunchConfigurations(configurationType);
- for (int i = 0; i < configs.length; i++) {
- if(resource.getFullPath().toString().equals(configs[i].getAttribute(JETLaunchConstants.SOURCE, (String)null))){
- DebugUITools.launch(configs[i], mode);
- return;
- }
- }
-
- String id = ""; //$NON-NLS-1$
- final IJETBundleDescriptor descriptor = JET2Platform.getProjectDescription(resource.getProject().getName());
- if(descriptor != null) {
- id = descriptor.getId();
- }
-
- final ILaunchConfigurationWorkingCopy wConfig = configurationType
- .newInstance(null, generateLaunchName(id, resource));
- wConfig.setAttribute(JETLaunchConstants.ID, id);
- wConfig.setAttribute(JETLaunchConstants.SOURCE, resource.getFullPath().toString());
- final ILaunchConfiguration config = wConfig.doSave();
- DebugUITools.launch(config, mode);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- private ILaunchConfigurationType getConfigurationType() {
- ILaunchManager lm= DebugPlugin.getDefault().getLaunchManager();
- return lm.getLaunchConfigurationType(JETLaunchConstants.CONFIG_ID);
- }
-
-
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
*/
public void launch(IEditorPart editor, String mode) {
- // TODO Auto-generated method stub
final IResource resource = (IResource) editor.getEditorInput().getAdapter(IResource.class);
- findAndLaunch(resource, mode);
+ JETLaunchHelper.findAndLauchForResource(editor.getSite().getShell(), ILaunchManager.RUN_MODE, resource);
+// findAndLaunch(resource, mode);
}
public static String generateLaunchName(String id, IResource input)
{
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- String prefix;
- if (id == null && input == null) {
- prefix = Messages.LaunchShortcut_DefaultLaunchName;
- } else if(input == null) {
- prefix = id;
- } else if(id == null)
- {
- prefix = input.getName();
- } else {
- prefix = id + " (" + input.getName() + ")"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- return lm.generateUniqueLaunchConfigurationNameFrom(prefix);
+ return JETLaunchHelper.generateLaunchName(id, input, Messages.LaunchShortcut_DefaultLaunchName);
}
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
index e87f3ae..6c95a44 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
@@ -31,6 +31,7 @@ public class NewProjectInfo {
private Map otherInfo = null;
private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
private static final String INDENT = " "; //$NON-NLS-1$
+ private String location = null;
public NewProjectInfo() {
// nothing to do
@@ -57,7 +58,10 @@ public class NewProjectInfo {
}
StringBuffer xml = new StringBuffer();
xml.append("<newProjectModel>").append(NL); //$NON-NLS-1$
- xml.append(INDENT).append("<project name=\"" + projectName + "\"/>").append(NL); //$NON-NLS-1$ //$NON-NLS-2$
+ xml.append(INDENT).append("<project"); //$NON-NLS-1$
+ addAttribute(xml, "name", projectName); //$NON-NLS-1$
+ addAttribute(xml, "location", location); //$NON-NLS-1$
+ xml.append("/>").append(NL); //$NON-NLS-1$
if(otherInfo != null) {
for (Iterator i = otherInfo.values().iterator(); i.hasNext();) {
String otherElement = (String) i.next();
@@ -67,6 +71,16 @@ public class NewProjectInfo {
xml.append("</newProjectModel>").append(NL); //$NON-NLS-1$
return xml.toString();
}
+ /**
+ * @param xml
+ * @param name
+ * @param value
+ */
+ private void addAttribute(StringBuffer xml, String name, final String value) {
+ if(value != null) {
+ xml.append(' ').append(name).append("=\"").append(value).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
public void setOtherInfo(String key, String xmlContent) {
@@ -80,4 +94,7 @@ public class NewProjectInfo {
}
}
+ public void setLocation(String location) {
+ this.location = location;
+ }
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
index 6fa34de..9792d6c 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
@@ -80,6 +80,9 @@ public class NewProjectWizard extends Wizard implements INewWizard {
protected final String getBuildModel() {
newProjectInfo.setProjectName(projectPage.getProjectName());
+ if(!projectPage.useDefaults()) {
+ newProjectInfo.setLocation(projectPage.getLocationPath().toString());
+ }
return newProjectInfo.toXmlString();
}
diff --git a/plugins/org.eclipse.jet/.options b/plugins/org.eclipse.jet/.options
index a138221..98fb8c3 100644
--- a/plugins/org.eclipse.jet/.options
+++ b/plugins/org.eclipse.jet/.options
@@ -1,6 +1,7 @@
org.eclipse.jet/debug=false
org.eclipse.jet/debug/builder=false
org.eclipse.jet/debug/projectBundleLoading=false
+org.eclipse.jet/debug/additionalBundleLoading=false
org.eclipse.jet/debug/pluginBundleLoading=false
org.eclipse.jet/debug/bundleLoading=false
org.eclipse.jet/debug/traceTagExecution=false
@@ -8,4 +9,5 @@ org.eclipse.jet/debug/ext/xpathFunctions=false
org.eclipse.jet/debug/xpath/compilations=false
org.eclipse.jet/debug/savedState=false
org.eclipse.jet/debug/pluginProjectMonitor=false
+org.eclipse.jet/debug/modelLoaderExtensions=false
diff --git a/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETCompileTask.java b/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETCompileTask.java
index ecca6e8..b212396 100644
--- a/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETCompileTask.java
+++ b/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETCompileTask.java
@@ -69,6 +69,7 @@ public class JETCompileTask extends Task {
private void validate() {
if(destdir == null) throw new BuildException("destdir not set");
if(srcFilesets.size() == 0) throw new BuildException("srcdir not set");
+ if(eclipseProject == null) throw new BuildException("project not set");
if(!eclipseProject.exists()) throw new BuildException("project does not exist");
if(!eclipseProject.isOpen()) throw new BuildException("project is not open");
}
diff --git a/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETTransformTask.java b/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETTransformTask.java
index 3253ce5..048003d 100644
--- a/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETTransformTask.java
+++ b/plugins/org.eclipse.jet/antsrc/org/eclipse/jet/ant/tasks/JETTransformTask.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.l10n.JET2Messages;
/**
* Implement an ANT Task to run a JET transform.
@@ -67,6 +68,9 @@ public class JETTransformTask extends Task {
if(transformId == null) {
throw new BuildException(MessageFormat.format(missingAttrMsg, new Object[] {"transformId"})); //$NON-NLS-1$
}
+ if(JET2Platform.getJETBundleManager().getDescriptor(transformId) == null) {
+ throw new BuildException(MessageFormat.format(JET2Messages.JET2Platform_TransformNotFound, new Object[] {transformId}));
+ }
if(source == null) {
throw new BuildException(MessageFormat.format(missingAttrMsg, new Object[] {"source"})); //$NON-NLS-1$
}
@@ -83,7 +87,7 @@ public class JETTransformTask extends Task {
monitor = new NullProgressMonitor();
}
- log("Running \"" + transformId + "\" on resource \"" + resource.toString() + "\".");
+ log("Running \"" + transformId + "\" on resource \"" + resource.getFullPath().toString() + "\".");
final IStatus result = JET2Platform.runTransformOnResource(transformId, resource, monitor);
if(!result.isOK()) {
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
index f709e2e..c9f020f 100644
--- a/plugins/org.eclipse.jet/plugin.xml
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -27,11 +27,9 @@
point="org.eclipse.jet.deployedTransforms">
<deployedTransform
bundle="transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar"
- id="org.eclipse.jet.transforms.newproject"
private="true"/>
<deployedTransform
bundle="transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar"
- id="org.eclipse.jet.transforms.taglibdoc"
private="false"/>
</extension>
<extension
@@ -40,130 +38,57 @@
id="controlTags"
name="Standard JET2 Control Tags"
standardPrefix="c">
- <iteratingTag
- class="org.eclipse.jet.internal.taglib.control.IterateTag"
- name="iterate"
- whenContainingLineIsEmpty="remove">
+ <description>
+ Control flow and data management tags. This tags allow templates to evaluate conditions, perform loops and access and set information in the template input.
+ </description><emptyTag class="org.eclipse.jet.internal.taglib.control.AddElementTag" name="addElement" whenContainingLineIsEmpty="remove">
- <attribute
- name="select"
- type="xpath"
- use="required">
- <description>
- An XPath expression that returns either a node set (a collection of elements or attributes) or a number.
- </description>
- </attribute>
- <attribute
- name="var"
- type="string"
- use="required">
+
+ <description>
+ Create a new model element under the selected node.
+ </description>
+ <attribute name="select" type="xpath" use="required">
<description>
- A variable name. During each iteration, the value of the variable is an object from the set of objects selected by the &apos;select&apos; XPath expression.
+ An XPath expression identifying the parent of the new element.
</description>
</attribute>
- <description>
- Write the tag contents for each in the template input model identified by an XPath expression.
-
-If the &amp;apos;select&amp;apos; XPath expression selects no objects, then the contents of the tag are not processed. If the XPath expression is not well-formed, then an error results.
-
-If the &apos;select&apos; XPath expression returns a number, then the body of the loop is processed that number of times, and the variable named by &apos;var&apos; is set to 1 for the first iteration, and incremented by one for each successive iteration.
-
-If there is a variable in scope with the same name as the value &amp;apos;var&amp;apos; attribute, then it is hidden during the execution of this tag.
- </description>
- <attribute
- name="delimiter"
- type="string"
- use="optional">
-
+ <attribute name="name" type="string" use="required">
<description>
- A string that is written to the tag's output between iteration of the tag. The text is not written after the last iteration.
+ The name of the new element.
</description>
</attribute>
- </iteratingTag>
- <conditionalTag
- class="org.eclipse.jet.internal.taglib.control.IfTag"
- name="if"
- whenContainingLineIsEmpty="remove">
- <attribute
- name="test"
- type="xpath"
- use="required">
+ <attribute name="var" type="string" use="optional">
<description>
- An expression expression, that, if true, causes the tag contents to be evaluated.
+ A variable name that will refer to the newly created element.
</description>
</attribute>
+ </emptyTag><functionTag class="org.eclipse.jet.internal.taglib.control.AddTextElementTag" name="addTextElement">
+
+
<description>
- Process the tag contents if a test condition is satisfied.
-
-If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
-
-If the 'test' XPath expression is not well formed, then an error results.
+ Create a new model element node under the selected element, and whose text content is the content of this tag.
</description>
- <attribute
- name="var"
- type="string"
- use="optional">
+ <attribute name="select" type="xpath" use="required">
<description>
- The name of a variable that will refer to the value of the 'test' expression prior to it being converted to a boolean value'. The variable has the scope of the tag contents.
+ An XPath expression determining the parent of the new element.
</description>
</attribute>
- </conditionalTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.GetTag"
- name="get"
- whenContainingLineIsEmpty="preserve">
-
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="name" type="string" use="required">
<description>
- The XPath expression to evaluate.
+ The name of the new element.
</description>
</attribute>
- <attribute
- name="default"
- type="string"
- use="optional">
+ <attribute name="var" type="string" use="optional">
<description>
- The value to write, if the XPath expression selects no objects.
+ A variable name that will refer to the newly created element.
</description>
</attribute>
- <description>
- Write a the result of an XPath expression.
-
-If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.
- </description>
- </emptyTag>
- <containerTag
- class="org.eclipse.jet.internal.taglib.control.ChooseTag"
- name="choose"
- processContents="custom"
- whenContainingLineIsEmpty="remove">
- <description>
- Define a group of mutually exclusive choices. The contents of this tag are restricted to &apos;when&apos; and &apos;otherwise&apos; tags only.
-
-During execution of this tag, each &apos;when&apos; and &apos;otherwise&apos; tag is evaluated in sequence. If one of these tags evaluates to &apos;true&apos;, then any subsequent tags are ignored. A &apos;when&apos; tag evaluates to &apos;true&apos; if its &apos;test&apos; attribute&apos;s XPath expression evaluates to &apos;true&apos;. An &apos;otherwise&apos; tag evaluates to &apos;true&apos; if no preceeding &apos;when&apos; (or &apos;otherwise&apos;) tag has evaluated to true.
- </description>
- <attribute
- name="select"
- type="string"
- use="optional">
+ <attribute name="cdata" type="boolean" use="optional">
<description>
- Optional test expression. When specified, each 'when' tag 'test' expression is tested for equality against this value. When not specified, this is the equivalent of the XPath expression 'true()'.
+ Add the text as a CData section. Default is 'false'.
</description>
</attribute>
- </containerTag>
- <conditionalTag
- class="org.eclipse.jet.internal.taglib.control.WhenTag"
- deprecated="true"
- name="case"
- processContents="custom"
- whenContainingLineIsEmpty="remove">
- <attribute
- name="test"
- type="xpath"
- use="required">
+ </functionTag><conditionalTag class="org.eclipse.jet.internal.taglib.control.WhenTag" deprecated="true" name="case" processContents="custom" whenContainingLineIsEmpty="remove">
+ <attribute name="test" type="xpath" use="required">
<description>
An expression expression, that, if true, causes the tag contents to be evaluated.
</description>
@@ -178,81 +103,94 @@ If the &apos;test&apos; XPath expression is not well formed, then an error resul
If this tag is not directly contained by a &apos;choose&apos; tag, then an error results.
</description>
- </conditionalTag>
- <conditionalTag
- class="org.eclipse.jet.internal.taglib.control.OtherwiseTag"
- name="otherwise"
- processContents="custom"
- whenContainingLineIsEmpty="remove">
+ </conditionalTag><containerTag class="org.eclipse.jet.internal.taglib.control.ChooseTag" name="choose" processContents="custom" whenContainingLineIsEmpty="remove">
<description>
- Define a default case for a 'choose' tag. The body of this tag is processed only if no previous 'case' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
+ Define a group of mutually exclusive choices. The contents of this tag are restricted to &apos;when&apos; and &apos;otherwise&apos; tags only.
-An error occurs if the 'otherwise' is not directly contained by a 'choose' tag.
+During execution of this tag, each &apos;when&apos; and &apos;otherwise&apos; tag is evaluated in sequence. If one of these tags evaluates to &apos;true&apos;, then any subsequent tags are ignored. A &apos;when&apos; tag evaluates to &apos;true&apos; if its &apos;test&apos; attribute&apos;s XPath expression evaluates to &apos;true&apos;. An &apos;otherwise&apos; tag evaluates to &apos;true&apos; if no preceeding &apos;when&apos; (or &apos;otherwise&apos;) tag has evaluated to true.
</description>
- </conditionalTag>
- <iteratingTag
- class="org.eclipse.jet.internal.taglib.control.VisitorTag"
- name="visitor"
- whenContainingLineIsEmpty="remove">
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="select" type="string" use="optional">
+ <description>
+ Optional test expression. When specified, each 'when' tag 'test' expression is tested for equality against this value. When not specified, this is the equivalent of the XPath expression 'true()'.
+ </description>
+ </attribute>
+ </containerTag><emptyTag class="org.eclipse.jet.internal.taglib.control.CopyElementTag" name="copyElement" whenContainingLineIsEmpty="remove">
+
+ <description>
+ Copy the selected node to the selected location.
+ </description>
+ <attribute name="select" type="xpath" use="required">
+ <description>
+ An XPath expression selecting the element node to copy.
+ </description>
+ </attribute>
+ <attribute name="toSelect" type="xpath" use="required">
+ <description>
+ An XPath expression identifying the parent of the newly selected node.
+ </description>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <description>
+ The name for the newly created element.
+ </description>
+ </attribute>
+ <attribute name="recursive" type="boolean" use="optional">
+ <description>
+ Determine whether child elements of the copied element are copied, too. Default is &apos;true&apos;.
+ </description>
+ </attribute>
+ <attribute name="var" type="string" use="optional">
+ <description>
+ The name of a variable that will be set to the newly copied element.
+ </description>
+ </attribute>
+ </emptyTag><emptyTag name="dump" class="org.eclipse.jet.internal.taglib.control.DumpTag">
+ <attribute name="select" type="xpath" use="required">
+ <description>A query expression specifying a single node in the model</description>
+ </attribute>
+ <attribute name="format" type="boolean" use="optional">
+ <description>A true/false value indicating whether the tag should try to write out whitespace to cause the output to be nicely formatted and indented.</description>
+ </attribute>
+ <attribute name="entities" type="boolean" use="optional">
+ <description>A true/false value indicating whether characters that can cause XML parsing problems (left and right angle brackets, quotes, apostrophes, etc) should be written as entities (e.g. "%lt;" for the left angle bracket).</description>
+ </attribute>
+ <description>Writes out the DOM subtree under a specified model node.</description>
+ </emptyTag><emptyTag class="org.eclipse.jet.internal.taglib.control.GetTag" name="get" whenContainingLineIsEmpty="preserve">
+
+ <attribute name="select" type="xpath" use="required">
<description>
The XPath expression to evaluate.
</description>
</attribute>
- <attribute
- name="var"
- type="string"
- use="required">
+ <attribute name="default" type="string" use="optional">
<description>
- The name of a variable that will contain the current object in the iteration.
+ The value to write, if the XPath expression selects no objects.
</description>
</attribute>
<description>
- *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal. For each identified object, the tag evaluates the 'test' condition on its contained 'visit' tags. Only those tags whose test condition is true have their contents processed.
+ Write a the result of an XPath expression.
If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.
</description>
- </iteratingTag>
- <conditionalTag
- class="org.eclipse.jet.internal.taglib.control.VisitTag"
- name="visit"
- whenContainingLineIsEmpty="remove">
- <attribute
- name="test"
- type="xpath"
- use="required"/>
+ </emptyTag><conditionalTag class="org.eclipse.jet.internal.taglib.control.IfTag" name="if" whenContainingLineIsEmpty="remove">
+ <attribute name="test" type="xpath" use="required">
+ <description>
+ An expression expression, that, if true, causes the tag contents to be evaluated.
+ </description>
+ </attribute>
<description>
- Define content to process for an object found by the parent 'visitor' tag, provided a condition is met. The contents of this tag are evaluated if the current object of the 'visitor' iteration satisfies the 'test' XPath expression.
-
-The 'test' XPath expression is relative to the current object of the parent 'visitor' tag. If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
+ Process the tag contents if a test condition is satisfied.
-Note that more than one 'visit' tag may be executed for the same object identified by the parent 'visitor' tag.
- </description>
- </conditionalTag>
- <description>
- Control flow and data management tags. This tags allow templates to evaluate conditions, perform loops and access and set information in the template input.
- </description>
- <containerTag
- class="org.eclipse.jet.internal.taglib.control.UserRegionTag"
- name="userRegion"
- whenContainingLineIsEmpty="remove">
-
- <description>
- Define a region in the generated text where users may write customized code.
+If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
-The tag must contain a single &apos;initialCode&apos; tag. Content before the initialCode tag is considered a &apos;begin marker&apos;, while content after it is considered an
-&apos;end marker&apos;. During execution, the existing file is searched for the begin and end markers. If found, the content of the user region tag is replaced with
-the content found in the existing file. If the markers are not found (or the file does not exist), then the markers, along with the content of the initialCode
-tag are written.
+If the 'test' XPath expression is not well formed, then an error results.
</description>
- </containerTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.IncludeTag"
- name="include"
- whenContainingLineIsEmpty="remove">
+ <attribute name="var" type="string" use="optional">
+ <description>
+ The name of a variable that will refer to the value of the 'test' expression prior to it being converted to a boolean value'. The variable has the scope of the tag contents.
+ </description>
+ </attribute>
+ </conditionalTag><emptyTag class="org.eclipse.jet.internal.taglib.control.IncludeTag" name="include" whenContainingLineIsEmpty="remove">
<description>
Process the referenced template, and include its results in the output of the current template.
@@ -263,291 +201,276 @@ The deprecated &amp;apos;restoreNames&amp;apos; attribute is useful in recursive
The &apos;restoreNames&apos; and &apos;passVariables&apos; options are mutually exclusive.
</description>
- <attribute
- name="template"
- type="string"
- use="required">
+ <attribute name="template" type="string" use="required">
<description>
A transformation project relative path to the template to execute.
</description>
</attribute>
- <attribute
- deprecated="true"
- name="restoreNames"
- type="string"
- use="optional">
+ <attribute deprecated="true" name="restoreNames" type="string" use="optional">
<description>
A comma separated list of variable names (without the $ sign). Mutually exclusive with &apos;passVariables&apos;.
</description>
</attribute>
- <attribute
- name="passVariables"
- type="string"
- use="optional">
+ <attribute name="passVariables" type="string" use="optional">
<description>
A comma separated list of variable names (without the $ sign). Mutually exclusive with 'restoreNames'.
</description>
</attribute>
- </emptyTag>
- <functionTag
- class="org.eclipse.jet.internal.taglib.control.LogTag"
- name="log"
- whenContainingLineIsEmpty="remove">
- <description>
- Write a message to the transformation log. The contents of the tag are written to the log. Nothing is written the template output.
-
-The optional 'severity' attribute may have one of the following values: 'info', 'warning' or 'error'. The default is 'info'.
- </description>
- <attribute
- name="severity"
- type="string"
- use="optional">
+ <attribute name="super" type="boolean" use="optional">
<description>
- The message severity level. Default is 'info'.
+ If set to &apos;true&apos;, the template loader attempts to load directly from the overriden transformation (as specified by the &apos;override&apos; tag or by the &apos;overrides&apos; attribute of the &apos;transform&apos; element of the &apos;org.eclipse.jet.transform&apos; extension in the transforms plugin.xml). If no &apos;super&apos; template can be found, an error occurs. The default is &apos;false&apos;, indicating normal template loading.
</description>
</attribute>
- </functionTag>
- <containerTag
- class="org.eclipse.jet.internal.taglib.control.InitialCodeTag"
- name="initialCode"
- whenContainingLineIsEmpty="remove">
+ </emptyTag><containerTag class="org.eclipse.jet.internal.taglib.control.InitialCodeTag" name="initialCode" whenContainingLineIsEmpty="remove">
<description>
A child tag of the 'userRegion' tag containing the initial code to write. See 'userRegion' for more information.
</description>
- </containerTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.SetVariableTag"
- name="setVariable"
- whenContainingLineIsEmpty="remove">
+ <attribute name="unmodifiedMarker" type="string" use="optional">
+ <description>
+ A string that when present in the content of the existing code indicates that the code has not been modified by the user, and should be replace with the contents of this initial code block.
+ </description>
+ </attribute>
+ </containerTag><emptyTag class="org.eclipse.jet.internal.taglib.control.InvokeTransformTag" name="invokeTransform" whenContainingLineIsEmpty="remove">
<description>
- Create a variable whose value is set to the result of the provided XPath expression.
+ Invoke the another transformation, passing it the current transformation&apos;s source model and context variables. The transformation&apos;s actions will be accumulated, and commit when the invoking transformation commits.
+
+The attribute &apos;passVariables&apos; allows explicit declaration of the variables that are passed to the transformation. By default, all context variables are available. With this parameter, only those variables specified are available. In addition, any changes to passed variables are not reflected in the invoking context.
+
+The deprecated &apos;restoreNames&apos; attribute allows for the restoration of variables set by the invoked transformation back to their pre-invocation value.
+
+The &apos;restoreNames&apos; and &apos;passVariables&apos; options are mutually exclusive.
</description>
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="transformId" type="string" use="required">
<description>
- An XPath expression to creates the variable's value.
+ The transformation id of the transformation to invoke.
</description>
</attribute>
- <attribute
- name="var"
- type="string"
- use="required">
+ <attribute deprecated="true" name="restoreNames" type="string" use="optional">
<description>
- The name of the variable to set.
+ A comma separated list of variable names (without the $ sign). Mutually exclusive with 'passVariables'.
</description>
+
</attribute>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.AddElementTag"
- name="addElement"
+ <attribute name="passVariables" type="string" use="optional">
+ <description>
+ A comma separated list of variable names (without the $ sign). Mutually exclusive with 'restoreNames'.
+ </description>
+ </attribute>
+ </emptyTag><iteratingTag
+ class="org.eclipse.jet.internal.taglib.control.IterateTag"
+ name="iterate"
whenContainingLineIsEmpty="remove">
-
- <description>
- Create a new model element under the selected node.
- </description>
<attribute
name="select"
type="xpath"
use="required">
<description>
- An XPath expression identifying the parent of the new element.
+ An XPath expression that returns either a node set (a collection of elements or attributes) or a number.
</description>
</attribute>
<attribute
- name="name"
+ name="var"
type="string"
use="required">
<description>
- The name of the new element.
+ A variable name. During each iteration, the value of the variable is an object from the set of objects selected by the &apos;select&apos; XPath expression.
</description>
</attribute>
+ <description>
+ Write the tag contents for each in the template input model identified by an XPath expression.
+
+If the &amp;apos;select&amp;apos; XPath expression selects no objects, then the contents of the tag are not processed. If the XPath expression is not well-formed, then an error results.
+
+If the &apos;select&apos; XPath expression returns a number, then the body of the loop is processed that number of times, and the variable named by &apos;var&apos; is set to 1 for the first iteration, and incremented by one for each successive iteration.
+
+If there is a variable in scope with the same name as the value &amp;apos;var&amp;apos; attribute, then it is hidden during the execution of this tag.
+ </description>
<attribute
- name="var"
+ name="delimiter"
type="string"
use="optional">
+
<description>
- A variable name that will refer to the newly created element.
+ A string that is written to the tag's output between iteration of the tag. The text is not written after the last iteration.
</description>
</attribute>
- </emptyTag>
- <functionTag
- class="org.eclipse.jet.internal.taglib.control.AddTextElementTag"
- name="addTextElement">
-
-
+ </iteratingTag>
+
+
+
+
+ <emptyTag class="org.eclipse.jet.internal.taglib.control.LoadTag" name="load" whenContainingLineIsEmpty="remove">
<description>
- Create a new model element node under the selected element, and whose text content is the content of this tag.
+ Load the referenced model, and set the passed variable to the loaded document root.
+
+The optional urlContext attribute determines how relative URL in the url attribute are resolved. Predefined constants: &apos;transform&apos;, indicating that URL is relative to the root directory of the transformation; &apos;workspace&apos;, indicating the URL is relative to the current Eclipse workspace.
+
+The optional loader attribute determines which loader is used to load the model. The default loader is &apos;emf&apos;, although other loaders may have been contributed.
</description>
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="url" type="string" use="required">
<description>
- An XPath expression determining the parent of the new element.
+ The URL of the model to load. Usually, this is a relative URL, and is interpretation is controlled by the urlContext attribute.
</description>
</attribute>
- <attribute
- name="name"
- type="string"
- use="required">
+ <attribute name="var" type="string" use="required">
+ A variable name which will be set to the root of the loaded model.
<description>
- The name of the new element.
+ A variable name. The root of the loaded document is set to this variable.
</description>
</attribute>
- <attribute
- name="var"
- type="string"
- use="optional">
+ <attribute name="urlContext" type="string" use="optional">
<description>
- A variable name that will refer to the newly created element.
+ A url context constant. See tag comments for possible values. The default is 'transform'.
</description>
</attribute>
- <attribute
- name="cdata"
- type="boolean"
- use="optional">
+ <attribute name="loader" type="string" use="optional">
+
<description>
- Add the text as a CData section. Default is 'false'.
+ A constant defining the loader to use. The default is determined by the system, depending upon the value of &apos;type&apos; if specified, or the extension specified on &apos;url&apos;.
</description>
</attribute>
- </functionTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.RemoveElementTag"
- name="removeElement"
- whenContainingLineIsEmpty="remove">
- <description>
- Remove the selected node from the document tree.
- </description>
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="type" type="string" use="optional">
<description>
- An XPath expression determining the document to remove.
+ The type (typically the extension) of the model. That may be required if the URL does not have a standard extension.
</description>
</attribute>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.CopyElementTag"
- name="copyElement"
- whenContainingLineIsEmpty="remove">
-
+ </emptyTag><functionTag name="loadContent" class="org.eclipse.jet.internal.taglib.control.LoadContentTag">
+ <attribute name="var" use="required">
+ <description>A name to associate with the document root of the DOM created by the parse. Subsequent template tags can use this name in query expressions to access the data in this DOM.</description>
+ </attribute>
+ <attribute name="type" use="optional">
+ <description>A content type with which to search for an appropriate loader for the content. Defaults to "xml" if null.</description>
+ </attribute>
+ <attribute name="loader" use="optional">
+ <description>The id of a specific loader which will parse the content and build a model.</description>
+ </attribute>
+ <description>Extends the model by parsing its contents as XML.</description>
+ </functionTag><functionTag class="org.eclipse.jet.internal.taglib.control.LogTag" name="log" whenContainingLineIsEmpty="remove">
<description>
- Copy the selected node to the selected location.
+ Write a message to the transformation log. The contents of the tag are written to the log. Nothing is written the template output.
+
+The optional 'severity' attribute may have one of the following values: 'info', 'warning' or 'error'. The default is 'info'.
</description>
- <attribute
- name="select"
- type="xpath"
- use="required">
+ <attribute name="severity" type="string" use="optional">
<description>
- An XPath expression selecting the element node to copy.
+ The message severity level. Default is 'info'.
</description>
</attribute>
- <attribute
- name="toSelect"
- type="xpath"
- use="required">
+ </functionTag><containerTag allowAsEmpty="false" class="org.eclipse.jet.internal.taglib.control.MarkerTag" name="marker" processContents="standard" whenContainingLineIsEmpty="remove">
+ <description>
+ Create an Eclipse task marker refering to the text contained in the tag. If the description attribute is specified, then the tasks description is the value of that attribute, otherwise, it is the same as the text refered to by the marker.
+ </description>
+ <attribute name="description" type="string" use="optional">
<description>
- An XPath expression identifying the parent of the newly selected node.
+ The description to use in the task marker. The default is to use the text the marker refers to (the tag's content).
</description>
</attribute>
- <attribute
- name="name"
- type="string"
- use="required">
+ </containerTag><conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.OtherwiseTag"
+ name="otherwise"
+ processContents="custom"
+ whenContainingLineIsEmpty="remove">
+ <description>
+ Define a default case for a 'choose' tag. The body of this tag is processed only if no previous 'case' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
+
+An error occurs if the 'otherwise' is not directly contained by a 'choose' tag.
+ </description>
+ </conditionalTag>
+ <emptyTag class="org.eclipse.jet.internal.taglib.control.OverrideTag" deprecated="false" name="override" whenContainingLineIsEmpty="remove">
+ <description>
+ *** Deprecated: Use the 'overrides' attribute on 'transform' extension in plugin.xml instead. *** Declares that this transformation overrides templates in the identified transformation.
+ </description>
+ <attribute name="transformId" type="string" use="required">
<description>
- The name for the newly created element.
+ The transformation id of the transformation which is being overriden.
</description>
</attribute>
- <attribute
- name="recursive"
- type="boolean"
- use="optional">
+ </emptyTag><emptyTag class="org.eclipse.jet.internal.taglib.control.RemoveElementTag" name="removeElement" whenContainingLineIsEmpty="remove">
+ <description>
+ Remove the selected node from the document tree.
+ </description>
+ <attribute name="select" type="xpath" use="required">
<description>
- Determine whether child elements of the copied element are copied, too. Default is &apos;true&apos;.
+ An XPath expression determining the document to remove.
</description>
</attribute>
- <attribute
- name="var"
- type="string"
- use="optional">
- <description>
- The name of a variable that will be set to the newly copied element.
- </description>
+ </emptyTag><functionTag name="replaceStrings" class="org.eclipse.jet.internal.taglib.control.ReplaceStringsTag">
+ <attribute name="replace" use="required">
+ <description>A comma-separated list of strings to be replaced. The backslash ("\") acts as an escape character for special characters</description>
</attribute>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.LoadTag"
- name="load"
- whenContainingLineIsEmpty="remove">
+ <attribute name="with" use="required">
+ <description>A comma-separated list of replacement strings corresponding to the strings in the replace attribute.</description>
+ </attribute>
+ <description>Replaces one set of strings in its content with another set of strings and writes out the result.</description>
+ </functionTag><containerTag allowAsEmpty="false" class="org.eclipse.jet.internal.taglib.control.SetTag" name="set" processContents="custom" whenContainingLineIsEmpty="remove">
<description>
- Load the referenced model, and set the passed variable to the loaded document root.
+ Set an attribute on an object selected by an XPath expression. The value of the attribute is determined by the contents of the tag.
-The optional urlContext attribute determines how relative URL in the url attribute are resolved. Predefined constants: &apos;transform&apos;, indicating that URL is relative to the root directory of the transform; &apos;workspace&apos;, indicating the URL is relative to the current Eclipse workspace.
+If the XPath expression results in more than one object being selected, then that attribute is created on only the first selected object.
-The optional loader attribute determines which loader is used to load the model. The default loader is &apos;emf&apos;, although other loaders may have been contributed.
+If the XPath expression does not select an object, or if the XPath expression is malformed, then an error occurs.
+
+The 'name' attribute need not refer to an attribute defined on the selected object. If the attribute does not exist, one is created dynamically. Such dynamically created attributes are not permanent - they are destroyed when the JET2Context object passed to the template is destroyed.
+
+If the 'name' attribute refers to an existing attribute on the selected object, then the tag attempts to convert the string contents of this tag to the appropriate attribute data type. If this conversion fails, then an error occurs.
</description>
- <attribute
- name="url"
- type="string"
- use="required">
+ <attribute name="select" type="xpath" use="required">
<description>
- The URL of the model to load. Usually, this is a relative URL, and is interpretation is controlled by the urlContext attribute.
+ The XPath expression to evaluate.
</description>
</attribute>
- <attribute
- name="var"
- type="string"
- use="required">
- A variable name which will be set to the root of the loaded model.
+ <attribute name="name" type="string" use="required">
<description>
- A variable name. The root of the loaded document is set to this variable.
+ The name of the attribute to set or create and set.
</description>
</attribute>
- <attribute
- name="urlContext"
- type="string"
- use="optional">
+ </containerTag><emptyTag class="org.eclipse.jet.internal.taglib.control.SetVariableTag" name="setVariable" whenContainingLineIsEmpty="remove">
+ <description>
+ Create a variable whose value is set to the result of the provided XPath expression.
+ </description>
+ <attribute name="select" type="xpath" use="required">
<description>
- A url context constant. See tag comments for possible values. The default is 'transform'.
+ An XPath expression to creates the variable's value.
</description>
</attribute>
- <attribute
- name="loader"
- type="string"
- use="optional">
-
+ <attribute name="var" type="string" use="required">
<description>
- A constant defining the loader to use. The default is determined by the system, depending upon the value of &apos;type&apos; if specified, or the extension specified on &apos;url&apos;.
+ The name of the variable to set.
</description>
</attribute>
- <attribute
- name="type"
- type="string"
- use="optional">
- <description>
- The type (typically the extension) of the model. That may be required if the URL does not have a standard extension.
- </description>
+ </emptyTag><iteratingTag name="stringTokens" class="org.eclipse.jet.internal.taglib.control.StringTokensTag">
+ <attribute name="string" use="required">
+ <description>The string to be parsed</description>
</attribute>
- </emptyTag>
- <conditionalTag
- class="org.eclipse.jet.internal.taglib.control.WhenTag"
- name="when"
- processContents="custom"
- whenContainingLineIsEmpty="remove">
+ <attribute name="delimitedBy" use="optional">
+ <description>The tokens that delimit the tokens in the string</description>
+ </attribute>
+ <attribute name="name" use="required">
+ <description>The variable name to be associated with the temporary model nodes describing the tokens. Nested tags can use this variable name to refer to the temporary node.</description>
+ </attribute>
+ <attribute name="delimiter" use="optional">
+ <description>The string to write after every iteration except the last</description>
+ </attribute>
+ <attribute name="reverse" use="optional">
+ <description>A true/false value indicating whether the tokens should be iterated over first-to-last (false) or last-to-first (true)</description>
+ </attribute>
+ <attribute name="tokenLength" use="optional">
+ <description>Default description for attribute tokenLength</description>
+ </attribute>
+ <description>Parses a string into tokens and iterates over its content for each token.</description>
+ </iteratingTag><containerTag class="org.eclipse.jet.internal.taglib.control.UserRegionTag" name="userRegion" whenContainingLineIsEmpty="remove">
+
<description>
- Define a one of the mutually exclusive cases of a 'choose' tag. The body of this tag is processed only if the 'test' XPath expression evaluates to 'true', and no previous 'when' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
-
-If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
-
-If the 'test' XPath expression is not well formed, then an error results.
+ Define a region in the generated text where users may write customized code.
-If this tag is not directly contained by a 'choose' tag, then an error results.
+The tag must contain a single &apos;initialCode&apos; tag. Content before the initialCode tag is considered a &apos;begin marker&apos;, while content after it is considered an
+&apos;end marker&apos;. During execution, the existing file is searched for the begin and end markers. If found, the content of the user region tag is replaced with
+the content found in the existing file. If the markers are not found (or the file does not exist), then the markers, along with the content of the initialCode
+tag are written.
</description>
+ </containerTag><conditionalTag class="org.eclipse.jet.internal.taglib.control.VisitTag" name="visit" whenContainingLineIsEmpty="remove">
<attribute
name="test"
type="xpath"
@@ -556,24 +479,17 @@ If this tag is not directly contained by a 'choose' tag, then an error results.
An expression expression, that, if true, causes the tag contents to be evaluated.
</description>
</attribute>
- </conditionalTag>
- <containerTag
- allowAsEmpty="false"
- class="org.eclipse.jet.internal.taglib.control.SetTag"
- name="set"
- processContents="custom"
- whenContainingLineIsEmpty="remove">
<description>
- Set an attribute on an object selected by an XPath expression. The value of the attribute is determined by the contents of the tag.
-
-If the XPath expression results in more than one object being selected, then that attribute is created on only the first selected object.
-
-If the XPath expression does not select an object, or if the XPath expression is malformed, then an error occurs.
+ Define content to process for an object found by the parent 'visitor' tag, provided a condition is met. The contents of this tag are evaluated if the current object of the 'visitor' iteration satisfies the 'test' XPath expression.
-The 'name' attribute need not refer to an attribute defined on the selected object. If the attribute does not exist, one is created dynamically. Such dynamically created attributes are not permanent - they are destroyed when the JET2Context object passed to the template is destroyed.
+The 'test' XPath expression is relative to the current object of the parent 'visitor' tag. If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
-If the 'name' attribute refers to an existing attribute on the selected object, then the tag attempts to convert the string contents of this tag to the appropriate attribute data type. If this conversion fails, then an error occurs.
+Note that more than one 'visit' tag may be executed for the same object identified by the parent 'visitor' tag.
</description>
+ </conditionalTag><iteratingTag
+ class="org.eclipse.jet.internal.taglib.control.VisitorTag"
+ name="visitor"
+ whenContainingLineIsEmpty="remove">
<attribute
name="select"
type="xpath"
@@ -583,195 +499,148 @@ If the 'name' attribute refers to an existing attribute on the selected object,
</description>
</attribute>
<attribute
- name="name"
+ name="var"
type="string"
use="required">
<description>
- The name of the attribute to set or create and set.
+ The name of a variable that will contain the current object in the iteration.
</description>
</attribute>
- </containerTag>
- <containerTag
- allowAsEmpty="false"
- class="org.eclipse.jet.internal.taglib.control.MarkerTag"
- name="marker"
- processContents="standard"
- whenContainingLineIsEmpty="remove">
<description>
- Create an Eclipse task marker refering to the text contained in the tag. If the description attribute is specified, then the tasks description is the value of that attribute, otherwise, it is the same as the text refered to by the marker.
+ *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal. For each identified object, the tag evaluates the 'test' condition on its contained 'visit' tags. Only those tags whose test condition is true have their contents processed.
+
+If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.
</description>
- <attribute
- name="description"
- type="string"
- use="optional">
- <description>
- The description to use in the task marker. The default is to use the text the marker refers to (the tag's content).
- </description>
- </attribute>
- </containerTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.OverrideTag"
- deprecated="false"
- name="override"
+ </iteratingTag>
+
+
+
+
+
+
+
+
+
+
+
+
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.WhenTag"
+ name="when"
+ processContents="custom"
whenContainingLineIsEmpty="remove">
<description>
- *** Deprecated: Use the 'overrides' attribute on 'transform' extension in plugin.xml instead. *** Declares that this transformation overrides templates in the identified transformation.
+ Define a one of the mutually exclusive cases of a 'choose' tag. The body of this tag is processed only if the 'test' XPath expression evaluates to 'true', and no previous 'when' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
+
+If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
+
+If the 'test' XPath expression is not well formed, then an error results.
+
+If this tag is not directly contained by a 'choose' tag, then an error results.
</description>
<attribute
- name="transformId"
- type="string"
+ name="test"
+ type="xpath"
use="required">
<description>
- The transformation id of the transformation which is being overriden.
+ An expression expression, that, if true, causes the tag contents to be evaluated.
</description>
</attribute>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.control.InvokeTransformTag"
- name="invokeTransform"
- whenContainingLineIsEmpty="remove">
+ </conditionalTag>
+
+
+
+
+
+
+
+
+ </tagLibrary>
+ <tagLibrary
+ id="workspaceTags"
+ name="Standard JET2 Workspace Tags"
+ standardPrefix="ws">
+
+ <description>
+ A library of tags for performing actions against the Eclipse workspace.
+ </description><emptyTag class="org.eclipse.jet.internal.taglib.workspace.CopyFileTag" name="copyFile">
+
<description>
- Invoke the another transformation, passing it the current transformation&apos;s source model and context variables. The transformation&apos;s actions will be accumulated, and commit when the invoking transformation commits.
-
-The attribute &apos;passVariables&apos; allows explicit declaration of the variables that are passed to the transformation. By default, all context variables are available. With this parameter, only those variables specified are available. In addition, any changes to passed variables are not reflected in the invoking context.
-
-The deprecated &apos;restoreNames&apos; attribute allows for the restoration of variables set by the invoked transformation back to their pre-invocation value.
-
-The &apos;restoreNames&apos; and &apos;passVariables&apos; options are mutually exclusive.
+ Copy the file refered to by 'url' to the location refered to by 'path'.
</description>
- <attribute
- name="transformId"
- type="string"
- use="required">
+ <attribute name="binary" type="boolean" use="optional">
<description>
- The transformation id of the transformation to invoke.
+ Indicates whether the copy is binary or text base. Possible values: 'true' or 'false'. Default: 'false'.
</description>
</attribute>
- <attribute
- deprecated="true"
- name="restoreNames"
- type="string"
- use="optional">
+ <attribute name="replace" type="boolean" use="optional">
<description>
- A comma separated list of variable names (without the $ sign). Mutually exclusive with 'passVariables'.
+ Indicates if any existing version of the file should be replaced. Possible values: 'true' or 'false'. Default: 'true'.
</description>
-
</attribute>
- <attribute
- name="passVariables"
- type="string"
- use="optional">
+ <attribute name="srcEncoding" type="string" use="optional">
<description>
- A comma separated list of variable names (without the $ sign). Mutually exclusive with 'restoreNames'.
+ Defines the default text encoding of the source file. This is only meaningful if the 'binary' attribute is not 'false'. Default is the platform default text encoding.
</description>
</attribute>
- </emptyTag>
- <emptyTag name="dump" class="org.eclipse.jet.internal.taglib.control.DumpTag" >
- <attribute
- name="select"
- type="xpath"
- use="required">
- <description>A query expression specifying a single node in the model</description>
- </attribute>
- <attribute
- name="format"
- type="boolean"
- use="optional">
- <description>A true/false value indicating whether the tag should try to write out whitespace to cause the output to be nicely formatted and indented.</description>
- </attribute>
- <attribute
- name="entities"
- type="boolean"
- use="optional">
- <description>A true/false value indicating whether characters that can cause XML parsing problems (left and right angle brackets, quotes, apostrophes, etc) should be written as entities (e.g. "%lt;" for the left angle bracket).</description>
- </attribute>
- <description>Writes out the DOM subtree under a specified model node.</description>
- </emptyTag>
- <functionTag name="loadContent" class="org.eclipse.jet.internal.taglib.control.LoadContentTag" >
- <attribute name="var" use="required">
- <description>A name to associate with the document root of the DOM created by the parse. Subsequent template tags can use this name in query expressions to access the data in this DOM.</description>
- </attribute>
- <attribute name="type" use="optional">
- <description>A content type with which to search for an appropriate loader for the content. Defaults to "xml" if null.</description>
- </attribute>
- <attribute name="loader" use="optional">
- <description>The id of a specific loader which will parse the content and build a model.</description>
- </attribute>
- <description>Extends the model by parsing its contents as XML.</description>
- </functionTag>
- <iteratingTag
- class="org.eclipse.jet.internal.taglib.control.NodeAttributesTag"
- deprecated="true"
- name="nodeAttributes">
- <attribute name="node" use="required">
- <description>A query expression that resolves to a single node. The nodeAttributes tag will iterate over this node's attributes.</description>
- </attribute>
- <attribute name="name" use="required">
- <description>The variable name to associate with each temporary node describing an attribute. Once the variable name is assigned to the temporary node, the nodeAttributes tag will process its contents once.</description>
- </attribute>
- <attribute name="delimiter" use="optional">
- <description>A string to write out after every iteration except the last.</description>
- </attribute>
- <description>Iterates over the attributes for a given node.</description>
- </iteratingTag>
- <functionTag name="replaceStrings" class="org.eclipse.jet.internal.taglib.control.ReplaceStringsTag" >
- <attribute name="replace" use="required">
- <description>A comma-separated list of strings to be replaced. The backslash ("\") acts as an escape character for special characters</description>
+ <attribute name="targetEncoding" type="string" use="optional">
+ <description>
+ Identifies the text encoding to use when writing the target file. This is only meaningful if the 'binary' attribute is not 'true'. The default text encoding is determined by the platform.
+ </description>
</attribute>
- <attribute name="with" use="required">
- <description>A comma-separated list of replacement strings corresponding to the strings in the replace attribute.</description>
+ <attribute name="src" type="string" use="required">
+ <description>
+ An absolute or relative URL identifying the file to copy. If a relative URL, the 'srcContext' attribute controls resolution of the URL.
+ </description>
</attribute>
- <description>Replaces one set of strings in its content with another set of strings and writes out the result.</description>
- </functionTag>
- <iteratingTag name="stringTokens" class="org.eclipse.jet.internal.taglib.control.StringTokensTag" >
- <attribute name="string" use="required">
- <description>The string to be parsed</description>
+ <attribute name="srcContext" type="string" use="optional">
+ <description>
+ Determines the context of relative URL in the 'src' attribute. Default value is 'transform'. Possible values: 'transform', 'workspace'.
+ </description>
</attribute>
- <attribute name="delimitedBy" use="optional">
- <description>The tokens that delimit the tokens in the string</description>
+ <attribute name="target" type="string" use="required">
+ <description>
+ The destination path of the resource. If relative, this is relative to any containing 'folder' or 'project' tag, otherwise, the first path element is treated as a project name.
+ </description>
</attribute>
- <attribute name="name" use="required">
- <description>The variable name to be associated with the temporary model nodes describing the tokens. Nested tags can use this variable name to refer to the temporary node.</description>
+ </emptyTag><emptyTag class="org.eclipse.jet.internal.taglib.workspace.FileTag" name="file">
+ <attribute name="path" type="string" use="required">
+ <description>
+ A relative path (no initial '/') or an absolute path.
+ </description>
</attribute>
- <attribute name="delimiter" use="optional">
- <description>The string to write after every iteration except the last</description>
+ <attribute name="template" type="string" use="required">
+ <description>
+ A project-relative path of a JET template to execute. The template provides the file&apos;s contents.
+ </description>
</attribute>
- <attribute name="reverse" use="optional">
- <description>A true/false value indicating whether the tokens should be iterated over first-to-last (false) or last-to-first (true)</description>
+ <attribute name="encoding" type="string" use="optional">
+ <description>
+ The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of &apos;#default&apos; restores the encoding of the file to the workspace determined default.
+ </description>
</attribute>
- <attribute name="tokenLength" use="optional">
- <description>Default description for attribute tokenLength</description>
+ <attribute name="replace" type="boolean" use="optional">
+ <description>
+ A boolean (&apos;true&apos; or &apos;false&apos;) value. If &apos;true&apos;, the tag will overwrite an existing file, otherwise it will not. If omitted, a value of &apos;true&apos; is assumed.
+ </description>
</attribute>
- <description>Parses a string into tokens and iterates over its content for each token.</description>
- </iteratingTag>
- </tagLibrary>
- <tagLibrary
- id="workspaceTags"
- name="Standard JET2 Workspace Tags"
- standardPrefix="ws">
- <containerTag
- allowAsEmpty="true"
- class="org.eclipse.jet.internal.taglib.workspace.ProjectTag"
- name="project">
- <attribute
- name="name"
- type="string"
- use="required">
+ <attribute name="derived" type="boolean" use="optional">
<description>
- The name of the project.
+ A boolean value (&apos;true&apos; or &apos;false&apos;) determining the value of the workspace &apos;derived&apos; attribute for the file. If omitted, a value of &apos;false&apos; is assumed.
</description>
</attribute>
<description>
- Ensure the existence of an Eclipse Project of a given name. If the project does not exist, it is created. If the project is not opened, it is opened.
+ Create or write an Eclipse workspace file. If the file does not exist, the tag attempts to create it and any containing folders. An error occurs if the file does not exist and cannot be created.
-Note that the actual creation of the workspace project is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transformation, this occurs once all templates have executed.
+Note that the actual creation of the workspace file is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transformation, this occurs once all templates have executed.
-An error occurs of the project does not exist and cannot be created, or if the project exists, but cannot be opened.
+If the 'file' tag is contained directly or indirectly by a 'folder' or 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.
-The 'project' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the project defined by this tag.
+An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names, with the last segment being interpreted as the file name.
+
+When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.
</description>
- </containerTag>
- <containerTag
+ </emptyTag><containerTag
allowAsEmpty="true"
class="org.eclipse.jet.internal.taglib.workspace.FolderTag"
name="folder">
@@ -797,137 +666,98 @@ An absolute &apos;path&apos; (one starting with &apos;/&apos;) is treated as a w
When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.
</description>
</containerTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.workspace.FileTag"
- name="file">
- <attribute
- name="path"
- type="string"
- use="required">
+
+ <containerTag allowAsEmpty="true" class="org.eclipse.jet.internal.taglib.workspace.ProjectTag" name="project">
+ <attribute name="name" type="string" use="required">
<description>
- A relative path (no initial '/') or an absolute path.
- </description>
- </attribute>
- <attribute
- name="template"
- type="string"
- use="required">
- <description>
- A project-relative path of a JET template to execute. The template provides the file's contents.
- </description>
- </attribute>
- <attribute
- name="encoding"
- type="string"
- use="optional">
- <description>
- The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.
- </description>
- </attribute>
- <attribute
- name="replace"
- type="boolean"
- use="optional">
- <description>
- A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.
- </description>
- </attribute>
- <attribute
- name="derived"
- type="boolean"
- use="optional">
- <description>
- A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.
+ The name of the project.
</description>
</attribute>
<description>
- Create or write an Eclipse workspace file. If the file does not exist, the tag attempts to create it and any containing folders. An error occurs if the file does not exist and cannot be created.
-
-Note that the actual creation of the workspace file is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transformation, this occurs once all templates have executed.
+ Ensure the existence of an Eclipse Project of a given name. If the project does not exist, it is created. If the project is not opened, it is opened.
-If the 'file' tag is contained directly or indirectly by a 'folder' or 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.
+Note that the actual creation of the workspace project is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transformation, this occurs once all templates have executed.
-An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names, with the last segment being interpreted as the file name.
+An error occurs of the project does not exist and cannot be created, or if the project exists, but cannot be opened.
-When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.
+The 'project' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the project defined by this tag.
</description>
+ <attribute name="location" type="string" use="optional">
+ <description>
+ An optional absolute file-system location for the new project. If not specified, the project is created in a directory under the workspace directory.
+ </description>
+ </attribute>
+ </containerTag><emptyTag name="rebuildWorkspace" class="org.eclipse.jet.internal.taglib.workspace.RebuildWorkspaceTag">
+ <description>Causes the Eclipse workspace to process resources that were changed or created by the pattern.</description>
</emptyTag>
+
+
+ </tagLibrary>
+ <tagLibrary
+ id="javaTags"
+ name="Standard JET2 Java Tags"
+ standardPrefix="java">
+
<description>
- A library of tags for performing actions against the Eclipse workspace.
- </description>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.workspace.CopyFileTag"
- name="copyFile">
-
+ Tags useful in generating Java code.
+ </description><emptyTag class="org.eclipse.jet.internal.taglib.java.JavaClassTag" name="class">
<description>
- Copy the file refered to by 'url' to the location refered to by 'path'.
+ Create a Java class with the specified name and write its contents by evaluating the supplied template.
</description>
- <attribute
- name="binary"
- type="boolean"
- use="optional">
+ <attribute name="name" type="string" use="required">
<description>
- Indicates whether the copy is binary or text base. Possible values: 'true' or 'false'. Default: 'false'.
+ The name unqualified name of the Java class.
</description>
</attribute>
- <attribute
- name="replace"
- type="boolean"
- use="optional">
+ <attribute name="package" type="string" use="optional">
<description>
- Indicates if any existing version of the file should be replaced. Possible values: 'true' or 'false'. Default: 'true'.
+ The name of the java package. If not specified, then the name of the containing &apos;java:package&apos; tag is used, otherwise, the default package is used.
</description>
</attribute>
- <attribute
- name="srcEncoding"
- type="string"
- use="optional">
+ <attribute name="srcFolder" type="string" use="optional">
<description>
- Defines the default text encoding of the source file. This is only meaningful if the 'binary' attribute is not 'false'. Default is the platform default text encoding.
+ The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.
</description>
</attribute>
- <attribute
- name="targetEncoding"
- type="string"
- use="optional">
+ <attribute name="template" type="string" use="required">
<description>
- Identifies the text encoding to use when writing the target file. This is only meaningful if the 'binary' attribute is not 'true'. The default text encoding is determined by the platform.
+ A project-relative path of a JET template to execute. The template provides the class file&apos;s contents.
</description>
</attribute>
- <attribute
- name="src"
- type="string"
- use="required">
+ <attribute name="replace" type="boolean" use="optional">
<description>
- An absolute or relative URL identifying the file to copy. If a relative URL, the 'srcContext' attribute controls resolution of the URL.
+ A boolean (&apos;true&apos; or &apos;false&apos;) value. If &apos;true&apos;, the tag will overwrite an existing file, otherwise it will not. If omitted, a value of &apos;true&apos; is assumed.
</description>
</attribute>
- <attribute
- name="srcContext"
- type="string"
- use="optional">
+ <attribute name="encoding" type="string" use="optional">
<description>
- Determines the context of relative URL in the 'src' attribute. Default value is 'transform'. Possible values: 'transform', 'workspace'.
+ The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of &apos;#default&apos; restores the encoding of the file to the workspace determined default.
</description>
</attribute>
- <attribute
- name="target"
- type="string"
- use="required">
+ <attribute name="derived" type="boolean" use="optional">
<description>
- The destination path of the resource. If relative, this is relative to any containing 'folder' or 'project' tag, otherwise, the first path element is treated as a project name.
+ A boolean value (&apos;true&apos; or &apos;false&apos;) determining the value of the workspace &apos;derived&apos; attribute for the file. If omitted, a value of &apos;false&apos; is assumed.
</description>
</attribute>
- </emptyTag>
- <emptyTag name="rebuildWorkspace" class="org.eclipse.jet.internal.taglib.workspace.RebuildWorkspaceTag" >
- <description>Causes the Eclipse workspace to process resources that were changed or created by the pattern.</description>
- </emptyTag>
- </tagLibrary>
- <tagLibrary
- id="javaTags"
- name="Standard JET2 Java Tags"
- standardPrefix="java">
- <emptyTag
+ </emptyTag><emptyTag class="org.eclipse.jet.internal.taglib.java.ImpliedImportTag" name="impliedImport">
+ <attribute name="name" type="string" use="required">
+ <description>
+ The name of the class (unqualified) for which there is an implicit import.
+ </description>
+ </attribute>
+ <description>
+ Record a name as being implicitly imported. This is a name that a sibling class of the one being generated by the current template.
+
+This tag must occur after the initial &amp;apos;importsLocation&amp;apos; tag, but before any &amp;apos;imports&amp;apos; tags in the template.
+ </description>
+ </emptyTag><functionTag class="org.eclipse.jet.internal.taglib.java.ImportTag" name="import">
+ <description>
+ Replace the enclosed content with the equivalent unqualified Java name (if possible), and ensure an appropriate Java import statement is generated.
+
+This tag must be preceded by a 'importsLocation' tag.
+
+ </description>
+ </functionTag><emptyTag
class="org.eclipse.jet.internal.taglib.java.ImportsLocationTag"
name="importsLocation">
<attribute
@@ -944,37 +774,25 @@ When executing, this tag will cause the implicit creation of any folders contain
This tag may occur only once in a template.
</description>
</emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.java.ImpliedImportTag"
- name="impliedImport">
- <attribute
- name="name"
- type="string"
- use="required">
+
+
+
+ <emptyTag class="org.eclipse.jet.internal.taglib.java.MergeTag" name="merge" whenContainingLineIsEmpty="preserve">
+
+ <description>
+ Cause the template contents to be merged with the existing Java file using the EMF JMerge engine.
+ </description>
+ <attribute name="rules" type="string" use="optional">
<description>
- The name of the class (unqualified) for which there is an implicit import.
+ A URL to the JMerge rules file. If the path is relative, then it is relative to the location specified by the rulesContext attribute. If not specified, the default is the JMerge rules used by the EMF Code Generator.
</description>
</attribute>
- <description>
- Record a name as being implicitly imported. This is a name that a sibling class of the one being generated by the current template.
-
-This tag must occur after the initial &amp;apos;importsLocation&amp;apos; tag, but before any &amp;apos;imports&amp;apos; tags in the template.
- </description>
- </emptyTag>
- <functionTag
- class="org.eclipse.jet.internal.taglib.java.ImportTag"
- name="import">
- <description>
- Replace the enclosed content with the equivalent unqualified Java name (if possible), and ensure an appropriate Java import statement is generated.
-
-This tag must be preceded by a 'importsLocation' tag.
-
- </description>
- </functionTag>
- <description>
- Tags useful in generating Java code.
- </description>
- <containerTag
+ <attribute name="rulesContext" type="string" use="optional">
+ <description>
+ The context for resolving relative 'rules' URLs. Possible values are 'transform' or 'workspace'. If the value is 'transform', then the 'rules' URL is treated as a JET project relative path. If the value is 'workspace', then the 'rules' URL is treated as an Eclipse workspace relative path. The default is 'transform'.
+ </description>
+ </attribute>
+ </emptyTag><containerTag
class="org.eclipse.jet.internal.taglib.java.PackageTag"
name="package"
processContents="standard">
@@ -994,12 +812,10 @@ This tag must be preceded by a 'importsLocation' tag.
name="srcFolder"
type="string"
use="optional">
- <description/>
+ <description>
+ The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.
+ </description>
</attribute>
- <attribute
- name="project"
- type="string"
- use="optional"/>
</containerTag>
<emptyTag
class="org.eclipse.jet.internal.taglib.java.JavaResourceTag"
@@ -1019,114 +835,91 @@ This tag must be preceded by a 'importsLocation' tag.
name="package"
type="string"
use="optional">
- <description/>
+
+ <description>
+ The name of the java package. If not specified, then the name of the containing 'java:package' tag is used, otherwise, the default package is used.
+ </description>
</attribute>
<attribute
name="srcFolder"
type="string"
use="optional">
- <description/>
+ <description>
+ The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.
+ </description>
</attribute>
<attribute
name="template"
type="string"
- use="required"/>
- <attribute
- name="replace"
- type="boolean"
- use="optional"/>
- <attribute
- name="encoding"
- type="string"
- use="optional"/>
- <attribute
- name="derived"
- type="boolean"
- use="optional"/>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.java.JavaClassTag"
- name="class">
- <description>
- Create a Java class with the specified name.
- </description>
- <attribute
- name="name"
- type="string"
use="required">
<description>
- The name unqualified name of the Java class.
- </description>
- </attribute>
- <attribute
- name="package"
- type="string"
- use="optional">
<description>
- The name of the java package. If not specified, then the name of the containing 'java:package' tag is used, otherwise, the default package is used.
+ A project-relative path of a JET template to execute. The template provides the resource file's contents.
+ </description>
+ A project-relative path of a JET template to execute. The template provides the resource file's contents.
</description>
</attribute>
<attribute
- name="srcFolder"
- type="string"
+ name="replace"
+ type="boolean"
use="optional">
<description>
- The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.
+ A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.
</description>
</attribute>
<attribute
- name="template"
- type="string"
- use="required"/>
- <attribute
- name="project"
- type="string"
- use="optional"/>
- <attribute
- name="replace"
- type="boolean"
- use="optional"/>
- <attribute
name="encoding"
type="string"
- use="optional"/>
- <attribute
- name="derived"
- type="boolean"
- use="optional"/>
- </emptyTag>
- <emptyTag
- class="org.eclipse.jet.internal.taglib.java.MergeTag"
- name="merge"
- whenContainingLineIsEmpty="preserve">
-
- <description>
- Cause the template contents to be merged with the existing Java file using the EMF JMerge engine.
- </description>
- <attribute
- name="rules"
- type="string"
use="optional">
<description>
- A URL to the JMerge rules file. If the path is relative, then it is relative to the location specified by the rulesContext attribute. If not specified, the default is the JMerge rules used by the EMF Code Generator.
+ The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.
</description>
</attribute>
<attribute
- name="rulesContext"
- type="string"
+ name="derived"
+ type="boolean"
use="optional">
<description>
- The context for resolving relative 'rules' URLs. Possible values are 'transform' or 'workspace'. If the value is 'transform', then the 'rules' URL is treated as a JET project relative path. If the value is 'workspace', then the 'rules' URL is treated as an Eclipse workspace relative path. The default is 'transform'.
+ A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.
</description>
</attribute>
</emptyTag>
+
+
</tagLibrary>
<tagLibrary
id="formatTags"
name="Standard JET2 Format Tags"
standardPrefix="f">
- <functionTag
+ <description>
+ Standard utility tags that rewrite their content in a different format.
+ </description><emptyTag name="formatNow" class="org.eclipse.jet.internal.taglib.format.FormatNowTag">
+ <attribute name="pattern" use="required">
+ <description>The pattern with which to format the current data and time. See documentation for the Java class java.util.SimpleDateFormat for more details.</description>
+ </attribute>
+ <description>Formats and writes out the current date and time</description>
+ </emptyTag><functionTag class="org.eclipse.jet.internal.taglib.format.LowerCaseTag" name="lc">
+ <attribute name="offset" use="optional">
+ <description>
+ The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.
+ </description>
+ </attribute>
+ <attribute name="length" use="optional">
+ <description>
+ The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.
+ </description>
+ </attribute>
+ <description>
+ Convert the tag contents to lower case.
+
+If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.
+
+if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.
+ </description>
+ </functionTag><emptyTag name="milliseconds" class="org.eclipse.jet.internal.taglib.format.MillisecondsTag">
+ <description>Writes out a current system milliseconds value.</description>
+ </emptyTag><functionTag
class="org.eclipse.jet.internal.taglib.format.ReplaceAllTag"
name="replaceAll">
@@ -1192,48 +985,15 @@ If 'offset' is specified, start conversion from the specified character, otherwi
if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.
</description>
- </functionTag> <functionTag
- class="org.eclipse.jet.internal.taglib.format.LowerCaseTag"
- name="lc">
- <attribute
- name="offset"
- use="optional">
- <description>
- The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.
- </description>
- </attribute>
- <attribute
- name="length"
- use="optional">
- <description>
- The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.
- </description>
- </attribute>
- <description>
- Convert the tag contents to lower case.
-
-If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.
-
-if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.
- </description>
- </functionTag>
- <description>
- Standard utility tags that rewrite their content in a different format.
- </description>
- <emptyTag name="formatNow" class="org.eclipse.jet.internal.taglib.format.FormatNowTag" >
- <attribute name="pattern" use="required">
- <description>The pattern with which to format the current data and time. See documentation for the Java class java.util.SimpleDateFormat for more details.</description>
- </attribute>
- <description>Formats and writes out the current date and time</description>
- </emptyTag>
- <emptyTag name="milliseconds" class="org.eclipse.jet.internal.taglib.format.MillisecondsTag" >
- <description>Writes out a current system milliseconds value.</description>
- </emptyTag>
+ </functionTag>
+
+
+
<emptyTag name="unique" class="org.eclipse.jet.internal.taglib.format.UniqueTag" >
<description>Writes out a unique integer value</description>
</emptyTag>
<emptyTag name="uuid" class="org.eclipse.jet.internal.taglib.format.UuidTag" >
- <description>Default description for tag uuid</description>
+ <description>Generate a universally unique identifier (UUID).</description>
</emptyTag>
</tagLibrary>
</extension>
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
index 3751bcc..530be94 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
@@ -25,11 +25,13 @@ import java.util.Map;
import org.eclipse.jet.internal.InternalJET2Platform;
import org.eclipse.jet.taglib.JET2TagException;
+import org.eclipse.jface.text.AbstractDocument;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultLineTracker;
import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextStore;
import org.eclipse.jface.text.Position;
@@ -40,10 +42,74 @@ import org.eclipse.jface.text.Position;
public class BodyContentWriter implements JET2Writer
{
- // private StringBuffer buffer = new StringBuffer();
+ /**
+ * IDocument implementationt that is optimized for appending.
+ */
+ private static class StringBufferDocument extends AbstractDocument
+ {
+ public StringBufferDocument() {
+ super();
+ setTextStore(new StringBufferTextStore());
+ setLineTracker(new DefaultLineTracker());
+ completeInitialization();
+ }
+ }
+
+/**
+ * Simple text store optimized for appending
+ */
+ private static class StringBufferTextStore implements ITextStore
+ {
+
+ private final StringBuffer buffer = new StringBuffer();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.ITextStore#get(int)
+ */
+ public char get(int offset)
+ {
+ return buffer.charAt(offset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.ITextStore#get(int, int)
+ */
+ public String get(int offset, int length)
+ {
+ return buffer.substring(offset, offset + length);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
+ */
+ public void set(String text)
+ {
+ buffer.replace(0, buffer.length(), text);
+ }
+
+ public int getLength()
+ {
+ return buffer.length();
+ }
+
+ public void replace(int offset, int length, String text)
+ {
+ if(offset == buffer.length() && length == 0)
+ {
+ buffer.append(text);
+ }
+ else
+ {
+ buffer.replace(offset, offset + length, text);
+ }
+ }
+
+ }
+
+// private StringBuffer buffer = new StringBuffer();
private final BodyContentWriter parentWriter;
- private final IDocument document = new Document();
+ private final IDocument document = new StringBufferDocument();
private final Map listeners;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
index f746ab6..363b923 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
@@ -150,6 +150,9 @@ public class JET2Platform
if (problems[i] instanceof JET2TemplateStatus)
{
JET2TemplateStatus tStatus = (JET2TemplateStatus)problems[i];
+
+ if(tStatus.getTagInfo() == null) continue;
+
String templatePath = tStatus.getTemplatePath();
IResource errorResource = templatePath != null ? project.findMember(templatePath) : project;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
index 879dde6..2d0633e 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
@@ -255,7 +255,15 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
IElementInspector elementInspector = getElementInspector(element);
- boolean isSet = elementInspector.createAttribute(element, name, bodyContent);
+ boolean isSet = false;
+ try
+ {
+ isSet = elementInspector.createAttribute(element, name, bodyContent);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ // continue, ;
+ }
if(!isSet && getData().annotationManager != null) {
Object annotation = getData().annotationManager.getAnnotationObject(element);
@@ -322,14 +330,35 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
// cannot happend, as we're passing null as the third argument;
throw new JET2TagException(e);
}
+ catch(UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}
public void removeElement(Object element) throws JET2TagException
{
IElementInspector inspector = getElementInspector(element);
- inspector.removeElement(element);
+ try
+ {
+ inspector.removeElement(element);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
+
+ }
+ /**
+ * @param e
+ * @return
+ */
+ private JET2TagException convertToTagException(UnsupportedOperationException e)
+ {
+ // FIXME: add a message for this
+ return new JET2TagException(e.toString());
}
/**
@@ -355,6 +384,10 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
throw new JET2TagException(e.getLocalizedMessage(), e);
}
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}
/**
@@ -391,6 +424,9 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
throw new JET2TagException(e.getLocalizedMessage(), e);
}
+ catch (UnsupportedOperationException e) {
+ throw convertToTagException(e);
+ }
}
/**
@@ -447,7 +483,14 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
public void removeAttribute(Object element, String attributeName) throws JET2TagException
{
IElementInspector inspector = getElementInspector(element);
- inspector.removeAttribute(element, attributeName);
+ try
+ {
+ inspector.removeAttribute(element, attributeName);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java
index 4bb2ef0..96d516a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java
@@ -30,6 +30,7 @@ import java.util.Set;
import org.eclipse.emf.codegen.jet.JETException;
import org.eclipse.jet.internal.compiler.CommentElementDelegate;
import org.eclipse.jet.internal.compiler.DeclarationElementDelegate;
+import org.eclipse.jet.internal.compiler.ErrorRedirectingCoreElementDelegate;
import org.eclipse.jet.internal.compiler.XMLElementDelegate;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.internal.parser.JETCoreElement;
@@ -572,27 +573,40 @@ class ASTCompilerParseListener implements JETParseEventListener2
TagDefinition td = tagLibManager.getTagDefinition(tagName);
- XMLBodyElement decl = ast.createXMLBodyElement(
- start.getLine(),
- start.getCol(),
- start.getCursor(),
- stop.getCursor(),
- tagName,
- attributeMap,
- td);
-
- if (elementStack.isEmpty())
+ if(!td.isContentAllowed() && tagName.indexOf(':') == -1)
{
- compilationUnit.getInternalBodyElements().addBodyElement(decl);
+ // bug 147714: for DPTK compatibility, allow empty tags to appear as <tagname ...> instead of <tagname .../>
+ // We only allow this for tags that have no namespace (as DPTK did not support namespaces).
+ recordProblem(ParseProblemSeverity.WARNING, Problem.TagInterpretedAsEmptyTag,
+ JET2Messages.JET2Compiler_TagShouldBeEmptyFormat,
+ new Object [] {"<" + tagName + "/>"}, //$NON-NLS-1$ //$NON-NLS-2$
+ start.getCursor(), stop.getCursor(), start.getLine(), start.getCol());
+ handleXMLEmptyTag(tagName, start, stop, attributeMap);
}
else
{
- XMLBodyElement topElement = elementStack.peek();
-
- topElement.getInternalBodyElements().addBodyElement(decl);
+ XMLBodyElement decl = ast.createXMLBodyElement(
+ start.getLine(),
+ start.getCol(),
+ start.getCursor(),
+ stop.getCursor(),
+ tagName,
+ attributeMap,
+ td);
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(decl);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(decl);
+ }
+
+ elementStack.push(decl);
}
-
- elementStack.push(decl);
}
/**
@@ -635,12 +649,12 @@ class ASTCompilerParseListener implements JETParseEventListener2
directive.getDirectives().add("start"); //$NON-NLS-1$
directive.getDirectives().add("end"); //$NON-NLS-1$
JETCoreElement[] coreElements = new JETCoreElement []{
- directive,
- new JETParser.Expression(),
- new CommentElementDelegate(),
- new DeclarationElementDelegate(),
- new JETParser.Scriptlet(),
- new XMLElementDelegate(), };
+ new ErrorRedirectingCoreElementDelegate(directive),
+ new ErrorRedirectingCoreElementDelegate(new JETParser.Expression()),
+ new ErrorRedirectingCoreElementDelegate(new CommentElementDelegate()),
+ new ErrorRedirectingCoreElementDelegate(new DeclarationElementDelegate()),
+ new ErrorRedirectingCoreElementDelegate(new JETParser.Scriptlet()),
+ new ErrorRedirectingCoreElementDelegate(new XMLElementDelegate()), };
parser = new JETParser(reader, this, coreElements);
this.beginPageProcessing();
try
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
index 9420185..875ad3c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
@@ -45,6 +45,7 @@ import org.eclipse.jet.internal.JETActivatorWrapper;
import org.eclipse.jet.internal.compiler.JETCompilerState;
import org.eclipse.jet.internal.compiler.LoaderGenerationParameters;
import org.eclipse.jet.internal.compiler.TemplateRunner;
+import org.eclipse.jet.internal.compiler.TextTrimmingVisitor;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.internal.parser.ParseProblemSeverity;
import org.eclipse.jet.taglib.TagLibraryReference;
@@ -636,7 +637,8 @@ public class JET2Compiler
public void clean()
{
- final Set templatePathSet = compilerState.getTemplateMap().keySet();
+ // make a safe copy of the keyset, as we will be modifying the template map by cleaning...
+ final Set templatePathSet = new HashSet(compilerState.getTemplateMap().keySet());
monitor.beginTask("", templatePathSet.size() + 2); //$NON-NLS-1$
for (Iterator i = templatePathSet.iterator(); i.hasNext();)
{
@@ -668,6 +670,7 @@ public class JET2Compiler
try
{
removeDerivedResources(templateResource, true);
+ compilerState.removeTemplate(templatePath);
}
catch (CoreException e)
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
index 4f55b6b..dc60ce8 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
@@ -19,7 +19,7 @@ package org.eclipse.jet.compiler;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
@@ -48,7 +48,7 @@ public final class JET2Directive extends JET2ASTElement
{
super(ast, line, colOffset, start, end);
this.name = name;
- this.attributes = Collections.unmodifiableMap(new HashMap(attributes));
+ this.attributes = Collections.unmodifiableMap(new LinkedHashMap(attributes));
}
/**
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java
index d87c8d5..4a87d6d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java
@@ -116,6 +116,12 @@ public class Problem
*/
public static final int UnknownXMLTag = 16;
+ /**
+ * A tag this is declared as an 'emptyTag' occured as &lt;tag ...&gt;, and has been
+ * interpreted as the equivalent empty tag &lt;tag .../&gt;.
+ */
+ public static final int TagInterpretedAsEmptyTag = 17;
+
private final String originatingFileName;
private final int id;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
index 863572e..4aa78f2 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
@@ -58,7 +58,7 @@ public class JETPreferenceInitializer extends AbstractPreferenceInitializer
node.putBoolean(JETPreferences.PROJECT_SPECIFIC_SETTINGS, false);
node.put(JETPreferences.CONSOLE_ERROR_COLOR, "255,0,0"); // Red //$NON-NLS-1$
- node.put(JETPreferences.CONSOLE_WARNING_COLOR, "255,255,128"); // Yellow //$NON-NLS-1$
+ node.put(JETPreferences.CONSOLE_WARNING_COLOR, "250,100,0"); // Orange //$NON-NLS-1$
node.put(JETPreferences.CONSOLE_INFO_COLOR, "0,0,0"); // Black //$NON-NLS-1$
node.put(JETPreferences.CONSOLE_TRACE_COLOR, "128,128,128"); // Dark grey //$NON-NLS-1$
node.put(JETPreferences.CONSOLE_DEBUG_COLOR, "192,192,192"); // Light grey //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java
index a53a51d..12ba899 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java
@@ -18,7 +18,6 @@
package org.eclipse.jet.internal.compiler;
-import org.eclipse.emf.codegen.CodeGenPlugin;
import org.eclipse.emf.codegen.jet.JETException;
import org.eclipse.jet.internal.parser.JETCoreElement;
import org.eclipse.jet.internal.parser.JETMark;
@@ -69,16 +68,19 @@ public class CommentElementDelegate implements JETCoreElement
{
return false;
}
+ JETMark elementStart = reader.mark();
reader.advance(elementOpen.length());
JETMark start = reader.mark();
JETMark stop = reader.skipUntil(elementClose);
if (stop == null)
{
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", new Object []{ elementOpen, reader.mark().toString() })); //$NON-NLS-1$
+ CompilerErrorUtil.recordUnterminatedElement(jet2Listener, elementClose, elementStart, reader);
+ }
+ else
+ {
+ jet2Listener.handleComment(start, stop);
}
- jet2Listener.handleComment(start, stop);
return true;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerErrorUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerErrorUtil.java
new file mode 100644
index 0000000..a17858c
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerErrorUtil.java
@@ -0,0 +1,90 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.compiler;
+
+
+import java.text.MessageFormat;
+
+import org.eclipse.jet.compiler.Problem;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETReader;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+
+/**
+ * Utility class to aid in handling file errors
+ */
+public class CompilerErrorUtil
+{
+
+ /**
+ *
+ */
+ private CompilerErrorUtil()
+ {
+ }
+
+ /**
+ * Record a parse error for a JET element whose close sequence is missing.
+ * @param listener the JETParseEventLister2
+ * @param expectedCloseSequence the expected close sequence
+ * @param elementStart the JETMark for the start of the element
+ * @param reader the current JETReader
+ */
+ public static void recordUnterminatedElement(
+ JETParseEventListener2 listener,
+ String expectedCloseSequence,
+ JETMark elementStart,
+ JETReader reader)
+ {
+ // FIXME: Note that we use XPath_Expected (text: Expected: {0}) because the message "jet.error.unterminated"
+ // in the codegen plug-in is incorrect.
+ listener.recordProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.UnterminatedXMLTag,
+ JET2Messages.XPath_Expected,
+ new Object []{ expectedCloseSequence },
+ elementStart.getCursor(),
+ reader.mark().getCursor(),
+ elementStart.getLine(),
+ elementStart.getCol());
+
+ }
+
+ /**
+ * Return the formatted error message for an unterminated string.
+ * @param openSequence
+ * @param expectedCloseSequence
+ * @param reader
+ * @return
+ */
+ public static String getUnterminatedMessage(String openSequence, String expectedCloseSequence, JETReader reader) {
+ // This method encapsulates the retrieval of the 'unterminated' error message. Because this message is part
+ // of EMF Codegen, and it is incorect (it incorrectly uses the first argument twice), we centralize
+ // access to it, and implement the 'fix' once.
+ // This is the 'unfixed' code:
+// final String msg = CodeGenPlugin.getPlugin().getString(
+// "jet.error.unterminated", //$NON-NLS-1$
+// new Object []{ openSequence, reader.mark().toString() });
+
+ // FIXME: Note that we use XPath_Expected (text: Expected: {0}) because the message "jet.error.unterminated"
+ // in the codegen plug-in is incorrect.
+ return MessageFormat.format(JET2Messages.XPath_Expected, new Object[] {expectedCloseSequence});
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java
index 5323e81..ac83aac 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java
@@ -17,7 +17,6 @@
package org.eclipse.jet.internal.compiler;
-import org.eclipse.emf.codegen.CodeGenPlugin;
import org.eclipse.emf.codegen.jet.JETException;
import org.eclipse.jet.internal.parser.JETCoreElement;
import org.eclipse.jet.internal.parser.JETMark;
@@ -54,16 +53,19 @@ public class DeclarationElementDelegate implements JETCoreElement
{
return false;
}
+ JETMark elementStart = reader.mark();
reader.advance(declOpen.length());
JETMark start = reader.mark();
JETMark stop = reader.skipUntil(declClose);
if (stop == null)
{
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", new Object []{ declOpen, reader.mark().toString() })); //$NON-NLS-1$
+ CompilerErrorUtil.recordUnterminatedElement(jet2Listener, declClose, elementStart, reader);
+ }
+ else
+ {
+ jet2Listener.handleDeclaration(start, stop);
}
- jet2Listener.handleDeclaration(start, stop);
return true;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/ErrorRedirectingCoreElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/ErrorRedirectingCoreElementDelegate.java
new file mode 100644
index 0000000..6cf84fc
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/ErrorRedirectingCoreElementDelegate.java
@@ -0,0 +1,63 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.compiler;
+
+import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.compiler.Problem;
+import org.eclipse.jet.internal.parser.JETCoreElement;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETParser;
+import org.eclipse.jet.internal.parser.JETReader;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+/**
+ * A JETCoreElement that delegates its accept the the passed core element, but records any JETException
+ * as errors on a JETParseEventListener2.
+ */
+public class ErrorRedirectingCoreElementDelegate implements JETCoreElement
+{
+
+ private final JETCoreElement delegate;
+
+ public ErrorRedirectingCoreElementDelegate(JETCoreElement delegate) {
+ this.delegate = delegate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.parser.JETCoreElement#accept(org.eclipse.jet.internal.parser.JETParseEventListener, org.eclipse.jet.internal.parser.JETReader, org.eclipse.jet.internal.parser.JETParser)
+ */
+ public boolean accept(JETParseEventListener listener, JETReader reader, JETParser parser)
+ {
+ boolean isAccepted = true;
+ JETMark start = reader.mark();
+ try {
+ isAccepted = delegate.accept(listener, reader, parser);
+ }
+ catch(JETException e) {
+ if(listener instanceof JETParseEventListener2)
+ {
+ JETParseEventListener2 listener2 = (JETParseEventListener2)listener;
+ listener2.recordProblem(ParseProblemSeverity.ERROR, Problem.JETException, e.getLocalizedMessage(), new Object[0],
+ start.getCursor(), reader.mark().getCursor(), start.getLine(), start.getCol());
+ }
+ }
+ return isAccepted;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextTrimmingVisitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/TextTrimmingVisitor.java
index a6dd34b..8911930 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextTrimmingVisitor.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/TextTrimmingVisitor.java
@@ -15,9 +15,21 @@
* $Id$
*/
-package org.eclipse.jet.compiler;
-
-
+package org.eclipse.jet.internal.compiler;
+
+
+import org.eclipse.jet.compiler.Comment;
+import org.eclipse.jet.compiler.DefaultJET2ASTVisitor;
+import org.eclipse.jet.compiler.JET2ASTElement;
+import org.eclipse.jet.compiler.JET2ASTVisitor;
+import org.eclipse.jet.compiler.JET2Declaration;
+import org.eclipse.jet.compiler.JET2Directive;
+import org.eclipse.jet.compiler.JET2Expression;
+import org.eclipse.jet.compiler.JET2Scriptlet;
+import org.eclipse.jet.compiler.TextElement;
+import org.eclipse.jet.compiler.XMLBodyElement;
+import org.eclipse.jet.compiler.XMLBodyElementEnd;
+import org.eclipse.jet.compiler.XMLEmptyElement;
import org.eclipse.jet.internal.parser.LineInfo;
@@ -25,7 +37,7 @@ import org.eclipse.jet.internal.parser.LineInfo;
* A JET AST Visitor that strips whitespace and new-lines
*
*/
-class TextTrimmingVisitor extends DefaultJET2ASTVisitor implements JET2ASTVisitor
+public class TextTrimmingVisitor extends DefaultJET2ASTVisitor implements JET2ASTVisitor
{
/**
*
@@ -158,6 +170,6 @@ class TextTrimmingVisitor extends DefaultJET2ASTVisitor implements JET2ASTVisito
public void visit(Comment comment)
{
-// checkAndStrip(comment);
+ checkAndStrip(comment);
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java
index bf07860..58ef03b 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java
@@ -21,7 +21,6 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
-import org.eclipse.emf.codegen.CodeGenPlugin;
import org.eclipse.emf.codegen.jet.JETException;
import org.eclipse.jet.compiler.Problem;
import org.eclipse.jet.internal.l10n.JET2Messages;
@@ -92,17 +91,7 @@ public class XMLElementDelegate implements JETCoreElement
JETMark endTagMark = reader.skipUntil(XML_TAG_CLOSE);
if (endTagMark == null)
{
- Object[] msgArgs = new Object []{ elementOpen, reader.mark().toString() };
- String msg = CodeGenPlugin.getPlugin().getString("jet.error.unterminated", msgArgs); //$NON-NLS-1$
- JETMark errorMark = reader.mark();
- jet2Listener.recordProblem(
- ParseProblemSeverity.ERROR,
- Problem.UnterminatedXMLTag,
- msg,
- msgArgs,
- start.getCursor(),
- errorMark.getCursor(),
- start.getLine(), start.getCol());
+ CompilerErrorUtil.recordUnterminatedElement(jet2Listener, XML_TAG_CLOSE, start, reader);
return true;
}
@@ -152,18 +141,7 @@ public class XMLElementDelegate implements JETCoreElement
}
if (reader.peekChar() != '>')
{
- // jet2Listener.recordProblem(Severity.ERROR, );
- Object[] msgArgs = new Object []{ elementOpen, reader.mark().toString() };
- String msg = CodeGenPlugin.getPlugin().getString("jet.error.unterminated", msgArgs); //$NON-NLS-1$
- JETMark errorMark = reader.mark();
- jet2Listener.recordProblem(
- ParseProblemSeverity.ERROR,
- Problem.UnterminatedXMLTag,
- msg,
- msgArgs,
- start.getCursor(),
- errorMark.getCursor(),
- start.getLine(), start.getCol());
+ CompilerErrorUtil.recordUnterminatedElement(jet2Listener, ">", start, reader); //$NON-NLS-1$
}
reader.nextChar();
JETMark stop = reader.mark();
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
index 7939b58..e6c9044 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
@@ -9,8 +9,37 @@ import org.eclipse.jet.JET2Template;
public class CodeGenTemplateLoader implements JET2TemplateLoader, JET2TemplateLoaderExtension {
- private interface TemplateFactoryMethod {
- public abstract JET2Template newTemplate();
+ private static final class TemplateFactoryMethod {
+
+ private final String templatePath;
+ private final String templateClass;
+
+ public TemplateFactoryMethod(String templatePath, String templateClass) {
+ this.templatePath = templatePath;
+ this.templateClass = templateClass;
+
+ }
+
+ public String getTemplateClass() {
+ return templateClass;
+ }
+
+ public String getTemplatePath() {
+ return templatePath;
+ }
+
+ public JET2Template newTemplate() {
+ JET2Template template = null;
+ try {
+ template = (JET2Template) Class.forName(templateClass).newInstance();
+ } catch (InstantiationException e) {
+ } catch (IllegalAccessException e) {
+ } catch (ClassNotFoundException e) {
+ }
+ return template;
+ }
+
+
}
private Map pathToFactoryMap = null;
@@ -23,60 +52,29 @@ public class CodeGenTemplateLoader implements JET2TemplateLoader, JET2TemplateLo
public JET2Template getTemplate(String templatePath) {
if(pathToFactoryMap == null) {
- pathToFactoryMap = new HashMap(8);
- pathToFactoryMap.put("templates/writeJavaExpression.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.WriteJavaExpressionTemplate();
- }
- });
- pathToFactoryMap.put("templates/jet2java.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.JET2JavaGenerator();
- }
- });
- pathToFactoryMap.put("templates/xmlStart.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.XMLStartGenerator();
- }
- });
- pathToFactoryMap.put("templates/main.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.DummyMain();
- }
- });
- pathToFactoryMap.put("templates/jet2transform.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.JET2TransformGenerator();
- }
- });
- pathToFactoryMap.put("templates/xmlEnd.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.XMLEndGenerator();
- }
- });
- pathToFactoryMap.put("templates/tagDataDeclarations.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.TagDataDeclGenerator();
- }
- });
- pathToFactoryMap.put("templates/writeTextElement.jet", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new org.eclipse.jet.internal.compiler.templates.WriteTextElementTemplate();
- }
- });
+ initPathToFactoryMap();
}
TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);
return factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();
}
+ private void addTemplate(String templatePath, String templateClass) {
+ pathToFactoryMap.put(templatePath, //$NON-NLS-1$
+ new TemplateFactoryMethod(templatePath, templateClass));
+ }
+
+ private void initPathToFactoryMap() {
+ pathToFactoryMap = new HashMap(8);
+ addTemplate("templates/writeJavaExpression.jet", "org.eclipse.jet.internal.compiler.templates.WriteJavaExpressionTemplate" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/jet2java.jet", "org.eclipse.jet.internal.compiler.templates.JET2JavaGenerator" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/xmlStart.jet", "org.eclipse.jet.internal.compiler.templates.XMLStartGenerator" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/main.jet", "org.eclipse.jet.internal.compiler.templates.DummyMain" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/jet2transform.jet", "org.eclipse.jet.internal.compiler.templates.JET2TransformGenerator" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/xmlEnd.jet", "org.eclipse.jet.internal.compiler.templates.XMLEndGenerator" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/tagDataDeclarations.jet", "org.eclipse.jet.internal.compiler.templates.TagDataDeclGenerator" ); //$NON-NLS-1$ //$NON-NLS-2$
+ addTemplate("templates/writeTextElement.jet", "org.eclipse.jet.internal.compiler.templates.WriteTextElementTemplate" ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
public void setDelegateLoader(JET2TemplateLoader loader) {
this.delegate = loader;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
index e869afc..31e958a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
@@ -21,19 +21,19 @@ Map templateMap = (Map) parms.getTemplateMap();;
out.write( parms.getPackageName() );
out.write( ";\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\nimport org.eclipse.jet.JET2TemplateLoader;\r\nimport org.eclipse.jet.JET2TemplateLoaderExtension;\r\nimport org.eclipse.jet.JET2Template;\r\n\r\npublic class " ); //$NON-NLS-1$
out.write( parms.getClassName() );
- out.write( " implements JET2TemplateLoader, JET2TemplateLoaderExtension {\r\n\r\n\tprivate interface TemplateFactoryMethod {\r\n\t\tpublic abstract JET2Template newTemplate();\r\n\t}\r\n\r\n\tprivate Map pathToFactoryMap = null;\r\n\t\r\n\tprivate JET2TemplateLoader delegate = null;\r\n\r\n\tpublic " ); //$NON-NLS-1$
+ out.write( " implements JET2TemplateLoader, JET2TemplateLoaderExtension {\r\n\r\n\tprivate static final class TemplateFactoryMethod {\r\n\r\n\t\tprivate final String templatePath;\r\n\t\tprivate final String templateClass;\r\n\r\n\t\tpublic TemplateFactoryMethod(String templatePath, String templateClass) {\r\n\t\t\tthis.templatePath = templatePath;\r\n\t\t\tthis.templateClass = templateClass;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tpublic String getTemplateClass() {\r\n\t\t\treturn templateClass;\r\n\t\t}\r\n\r\n\t\tpublic String getTemplatePath() {\r\n\t\t\treturn templatePath;\r\n\t\t}\r\n\r\n\t\tpublic JET2Template newTemplate() {\r\n\t\t\tJET2Template template = null;\r\n\t\t\ttry {\r\n\t\t\t\ttemplate = (JET2Template) Class.forName(templateClass).newInstance();\r\n\t\t\t} catch (InstantiationException e) {\r\n\t\t\t} catch (IllegalAccessException e) {\r\n\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t}\r\n\t\t\treturn template;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\r\n\tprivate Map pathToFactoryMap = null;\r\n\t\r\n\tprivate JET2TemplateLoader delegate = null;\r\n\r\n\tpublic " ); //$NON-NLS-1$
out.write( parms.getClassName() );
- out.write( "() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic JET2Template getTemplate(String templatePath) {\r\n\t if(pathToFactoryMap == null) {\r\n\t pathToFactoryMap = new HashMap(" ); //$NON-NLS-1$
+ out.write( "() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic JET2Template getTemplate(String templatePath) {\r\n\t if(pathToFactoryMap == null) {\r\n \t initPathToFactoryMap();\r\n }\r\n TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);\r\n\t\treturn factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();\r\n\t}\r\n\r\n\tprivate void addTemplate(String templatePath, String templateClass) {\r\n\t\tpathToFactoryMap.put(templatePath, //$NON-NLS-1$\r\n\t\t new TemplateFactoryMethod(templatePath, templateClass));\r\n\t}\r\n\t\r\n private void initPathToFactoryMap() {\r\n\t pathToFactoryMap = new HashMap(" ); //$NON-NLS-1$
out.write( templateMap.size() );
out.write( ");\r\n" ); //$NON-NLS-1$
for(Iterator i = templateMap.entrySet().iterator(); i.hasNext();){
Map.Entry entry = (Map.Entry)i.next();
- out.write( "\t\t pathToFactoryMap.put(\"" ); //$NON-NLS-1$
+ out.write( "\t\t addTemplate(\"" ); //$NON-NLS-1$
out.write( entry.getKey() );
- out.write( "\", //$NON-NLS-1$\r\n\t\t new TemplateFactoryMethod() {\r\n\t\t public JET2Template newTemplate() {\r\n return new " ); //$NON-NLS-1$
+ out.write( "\", \"" ); //$NON-NLS-1$
out.write( entry.getValue() );
- out.write( "();\r\n\t\t }\r\n\t\t });\r\n" ); //$NON-NLS-1$
- } out.write( " }\r\n TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);\r\n\t\treturn factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();\r\n\t}\r\n\r\n public void setDelegateLoader(JET2TemplateLoader loader) {\r\n this.delegate = loader;\r\n }\r\n \r\n public JET2TemplateLoader getDelegateLoader() {\r\n return delegate;\r\n }\r\n}\r\n\r\n" ); //$NON-NLS-1$
+ out.write( "\" ); //$NON-NLS-1$ //$NON-NLS-2$\r\n" ); //$NON-NLS-1$
+ } out.write( "\t}\r\n\r\n public void setDelegateLoader(JET2TemplateLoader loader) {\r\n this.delegate = loader;\r\n }\r\n \r\n public JET2TemplateLoader getDelegateLoader() {\r\n return delegate;\r\n }\r\n}\r\n\r\n" ); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/ModelLoaderExtManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/ModelLoaderExtManager.java
index 347e473..52a0236 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/ModelLoaderExtManager.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/ModelLoaderExtManager.java
@@ -59,6 +59,8 @@ import org.eclipse.jet.runtime.model.ILoaderManager;
*/
public final class ModelLoaderExtManager implements IRegistryChangeListener
{
+ private static boolean DEBUG = InternalJET2Platform.getDefault().isDebugging()
+ && Boolean.valueOf(Platform.getDebugOption("org.eclipse.jet/debug/modelLoaderExtensions")).booleanValue(); //$NON-NLS-1$
private static final String PLUGIN_ID = "org.eclipse.jet"; //$NON-NLS-1$
@@ -115,10 +117,17 @@ public final class ModelLoaderExtManager implements IRegistryChangeListener
IExtension ext = deltas[i].getExtension();
if (deltas[i].getKind() == IExtensionDelta.ADDED)
{
+ if(DEBUG)
+ {
+ System.out.println("ModelLoaderExtManager.registryChanged(add " + ext.getContributor().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
addConfigElements(ext.getConfigurationElements());
}
else
{
+ if(DEBUG) {
+ System.out.println("ModelLoaderExtManager.registryChanged(remove " + ext.getContributor().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
removeConfigElements(ext.getConfigurationElements());
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/PluginProjectMonitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/PluginProjectMonitor.java
index 40787bd..e5461aa 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/PluginProjectMonitor.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/PluginProjectMonitor.java
@@ -43,6 +43,7 @@ import org.eclipse.jet.internal.InternalJET2Platform;
import org.eclipse.jet.internal.JETActivatorWrapper;
import org.eclipse.jet.internal.runtime.BundleManifest;
import org.eclipse.jet.internal.runtime.JETBundleManager;
+import org.eclipse.jet.internal.runtime.NotABundleException;
/**
* Monitor plugin projects in the workspace for changes in extension point definitions
@@ -232,6 +233,11 @@ public class PluginProjectMonitor implements IResourceChangeListener
{
JETActivatorWrapper.INSTANCE.log(e);
}
+ catch (NotABundleException e)
+ {
+ // arises when we find MANIFEST.MF that is not a OSGi bundle. In this case, we'll
+ // just assume the plug-in does not contain JET tags
+ }
}
public void shutdown()
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java
index 9e77691..0d578df 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java
@@ -65,6 +65,8 @@ public class JET2Messages extends NLS
public static String JET2BundleBuildTool_CreatingJar;
+ public static String JET2Compiler_TagShouldBeEmptyFormat;
+
public static String JET2Context_InvalidVariableName;
public static String JETStreamMonitor_Debug;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties
index 32f622d..7b1eeb5 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties
@@ -55,6 +55,7 @@ JET2Compiler_ErrorRemovingMarkers=Unexpected error removing resource markers
JET2Compiler_ErrorCreatingMarkers=Unexpected exception creating problem markers
JET2Compiler_SameJavaClassAsOther=This template creates the same Java class {0} as {1}
JET2Compiler_TagCannotHaveContent=Tag can only occur as an empty tag.
+JET2Compiler_TagShouldBeEmptyFormat=Tag should be have format {0}
JET2Compiler_DeprecatedAttribute=Use of deprecated attribute: {0}
JET2Compiler_MissingDirectiveAttribute=The {0} directive requires an {1} attribute.
JET2Compiler_MissingRequiredAttribute=Missing required attribute: {0}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java
index cfdae55..16ea08d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2002-2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java
index 6ebb213..5a100b5 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2002-2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java
index b8fe5b0..9c45dd2 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2002-2004 IBM Corporation and others.
+ * Copyright (c) 2002, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java
index cb7fc25..7be9a5d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2002-2005 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -79,6 +79,7 @@ import java.util.Map;
import org.eclipse.emf.codegen.CodeGenPlugin;
import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.internal.compiler.CompilerErrorUtil;
/**
@@ -388,7 +389,7 @@ public class JETParser
{
public boolean accept(JETParseEventListener listener, JETReader reader, JETParser parser) throws JETException
{
- String close, open, end_open = null;
+ String close, open;
Map attrs = null;
if (reader.matches(parser.getOpenScriptlet()))
@@ -403,28 +404,11 @@ public class JETParser
reader.advance(open.length());
- if (end_open != null)
- {
- attrs = reader.parseTagAttributes();
-
- reader.skipSpaces();
- if (!reader.matches(end_open))
- {
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", //$NON-NLS-1$
- new Object []{ open, reader.mark().toString() }));
- }
- reader.advance(end_open.length());
- reader.skipSpaces();
- }
-
JETMark start = reader.mark();
JETMark stop = reader.skipUntil(close);
if (stop == null)
{
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", //$NON-NLS-1$
- new Object []{ open, reader.mark().toString() }));
+ throw new JETException(CompilerErrorUtil.getUnterminatedMessage(open, close, reader));
}
listener.handleScriptlet(start, stop, attrs);
return true;
@@ -454,9 +438,7 @@ public class JETParser
JETMark stop = reader.skipUntil(close);
if (stop == null)
{
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", //$NON-NLS-1$
- new Object []{ open, reader.mark().toString() }));
+ throw new JETException(CompilerErrorUtil.getUnterminatedMessage(open, close, reader));
}
listener.handleExpression(start, stop, attrs);
return true;
@@ -555,9 +537,8 @@ public class JETParser
reader.skipSpaces();
if (!reader.matches(parser.getCloseDirective()))
{
- throw new JETException(CodeGenPlugin.getPlugin().getString(
- "jet.error.unterminated", //$NON-NLS-1$
- new Object []{ parser.getOpenDirective(), reader.mark().toString() }));
+ throw new JETException(CompilerErrorUtil.getUnterminatedMessage(parser.getOpenDirective(),
+ parser.getCloseDirective(), reader));
}
else
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
index d377485..a70cd95 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2002-2005 IBM Corporation and others.
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@ import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.emf.codegen.CodeGenPlugin;
@@ -529,7 +530,7 @@ public class JETReader
skipSpaces();
if (peekChar() != '=')
{
- throw new JETException(CodeGenPlugin.getPlugin().getString("jet.error.attr.novalue", new Object []{ name, mark().toString() })); //$NON-NLS-1$
+ throw new JETException(CodeGenPlugin.getPlugin().getString("jet.error.param.novalue", new Object []{ name, mark().toString() })); //$NON-NLS-1$
}
attributeMarks[2] = mark(); // equals
nextChar();
@@ -560,7 +561,7 @@ public class JETReader
*/
public HashMap parseTagAttributes() throws JETException
{
- HashMap values = new HashMap(11);
+ HashMap values = new LinkedHashMap(11);
while (true)
{
skipSpaces();
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/AdditionalBundleLocationProvider.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/AdditionalBundleLocationProvider.java
new file mode 100644
index 0000000..39dc0c3
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/AdditionalBundleLocationProvider.java
@@ -0,0 +1,231 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.runtime;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.JETPreferences;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * BundleProvider for directories referenced in the JET preferences
+ */
+public class AdditionalBundleLocationProvider implements IJETBundleProvider, IPreferenceChangeListener
+{
+ private static boolean DEBUG = InternalJET2Platform.getDefault().isDebugging()
+ && Boolean.valueOf(Platform.getDebugOption("org.eclipse.jet/debug/additionalBundleLoading")).booleanValue(); //$NON-NLS-1$
+
+ private IEclipsePreferences defaultsNode;
+ private IEclipsePreferences configurationNode;
+ private IEclipsePreferences instanceNode;
+ private IEclipsePreferences[] searchList;
+ private final IPreferencesService service = Platform.getPreferencesService();
+ private final List directoryProviders = new ArrayList();
+
+ private String[] parseAdditionalPathString(String stringList) {
+ if(stringList == null) return new String[0];
+ StringTokenizer st = new StringTokenizer(stringList, File.pathSeparator
+ + "\n\r");//$NON-NLS-1$
+ List v = new ArrayList();
+ while (st.hasMoreElements()) {
+ v.add(st.nextElement());
+ }
+ return (String[]) v.toArray(new String[v.size()]);
+}
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#getAllJETBundleDescriptors()
+ */
+ public Collection getAllJETBundleDescriptors()
+ {
+ Set allIds = getAllJETBundleIds();
+
+ List descriptors = new ArrayList(allIds.size());
+ for (Iterator i = allIds.iterator(); i.hasNext();)
+ {
+ String id = (String)i.next();
+ descriptors.add(getDescriptor(id));
+ }
+
+ return descriptors;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#getAllJETBundleIds()
+ */
+ public Set getAllJETBundleIds()
+ {
+ if(DEBUG) System.out.println("AdditionalBundleLocationProvider.getAllJETBundleIds()");; //$NON-NLS-1$
+ Set result = new HashSet();
+ for (Iterator i = directoryProviders.iterator(); i.hasNext();)
+ {
+ DirectoryBundleProvider provider = (DirectoryBundleProvider)i.next();
+ result.addAll(provider.getAllJETBundleIds());
+ }
+ if(DEBUG) System.out.println(" " + result); //$NON-NLS-1$
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#getDescriptor(java.lang.String)
+ */
+ public IJETBundleDescriptor getDescriptor(String id)
+ {
+ if(DEBUG) System.out.println("AdditionalBundleLocationProvider.getDescriptor(" + id + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ IJETBundleDescriptor descriptor = null;
+ for (Iterator i = directoryProviders.iterator(); i.hasNext() && descriptor == null;)
+ {
+ DirectoryBundleProvider provider = (DirectoryBundleProvider)i.next();
+ descriptor = provider.getDescriptor(id);
+ }
+ return descriptor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#load(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public Bundle load(String id, IProgressMonitor monitor) throws BundleException
+ {
+ Bundle bundle = null;
+ final DynamicJETBundleDescriptor descriptor = (DynamicJETBundleDescriptor)getDescriptor(id);
+ if(descriptor != null)
+ {
+ bundle = InternalJET2Platform.getDefault().getJETBundleInstaller().installBundle(descriptor.getBundleURL());
+ if(DEBUG) System.out.println("[deployedBundle] Loaded " + bundle.getSymbolicName()); //$NON-NLS-1$
+ }
+ return bundle;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#shutdown()
+ */
+ public void shutdown()
+ {
+ instanceNode.removePreferenceChangeListener(this);
+ directoryProviders.clear();
+
+ configurationNode = null;
+ instanceNode = null;
+ searchList = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#startup()
+ */
+ public void startup()
+ {
+ if(DEBUG) {
+ System.out.println("AdditionalBundleLocationProvider.startup()"); //$NON-NLS-1$
+ }
+ defaultsNode = new DefaultScope().getNode(JET2Platform.PLUGIN_ID);
+ configurationNode = new ConfigurationScope().getNode(JET2Platform.PLUGIN_ID);
+ instanceNode = new InstanceScope().getNode(JET2Platform.PLUGIN_ID);
+ searchList = new IEclipsePreferences[] {
+ instanceNode,
+ configurationNode,
+ defaultsNode,
+ };
+
+ final String additonalLocations = service.get(JETPreferences.ADDITIONAL_TEMPLATE_JAR_LOCATIONS, null, searchList);
+ addTransforms(additonalLocations);
+
+ instanceNode.addPreferenceChangeListener(this);
+ }
+
+
+ /**
+ * @param additonalLocations
+ */
+ private void addTransforms(final String additonalLocations)
+ {
+ if(DEBUG)
+ {
+ System.out.println("AdditionalBundleLocationProvider.addTransforms(" + additonalLocations + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String[] dirNames = parseAdditionalPathString(additonalLocations);
+
+
+ directoryProviders.clear();
+
+ File[] dirs = new File[dirNames.length];
+ for (int i = 0; i < dirNames.length; i++)
+ {
+ dirs[i] = new File(dirNames[i]);
+ if(dirs[i].exists() && dirs[i].isDirectory())
+ {
+ directoryProviders.add(new DirectoryBundleProvider(dirs[i]));
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#unload(java.lang.String)
+ */
+ public void unload(String id) throws BundleException
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.internal.runtime.IJETBundleProvider#unload(org.osgi.framework.Bundle)
+ */
+ public void unload(Bundle bundle) throws BundleException
+ {
+ if(bundle != null)
+ {
+ if(DEBUG) System.out.println("[deployedBundle] Unloading " + bundle.getSymbolicName()); //$NON-NLS-1$
+ bundle.uninstall();
+ }
+ }
+
+
+ public void preferenceChange(PreferenceChangeEvent event)
+ {
+ if(DEBUG) {
+ System.out.println("AdditionalBundleLocationProvider.preferenceChange()"); //$NON-NLS-1$
+ System.out.println(" key: " + event.getKey()); //$NON-NLS-1$
+ System.out.println(" old: " + event.getOldValue()); //$NON-NLS-1$
+ System.out.println(" new: " + event.getNewValue()); //$NON-NLS-1$
+ }
+ if(JETPreferences.ADDITIONAL_TEMPLATE_JAR_LOCATIONS.equals(event.getKey())) {
+ final String additonalLocations = service.get(JETPreferences.ADDITIONAL_TEMPLATE_JAR_LOCATIONS, null, searchList);
+ addTransforms(additonalLocations);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleJarInfo.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleJarInfo.java
new file mode 100644
index 0000000..84429fe
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleJarInfo.java
@@ -0,0 +1,87 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.runtime;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Information class on OSGi Bundle Jars.
+ */
+public class BundleJarInfo
+{
+ /**
+ * Factory for create a BundleJarInfo instance
+ * @param jarName the jar file name
+ * @return the BundleJarInfo instance, or <code>null</code> if <code>jarName</code> is not a bundle jar.
+ */
+ public static BundleJarInfo createBundleJarInfo(String jarName)
+ {
+ final Matcher m = jarPattern.matcher(jarName);
+
+
+ return m.matches() ? new BundleJarInfo(jarName, m.group(1), m.group(2)) : null;
+ }
+
+ private final String jarName;
+
+ private static final String VERSION = "\\d+\\.\\d+\\.\\d+"; //$NON-NLS-1$
+ /**
+ * Pattern for pulling symbolic name and version from an exported JAR which is of the form
+ * <p><code>symbolicName_version.jar</code></p>
+ * <p>
+ * Note that plug-in is can contain numbers, and that the 4th component may contain underscores, so
+ * you can have a plug-in such as:
+ * </p>
+ * <p><code>symbolic name: a.b.c_1.2.3.x_yz</code></p>
+ * <p><code>version: 4.5.6.a_b_c</code></p>
+ * <p><code>jar file name: a.b.c_1.2.3.x_yz_4.5.6.a_b_c.jar</code></p>
+ */
+ private final static Pattern jarPattern = Pattern.compile(
+ "((?:\\w|\\.|\\_)+)" // group 1: capture symbolic name //$NON-NLS-1$
+ + "_(" + VERSION + "(?:\\..*)?)" // group 2: capture version //$NON-NLS-1$ //$NON-NLS-2$
+ + "(?!" + VERSION + ").jar" // negative look-ahead for VERSION unsures we get the right parts //$NON-NLS-1$ //$NON-NLS-2$
+ );
+
+ private final String symbolicName;
+
+ private final String version;
+
+ private BundleJarInfo(String jarName, String symbolicName, String version)
+ {
+ this.jarName = jarName;
+ this.symbolicName = symbolicName;
+ this.version = version;
+ }
+
+ public String getBundleSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public final String getJarName()
+ {
+ return jarName;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleManifest.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleManifest.java
index 61e22b3..da00e4d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleManifest.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/BundleManifest.java
@@ -27,8 +27,11 @@ public class BundleManifest
{
protected final Dictionary manifest;
- public BundleManifest(Dictionary manifest)
+ public BundleManifest(Dictionary manifest) throws NotABundleException
{
+ if(manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null) {
+ throw new NotABundleException(manifest);
+ }
this.manifest = manifest;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DeployedJETBundleProvider.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DeployedJETBundleProvider.java
index 18bd661..00f4e98 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DeployedJETBundleProvider.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DeployedJETBundleProvider.java
@@ -16,8 +16,6 @@
*/
package org.eclipse.jet.internal.runtime;
-import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Collection;
@@ -38,8 +36,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jet.JET2Platform;
import org.eclipse.jet.internal.InternalJET2Platform;
-import org.eclipse.jet.internal.extensionpoints.TransformData;
-import org.eclipse.jet.internal.extensionpoints.TransformDataFactory;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.transform.IJETBundleDescriptor;
import org.osgi.framework.Bundle;
@@ -157,28 +153,16 @@ public class DeployedJETBundleProvider implements IJETBundleProvider, IRegistryC
if (jet2Bundle != null)
{
Bundle declaringBundle = Platform.getBundle(configElements[i].getDeclaringExtension().getNamespace());
- try
+ URL bundleURL = declaringBundle.getEntry(jet2Bundle);
+ IJETBundleDescriptor descriptor = JETBundleManager.getJETBundleDescriptorForJAR(bundleURL);
+ if(descriptor != null)
{
- URL bundleURL = declaringBundle.getEntry(jet2Bundle);
- URL jarURL = new URL("jar", "", bundleURL.toExternalForm() + "!/"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- JETBundleManifest manifest = JETBundleManager.loadManifest(jarURL);
- TransformData transformData = TransformDataFactory.INSTANCE.createTransformData(manifest.getTransformId(), jarURL);
-
- final DynamicJETBundleDescriptor descriptor = new DynamicJETBundleDescriptor(manifest, transformData, jarURL, bundleURL);
descriptorsById.put(descriptor.getId(), descriptor);
if (DEBUG)
{
- InternalJET2Platform.debugMessage(this, "addTransforms(" + descriptor.getId() + ", " + jarURL + ")"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ InternalJET2Platform.debugMessage(this, "addTransforms(" + descriptor.getId() + ", " + bundleURL + ")"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
}
- catch (MalformedURLException e)
- {
- InternalJET2Platform.logError("Unexpected failure getting deployed transform information.", e); //$NON-NLS-1$
- }
- catch (IOException e)
- {
- InternalJET2Platform.logError("Unexpected failure reading deployed transform manifest.", e); //$NON-NLS-1$
- }
}
else
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DirectoryBundleProvider.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DirectoryBundleProvider.java
new file mode 100644
index 0000000..305dfad
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DirectoryBundleProvider.java
@@ -0,0 +1,188 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.runtime;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Bundle Provider for bundles stored in a directory.
+ */
+public class DirectoryBundleProvider implements IJETBundleProvider
+{
+ private static boolean DEBUG = InternalJET2Platform.getDefault().isDebugging()
+ && Boolean.valueOf(Platform.getDebugOption("org.eclipse.jet/debug/additionalBundleLoading")).booleanValue(); //$NON-NLS-1$
+
+ private final File directory;
+
+ /**
+ *
+ * @param directoryLocation
+ */
+ public DirectoryBundleProvider(String directoryLocation)
+ {
+ this(new File(directoryLocation));
+ }
+
+ public DirectoryBundleProvider(File directory)
+ {
+ if(!directory.exists() || !directory.isDirectory())
+ {
+ throw new IllegalArgumentException();
+ }
+ this.directory = directory;
+ System.out.println("DirectoryBundleProvider.DirectoryBundleProvider(" + directory.getAbsolutePath() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public Collection getAllJETBundleDescriptors()
+ {
+ final Map descriptorsById = getDescriptorsById();
+ return descriptorsById.values();
+ }
+
+ /**
+ * @return
+ */
+ private Map getDescriptorsById()
+ {
+ final Map descriptorsById = new HashMap();
+ directory.listFiles(new FileFilter() {
+
+ public boolean accept(File pathname)
+ {
+ final BundleJarInfo jarInfo = BundleJarInfo.createBundleJarInfo(pathname.getName());
+
+ if(jarInfo != null)
+ {
+ try
+ {
+ final URL bundleURL = pathname.toURL();
+ final IJETBundleDescriptor descriptor = JETBundleManager.getJETBundleDescriptorForJAR(bundleURL);
+ if(descriptor != null)
+ {
+ descriptorsById.put(jarInfo.getBundleSymbolicName(), descriptor);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ // should not have happened.
+ }
+ }
+
+ return false;
+ }});
+ return descriptorsById;
+ }
+
+ public Set getAllJETBundleIds()
+ {
+ if(DEBUG) System.out.println("DirectoryBundleProvider.getAllJETBundleIds()"); //$NON-NLS-1$
+
+ final Map descriptorsById = getDescriptorsById();
+ if(DEBUG) System.out.println(" ids: " + descriptorsById.keySet()); //$NON-NLS-1$
+ return descriptorsById.keySet();
+ }
+
+ private URL getBundleURL(final String id)
+ {
+
+ File[] jars = directory.listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name)
+ {
+ final BundleJarInfo jarInfo = BundleJarInfo.createBundleJarInfo(name);
+ return jarInfo != null && jarInfo.getBundleSymbolicName().equals(id);
+ }});
+
+ URL url = null;
+ if(jars.length > 0)
+ {
+ try
+ {
+ url = jars[0].toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // do nothing...
+ }
+ }
+
+ return url;
+ }
+
+ public IJETBundleDescriptor getDescriptor(String id)
+ {
+ if(DEBUG) System.out.println("DirectoryBundleProvider.getDescriptor("+ id + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ URL bundleURL = getBundleURL(id);
+ IJETBundleDescriptor descriptor = null;
+
+ if(bundleURL != null)
+ {
+ descriptor = JETBundleManager.getJETBundleDescriptorForJAR(bundleURL);
+ }
+
+ if(DEBUG) System.out.println(" " + (descriptor == null ? "not found" : "found")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return descriptor;
+ }
+
+ public Bundle load(String id, IProgressMonitor monitor) throws BundleException
+ {
+ URL bundleURL = getBundleURL(id);
+ Bundle bundle = null;
+ if(bundleURL != null)
+ {
+ bundle = InternalJET2Platform.getDefault().getJETBundleInstaller().installBundle(bundleURL);
+ }
+ return bundle;
+ }
+
+ public void shutdown()
+ {
+ }
+
+ public void startup()
+ {
+ }
+
+ public void unload(String id) throws BundleException
+ {
+ }
+
+ public void unload(Bundle bundle) throws BundleException
+ {
+ if(bundle != null)
+ {
+ bundle.uninstall();
+ }
+ }
+
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/InstalledJETBundleProvider.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/InstalledJETBundleProvider.java
index b5127f2..889a948 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/InstalledJETBundleProvider.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/InstalledJETBundleProvider.java
@@ -165,6 +165,10 @@ public final class InstalledJETBundleProvider implements IRegistryChangeListener
{
e.printStackTrace();
}
+ catch (NotABundleException e)
+ {
+ e.printStackTrace();
+ }
}
public void removeJETPlugin(String id)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleDescriptor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleDescriptor.java
index f2cc147..fc243c0 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleDescriptor.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleDescriptor.java
@@ -95,7 +95,7 @@ public class JETBundleDescriptor implements IJETBundleDescriptor
*/
public String getName()
{
- return name;
+ return name == null ? id : name;
}
/* (non-Javadoc)
@@ -103,7 +103,7 @@ public class JETBundleDescriptor implements IJETBundleDescriptor
*/
public String getDescription()
{
- return description;
+ return description == null ? "" : description; //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManager.java
index 93723c7..70a21df 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManager.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManager.java
@@ -18,6 +18,7 @@ package org.eclipse.jet.internal.runtime;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
@@ -39,6 +40,8 @@ import org.eclipse.jet.CoreJETException;
import org.eclipse.jet.JET2Platform;
import org.eclipse.jet.JET2TemplateLoader;
import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.extensionpoints.TransformData;
+import org.eclipse.jet.internal.extensionpoints.TransformDataFactory;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.transform.IJETBundleDescriptor;
import org.eclipse.jet.transform.IJETBundleManager;
@@ -110,7 +113,7 @@ public class JETBundleManager implements IJETBundleManager
}
}
- public static JETBundleManifest loadManifest(URL pluginURL) throws IOException
+ public static JETBundleManifest loadManifest(URL pluginURL) throws IOException, NotABundleException
{
URL manifestURL = new URL(pluginURL, JarFile.MANIFEST_NAME);
@@ -127,6 +130,40 @@ public class JETBundleManager implements IJETBundleManager
}
}
+ /**
+ * Return a JET bundle descriptor the JAR refered to by <code>bundleURL</code>.
+ * @param bundleURL a URL to a bundle JAR
+ * @return the bundle descriptor, or <code>null</code> if this is not a JET bundle.
+ */
+ public static IJETBundleDescriptor getJETBundleDescriptorForJAR(URL bundleURL)
+ {
+ IJETBundleDescriptor descriptor = null;
+ try
+ {
+ URL jarURL = new URL("jar", "", bundleURL.toExternalForm() + "!/"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ JETBundleManifest manifest = JETBundleManager.loadManifest(jarURL);
+ TransformData transformData = TransformDataFactory.INSTANCE.createTransformData(manifest.getTransformId(), jarURL);
+
+ descriptor = new DynamicJETBundleDescriptor(manifest, transformData, jarURL, bundleURL);
+ if(descriptor.getTemplateLoaderClass() == null) {
+ descriptor = null;
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ InternalJET2Platform.logError("Failed to correctly format a jar URL. bundleURL = " + bundleURL.toExternalForm(), e); //$NON-NLS-1$
+ }
+ catch (IOException e)
+ {
+ // can't read. Assume it's not a JET bundle.
+ }
+ catch (NotABundleException e)
+ {
+ // MANIFEST.MF is not an OSGi bundle, so it's not a JET bundle.
+ }
+ return descriptor;
+ }
+
private static Properties manifestToProperties(Attributes d) {
Iterator iter = d.keySet().iterator();
Properties result = new Properties();
@@ -143,6 +180,8 @@ public class JETBundleManager implements IJETBundleManager
private DeployedJETBundleProvider deployedBundleProvider;
+ private AdditionalBundleLocationProvider additionalBundleLocationProvider;
+
private IJETBundleProvider[] providerSearchOrder;
private Map bundlesById = new HashMap();
@@ -241,6 +280,9 @@ public class JETBundleManager implements IJETBundleManager
deployedBundleProvider.shutdown();
deployedBundleProvider = null;
+ additionalBundleLocationProvider.shutdown();
+ additionalBundleLocationProvider = null;
+
providerSearchOrder = null;
}
@@ -257,11 +299,15 @@ public class JETBundleManager implements IJETBundleManager
deployedBundleProvider = new DeployedJETBundleProvider();
deployedBundleProvider.startup();
+ additionalBundleLocationProvider = new AdditionalBundleLocationProvider();
+ additionalBundleLocationProvider.startup();
+
// Note: The order here is significant. Changing it will have impacts on
// which transform is found.
providerSearchOrder = new IJETBundleProvider[] {
installedBundleProvider,
projectBundleProvider,
+ additionalBundleLocationProvider,
deployedBundleProvider,
};
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManifest.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManifest.java
index ccef69f..a38bbbb 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManifest.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JETBundleManifest.java
@@ -27,9 +27,10 @@ public class JETBundleManifest extends BundleManifest
public static final String JET2_TRANSFORM_LOADER_ATTRIBUTE = "JET2-TransformClass"; //$NON-NLS-1$
/**
+ * @throws NotABundleException
*
*/
- public JETBundleManifest(Dictionary manifest)
+ public JETBundleManifest(Dictionary manifest) throws NotABundleException
{
super(manifest);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/NotABundleException.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/NotABundleException.java
new file mode 100644
index 0000000..51314b2
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/NotABundleException.java
@@ -0,0 +1,49 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.runtime;
+
+import java.util.Dictionary;
+
+/**
+ * Exception thrown when a {@link BundleManifest} is constructed against
+ * a manifest that is not an Eclipse Bundle.
+ */
+public class NotABundleException extends Exception
+{
+
+ private final Dictionary manifest;
+
+ public NotABundleException(Dictionary manifest)
+ {
+ this.manifest = manifest;
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -344501343498059244L;
+
+ /**
+ * A dictionary of Manifest values passed to {@link BundleManifest#BundleManifest(Dictionary)}.
+ * @return Returns the manifest.
+ */
+ public final Dictionary getManifest()
+ {
+ return manifest;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectJETBundleProvider.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectJETBundleProvider.java
index 87551ce..a06f78c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectJETBundleProvider.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectJETBundleProvider.java
@@ -227,6 +227,10 @@ public class ProjectJETBundleProvider implements IResourceChangeListener, IJETBu
{
e.printStackTrace();
}
+ catch (NotABundleException e)
+ {
+ // not an OSGi bundle, so it cannot be a JET bundle
+ }
}
public IJETBundleDescriptor getDescriptorForProject(String name)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java
index 8c6ea32..ddd2d9d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java
@@ -46,7 +46,8 @@ public abstract class SafeCustomRuntimeTag implements RuntimeTagElement
public void handleException(Throwable exception)
{
- if (exception instanceof RuntimeException)
+
+ if (exception instanceof RuntimeException && !(exception instanceof JET2TagException))
{
// we make the assumption that runtime exceptions we're unintended results of
// tag execution, and that a clearer message should be issued.
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
index a3f4f85..3f2bbf4 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
@@ -246,7 +246,7 @@ public final class TagDefinitionImpl implements TagDefinition
{
boolean allowed = false;
if (kind == CustomTagKind.FUNCTION || kind == CustomTagKind.CONTAINER || kind == CustomTagKind.CONDITIONAL
- || kind == CustomTagKind.ITERATING)
+ || kind == CustomTagKind.ITERATING || kind == CustomTagKind.OTHER)
{
allowed = true;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java
index efbafa9..8c0d4ed 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java
@@ -62,7 +62,7 @@ public class CopyElementTag extends AbstractEmptyTag
Object newElement = xpathExtender.copyElement(srcElement, tgtParent, name, recursive);
- if (name != null && newElement != null)
+ if (var != null && newElement != null)
{
context.setVariable(var, newElement);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/DumpTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/DumpTag.java
index f90e4f2..6bd3c57 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/DumpTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/DumpTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -104,7 +104,11 @@ public class DumpTag extends AbstractEmptyTag {
if ("true".equalsIgnoreCase(_entities)) { entities = true; } //$NON-NLS-1$
if ("yes".equalsIgnoreCase(_entities)) { entities = true; } //$NON-NLS-1$
- dump(resolved_node,format,entities,1,context,out);
+// dump(resolved_node,format,entities,1,context,out);
+
+ StringBuffer buffer = new StringBuffer();
+ dump2(resolved_node,format,entities,1,context,buffer);
+ out.write(buffer.toString());
/**
* End doAction logic
@@ -112,7 +116,119 @@ public class DumpTag extends AbstractEmptyTag {
}
- public void dump(Object node, boolean format, boolean entities, int indent, JET2Context context, JET2Writer out) {
+ private void dump2(Object node, boolean format, boolean entities, int indent, JET2Context context, StringBuffer out)
+ {
+ final String CHILD_NODES_XPATH = "child::node()"; //$NON-NLS-1$
+ final String ATTRIBUTEs_XPATH = "attribute::*"; //$NON-NLS-1$
+ final String ATTRIBUTE_NAME_XPATH = "name()"; //$NON-NLS-1$
+ final String NODE_VALUE_XPATH = "string()"; //$NON-NLS-1$
+ XPathContextExtender xpc = XPathContextExtender.getInstance(context);
+
+ INodeInspector inspector = InspectorManager.getInstance().getInspector(node);
+ if(inspector == null)
+ {
+ return;
+ }
+
+ final NodeKind nodeKind = inspector.getNodeKind(node);
+ if(nodeKind == NodeKind.ELEMENT)
+ {
+ out.append("<"); //$NON-NLS-1$
+ final String tagName = inspector.nameOf(node);
+ out.append(tagName);
+ final Object[] attrs = xpc.resolve(node, ATTRIBUTEs_XPATH);
+ for (int i = 0; attrs != null && i < attrs.length; i++)
+ {
+ out.append(" "); //$NON-NLS-1$
+ out.append(xpc.resolveAsString(attrs[i], ATTRIBUTE_NAME_XPATH));
+ out.append("="); //$NON-NLS-1$
+ out.append(useRightQuotes(xpc.resolveAsString(attrs[i], NODE_VALUE_XPATH)));
+ }
+ final Object[] children = xpc.resolve(node, CHILD_NODES_XPATH);
+ if(children != null && children.length > 0)
+ {
+ out.append(">"); //$NON-NLS-1$
+ writeChildren(children, format, entities, indent, context, out);
+ out.append("</"); //$NON-NLS-1$
+ out.append(tagName);
+ out.append(">"); //$NON-NLS-1$
+ }
+ else
+ {
+ out.append("/>"); //$NON-NLS-1$
+ }
+ }
+ else if(nodeKind == NodeKind.TEXT)
+ {
+ String buffer = xpc.resolveAsString(node, NODE_VALUE_XPATH);
+ if (entities) { buffer = insertEntities(buffer); }
+ out.append(buffer);
+ }
+ else if(nodeKind == NodeKind.COMMENT)
+ {
+ out.append("<!--"); //$NON-NLS-1$
+ out.append(xpc.resolveAsString(node, NODE_VALUE_XPATH));
+ out.append("-->"); //$NON-NLS-1$
+ }
+ else if(nodeKind == NodeKind.ROOT)
+ {
+ final Object[] children = xpc.resolve(node, CHILD_NODES_XPATH);
+ if(children != null) {
+ writeChildren(children, format, entities, 0, context, out);
+ }
+ }
+ else if(nodeKind == NodeKind.PROCESSING_INSTRUCTION)
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+
+ /**
+ * @param children
+ * @param format
+ * @param entities
+ * @param indent
+ * @param context
+ * @param out
+ */
+ private void writeChildren(final Object[] children, boolean format, boolean entities, int indent, JET2Context context, StringBuffer out)
+ {
+ boolean textEncountered = false;
+ for (int i = 0; i < children.length; i++)
+ {
+ INodeInspector childInspector = InspectorManager.getInstance().getInspector(children[i]);
+ textEncountered = textEncountered || childInspector.getNodeKind(children[i]) == NodeKind.TEXT;
+
+ if(!textEncountered && format)
+ {
+ out.append(NL);
+ indent(out, indent);
+ }
+
+ dump2(children[i], format, entities, indent + 1, context, out);
+
+ }
+ if(!textEncountered && format)
+ {
+ out.append(NL);
+ indent(out, indent - 1);
+ }
+ }
+
+ /**
+ * @param out
+ * @param indent
+ */
+ private void indent(StringBuffer out, int indent)
+ {
+ for (int j = 0; j < indent; j++) { out.append(" "); } //$NON-NLS-1$
+ }
+
+ public void dump(Object node, boolean format, boolean entities, int indent, JET2Context context, JET2Writer out) {
boolean written = false;
boolean writeKids = false;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java
index 114e8cd..918a611 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java
@@ -52,6 +52,9 @@ public class IncludeTag extends AbstractEmptyTag
String template = getAttribute("template"); //$NON-NLS-1$
String restoreNames = getAttribute("restoreNames"); //$NON-NLS-1$
String passVariables = getAttribute("passVariables"); //$NON-NLS-1$
+
+ String useSuperStr = getAttribute("super"); //$NON-NLS-1$
+ boolean useSuper = useSuperStr != null && Boolean.valueOf(useSuperStr).booleanValue();
if(restoreNames != null && passVariables != null)
{
@@ -73,7 +76,7 @@ public class IncludeTag extends AbstractEmptyTag
try
{
TransformContextExtender tce = new TransformContextExtender(context);
- tce.execute(template, out);
+ tce.execute(template, useSuper, out);
}
finally
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java
index 30d262f..e0c301f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java
@@ -25,7 +25,6 @@ import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.taglib.AbstractContainerTag;
import org.eclipse.jet.taglib.JET2TagException;
import org.eclipse.jet.taglib.TagInfo;
-import org.eclipse.jet.taglib.UserRegionHelper;
/**
@@ -58,13 +57,14 @@ public class InitialCodeTag extends AbstractContainerTag
*/
public void doAfterBody(TagInfo td, JET2Context context, JET2Writer out) throws JET2TagException
{
+ String unmodifiedMarker = getAttribute("unmodifiedMarker"); //$NON-NLS-1$
if (!(getParent() instanceof UserRegionTag))
{
throw new JET2TagException(MessageFormat.format(JET2Messages.AnyTag_IllegalParent, new Object []{ "userRegion" })); //$NON-NLS-1$
}
- UserRegionHelper.markInitialCode(out, initialCodeOffset, out.getDocument().getLength());
+ ((UserRegionTag)getParent()).setInitiaCodeRegion(initialCodeOffset, out.getDocument().getLength(), unmodifiedMarker);
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadContentTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadContentTag.java
index e3db222..62f2f94 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadContentTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadContentTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/NodeAttributesTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/NodeAttributesTag.java
index 187a874..f909469 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/NodeAttributesTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/NodeAttributesTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ReplaceStringsTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ReplaceStringsTag.java
index 6912b8e..0fae806 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ReplaceStringsTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ReplaceStringsTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
index 0b46178..7798b55 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -77,12 +77,19 @@ public class StringTokensTag extends AbstractIteratingTag {
*/
doAnotherIteration = index < tokens.length;
-
- tokenNode = tokens[index];
-
- context.setVariable(_name, tokenNode); // TODO Need an inspector for StringToken
-
- index++;
+ if (!doAnotherIteration) { return false; }
+
+ context.setVariable(_name, tokenNode);
+
+ XPathContextExtender xpathContext = XPathContextExtender.getInstance(context);
+
+ xpathContext.setAttribute(tokenNode,"value",tokens[index].getToken()); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"delimiter",tokens[index].getDelimiter()); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"first",String.valueOf(tokens[index].isFirst())); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"last",String.valueOf(tokens[index].isLast())); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"index",String.valueOf(index)); //$NON-NLS-1$
+
+ index++;
/**
* End doEvalLoopCondition logic
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java
index 9d389e6..181d724 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java
@@ -34,6 +34,10 @@ public class UserRegionTag extends AbstractContainerTag
{
private int userRegionOffset;
+ private int initialCodeStart = -1;
+ private int initialCodeEnd = -1;
+ private String unmodifiedMarker = null;
+
/**
*
@@ -49,6 +53,10 @@ public class UserRegionTag extends AbstractContainerTag
public void doAfterBody(TagInfo td, JET2Context context, JET2Writer out) throws JET2TagException
{
UserRegionHelper.markUserRegion(out, userRegionOffset, out.getDocument().getLength());
+ if (initialCodeStart >= 0)
+ {
+ UserRegionHelper.markInitialCode(out, initialCodeStart, initialCodeEnd, unmodifiedMarker);
+ }
}
/* (non-Javadoc)
@@ -58,5 +66,17 @@ public class UserRegionTag extends AbstractContainerTag
{
userRegionOffset = out.getDocument().getLength();
}
+
+ /**
+ * Allow InitialCodeTag to register its region.
+ * @param start start of the initial code region (includsive of start)
+ * @param end end of the inital code region (exclusive of end)
+ * @param unmodifiedMarker an optional marker that indicates unmodified text.
+ */
+ void setInitiaCodeRegion(int start, int end, String unmodifiedMarker) {
+ this.initialCodeStart = start;
+ this.initialCodeEnd = end;
+ this.unmodifiedMarker = unmodifiedMarker;
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/FormatNowTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/FormatNowTag.java
index e8f0200..cb397d2 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/FormatNowTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/FormatNowTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/MillisecondsTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/MillisecondsTag.java
index dcaed71..041b8b8 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/MillisecondsTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/MillisecondsTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UniqueTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UniqueTag.java
index bcb4179..10b680a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UniqueTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UniqueTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UuidTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UuidTag.java
index eff6f50..3bdb560 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UuidTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UuidTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaPackageAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaPackageAction.java
index 6b08fad..2300b29 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaPackageAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaPackageAction.java
@@ -16,6 +16,7 @@
*/
package org.eclipse.jet.internal.taglib.java;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
@@ -58,9 +59,12 @@ public class JavaPackageAction extends AbstractWorkspaceAction implements IWorks
*/
public void performAction(IProgressMonitor monitor) throws JET2TagException
{
- IFolder folder = JavaActionsUtil.getFolderForPackage(srcFolderPath, packageName);
+ IContainer container = JavaActionsUtil.getContainerForPackage(srcFolderPath, packageName);
- ActionsUtil.ensureFolderExists(folder, monitor);
+ if(container instanceof IFolder)
+ {
+ ActionsUtil.ensureFolderExists((IFolder)container, monitor);
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java
index e705339..f990f63 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java
@@ -19,7 +19,9 @@ package org.eclipse.jet.internal.taglib.workspace;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.AbstractContainerTag;
@@ -54,6 +56,7 @@ public class ProjectTag extends AbstractContainerTag
public void doBeforeBody(TagInfo td, JET2Context context, JET2Writer out) throws JET2TagException
{
String name = getAttribute(NAME__ATTR);
+ String location = getAttribute("location"); //$NON-NLS-1$
WorkspaceContextExtender wsExtender = new WorkspaceContextExtender(context);
@@ -67,8 +70,14 @@ public class ProjectTag extends AbstractContainerTag
throw new JET2TagException(e.getMessage(), e);
}
+ final IProjectDescription projectDescription = ResourcesPlugin.getWorkspace().newProjectDescription(name);
+ if(location != null) {
+
+ projectDescription.setLocation(new Path(location));
+
+ }
TransformContextExtender tce = new TransformContextExtender(context);
- wsExtender.addAction(new WsProjectAction(context, tce.getTemplatePath(), td, project));
+ wsExtender.addAction(new WsProjectAction(context, tce.getTemplatePath(), td, project, projectDescription));
wsExtender.pushContainer(project);
containerPushed = true;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/RebuildWorkspaceTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/RebuildWorkspaceTag.java
index 4975fa5..090f5fa 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/RebuildWorkspaceTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/RebuildWorkspaceTag.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
index e8907f1..e780edd 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
@@ -21,6 +21,7 @@ package org.eclipse.jet.internal.taglib.workspace;
import java.text.MessageFormat;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jet.JET2Context;
@@ -48,18 +49,22 @@ public class WsProjectAction extends AbstractWorkspaceAction implements IWorkspa
private final JET2Context context;
+ private final IProjectDescription description;
+
/**
*
* @param context
* @param templatePath
* @param tagInfo
* @param project
+ * @param description
*/
- public WsProjectAction(JET2Context context, String templatePath, TagInfo tagInfo, IProject project)
+ public WsProjectAction(JET2Context context, String templatePath, TagInfo tagInfo, IProject project, IProjectDescription description)
{
super(tagInfo, templatePath);
this.context = context;
this.project = project;
+ this.description = description;
}
/* (non-Javadoc)
@@ -83,7 +88,7 @@ public class WsProjectAction extends AbstractWorkspaceAction implements IWorkspa
*/
public void performAction(IProgressMonitor monitor) throws JET2TagException
{
- ActionsUtil.createProject(project, monitor);
+ ActionsUtil.createProject(project, description, monitor);
final String createMessage = MessageFormat.format(JET2Messages.WsProjectAction_CreatingProject, new Object []{ project.getName() });
RuntimeLoggerContextExtender.log(context, createMessage, getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java
index 83e58f4..aeaca9f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java
@@ -17,8 +17,12 @@
package org.eclipse.jet.internal.xpath;
+import java.text.MessageFormat;
+
+import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.internal.xpath.ast.ExprNode;
import org.eclipse.jet.internal.xpath.functions.BuiltinXPathFunctionResolver;
+import org.eclipse.jet.internal.xpath.parser.Token;
import org.eclipse.jet.internal.xpath.parser.XPathParser;
import org.eclipse.jet.xpath.IAnnotationManager;
import org.eclipse.jet.xpath.NamespaceContext;
@@ -26,6 +30,7 @@ import org.eclipse.jet.xpath.XPath;
import org.eclipse.jet.xpath.XPathException;
import org.eclipse.jet.xpath.XPathExpression;
import org.eclipse.jet.xpath.XPathFunctionResolver;
+import org.eclipse.jet.xpath.XPathSyntaxException;
import org.eclipse.jet.xpath.XPathVariableResolver;
@@ -94,7 +99,9 @@ public class XPathImpl implements XPath
XPathParser parser = new XPathParser(expression, functionResolver, nsContext);
ExprNode expr = parser.expr();
- // FIXME verify that the parser is at the end of its input.
+ if(parser.peekNext() != Token.EOF_TOKEN) {
+ throw new XPathSyntaxException(MessageFormat.format(JET2Messages.XPath_UnrecognizedToken, new Object[] {parser.peekNext()}));
+ }
// FIXME Do a semantic analysis of expr to detect semantic errors not found in parsing.
XPathExpressionImpl pathExpr = new XPathExpressionImpl(expr, variableResolver, annotationManager);
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
index 96e9a16..039ee9f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
@@ -242,7 +242,7 @@ public abstract class Axis
}
- private static final class DescendentOrSelfAxis extends Axis
+ private static final class DescendantOrSelfAxis extends Axis
{
public NodeSet evaluate(NodeTest nodeTest, Context context)
@@ -273,7 +273,7 @@ public abstract class Axis
public String getAxisName()
{
- return "descendent-or-self"; //$NON-NLS-1$
+ return "descendant-or-self"; //$NON-NLS-1$
}
}
@@ -286,7 +286,7 @@ public abstract class Axis
private static final Axis selfAxis = new SelfAxis();
- private static final Axis descendentOrSelfAxis = new DescendentOrSelfAxis();
+ private static final Axis descendantOrSelfAxis = new DescendantOrSelfAxis();
private static final Map axisByNameMap = new HashMap(15);
static
@@ -295,7 +295,7 @@ public abstract class Axis
axisByNameMap.put(attributeAxis.getAxisName(), attributeAxis);
axisByNameMap.put(parentAxis.getAxisName(), parentAxis);
axisByNameMap.put(selfAxis.getAxisName(), selfAxis);
- axisByNameMap.put(descendentOrSelfAxis.getAxisName(), descendentOrSelfAxis);
+ axisByNameMap.put(descendantOrSelfAxis.getAxisName(), descendantOrSelfAxis);
}
/**
@@ -327,9 +327,9 @@ public abstract class Axis
return parentAxis;
}
- public static Axis descendentOfSelf()
+ public static Axis descendantOrSelf()
{
- return descendentOrSelfAxis;
+ return descendantOrSelfAxis;
}
public static Axis axisByName(String axisName)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java
index db3598c..9068e3c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java
@@ -37,7 +37,7 @@ import org.eclipse.jet.xpath.inspector.InspectorManager;
public class StringFunction implements XPathFunction, XPathFunctionWithContext
{
- public static final XPathFunctionMetaData FUNCTION_META_DATA = new XPathFunctionMetaData("string", null, new StringFunction(), 1, 1); //$NON-NLS-1$
+ public static final XPathFunctionMetaData FUNCTION_META_DATA = new XPathFunctionMetaData("string", null, new StringFunction(), 0, 1); //$NON-NLS-1$
private Context context;
/**
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CamelCaseFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CamelCaseFunction.java
index 8ae09a6..dd0fe39 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CamelCaseFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CamelCaseFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CardinalityFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CardinalityFunction.java
index 4e44571..1e7ac85 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CardinalityFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/CardinalityFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/ClassNameFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/ClassNameFunction.java
index ebddf22..9b41979 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/ClassNameFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/ClassNameFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/EscapeJavaWhitespaceFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/EscapeJavaWhitespaceFunction.java
index 5481dd2..cd04657 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/EscapeJavaWhitespaceFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/EscapeJavaWhitespaceFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Lower_caseFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Lower_caseFunction.java
index 51a1706..a16f949 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Lower_caseFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Lower_caseFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/LowercaseFirstFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/LowercaseFirstFunction.java
index fa06943..babbdd1 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/LowercaseFirstFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/LowercaseFirstFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/PackageNameFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/PackageNameFunction.java
index ae514e0..9cddc36 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/PackageNameFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/PackageNameFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/RemoveWhitespaceFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/RemoveWhitespaceFunction.java
index 8a54c64..0baaaeb 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/RemoveWhitespaceFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/RemoveWhitespaceFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/TrimWhitespaceFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/TrimWhitespaceFunction.java
index cdd119a..32d7479 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/TrimWhitespaceFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/TrimWhitespaceFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Upper_caseFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Upper_caseFunction.java
index 3ebe08e..50bd68e 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Upper_caseFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/Upper_caseFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/UppercaseFirstFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/UppercaseFirstFunction.java
index d97215c..3c1acc9 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/UppercaseFirstFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/UppercaseFirstFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/XmlEncodeFunction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/XmlEncodeFunction.java
index 72a1c86..fc91a9f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/XmlEncodeFunction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/extras/XmlEncodeFunction.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005-2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java
index f63a55c..ad76635 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java
@@ -17,6 +17,9 @@
package org.eclipse.jet.internal.xpath.inspectors;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
@@ -28,18 +31,56 @@ public class EMFEAttrAsElementWrapper
{
private final Setting setting;
+ private final int index;
public EMFEAttrAsElementWrapper(Setting setting)
{
+ this(setting, -1);
+ }
+
+ public EMFEAttrAsElementWrapper(Setting setting, int index)
+ {
this.setting = setting;
- // TODO Auto-generated constructor stub
+ this.index = index;
+ }
+
+ public final Object getValue()
+ {
+
+ final Object object = setting.get(true);
+ if(setting.getEStructuralFeature().isMany()) {
+ EList list = (EList)object;
+ return 0 <= index && index < list.size() ? list.get(index) : null;
+ }
+ else
+ {
+ return object;
+ }
+ }
+
+ public final EStructuralFeature getFeature()
+ {
+ return setting.getEStructuralFeature();
+ }
+
+ public final EObject getEObject()
+ {
+ return setting.getEObject();
}
- /**
- * @return Returns the setting.
- */
- public final Setting getSetting()
+ public void remove()
{
- return setting;
+ if(setting.getEStructuralFeature().isMany())
+ {
+ EList list = (EList)setting.get(true);
+ if(index >= 0 && index < list.size())
+ {
+ list.remove(index);
+ }
+ }
+ else
+ {
+ setting.unset();
+ }
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java
index 684786b..6031b2d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java
@@ -18,7 +18,7 @@
package org.eclipse.jet.internal.xpath.inspectors;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.jet.xpath.inspector.AddElementException;
import org.eclipse.jet.xpath.inspector.ExpandedName;
import org.eclipse.jet.xpath.inspector.IElementInspector;
import org.eclipse.jet.xpath.inspector.InvalidChildException;
@@ -54,7 +54,7 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public Object getParent(Object obj)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)obj;
- return wrapper.getSetting().getEObject();
+ return wrapper.getEObject();
}
/* (non-Javadoc)
@@ -63,8 +63,7 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public String stringValueOf(Object object)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)object;
- final Setting setting = wrapper.getSetting();
- return stringValueOfFeature(setting.getEStructuralFeature(), setting.get(true));
+ return stringValueOfFeature(wrapper.getFeature(), wrapper.getValue());
}
/* (non-Javadoc)
@@ -73,8 +72,7 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public ExpandedName expandedNameOf(Object object)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)object;
- final Setting setting = wrapper.getSetting();
- return expandedNameOfFeature(setting.getEObject(), setting.getEStructuralFeature());
+ return expandedNameOfFeature(wrapper.getEObject(), wrapper.getFeature());
}
/* (non-Javadoc)
@@ -83,7 +81,7 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public Object getDocumentRoot(Object contextNode)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)contextNode;
- return super.getDocumentRoot(wrapper.getSetting().getEObject());
+ return super.getDocumentRoot(wrapper.getEObject());
}
/* (non-Javadoc)
@@ -91,7 +89,8 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
*/
public Object[] getChildren(Object contextNode)
{
- return EMPTY_ARRAY;
+ // this is a simple element, which has a single text node as a child, containing its value...
+ return new Object[] { new EMFXMLNodeWrapper(contextNode, stringValueOf(contextNode), NodeKind.TEXT)};
}
/* (non-Javadoc)
@@ -100,8 +99,7 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public String nameOf(Object contextNode)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)contextNode;
- final Setting setting = wrapper.getSetting();
- return nameOfFeature(setting.getEObject(), setting.getEStructuralFeature());
+ return nameOfFeature(wrapper.getEObject(), wrapper.getFeature());
}
public Object addElement(Object contextNode, ExpandedName elementName, Object addBeforeThisSibling) throws SimpleElementRequiresValueException,
@@ -113,8 +111,39 @@ public class EMFEAttrAsElementWrapperInspector extends EObjectInspector implemen
public void removeElement(Object contextNode)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)contextNode;
- final Setting setting = wrapper.getSetting();
- setting.unset();
-
+ wrapper.remove();
+ }
+
+ public Object[] getAttributes(Object contextNode)
+ {
+ return new Object[0];
+ }
+
+ public Object[] getNamedChildren(Object contextNode, ExpandedName nameTestExpandedName)
+ {
+ return new Object[0];
+ }
+
+ public void removeAttribute(Object element, String name)
+ {
+ // do nothing
+ }
+
+ public Object addTextElement(Object parentElement, String name, String bodyContent, boolean asCData) throws AddElementException
+ {
+ // FIXME Externalize
+ throw new AddElementException("Cannot add child element to simple types");
+ }
+
+ public boolean createAttribute(Object contextNode, String attributeName, String value)
+ {
+ return false;
+ }
+
+ public Object getNamedAttribute(Object contextNode, ExpandedName nameTestExpandedName)
+ {
+ return null;
}
+
+
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java
index c198189..e7fde76 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java
@@ -17,7 +17,6 @@
package org.eclipse.jet.internal.xpath.inspectors;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.jet.xpath.inspector.INodeInspector;
import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
@@ -29,7 +28,7 @@ import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
public class EMFXMLNodeWrapper
{
- private final EObject parent;
+ private final Object parent;
private final String text;
@@ -41,7 +40,7 @@ public class EMFXMLNodeWrapper
* @param nodeKind TODO
*
*/
- public EMFXMLNodeWrapper(EObject parent, String text, INodeInspector.NodeKind nodeKind)
+ public EMFXMLNodeWrapper(Object parent, String text, INodeInspector.NodeKind nodeKind)
{
super();
this.parent = parent;
@@ -52,7 +51,7 @@ public class EMFXMLNodeWrapper
/**
* @return Returns the parent.
*/
- public final EObject getParent()
+ public final Object getParent()
{
return parent;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
index 9ed50e1..a45f41b 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
@@ -26,6 +26,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
@@ -48,7 +49,9 @@ import org.eclipse.jet.xpath.inspector.AddElementException;
import org.eclipse.jet.xpath.inspector.CopyElementException;
import org.eclipse.jet.xpath.inspector.ExpandedName;
import org.eclipse.jet.xpath.inspector.IElementInspector;
+import org.eclipse.jet.xpath.inspector.INodeInspector;
import org.eclipse.jet.xpath.inspector.INodeInspectorExtension1;
+import org.eclipse.jet.xpath.inspector.InspectorManager;
import org.eclipse.jet.xpath.inspector.InvalidChildException;
import org.eclipse.jet.xpath.inspector.SimpleElementRequiresValueException;
@@ -242,7 +245,7 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
private boolean matchesFeature(ExpandedName expandedName, EStructuralFeature feature)
{
ExpandedName featureEN = expandedNameOfFeature(feature);
- final boolean equals = expandedName.equals(featureEN);
+ final boolean equals = expandedName.equals(featureEN) || expandedName.equals(new ExpandedName(feature.getName()));
return equals;
}
@@ -371,6 +374,9 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
}
}
}
+ else if(object instanceof EEnumLiteral) {
+ return ((EEnumLiteral)object).getLiteral();
+ }
return EMPTY_STRING;
}
@@ -393,9 +399,9 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
}
else if (children[i] instanceof EMFEAttrAsElementWrapper)
{
- Setting setting = ((EMFEAttrAsElementWrapper)children[i]).getSetting();
- Object rawValue = setting.get(true);
- result.append(stringValueOfFeature(setting.getEStructuralFeature(), rawValue));
+ final EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)children[i];
+ Object rawValue = wrapper.getValue();
+ result.append(stringValueOfFeature(wrapper.getFeature(), rawValue));
}
}
}
@@ -488,7 +494,18 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
{
if (eObject.eIsSet(feature))
{
- result.add(new EMFEAttrAsElementWrapper(((InternalEObject)eObject).eSetting(feature)));
+ final Setting setting = ((InternalEObject)eObject).eSetting(feature);
+ if(!feature.isMany())
+ {
+ result.add(new EMFEAttrAsElementWrapper(setting));
+ }
+ else
+ {
+ final EList list = (EList)setting.get(true);
+ for(int j = 0; j < list.size(); j++ ) {
+ result.add(new EMFEAttrAsElementWrapper(setting, j));
+ }
+ }
}
}
else if (feature.isMany())
@@ -609,7 +626,8 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
EPackage ePkg = feature.getEContainingClass().getEPackage();
String namespace = ePkg.getNsURI();
String nsPrefix = ePkg.getNsPrefix();
- Object root = getDocumentRoot(eObject);
+ final INodeInspector inspector = InspectorManager.getInstance().getInspector(eObject);
+ Object root = inspector.getDocumentRoot(eObject);
if (root instanceof EObject)
{
String namespace2 = getExtendedMetaData().getNamespace(feature);
@@ -680,7 +698,7 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
else if (allChildren[i] instanceof EMFEAttrAsElementWrapper)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)allChildren[i];
- if (matchesFeature(nameTestExpandedName, wrapper.getSetting().getEStructuralFeature()))
+ if (matchesFeature(nameTestExpandedName, wrapper.getFeature()))
{
result.add(wrapper);
}
@@ -983,7 +1001,21 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
else
{
EcoreUtil.Copier copier = new ShallowCopier();
- newElement = copier.copy(srcEObject);
+ EObject newEObject = copier.copy(srcEObject);
+ copier.copyReferences();
+ final EClass eClass = newEObject.eClass();
+ if(isXMLNode(eClass)) {
+ // copyReferences will have copied mixed and any features, if present
+ // we need to remove these...
+ final EAttribute mixedFeature = extendedMetaData.getMixedFeature(eClass);
+ if(mixedFeature != null)
+ {
+ FeatureMap fm = (FeatureMap)newEObject.eGet(mixedFeature);
+ fm.clear();
+ }
+ }
+
+ newElement = newEObject;
}
addElementToParent(eObject, feature, newElement, null);
@@ -991,9 +1023,8 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
else if (srcElement instanceof EMFEAttrAsElementWrapper)
{
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper)srcElement;
- Setting setting = wrapper.getSetting();
- eObject.eSet(feature, setting.get(true));
+ eObject.eSet(feature, wrapper.getValue());
newElement = new EMFEAttrAsElementWrapper(((InternalEObject)eObject).eSetting(feature));
}
else
@@ -1067,7 +1098,8 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
{
EObject eObject = (EObject)element;
final Setting setting = getNamedAttributeInternal(eObject, new ExpandedName(name));
- if(setting != null && setting.isSet() && setting.getEStructuralFeature().isUnsettable()) {
+// if(setting != null && setting.isSet() && setting.getEStructuralFeature().isUnsettable()) {
+ if(setting != null) {
setting.unset();
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java
index fe60b2b..f488eee 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java
@@ -363,7 +363,7 @@ public class XPathParser
else if (peekNext() == XPathTokens.SLASH_SLASH)
{
consumeToken();
- anchorNode = new Step(new Root(), Axis.descendentOfSelf(), NodeTest.allNodes());
+ anchorNode = new Step(new Root(), Axis.descendantOrSelf(), NodeTest.allNodes());
}
else
{
@@ -404,7 +404,8 @@ public class XPathParser
}
else if (peekNext() == XPathTokens.SLASH_SLASH)
{
- result = step(new Step(result, Axis.descendentOfSelf(), NodeTest.allNodes()));
+ consumeToken();
+ result = step(new Step(result, Axis.descendantOrSelf(), NodeTest.allNodes()));
}
else
{
@@ -430,7 +431,7 @@ public class XPathParser
{
// build a descendent-or-self axis
consumeToken();
- return relativeLocationPath(new Step(castToNodeSetExpr(filterExpr), Axis.descendentOfSelf(), NodeTest.allNodes()));
+ return relativeLocationPath(new Step(castToNodeSetExpr(filterExpr), Axis.descendantOrSelf(), NodeTest.allNodes()));
}
else
{
@@ -668,7 +669,7 @@ public class XPathParser
return ti.getTokenText(input);
}
- private Token peekNext()
+ public Token peekNext()
{
return peek(1);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java
index c65bfd4..0925a4a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java
@@ -297,19 +297,8 @@ public class XPathTokenScanner
public int next()
{
- int next = EOF;
- try
- {
- next = input.charAt(nextOffset);
- }
- catch (IndexOutOfBoundsException e)
- {
- // do nothing
- }
- finally
- {
- ++nextOffset;
- }
+ int next = nextOffset < input.length() ? input.charAt(nextOffset) : EOF;
+ ++nextOffset;
return next;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
index a8ef90e..b9f644d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagUtil.java
@@ -16,11 +16,15 @@
*/
package org.eclipse.jet.taglib;
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import java.net.MalformedURLException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.taglib.workspace.ActionsUtil;
/**
* Utility class with various functions useful to tag implementations
@@ -36,17 +40,33 @@ public class TagUtil
super();
}
+ /**
+ * Return the contents of the text file refered to by location.
+ * @param location the full file system location of the resource.
+ * @return the contents as a string
+ * @throws CoreException if an error occurs while reading the file
+ * @throws IllegalArgumentException if <code>location</code> does not refer to an existing workspace file.
+ */
public static String getContents(IPath location) throws CoreException
{
- final ITextFileBufferManager mgr = FileBuffers.getTextFileBufferManager();
- mgr.connect(location, new NullProgressMonitor());
- try
- {
- return mgr.getTextFileBuffer(location).getDocument().get();
- }
- finally
- {
- mgr.disconnect(location, new NullProgressMonitor());
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location);
+ if(file != null) {
+ String encoding = file.getCharset();
+ try
+ {
+ return ActionsUtil.readTextFile(file.getLocationURI().toURL(), encoding);
+ }
+ catch (JET2TagException e)
+ {
+ final Exception cause = (Exception)e.getCause();
+ throw new CoreException(InternalJET2Platform.newStatus(IStatus.ERROR, cause.getMessage(), cause));
+ }
+ catch (MalformedURLException e)
+ {
+ throw new CoreException(InternalJET2Platform.newStatus(IStatus.ERROR, e.getMessage(), e));
+ }
+ } else {
+ throw new IllegalArgumentException(location.toString());
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
index 77b4979..105fc59 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
@@ -1,5 +1,6 @@
package org.eclipse.jet.taglib;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jet.IWriterListener;
@@ -8,6 +9,7 @@ import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
+
/**
* Utility class that allows implementation of user regions like &lt;c:userRegion&;gt.
* <p>
@@ -22,15 +24,38 @@ import org.eclipse.jface.text.Position;
*/
public final class UserRegionHelper implements IWriterListener
{
+ /**
+ * Position subclass that tracks user regions that include an unmodified marker.
+ */
+ private static class PositionWithUnmodifiedMarker extends Position
+ {
+
+ public final String unmodifiedMarker;
+
+ /**
+ * @param offset
+ * @param length
+ */
+ public PositionWithUnmodifiedMarker(int offset, int length, String unmodifiedMarker)
+ {
+ super(offset, length);
+ this.unmodifiedMarker = unmodifiedMarker;
+
+ }
+
+ }
+
private static final String INITIALCODE_POSITION_CATEGORY = "org.eclipse.jet.internal.taglib.control.initialcode"; //$NON-NLS-1$
+
private static final String ROUNDTRIP_LISTENER_CATEGORY = "org.eclipse.jet.internal.taglib.control.userRegion"; //$NON-NLS-1$
+
private static final String USERREGION_POSITION_CATEGORY = "org.eclipse.jet.internal.taglib.control.userRegion"; //$NON-NLS-1$
private UserRegionHelper()
{
// do nothing, but prevent external construction.
}
-
+
public void finalizeContent(JET2Writer writer, Object file)
{
if (file instanceof IFile)
@@ -60,6 +85,14 @@ public final class UserRegionHelper implements IWriterListener
final Position userRegionPosition = rtPositions[i];
Position initialCodePosition = findContainedInitialCodePosition(userRegionPosition, icPositions);
+ if (initialCodePosition == null)
+ {
+ continue;
+ }
+
+ String unmodifiedMarker = initialCodePosition instanceof PositionWithUnmodifiedMarker
+ ? ((PositionWithUnmodifiedMarker)initialCodePosition).unmodifiedMarker : null;
+
final Position beginMarkerPosition = new Position(userRegionPosition.offset, initialCodePosition.offset
- userRegionPosition.offset);
int endMarkerOffset = initialCodePosition.offset + initialCodePosition.length;
@@ -76,7 +109,8 @@ public final class UserRegionHelper implements IWriterListener
if (existingEndMarkerOffset != -1)
{
final String existingRegion = fileContents.substring(existingRegionOffset, existingEndMarkerOffset + endMarker.length());
- if(!existingRegion.equals(document.get(userRegionPosition.offset, userRegionPosition.length)))
+ if (!existingRegion.equals(document.get(userRegionPosition.offset, userRegionPosition.length))
+ && (unmodifiedMarker == null || existingRegion.indexOf(unmodifiedMarker) == -1))
{
document.replace(userRegionPosition.offset, userRegionPosition.length, existingRegion);
}
@@ -124,13 +158,37 @@ public final class UserRegionHelper implements IWriterListener
* @param out a JET2Writer
* @param initialCodeStart the inclusive offset (zero-based) of the start of the region's initial code block (immediately after the start tag).
* @param initialCodeEnd the exclusive offset (zero-based) of the end of the region's initial code block (offset of the end tag).
+ * @param unmodifiedMarker if non-null, indicates a string, that if present in the documents initial code indicates the initial code is unmodifiedand may be replaced
+ * @since 0.7.1
*/
- public static void markInitialCode(JET2Writer out, final int initialCodeStart, int initialCodeEnd)
+ public static void markInitialCode(JET2Writer out, final int initialCodeStart, int initialCodeEnd, String unmodifiedMarker)
{
out.addPositionCategory(INITIALCODE_POSITION_CATEGORY);
- out.addPosition(INITIALCODE_POSITION_CATEGORY, new Position(initialCodeStart, initialCodeEnd - initialCodeStart));
+ if (unmodifiedMarker == null)
+ {
+ out.addPosition(INITIALCODE_POSITION_CATEGORY, new Position(initialCodeStart, initialCodeEnd - initialCodeStart));
+ }
+ else
+ {
+ out.addPosition(INITIALCODE_POSITION_CATEGORY, new PositionWithUnmodifiedMarker(
+ initialCodeStart,
+ initialCodeEnd - initialCodeStart,
+ unmodifiedMarker));
+ }
}
-
+
+ /**
+ * Mark the initial code portion of the user region. Equivalent to
+ * <code>markInitialCode(out, initialCodeStart, initialCodeEnd, null)</code>.
+ * @param out a JET2Writer
+ * @param initialCodeStart the inclusive offset (zero-based) of the start of the region's initial code block (immediately after the start tag).
+ * @param initialCodeEnd the exclusive offset (zero-based) of the end of the region's initial code block (offset of the end tag).
+ * @see #markInitialCode(JET2Writer, int, int, String)
+ */
+ public static void markInitialCode(JET2Writer out, final int initialCodeStart, int initialCodeEnd) {
+ markInitialCode(out, initialCodeStart, initialCodeEnd, null);
+ }
+
/**
* Mark the user region on the output writer
* @param out a JET2Writer
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/java/JavaActionsUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/java/JavaActionsUtil.java
index 04ce139..86bb471 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/java/JavaActionsUtil.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/java/JavaActionsUtil.java
@@ -19,8 +19,10 @@ package org.eclipse.jet.taglib.java;
import java.text.MessageFormat;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -62,10 +64,23 @@ public class JavaActionsUtil
* @param packageName the package name
* @return the folder corresponding to the package
* @throws JET2TagException if the source folder is not valid.
+ * @deprecated Use {@link #getContainerForPackage(IPath,String)} instead
*/
public static IFolder getFolderForPackage(IPath sourceFolder, String packageName) throws JET2TagException
{
- IFolder result = null;
+ return (IFolder)getContainerForPackage(sourceFolder, packageName);
+ }
+
+ /**
+ * Return the {@link IFolder} corresponding to the given Java package name.
+ * @param sourceFolder the source folder containing the package
+ * @param packageName the package name
+ * @return the folder corresponding to the package
+ * @throws JET2TagException if the source folder is not valid.
+ */
+ public static IContainer getContainerForPackage(IPath sourceFolder, String packageName) throws JET2TagException
+ {
+ IContainer result = null;
if (sourceFolder == null || packageName == null)
{
throw new NullPointerException();
@@ -76,79 +91,82 @@ public class JavaActionsUtil
}
// if the JDT is not sync'd with the workspace changes, this may return null.
- IJavaElement jElementForFolder = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getFolder(sourceFolder));
+ IJavaElement jElementForFolder = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().findMember(sourceFolder));
if (jElementForFolder == null)
{
// checkpoint the workspace (inform the builders) of our changes to date...
ActionsUtil.checkpointWorkspace(true, new NullProgressMonitor());
// and try again...
- jElementForFolder = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getFolder(sourceFolder));
+ jElementForFolder = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().findMember(sourceFolder));
}
if (jElementForFolder != null)
{
// find the package fragment root corresponding to sourceFolder
- if (!(jElementForFolder instanceof IPackageFragmentRoot))
- {
- throw new JET2TagException(MessageFormat.format(JET2Messages.JavaActionsUtil_InvalidSourceFolder, new Object []{ sourceFolder.toString() }));
- }
- IPackageFragmentRoot root = (IPackageFragmentRoot)jElementForFolder;
- final IPackageFragment packageFragment = root.getPackageFragment(packageName);
- result = (IFolder)packageFragment.getResource();
- }
- else
- {
- // sourceFolder wasn't a package root, maybe its just a project name, and we need to use the first package
- // root in that project that contains the packageName
- if (sourceFolder.segmentCount() >= 1)
+ if (jElementForFolder instanceof IPackageFragmentRoot)
{
- String msg;
- msg = JET2Messages.JavaActionsUtil_InvalidSourceFolder;
- throw new JET2TagException(MessageFormat.format(msg, new Object []{ sourceFolder.toString() }));
+ IPackageFragmentRoot root = (IPackageFragmentRoot)jElementForFolder;
+ final IPackageFragment packageFragment = root.getPackageFragment(packageName);
+ result = (IContainer)packageFragment.getResource();
}
- IJavaProject jProject = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(sourceFolder.segment(0)));
- try
+ else if (jElementForFolder instanceof IJavaProject)
{
- result = findOrCreateJavaPackage(jProject, packageName);
+ try
+ {
+ result = (IContainer)findOrCreateJavaPackage((IJavaProject)jElementForFolder, packageName);
+ }
+ catch (JavaModelException e)
+ {
+ final String msg = JET2Messages.JavaActionsUtil_CannotFindSourceFolder;
+ // it's serious this time, throw an exception;
+ throw new JET2TagException(MessageFormat.format(msg, new Object []{ sourceFolder.segment(0), packageName, }));
+ }
}
- catch (JavaModelException e1)
+ else
{
- final String msg = JET2Messages.JavaActionsUtil_CannotFindSourceFolder;
- // it's serious this time, throw an exception;
- throw new JET2TagException(MessageFormat.format(msg, new Object []{ sourceFolder.segment(0), packageName, }));
+ throw new JET2TagException(MessageFormat.format(JET2Messages.JavaActionsUtil_InvalidSourceFolder, new Object []{ sourceFolder.toString() }));
}
}
+ else
+ {
+ throw new JET2TagException(MessageFormat.format(JET2Messages.JavaActionsUtil_InvalidSourceFolder, new Object []{ sourceFolder.toString() }));
+ }
return result;
}
/**
- * @param jProject
- * @param packageName
- * @return
- * @throws JavaModelException
+ * Find the a container corresponding the the given package in the specified project.
+ * Traverse all project source package roots, looking for an existing instance of a package fragment corresponding to packageName.
+ * If not found, return the first non-existant fragment found.
+ * If the project has no source package roots, then null is returned.
+ * @param jProject the Java project to search
+ * @param packageName the Java package for which a container is sought.
+ * @return the container corresponding to the package, or null.
+ * @throws JavaModelException if the package roots or root kinds cannot be determined.
*/
- private static IFolder findOrCreateJavaPackage(IJavaProject jProject, String packageName) throws JavaModelException
+ private static IContainer findOrCreateJavaPackage(IJavaProject jProject, String packageName) throws JavaModelException
{
- final IPackageFragment[] fragments = jProject.getPackageFragments();
- for (int i = 0; i < fragments.length; i++)
- {
- if (packageName.equals(fragments[i].getElementName()))
- {
- return (IFolder)fragments[i].getResource();
- }
- }
- // didn't find an existing fragment, we'll create a fragment in the first package root...
+ IPackageFragment firstNonExistantFragment = null;
+ // Traverse package roots, looking for an existing instance of the package fragment corresponding to packageName.
+ // Otherwise, return the first non-existant fragment
final IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots();
for (int i = 0; i < roots.length; i++)
{
if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE)
{
IPackageFragment fragment = roots[i].getPackageFragment(packageName);
- return (IFolder)fragment.getResource();
+ if(fragment.exists())
+ {
+ return (IContainer)fragment.getResource();
+ }
+ else if(firstNonExistantFragment == null)
+ {
+ firstNonExistantFragment = fragment;
+ }
}
}
- return null;
+ return firstNonExistantFragment != null ? (IContainer)firstNonExistantFragment.getResource() : null;
}
/**
@@ -198,8 +216,21 @@ public class JavaActionsUtil
public static IFile getResourceForJavaResource(IPath srcFolderPath, String pkgName, String fileName) throws JET2TagException
{
- IFolder folder = getFolderForPackage(srcFolderPath, pkgName);
- return folder.getFile(fileName);
+ IContainer container = getContainerForPackage(srcFolderPath, pkgName);
+ if(container instanceof IFolder)
+ {
+ return ((IFolder)container).getFile(fileName);
+ }
+ else if(container instanceof IProject)
+ {
+ return ((IProject)container).getFile(fileName);
+ }
+ else
+ {
+ final String msg = JET2Messages.JavaActionsUtil_CannotFindSourceFolder;
+ // it's serious this time, throw an exception;
+ throw new JET2TagException(MessageFormat.format(msg, new Object []{ srcFolderPath.toString(), pkgName, }));
+ }
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
index 93ff010..55f4e1d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
@@ -28,10 +28,12 @@ import java.io.SequenceInputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.text.MessageFormat;
+import java.util.Arrays;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -58,6 +60,17 @@ public final class ActionsUtil
{
/**
+ * Constant that identifies the UTF-8 character encoding schema.
+ */
+ private static final String CHARSET_UTF_8 = "UTF-8"; //$NON-NLS-1$
+
+ /**
+ * Constant that identifies the Byte-Order-Mark for contents encoded with
+ * the UTF-8 character encoding scheme.
+ */
+ private final static byte[] BOM_UTF_8 = { (byte)0xEF, (byte)0xBB, (byte)0xBF };
+
+ /**
*
*/
private ActionsUtil()
@@ -84,17 +97,23 @@ public final class ActionsUtil
* @see JET2Writer#finalizeContent(Object)
* @see JET2Writer#contentCommitted(Object)
*/
- public static boolean writeTextFileFromWriter(IFile file, boolean replace, String encoding, boolean derived, JET2Writer writer, IProgressMonitor monitor) throws JET2TagException
+ public static boolean writeTextFileFromWriter(
+ IFile file,
+ boolean replace,
+ String encoding,
+ boolean derived,
+ JET2Writer writer,
+ IProgressMonitor monitor) throws JET2TagException
{
writer.finalizeContent(file);
-
- boolean written = writeTextFile(file, replace, encoding, derived, writer.toString(), monitor);
-
+
+ boolean written = writeTextFile(file, replace, encoding, derived, writer.toString(), monitor);
+
if (written)
{
writer.contentCommitted(file);
}
-
+
return written;
}
@@ -109,7 +128,13 @@ public final class ActionsUtil
* @return <code>false</code> <code>replace</code> was <code>true</code> and the file existed; <code>true</code> otherwise.
* @throws JET2TagException if the file cannot be created or written, or the encoding is invalid.
*/
- public static boolean writeTextFile(IFile file, boolean replace, String encoding, boolean derived, final String contents, IProgressMonitor monitor) throws JET2TagException
+ public static boolean writeTextFile(
+ IFile file,
+ boolean replace,
+ String encoding,
+ boolean derived,
+ final String contents,
+ IProgressMonitor monitor) throws JET2TagException
{
try
{
@@ -123,7 +148,7 @@ public final class ActionsUtil
{
return false;
}
-
+
// Step 1: make sure file exists - necessary for proper encoding handling...
if (!file.exists())
{
@@ -164,14 +189,15 @@ public final class ActionsUtil
boolean hasBOM = false;
IContentDescription description = file.getContentDescription();
hasBOM = description != null && description.getProperty(IContentDescription.BYTE_ORDER_MARK) != null;
- if(hasBOM && "UTF-8".equals(file.getCharset())) { //$NON-NLS-1$
+ if (hasBOM && CHARSET_UTF_8.equals(file.getCharset()))
+ {
source = new SequenceInputStream(new ByteArrayInputStream(IContentDescription.BOM_UTF_8), source);
}
monitor.worked(1);
// Step 5: write the contents - we created the file in step 1, so we only need to set its proper contents
file.setContents(source, false, true, new SubProgressMonitor(monitor, 2));
-
+
// RuntimeLoggerContextExtender.log(context, fileMessage, tagInfo, templatePath);
// Step 6: Apply generated file properties...
file.setDerived(derived);
@@ -198,7 +224,7 @@ public final class ActionsUtil
* @param monitor a progress montiro
* @throws JET2TagException if the folder cannot be created
*/
- public static void ensureFolderExists(IFolder folder, IProgressMonitor monitor) throws JET2TagException
+ public static void ensureFolderExists(IFolder folder, IProgressMonitor monitor) throws JET2TagException
{
IProject project = folder.getProject();
IPath relPath = folder.getProjectRelativePath();
@@ -273,7 +299,7 @@ public final class ActionsUtil
{
file.create(input, false, new SubProgressMonitor(monitor, 1));
}
-// RuntimeLoggerContextExtender.log(context, fileMessage, tagInfo, templatePath);
+ // RuntimeLoggerContextExtender.log(context, fileMessage, tagInfo, templatePath);
return true;
}
catch (CoreException e)
@@ -285,8 +311,7 @@ public final class ActionsUtil
monitor.done();
}
}
-
-
+
/**
* Return the contents of the text file at the specified URL.
* @return the file contents
@@ -294,13 +319,17 @@ public final class ActionsUtil
*/
public static String readTextFile(URL url, String encoding) throws JET2TagException
{
+ InputStream input = null;
+ Reader reader = null;
try
{
- final InputStream input = url.openStream();
- StringBuffer inputContents = new StringBuffer();
- Reader reader;
+ input = url.openStream();
if (encoding != null)
{
+ if (encoding.equals(CHARSET_UTF_8))
+ {
+ input = stripByteOrderMark(input);
+ }
reader = new InputStreamReader(input, encoding);
}
else
@@ -308,6 +337,7 @@ public final class ActionsUtil
reader = new InputStreamReader(input);
}
+ StringBuffer inputContents = new StringBuffer();
char readChars[] = new char [1024];
for (int read = reader.read(readChars); read != -1; read = reader.read(readChars))
{
@@ -321,6 +351,66 @@ public final class ActionsUtil
{
throw new JET2TagException(e);
}
+ finally
+ {
+ // ensure stream and reader are closed.
+ if (reader != null)
+ {
+ try
+ {
+ reader.close();
+ }
+ catch (IOException e)
+ {
+ // ignore
+ }
+ }
+ if (input != null)
+ {
+ try
+ {
+ input.close();
+ }
+ catch (IOException e)
+ {
+ // ignore
+ }
+ }
+ }
+ }
+
+ /**
+ * Remove the optional Byte Order Mark from UTF-8 input streams. A JRE bug means that Java doesn't do this
+ * automatically for UTF-8 files.
+ * @param input an input stream positioned at the start of a UTF-8 encoded file.
+ * @return an input stream positioned immediately after any UTF-8 BOM
+ * @throws IOException if an IO Error occurs
+ */
+ private static InputStream stripByteOrderMark(InputStream input) throws IOException
+ {
+ // need to look for and remove any Byte-order-mark - a JRE bug means that Java doesn't do this for UTF-8.
+ if (!input.markSupported())
+ {
+ // wrap with a buffered input stream, we'll need to rewind if we don't find the BOM.
+ input = new BufferedInputStream(input);
+ }
+ input.mark(BOM_UTF_8.length + 1);
+ int bomLength = BOM_UTF_8.length;
+ byte[] bomStore = new byte [bomLength];
+ int bytesRead = 0;
+ do
+ {
+ int bytes = input.read(bomStore, bytesRead, bomLength - bytesRead);
+ if (bytes == -1)
+ throw new IOException();
+ bytesRead += bytes;
+ }
+ while (bytesRead < bomLength);
+ if (!Arrays.equals(BOM_UTF_8, bomStore))
+ {
+ input.reset(); // wasn't a bom, rewind to our mark and continue.
+ }
+ return input;
}
/**
@@ -378,21 +468,34 @@ public final class ActionsUtil
/**
* Create a new project.
- * @param project
- * @param monitor
- * @throws JET2TagException
+ * @param project the project to create
+ * @param monitor a progress monitor
+ * @throws JET2TagException if an error occurs
*/
public static void createProject(IProject project, IProgressMonitor monitor) throws JET2TagException
{
+ createProject(project, null, monitor);
+ }
+
+ /**
+ * Create a new project.
+ * @param project the project to create
+ * @param description an option project description
+ * @param monitor a progress monitor
+ * @throws JET2TagException if an error occurs
+ * @since 0.7.1
+ */
+ public static void createProject(IProject project, IProjectDescription description, IProgressMonitor monitor) throws JET2TagException
+ {
final String createMessage = MessageFormat.format(JET2Messages.WsProjectAction_CreatingProject, new Object []{ project.getName() });
monitor.beginTask(createMessage, 2); // two ticks: create & open
-
+
try
{
// create...
if (!project.exists())
{
- project.create(new SubProgressMonitor(monitor, 1));
+ project.create(description, new SubProgressMonitor(monitor, 1));
}
else
{
@@ -408,7 +511,7 @@ public final class ActionsUtil
monitor.worked(1);
}
}
- catch(IllegalArgumentException e)
+ catch (IllegalArgumentException e)
{
// create project throws this if the project name is invalid
throw new JET2TagException(e);
@@ -458,7 +561,7 @@ public final class ActionsUtil
public static void checkpointWorkspace(boolean build, IProgressMonitor monitor)
{
ResourcesPlugin.getWorkspace().checkpoint(build);
- if(build)
+ if (build)
{
waitForBuildToComplete(monitor);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java
index 3b425ea..1dacebb 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java
@@ -116,11 +116,27 @@ public class TransformContextExtender extends AbstractContextExtender
*/
public void execute(String templatePath, JET2Writer writer) throws JET2TagException
{
+ execute(templatePath, false, writer);
+ }
+
+ /**
+ * Execute the named template, writing all template output to the passed writer.
+ * @param templatePath the project relative path of the template to load
+ * @param useSuper if true, attempt to load the template from override transformation, if it exists
+ * @param writer the writer to which the template output will be written
+ * @throws JET2TagException if an execution error occurs or the template cannot be found
+ */
+ public void execute(String templatePath, boolean useSuper, JET2Writer writer) throws JET2TagException
+ {
getData().templateStack.push(templatePath);
getContext().setTemplatePath(getTemplatePath());
try
{
- JET2Template template = getData().loader.getTemplate(templatePath);
+ JET2TemplateLoader templateLoader = getData().loader;
+ if(useSuper) {
+ templateLoader = templateLoader instanceof JET2TemplateLoaderExtension ? ((JET2TemplateLoaderExtension)templateLoader).getDelegateLoader() : null;
+ }
+ JET2Template template = templateLoader != null ? templateLoader.getTemplate(templatePath) : null;
if (template == null)
{
@@ -134,6 +150,7 @@ public class TransformContextExtender extends AbstractContextExtender
getData().templateStack.pop();
getContext().setTemplatePath(getTemplatePath());
}
+
}
public JET2TemplateLoader getLoader()
diff --git a/plugins/org.eclipse.jet/templates/jet2transform.jet b/plugins/org.eclipse.jet/templates/jet2transform.jet
index ea9a31e..b52e10b 100644
--- a/plugins/org.eclipse.jet/templates/jet2transform.jet
+++ b/plugins/org.eclipse.jet/templates/jet2transform.jet
@@ -19,8 +19,37 @@ import org.eclipse.jet.JET2Template;
public class <%= parms.getClassName() %> implements JET2TemplateLoader, JET2TemplateLoaderExtension {
- private interface TemplateFactoryMethod {
- public abstract JET2Template newTemplate();
+ private static final class TemplateFactoryMethod {
+
+ private final String templatePath;
+ private final String templateClass;
+
+ public TemplateFactoryMethod(String templatePath, String templateClass) {
+ this.templatePath = templatePath;
+ this.templateClass = templateClass;
+
+ }
+
+ public String getTemplateClass() {
+ return templateClass;
+ }
+
+ public String getTemplatePath() {
+ return templatePath;
+ }
+
+ public JET2Template newTemplate() {
+ JET2Template template = null;
+ try {
+ template = (JET2Template) Class.forName(templateClass).newInstance();
+ } catch (InstantiationException e) {
+ } catch (IllegalAccessException e) {
+ } catch (ClassNotFoundException e) {
+ }
+ return template;
+ }
+
+
}
private Map pathToFactoryMap = null;
@@ -33,20 +62,24 @@ public class <%= parms.getClassName() %> implements JET2TemplateLoader, JET2Temp
public JET2Template getTemplate(String templatePath) {
if(pathToFactoryMap == null) {
+ initPathToFactoryMap();
+ }
+ TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);
+ return factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();
+ }
+
+ private void addTemplate(String templatePath, String templateClass) {
+ pathToFactoryMap.put(templatePath, //$NON-NLS-1$
+ new TemplateFactoryMethod(templatePath, templateClass));
+ }
+
+ private void initPathToFactoryMap() {
pathToFactoryMap = new HashMap(<%= templateMap.size() %>);
<% for(Iterator i = templateMap.entrySet().iterator(); i.hasNext();){
Map.Entry entry = (Map.Entry)i.next();
%>
- pathToFactoryMap.put("<%= entry.getKey() %>", //$NON-NLS-1$
- new TemplateFactoryMethod() {
- public JET2Template newTemplate() {
- return new <%= entry.getValue() %>();
- }
- });
+ addTemplate("<%= entry.getKey() %>", "<%= entry.getValue() %>" ); //$NON-NLS-1$ //$NON-NLS-2$
<% } %>
- }
- TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);
- return factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();
}
public void setDelegateLoader(JET2TemplateLoader loader) {
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
index 5af4bbb..9f89e42 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
Binary files differ
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
index 1bf6f9b..1a1dbb0 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF b/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF
new file mode 100644
index 0000000..ff8d913
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jet.tests;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-ClassPath: tests.jar
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.jet,
+ org.junit,
+ org.eclipse.emf.codegen,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.xsd,
+ org.eclipse.core.filebuffers,
+ org.eclipse.core.resources
+Bundle-Vendor: %providerName
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml
new file mode 100644
index 0000000..368bb8c
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml
new file mode 100644
index 0000000..a167ef1
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml
new file mode 100644
index 0000000..59bda64
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a attr="b"/>
+</root>
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml
new file mode 100644
index 0000000..e93c6a2
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a attr="b"/>
+</root>
diff --git a/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet b/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet
new file mode 100644
index 0000000..99bf3cc
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet
@@ -0,0 +1,6 @@
+<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
+
+<%-- The following line is missing a double quote (") on the 'var' attribute --%>
+<c:iterate select="foo" var="bar>
+ some text parameterized by bar: <c:get select="$bar"/>
+</c:iterate> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/bug147714.jet b/tests/org.eclipse.jet.tests/data/bug147714.jet
new file mode 100644
index 0000000..ec12e85
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/bug147714.jet
@@ -0,0 +1,11 @@
+<%-- Bug 147714 requests the JET compiler to treat <tag ...> as <tag .../> if tag is an emptyTag.
+This is for compatibility with DPTK: http://www.alphaworks.ibm.com/tech/dptk.
+Since DPTK does not use namespace prefixes, the fix only applies to tags with not prefix.
+--%>
+<%@taglib id="org.eclipse.jet.controlTags" prefix="c" %>
+<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="" %>
+
+<%-- line 8: expect error --%><c:get select="$foo">
+<%-- line 9: expect ok --%><c:get select="$foo"/>
+<%-- line 10: expect warning --%><nl>
+<%-- line 11: expect ok --%><nl/>
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
index 0c61be6..b73ff74 100644
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
@@ -1,6 +1,6 @@
<directive name="taglib" line="1" col="1">
- <attribute name="prefix">test</attribute>
<attribute name="id">org.eclipse.jet.tests.TestLibrary</attribute>
+ <attribute name="prefix">test</attribute>
</directive>
<data>
"isAllUpper", "nl", "other", "tokenize", "upper"
diff --git a/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet b/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet
new file mode 100644
index 0000000..1570482
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet
@@ -0,0 +1,70 @@
+<%@taglib id="org.eclipse.jet.controlTags" prefix="c"%>
+<%-- This template is used to verify text trimming rules. It is used by TextTrimmingTexts.java --%>
+
+<%-- text stripping around start/end tags that support stripping (e.g. c:iterate) --%>
+test 001
+<c:iterate select="foo" var="bar">
+ some text with four spaces after
+</c:iterate>
+test 001
+
+<%-- text stripping around start/end tags that support stripping (e.g. c:iterate)
+ with leading and trailing whitepace --%>
+test 002
+ <c:iterate select="foo" var="bar">
+ some text with four spaces after
+ </c:iterate>
+test 002
+
+<%-- text stripping around start/end tags that support stripping (e.g. c:iterate)
+ with multi-line tags --%>
+test 003
+ <c:iterate
+ select="foo"
+ var="bar"
+ >
+ some text with four spaces after
+ </c:iterate
+ >
+test 003
+
+<%-- text stripping on directives --%>
+test 004
+ <%@taglib id="org.eclipse.jet.workspaceTags" prefix="ws"%>
+test 004
+
+<%-- text stripping on scriptlet --%>
+test 005
+ <%
+ int x = 3;
+%>
+test 005
+
+<%-- text stripping on declarations --%>
+test 006
+ <%!
+ public int square(int arg) {
+ return arg * arg;
+ }
+%>
+test 006
+
+<%-- text stripping on empytags that supports stripping --%>
+test 007
+ <c:include template="templates/foo.jet"/>
+test 007
+
+<%-- text stripping on empytags that does not support stripping --%>
+test 008
+ <c:get select="templates/foo.jet"/>
+test 008
+
+<%-- text stripping on comments --%>
+test 009
+ <%-- a comment --%>
+test 009
+
+<%-- text stripping an expression --%>
+test 010
+ <%= x %>
+test 010
diff --git a/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet b/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
index 188636c..08f095f 100644
--- a/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
+++ b/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
@@ -1,3 +1,3 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
+<%@taglib id="org.eclipse.jet.controlTags" prefix="test" %>
-</test:start
+</test:include
diff --git a/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet b/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
index d3e55e0..31f3ccf 100644
--- a/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
+++ b/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
@@ -1,3 +1,3 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
+<%@taglib id="org.eclipse.jet.controlTags" prefix="test" %>
-<test:start attr="foo"
+<test:include template="foo"
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java
index 4b2fe16..fd2efbb 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java
@@ -14,6 +14,7 @@ public class AllTests {
suite.addTest(org.eclipse.jet.tests.model.load.AllTests.suite());
suite.addTest(org.eclipse.jet.tests.taglib.AllTests.suite());
suite.addTest(org.eclipse.jet.tests.taglib.control.AllTests.suite());
+ suite.addTest(org.eclipse.jet.tests.taglib.workspace.AllTests.suite());
suite.addTest(org.eclipse.jet.tests.taglib.java.AllTests.suite());
suite.addTest(org.eclipse.jet.tests.taglib.format.AllTests.suite());
suite.addTest(org.eclipse.jet.tests.runtime.AllTests.suite());
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java
index d15dc13..be0b1b5 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java
@@ -11,6 +11,7 @@ public class AllTests {
//$JUnit-BEGIN$
suite.addTestSuite(TestJETParser.class);
suite.addTestSuite(TestJET2Parser.class);
+ suite.addTest(TextTrimmingTests.suite());
suite.addTestSuite(LineInfoTests.class);
//$JUnit-END$
return suite;
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java
index 1339b0b..cb59f25 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java
@@ -6,8 +6,11 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import junit.framework.TestCase;
@@ -20,11 +23,13 @@ import org.eclipse.jet.compiler.JET2Declaration;
import org.eclipse.jet.compiler.JET2Directive;
import org.eclipse.jet.compiler.JET2Expression;
import org.eclipse.jet.compiler.JET2Scriptlet;
+import org.eclipse.jet.compiler.Problem;
import org.eclipse.jet.compiler.TextElement;
import org.eclipse.jet.compiler.XMLBodyElement;
import org.eclipse.jet.compiler.XMLBodyElementEnd;
import org.eclipse.jet.compiler.XMLEmptyElement;
import org.eclipse.jet.internal.compiler.TemplateRunner;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
import org.eclipse.jet.taglib.TagLibraryReference;
import org.eclipse.jet.tests.FileUtils;
@@ -253,4 +258,211 @@ public class TestJET2Parser extends TestCase {
}
+ public void testXMLStartAsEmpty_bug147714() throws MalformedURLException, FileNotFoundException, IOException {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/bug147714.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 2, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 8, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.MissingXmlEndTag, problems[0].getId());
+
+ assertEquals("Problem 2 line number", 10, problems[1].getLineNumber());
+ assertEquals("Problem 2 severity", ParseProblemSeverity.WARNING, problems[1].getSeverity());
+ assertEquals("Problem 2 id", Problem.TagInterpretedAsEmptyTag, problems[1].getId());
+
+
+ }
+
+ public void testUnclosedCommnetErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedComment.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.UnterminatedXMLTag, problems[0].getId());
+
+ }
+
+ public void testUnclosedDeclarationErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDeclaration.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.UnterminatedXMLTag, problems[0].getId());
+
+ }
+
+ public void testUnclosedDirectiveErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDirective.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 1, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.JETException, problems[0].getId());
+
+ }
+
+ public void testUnclosedExpressionErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedExpression.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.JETException, problems[0].getId());
+
+ }
+
+ public void testUnclosedScriptletErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedScriplet.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.JETException, problems[0].getId());
+
+ }
+
+ public void testUnclosedXMLEndErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLEnd.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.UnterminatedXMLTag, problems[0].getId());
+
+ }
+
+ public void testUnclosedXMLStartErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLStart.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertEquals("Number of problems", 1, problems.length);
+
+
+ // This assertions correspond to comments in bug147714.jet
+ assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.UnterminatedXMLTag, problems[0].getId());
+
+ }
+
+ /**
+ * @param cu
+ * @return
+ */
+ private Problem[] getSortedProblems(JET2CompilationUnit cu) {
+ List problems = new ArrayList(cu.getProblems());
+ // problems are not guaranteed to be in line order (should they)
+ Collections.sort(problems, new Comparator() {
+
+ public int compare(Object arg0, Object arg1) {
+ Problem p0 = (Problem) arg0;
+ Problem p1 = (Problem) arg1;
+ int lineCompare = p0.getLineNumber() - p1.getLineNumber();
+ if(lineCompare == 0) {
+ return p0.getColOffset() - p1.getColOffset();
+ } else {
+ return lineCompare;
+ }
+ }});
+
+ Problem[] problem = (Problem[]) problems.toArray(new Problem[problems.size()]);
+ return problem;
+ }
+
+ public void testAttributeParsingErrors() throws Exception {
+ String url = "platform:/plugin/org.eclipse.jet.tests/data/attributeParsingErrors.jet";
+
+ InputStream is = getFileContentsAsStream(url);
+
+ JET2CompilationUnit cu = new JET2CompilationUnit();
+ cu.parse(is, "UTF-8");
+
+ Problem[] problems = getSortedProblems(cu);
+
+ assertTrue("At least one problem", problems.length > 0);
+
+ assertEquals("Problem 1 severity", ParseProblemSeverity.ERROR, problems[0].getSeverity());
+ assertEquals("Problem 1 id", Problem.JETException, problems[0].getId());
+ assertEquals("Problem 1 line number", 4, problems[0].getLineNumber());
+
+
+ }
}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java
index 247fc8b..3ddd6e6 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java
@@ -254,6 +254,7 @@ public class TestJETParser extends TestCase {
AllJET2SyntaxListener listener = new AllJET2SyntaxListener(reader);
JETParser.Directive directive = new JETParser.Directive();
directive.getDirectives().add("jet");
+ directive.getDirectives().add("taglib");
JETCoreElement[] coreElements = new JETCoreElement[] {
directive,
@@ -289,12 +290,7 @@ public class TestJETParser extends TestCase {
String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedComment.jet";
String openChars = "<%--";
- try {
- doUnclosedElementTest(urlString, openChars, 0);
- fail();
- } catch(JETException e) {
- // success.
- }
+ doUnclosedElementTest(urlString, openChars, Problem.UnterminatedXMLTag);
}
@@ -303,12 +299,7 @@ public class TestJETParser extends TestCase {
String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDeclaration.jet";
String openChars = "<%!";
- try {
- doUnclosedElementTest(urlString, openChars, 0);
- fail();
- } catch(JETException e) {
- // success.
- }
+ doUnclosedElementTest(urlString, openChars, Problem.UnterminatedXMLTag);
}
public void testUnclosedDirective() throws Exception {
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java
new file mode 100644
index 0000000..361ab43
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java
@@ -0,0 +1,226 @@
+package org.eclipse.jet.tests.compiler;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.jet.compiler.DefaultJET2ASTVisitor;
+import org.eclipse.jet.compiler.JET2CompilationUnit;
+import org.eclipse.jet.compiler.TextElement;
+import org.eclipse.jet.internal.compiler.TextTrimmingVisitor;
+import org.eclipse.jet.internal.parser.LineInfo;
+import org.eclipse.jet.tests.FileUtils;
+
+public class TextTrimmingTests extends TestCase {
+
+ private static JET2CompilationUnit unstrippedCu;
+ private static JET2CompilationUnit strippedCu;
+
+ private static FileInputStream getFileContentsAsStream(String urlString) throws IOException, MalformedURLException, FileNotFoundException {
+ String fileName = FileUtils.resolveURLToLocationString(urlString);
+ FileInputStream inputStream = new FileInputStream(new File(fileName));
+ return inputStream;
+ }
+
+ /**
+ * Wrap this suite in a TestSetup so that we can do one-time setup
+ * @return a wrapped TestSetup wrapped suite.
+ */
+ public static Test suite() {
+ TestSetup setup = new TestSetup(new TestSuite(TextTrimmingTests.class)) {
+ protected void setUp() throws Exception {
+ setUpAllTests();
+ }
+
+ protected void tearDown() throws Exception {
+ tearDownAllTests();
+ }
+ };
+
+ return setup;
+ }
+
+ private static void setUpAllTests() throws Exception {
+ FileInputStream stream = getFileContentsAsStream("platform:/plugin/org.eclipse.jet.tests/data/textTrimmingTests.jet");
+
+ unstrippedCu = new JET2CompilationUnit();
+ unstrippedCu.parse(stream, "UTF-8");
+
+ stream = getFileContentsAsStream("platform:/plugin/org.eclipse.jet.tests/data/textTrimmingTests.jet");
+ strippedCu = new JET2CompilationUnit();
+ strippedCu.parse(stream, "UTF-8");
+ strippedCu.accept(new TextTrimmingVisitor());
+
+ assertFalse("Errors in test template", unstrippedCu.hasErrors());
+
+ }
+
+ private static void tearDownAllTests() {
+ // nothing to do
+ }
+
+
+ private String[] getLines(TextElement text) {
+ char[] chars = text.getText();
+ LineInfo[] lineInfos = LineInfo.calculateLines(chars);
+ String[] lines = new String[lineInfos.length];
+ for (int i = 0; i < lineInfos.length; i++) {
+ lines[i] = new String(chars, lineInfos[i].getStart(), lineInfos[i].getEnd() - lineInfos[i].getStart()) + lineInfos[i].getDelimiter();
+ }
+ return lines;
+ }
+
+ private String[] getTextLinesInRange(JET2CompilationUnit cu, final String testMarker) {
+ final StringBuffer linesBuffer = new StringBuffer();
+ cu.accept(new DefaultJET2ASTVisitor() {
+ private boolean rangeStarted = false;
+ private boolean rangeEnded = false;
+
+ public void visit(TextElement text) {
+ if(rangeEnded) return;
+
+ String lines[] = getLines(text);
+ int i = 0;
+ for (; i < lines.length && !rangeStarted; i++) {
+ if(lines[i].startsWith(testMarker)) {
+ rangeStarted = true;
+ linesBuffer.append(lines[i]);
+ }
+ }
+
+ for(; i < lines.length && rangeStarted && !rangeEnded; i++) {
+ linesBuffer.append(lines[i]);
+ if(lines[i].startsWith(testMarker)) {
+ rangeEnded = true;
+ }
+ }
+ }
+ });
+ final LineInfo[] lineInfos = LineInfo.calculateLines(linesBuffer.toString().toCharArray());
+ String[] lines = new String[lineInfos.length];
+ for (int i = 0; i < lineInfos.length; i++) {
+ lines[i] = linesBuffer.substring(lineInfos[i].getStart(), lineInfos[i].getEnd());
+ }
+ return lines;
+ }
+
+ public void testStartEndTagStripping() {
+ final String TEST_CASE = "test 001";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(5, unstrippedText.length);
+
+ assertEquals(3, strippedText.length);
+ }
+
+ public void testStartEndTagStripping2() {
+ final String TEST_CASE = "test 002";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(5, unstrippedText.length);
+
+ assertEquals(3, strippedText.length);
+
+ }
+
+ public void testStartEndTagStripping3() {
+ final String TEST_CASE = "test 003";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(5, unstrippedText.length);
+
+ assertEquals(3, strippedText.length);
+
+ }
+
+ public void testDirectiveStripping() {
+ final String TEST_CASE = "test 004";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(2, strippedText.length);
+
+ }
+
+ public void testScriptletStripping() {
+ final String TEST_CASE = "test 005";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(2, strippedText.length);
+
+ }
+
+ public void testDeclarationStripping() {
+ final String TEST_CASE = "test 006";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(2, strippedText.length);
+
+ }
+
+ public void testEmptyTagStripping_supportsRemove() {
+ final String TEST_CASE = "test 007";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(2, strippedText.length);
+
+ }
+
+
+ public void testEmptyTagStripping_noRemove() {
+ final String TEST_CASE = "test 008";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(3, strippedText.length);
+
+ }
+
+ public void testCommentStripping() {
+ final String TEST_CASE = "test 009";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(2, strippedText.length);
+
+ }
+
+ public void testExpressionStripping() {
+ final String TEST_CASE = "test 010";
+ String[] unstrippedText = getTextLinesInRange(unstrippedCu, TEST_CASE);
+ String[] strippedText = getTextLinesInRange(strippedCu, TEST_CASE);
+
+ assertEquals(3, unstrippedText.length);
+
+ assertEquals(3, strippedText.length);
+
+ }
+
+
+
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java
index d2e7fe9..1b5c8a9 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java
@@ -9,8 +9,9 @@ public class AllTests {
TestSuite suite = new TestSuite(
"Test for org.eclipse.jet.tests.runtime");
//$JUnit-BEGIN$
- suite.addTestSuite(TestBundleDescriptions.class);
suite.addTestSuite(TestBundleLoading.class);
+ suite.addTestSuite(TestBundleJarUtil.class);
+ suite.addTestSuite(TestBundleDescriptions.class);
//$JUnit-END$
return suite;
}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java
new file mode 100644
index 0000000..0eaf172
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java
@@ -0,0 +1,47 @@
+package org.eclipse.jet.tests.runtime;
+
+import org.eclipse.jet.internal.runtime.BundleJarInfo;
+
+import junit.framework.TestCase;
+
+public class TestBundleJarUtil extends TestCase {
+
+ private BundleJarInfo complexBJU;
+ private BundleJarInfo simpleBJU;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ complexBJU = BundleJarInfo.createBundleJarInfo("a.b.c_1.2.3.x_yz_4.5.6.a_b_c.jar");
+ simpleBJU = BundleJarInfo.createBundleJarInfo("a.b.c_1.2.3.jar");
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testGetBundleSymbolicName_complex() {
+ assertEquals("a.b.c_1.2.3.x_yz", complexBJU.getBundleSymbolicName());
+ }
+
+ public void testGetVersion_complex() {
+ assertEquals("4.5.6.a_b_c", complexBJU.getVersion());
+ }
+
+ public void testGetJarName_complex() {
+ assertEquals("a.b.c_1.2.3.x_yz_4.5.6.a_b_c.jar", complexBJU.getJarName());
+ }
+
+ public void testGetBundleSymbolicName_simple() {
+ assertEquals("a.b.c", simpleBJU.getBundleSymbolicName());
+ }
+
+ public void testGetVersion_simple() {
+ assertEquals("1.2.3", simpleBJU.getVersion());
+ }
+
+ public void testGetJarName_simple() {
+ assertEquals("a.b.c_1.2.3.jar", simpleBJU.getJarName());
+ }
+
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java
new file mode 100644
index 0000000..d532460
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java
@@ -0,0 +1,83 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.tests.runtime;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jet.internal.runtime.DirectoryBundleProvider;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
+
+/**
+ * @author pelder
+ *
+ */
+public class TestDirectoryBundleProvider extends TestCase {
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testGetAllJETBundleIds() throws Exception {
+ // FIXME: Tests are specific to one development environment/machine
+ DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
+
+ final Set ids = dbp.getAllJETBundleIds();
+
+// assertEquals(1, ids.size());
+ assertTrue("contains gp02.generator.pattern", ids.contains("gp02.generator.pattern"));
+ assertFalse("does not contain org.eclipse.jet.doc", ids.contains("org.eclipse.jet.doc"));
+ }
+
+ public void testGetDescriptor() throws Exception {
+ // FIXME: Tests are specific to one development environment/machine
+ DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
+
+ final IJETBundleDescriptor descriptor = dbp.getDescriptor("gp02.generator.pattern");
+ assertNotNull("Descriptor", descriptor);
+ assertEquals("gp02.generator.pattern", descriptor.getId());
+ }
+
+ public void testGetAllJETBundleDescriptors() throws Exception {
+ // FIXME: Tests are specific to one development environment/machine
+ DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
+
+ final Collection col = dbp.getAllJETBundleDescriptors();
+
+ for (Iterator i = col.iterator(); i.hasNext();) {
+ IJETBundleDescriptor descriptor = (IJETBundleDescriptor) i.next();
+ if(descriptor.getId().equals("gp02.generator.pattern")) {
+ return;
+ }
+ }
+ fail("gp02.generator.pattern not found");
+ }
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java
new file mode 100644
index 0000000..4304f79
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java
@@ -0,0 +1,70 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.tests.taglib.java;
+
+import junit.framework.TestCase;
+
+/**
+ * @author pelder
+ *
+ */
+public class JavaActionsUtilTests extends TestCase {
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getContainerForPackage(org.eclipse.core.runtime.IPath, java.lang.String)}.
+ */
+ public void testGetContainerForPackage() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getImportManager(org.eclipse.jet.JET2Writer)}.
+ */
+ public void testGetImportManager() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#findContainingJavaPackageTag(org.eclipse.jet.taglib.CustomTag)}.
+ */
+ public void testFindContainingJavaPackageTag() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getResourceForJavaResource(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)}.
+ */
+ public void testGetResourceForJavaResource() {
+ fail("Not yet implemented");
+ }
+
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java
new file mode 100644
index 0000000..9203668
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java
@@ -0,0 +1,116 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.tests.taglib.workspace;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jet.taglib.workspace.ActionsUtil;
+
+/**
+ * JUnit tests for {@link ActionsUtil}.
+ *
+ */
+public class ActionsUtilTests extends TestCase {
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
+ * @throws Exception
+ */
+ public void testReadTextFile_Manifest_MF() throws Exception {
+ URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF");
+ final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
+
+ final String rawText = ActionsUtil.readTextFile(url, null);
+
+ assertTrue("raw text", rawText.startsWith("Manifest-Version: 1.0"));
+ assertTrue("correct text", correctText.startsWith("Manifest-Version: 1.0"));
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
+ * @throws Exception
+ */
+ public void testReadTextFile_utf8_no_bom_xml() throws Exception {
+ URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml");
+ final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
+
+ final String rawText = ActionsUtil.readTextFile(url, null);
+
+ assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
+ assertTrue("raw text", rawText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
+ * @throws Exception
+ */
+ public void testReadTextFile_utf8_bom_xml() throws Exception {
+ URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml");
+ final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
+
+ final String rawText = ActionsUtil.readTextFile(url, null);
+
+ assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
+ assertTrue("raw text", rawText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
+ * @throws Exception
+ */
+ public void testReadTextFile_utf16_le_xml() throws Exception {
+ URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml");
+ final String correctText = ActionsUtil.readTextFile(url, "UTF-16");
+
+
+ assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-16\"?>"));
+ // XXX: Should verify presence of BOM by reading byte stream directly.
+// final String rawText = ActionsUtil.readTextFile(url, null);
+// assertTrue("raw text", rawText.startsWith("\u00FF\u00FE")); // Little Endian BOM is FF FE
+ }
+
+ /**
+ * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
+ * @throws Exception
+ */
+ public void testReadTextFile_utf16_be_xml() throws Exception {
+ URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml");
+ final String correctText = ActionsUtil.readTextFile(url, "UTF-16");
+
+ assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-16\"?>"));
+ // XXX: Should verify presence of BOM by reading byte stream directly.
+// final String rawText = ActionsUtil.readTextFile(url, null);
+// assertTrue("raw text", rawText.startsWith("\u00FE\u00FF")); // big endian BOM is FE FF
+ }
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java
new file mode 100644
index 0000000..1088325
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java
@@ -0,0 +1,17 @@
+package org.eclipse.jet.tests.taglib.workspace;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.eclipse.jet.tests.taglib.workspace");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(ActionsUtilTests.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java
index 4d7e201..6d10fc7 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java
@@ -15,6 +15,7 @@ public class AllTests {
suite.addTest(ResourceAttributeInspectorTests.suite());
suite.addTestSuite(SelfStepTests.class);
suite.addTestSuite(ParentStepTests.class);
+ suite.addTestSuite(DescendantOrSelfTests.class);
suite.addTestSuite(LogicalOpTests.class);
suite.addTestSuite(DOMInspectorTests.class);
suite.addTestSuite(ExpandedNameTests.class);
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java
new file mode 100644
index 0000000..1b725ea
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java
@@ -0,0 +1,58 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.tests.xpath;
+
+import java.util.Set;
+
+import org.eclipse.jet.internal.xpath.ast.Axis;
+import org.eclipse.jet.internal.xpath.ast.NodeTest;
+import org.eclipse.jet.internal.xpath.ast.Root;
+import org.eclipse.jet.internal.xpath.ast.Step;
+import org.eclipse.jet.xpath.Context;
+import org.eclipse.jet.xpath.inspector.ExpandedName;
+import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Test the 'descendant-of-self' axis.
+ *
+ */
+public class DescendantOrSelfTests extends AbstractExprTest {
+
+ public void testEvalAsNodeSet_root_slash_slash_b() {
+ Step stepExpr = new Step(
+ new Step(new Root(), Axis.childAxis(),
+ NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
+ Axis.descendantOrSelf(),
+ NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("b")));
+
+ Context context = new Context(document, null);
+
+ Set resultSet = stepExpr.evalAsNodeSet(context);
+
+ assertNotNull(resultSet);
+ assertEquals(2, resultSet.size());
+ Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
+ Node elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
+
+ assertTrue(resultSet.contains(elementB));
+ assertTrue(resultSet.contains(elementB2));
+
+ }
+}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java
index 227bc57..3c2912e 100644
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java
@@ -474,7 +474,7 @@ public class EObjectInspectorTests extends TestCase {
assertEquals(1, doc.length);
assertTrue("instanceof EMFEAttrAsElementWrapper", doc[0] instanceof EMFEAttrAsElementWrapper);
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper) doc[0];
- assertEquals("doc for Author.name", wrapper.getSetting().get(true));
+ assertEquals("doc for Author.name", wrapper.getValue());
}
/*
@@ -587,7 +587,7 @@ public class EObjectInspectorTests extends TestCase {
assertEquals(1, namedChildren.length);
for (int i = 0; i < namedChildren.length; i++) {
EMFEAttrAsElementWrapper child = (EMFEAttrAsElementWrapper) namedChildren[i];
- assertEquals("doc for Author.name", child.getSetting().get(true));
+ assertEquals("doc for Author.name", child.getValue());
}
}
@@ -699,6 +699,49 @@ public class EObjectInspectorTests extends TestCase {
assertTrue("cust not in afterList", !afterList.contains(emp));
}
+ public void testRemoveAttribute_emf() {
+ EStructuralFeature nameFeature = emfRoot.eClass().getEStructuralFeature("name");
+ assertTrue("setup: name is not set", emfRoot.eIsSet(nameFeature));
+
+ inspector.removeAttribute(emfRoot, "name");
+
+ assertFalse("name is still set", emfRoot.eIsSet(nameFeature));
+ assertNull(inspector.getNamedAttribute(emfRoot, new ExpandedName("name")));
+ }
+
+ public void testRemoveAttribute_emf_nonexisting() {
+ final String attrName = "notAnAttribute";
+ EStructuralFeature nameFeature = emfRoot.eClass().getEStructuralFeature(attrName);
+ assertNull("setup: " + attrName + " is not set", nameFeature);
+
+ inspector.removeAttribute(emfRoot, attrName);
+
+ // success if we get here without someone throwing an exception
+ }
+
+ public void testRemoveAttribute_xml() {
+ ExpandedName enRootAttr = new ExpandedName("rootAttr");
+ Object originalRootAttr = inspector.getNamedAttribute(xmlRootElement, enRootAttr);
+ assertNotNull("setup: originalRootAttr is null", originalRootAttr);
+
+ inspector.removeAttribute(xmlRootElement, "rootAttr");
+
+ Object rootAttr = inspector.getNamedAttribute(xmlRootElement, enRootAttr);
+ assertNull("rootAttr should be null", rootAttr);
+ }
+
+ public void testRemoveAttribute_xsd() {
+ Object projectElement = xsdRootElement.eContents().get(0);
+
+ Object originalAttribute = inspector.getNamedAttribute(projectElement, new ExpandedName("name"));
+ assertNotNull("setup: originalAttribute is null", originalAttribute);
+
+ inspector.removeAttribute(projectElement, "name");
+
+ Object attribute = inspector.getNamedAttribute(projectElement, new ExpandedName("name"));
+ assertNull("attribute should be null", attribute);
+ }
+
public void testRemoveElement_xml() {
// EStructuralFeature feature = xmlRootElement.getAny().getEStructuralFeature(0);
EStructuralFeature feature = Bug130552Workaround.getEStructuralFeature(xmlRootElement.getAny(), 0);
@@ -787,6 +830,7 @@ public class EObjectInspectorTests extends TestCase {
// assertEquals(elementACopy ,xmlRootElement.getAny().getValue(initialSize));
assertEquals(elementACopy ,Bug130552Workaround.getValue(xmlRootElement.getAny(), initialSize));
assertEquals(0, inspector.getChildren(elementACopy).length);
+ assertEquals(elementA.getAnyAttribute().size(), ((AnyType)elementACopy).getAnyAttribute().size());
}
public void testCopyElement_xsd() throws CopyElementException {
@@ -833,7 +877,7 @@ public class EObjectInspectorTests extends TestCase {
assertEquals(1, doc.length);
assertTrue("instanceof EMFEAttrAsElementWrapper", doc[0] instanceof EMFEAttrAsElementWrapper);
EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper) doc[0];
- assertEquals("Hello Attribute 1", wrapper.getSetting().get(true));
+ assertEquals("Hello Attribute 1", wrapper.getValue());
}
public void testAddTextElement_xml() throws AddElementException {
diff --git a/transforms/org.eclipse.jet.transforms.newproject/plugin.xml b/transforms/org.eclipse.jet.transforms.newproject/plugin.xml
index bf1cc1b..b8c13be 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/plugin.xml
+++ b/transforms/org.eclipse.jet.transforms.newproject/plugin.xml
@@ -4,6 +4,7 @@
<extension
point="org.eclipse.jet.transform">
<transform
+ private="true"
startTemplate="templates/control.jet"
templateLoaderClass="org.eclipse.jet.compiled._jet_transformation">
<description>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
index b2d7103..2ee663d 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
@@ -23,6 +23,9 @@
--- Iterate over each nested project element
--- Generate artifacts for the current project element
+ <c:if test="$project/@location">
+ <ws:project name="{$project/@name}" location="{$project/@location}"/>
+ </c:if>
<ws:project name="{$project/@name}">
<ws:folder path="META-INF">
<ws:file template="templates/project/manifest.mf.jet" path="MANIFEST.MF"/>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
index b45ba4d..aef59b5 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
@@ -1,21 +1,24 @@
<%@taglib prefix="cc" id="org.eclipse.jet.controlTags" %>
<\%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
-*** Control template for bean.transform
+<\%-- Main entry point for <cc:get select="$project/@bundleSymbolicName"/> --%>
+<\%--
+TODO: traverse input model, performing calculations and storing
+the results as model annotations via c:set tag
+--%>
- --- Define additional attributes for the current root element
-
- --- Iterate over each nested project element
-
-*** Traverse the model and generate artifacts
- --- Generate artifacts for the current root element
-
- --- Iterate over each nested project element
+<\%--
+TODO: traverse annotated model, performing text generation actions
+such as ws:file, ws:folder and ws:project
+--%>
-*** Dump the transformed model for testing and debug purposes
-
- <ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
-
+<\%-- For debug purposes, dump the annotated input model in
+ the root of the project containing the original input model.
+
+ Note that model formatting may not be identical, and that in
+ the case of non-XML input models, the dump may look quite different.
+--%>
+<ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
index b158526..b2757a2 100644
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
+++ b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
@@ -89,7 +89,7 @@
</TR>
</TBODY>
</TABLE>
-<exists node="tag/attribute use='required'">
+<c:if test="$tag/attribute[@use='required' or not(@use)]">
<HR>
<TABLE border="1" width="100%">
<TBODY>
@@ -103,7 +103,7 @@
</c:iterate>
</TBODY>
</TABLE>
-</exists>
+</c:if>
<c:if test="$tag/attribute[@use!='required']">
<HR>
<TABLE border="1" width="100%">
@@ -128,8 +128,8 @@
<TR>
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
-<%--roundtrip--%><!-- Begin <c:get select="$tag/@name" /> example -->
-<%--initialCode--%>
+<c:userRegion><!-- Begin <c:get select="$tag/@name" /> example -->
+<c:initialCode>
<c:choose>
<c:when test="local-name($tag) = 'iteratingTag'">
&lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
@@ -156,7 +156,7 @@
&lt;/<c:get select="$tag/@tagQName" />&gt;
</c:when>
</c:choose>
-<%--/initialCode--%><!-- End <c:get select="$tag/@name" /> example --><%--/roundtrip--%>
+</c:initialCode><!-- End <c:get select="$tag/@name" /> example --></c:userRegion>
</SPAN></TD>
</TR>
</TBODY>