Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-04-28 12:52:38 -0400
committerpelder2008-04-28 12:52:38 -0400
commit235d78e10b1fbb70cfa9f6b14a8bd685fa1fdffd (patch)
tree1912e83ca18f61479a4a98892bc8a6ba51f51f46
parent97436e12c0cee60287ed4dabf3579c1fa02cc92d (diff)
downloadorg.eclipse.jet-235d78e10b1fbb70cfa9f6b14a8bd685fa1fdffd.tar.gz
org.eclipse.jet-235d78e10b1fbb70cfa9f6b14a8bd685fa1fdffd.tar.xz
org.eclipse.jet-235d78e10b1fbb70cfa9f6b14a8bd685fa1fdffd.zip
[229094,229106] Create JET tag that invokes an XPath function on the tags contents. Create XPath function to encode Java properties contents.
[228337] [DBCS3.4] DBCS in JET output folder gets corrupted
-rw-r--r--plugins/org.eclipse.jet/plugin.xml38
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet6
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet4
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/org.eclipse.jet.prefs.jet4
4 files changed, 38 insertions, 14 deletions
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
index 7bc3c23..1e3bc23 100644
--- a/plugins/org.eclipse.jet/plugin.xml
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -1007,6 +1007,22 @@ if 'length' is specified, convert only the specified number of characters, other
<emptyTag name="uuid" class="org.eclipse.jet.internal.taglib.format.UuidTag" >
<description>Generate a universally unique identifier (UUID).</description>
</emptyTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.format.XPathTag"
+ name="xpath"
+ whenContainingLineIsEmpty="preserve">
+ <description>
+ Evaluate the specified XPath function on the tag content and write the result in place of the tag content. The tag content is referenced by the variable $bodyContent.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ The XPath expression to evaluate. The result is automatically converted to a a string. The tags content is refered to by the variable $bodyContent.
+ </description>
+ </attribute>
+ </functionTag>
</tagLibrary>
</extension>
<extension
@@ -1131,6 +1147,12 @@ if 'length' is specified, convert only the specified number of characters, other
minArgs="1"
name="escapeJavaWhitespace"/>
<function
+ implementation="org.eclipse.jet.internal.xpath.functions.extras.IsVariableDefinedFunction"
+ maxArgs="1"
+ minArgs="1"
+ name="isVariableDefined">
+ </function>
+ <function
implementation="org.eclipse.jet.internal.xpath.functions.extras.Lower_caseFunction"
maxArgs="1"
minArgs="1"
@@ -1141,17 +1163,12 @@ if 'length' is specified, convert only the specified number of characters, other
minArgs="1"
name="lowercaseFirst"/>
<function
- implementation="org.eclipse.jet.internal.xpath.functions.extras.XmlEncodeFunction"
- maxArgs="1"
- minArgs="1"
- name="xmlEncode"/>
- <function
implementation="org.eclipse.jet.internal.xpath.functions.extras.PackageNameFunction"
maxArgs="1"
minArgs="1"
name="packageName"/>
<function
- implementation="org.eclipse.jet.internal.xpath.functions.extras.RemoveWhitespaceFunction"
+ implementation="org.eclipse.jet.internal.xpath.functions.extras.PropertiesEncodeFunction"
maxArgs="1"
minArgs="1"
name="removeWhitespace"/>
@@ -1171,10 +1188,15 @@ if 'length' is specified, convert only the specified number of characters, other
minArgs="1"
name="uppercaseFirst"/>
<function
- implementation="org.eclipse.jet.internal.xpath.functions.extras.IsVariableDefinedFunction"
+ implementation="org.eclipse.jet.internal.xpath.functions.extras.XmlEncodeFunction"
maxArgs="1"
minArgs="1"
- name="isVariableDefined">
+ name="xmlEncode"/>
+ <function
+ implementation="org.eclipse.jet.internal.xpath.functions.extras.PropertiesEncodeFunction"
+ maxArgs="2"
+ minArgs="1"
+ name="propertiesEncode">
</function>
<function
implementation="org.eclipse.jet.internal.xpath.functions.extras.SortFunction"
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet
index 060f51c..0db5a3c 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet
@@ -1,10 +1,10 @@
<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
-source.. = <c:get select="$project/@jet2javaDir" />/
-output.. = <c:get select="$project/@binDir" />/
+source.. = <c:get select="propertiesEncode($project/@jet2javaDir,true())" />/
+output.. = <c:get select="propertiesEncode($project/@binDir,true())" />/
bin.includes = .,\
plugin.xml,\
META-INF/,\
- <c:get select="$project/@templatesDir" />/
+ <c:get select="propertiesEncode($project/@templatesDir,true())" />/
src.includes = .project,\
build.properties,\
.classpath
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 2f675e1..35f7c1b 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
@@ -28,6 +28,8 @@ such as ws:file, ws:folder and ws:project
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"/>
+<c:if test="isVariableDefined('org.eclipse.jet.resource.project.name')">
+ <ws:file template="<cc:get select="$project/@templatesDir"/>/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
+</c:if>
</cc:otherwise>
</cc:choose>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/org.eclipse.jet.prefs.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/org.eclipse.jet.prefs.jet
index 34cfcf0..df36efb 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/org.eclipse.jet.prefs.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/project/org.eclipse.jet.prefs.jet
@@ -1,5 +1,5 @@
#<f:formatNow pattern="EEE MMM dd HH:mm:ss zzz yyyy"/>
eclipse.preferences.version=1
-org.eclipse.jet.compiledTemplatePackage=<c:get select="$project/@dfltJavaPackage"/>
-org.eclipse.jet.compiledTemplateSrcDir=<c:get select="$project/@jet2javaDir"/>
+org.eclipse.jet.compiledTemplatePackage=<c:get select="propertiesEncode($project/@dfltJavaPackage, true())"/>
+org.eclipse.jet.compiledTemplateSrcDir=<c:get select="propertiesEncode($project/@jet2javaDir, true())"/>
org.eclipse.jet.projectPrefs=true

Back to the top