1 package org.apache.turbine.modules.navigations; 2 3 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 22 import org.apache.ecs.ConcreteElement; 23 import org.apache.ecs.StringElement; 24 25 import org.apache.turbine.TurbineConstants; 26 import org.apache.turbine.services.template.TurbineTemplate; 27 import org.apache.turbine.services.velocity.TurbineVelocity; 28 import org.apache.turbine.util.RunData; 29 30 import org.apache.velocity.context.Context; 31 32 44 public class VelocityNavigation 45 extends TemplateNavigation 46 { 47 48 private static Log log = LogFactory.getLog(VelocityNavigation.class); 49 50 51 private String prefix = TurbineConstants.NAVIGATION_PREFIX + "/"; 52 53 62 protected void doBuildTemplate(RunData data, 63 Context context) 64 throws Exception 65 { 66 } 67 68 76 protected void doBuildTemplate(RunData data) 77 throws Exception 78 { 79 doBuildTemplate(data, TurbineVelocity.getContext(data)); 80 } 81 82 89 public ConcreteElement buildTemplate(RunData data) 90 throws Exception 91 { 92 Context context = TurbineVelocity.getContext(data); 93 94 String navigationTemplate = data.getTemplateInfo().getNavigationTemplate(); 95 String templateName 96 = TurbineTemplate.getNavigationTemplateName(navigationTemplate); 97 98 StringElement output = new StringElement(); 99 output.setFilterState(false); 100 output.addElement(TurbineVelocity 101 .handleRequest(context, prefix + templateName)); 102 return output; 103 } 104 105 } 106 | Popular Tags |