Changeset 683
- Timestamp:
- 2008-10-08 10:53:38 (5 years ago)
- Location:
- trunk/universe/kauri-template/src
- Files:
-
- 3 added
- 5 edited
-
main/java/org/kauriproject/template/DefaultTemplateBuilder.java (modified) (1 diff)
-
main/java/org/kauriproject/template/Directive.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/DocumentBlock.java (modified) (1 diff)
-
main/java/org/kauriproject/template/IfBlock.java (modified) (1 diff)
-
main/java/org/kauriproject/template/ImportBlock.java (added)
-
test/java/org/kauriproject/template/TemplateExecutionTest.java (modified) (2 diffs)
-
test/resources/org/kauriproject/template/import.xml (added)
-
test/resources/org/kauriproject/template/import_result.xml (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/DefaultTemplateBuilder.java
r674 r683 278 278 localName, name, attributes), templateService); 279 279 pushBlock(includeblock); 280 } else if (Directive.IMPORT == directive) { 281 ImportBlock importblock = new ImportBlock(elFacade, locator, new SaxElement(uri, 282 localName, name, attributes), templateService); 283 pushBlock(importblock); 280 284 } else if (Directive.VARIABLE == directive) { 281 285 VariableBlock varblock = new VariableBlock(elFacade, locator, new SaxElement(uri, -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/Directive.java
r644 r683 67 67 INCLUDE("include"), 68 68 /** 69 * directive to import another template<br> 70 * import src="template-location" 71 */ 72 IMPORT("import"), 73 /** 69 74 * directive to create a variable<br> 70 75 * variable name="foo" [value="bar"] … … 120 125 else if (name.equals(INCLUDE.tagName)) 121 126 return INCLUDE; 127 else if (name.equals(IMPORT.tagName)) 128 return IMPORT; 122 129 else if (name.equals(VARIABLE.tagName)) 123 130 return VARIABLE; -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/DocumentBlock.java
r656 r683 78 78 if (inc != null) { 79 79 // import or include 80 Step next = inc.getEndStep() .getCompiledNext();80 Step next = inc.getEndStep(); 81 81 // remove mapping because of recursion detection 82 82 includeRegistry.remove(key); -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/IfBlock.java
r487 r683 75 75 public Step executeAndProceed(ExecutionContext context, TemplateResult result) { 76 76 77 // final boolean test = (Boolean) elFacade.evaluateExpression(elExpression, context);78 77 final boolean test = (Boolean) elExpression.evaluate(context.getTemplateContext()); 79 78 -
trunk/universe/kauri-template/src/test/java/org/kauriproject/template/TemplateExecutionTest.java
r657 r683 102 102 testFlow("/org/kauriproject/template/comment.xml", true); 103 103 } 104 104 105 105 public void testMacro() throws Exception { 106 106 testFlow("/org/kauriproject/template/macro.xml", true); 107 107 } 108 108 109 109 public void testInclude() throws Exception { 110 110 testFlow("/org/kauriproject/template/include.xml", true); 111 } 112 113 public void testImport() throws Exception { 114 testFlow("/org/kauriproject/template/import.xml", true); 111 115 } 112 116 … … 121 125 testFlow("/org/kauriproject/template/dropprefix3.xml", true); 122 126 123 // test drop mapping which is still used in the document127 // test drop mapping which is still used in the document 124 128 testFlow("/org/kauriproject/template/dropprefix4.xml", true); 125 129 126 // test drop mapping which is still used in the document, attrs with same local name130 // test drop mapping which is still used in the document, attrs with same local name 127 131 testFlow("/org/kauriproject/template/dropprefix4a.xml", true); 128 132
Note: See TracChangeset
for help on using the changeset viewer.