1 5 package com.teamkonzept.web; 6 7 import java.io.*; 8 import com.oroinc.text.regex.*; 9 10 import com.teamkonzept.lib.*; 11 import com.teamkonzept.lib.templates.*; 12 import com.teamkonzept.web.templates.*; 13 14 18 public class TKHTMLTemplate extends TKTemplate { 19 static protected final String patRefTag = "(SRC|HREF|ACTION|BACKGROUND)"; 20 21 static Pattern patBaseURL; 22 public TKTemplateSyntax newSyntax() 23 { 24 return new TKHTMLTemplateSyntax(); 25 } 26 27 public TKTemplateSyntax newSyntax(Pattern patTKTag) 28 { 29 return new TKHTMLTemplateSyntax(patTKTag); 30 } 31 32 39 public TKHTMLTemplate( String location ) throws TKTemplateSyntaxException, FileNotFoundException 40 { 41 super( location ); 42 } 43 44 53 public TKHTMLTemplate( TKTemplateSyntax ts ) 54 { 55 super( ts ); 56 } 57 58 67 public void setURLBase(String aBase){ 68 ((TKHTMLTemplateData)td).base = aBase; 69 } 70 71 81 public void doTagSubstitution() throws TKTemplateSyntaxException 82 { 83 doMainSubstitutions(); 85 86 if (((TKHTMLTemplateData)td).base != null){ 88 rel2baseURL(); 89 } 90 } 91 92 98 protected void rel2baseURL() 99 { 100 text = Util.substitute( TKReg.getMatcher(), patBaseURL, " $1=\""+((TKHTMLTemplateData)td).base, text, Util.SUBSTITUTE_ALL ); 101 } 102 103 } 106 107 108 | Popular Tags |