1 package org.apache.turbine.modules.actions; 2 3 18 19 import org.apache.turbine.modules.screens.TemplateScreen; 20 import org.apache.turbine.services.velocity.TurbineVelocity; 21 import org.apache.turbine.util.RunData; 22 import org.apache.turbine.util.velocity.VelocityActionEvent; 23 import org.apache.velocity.context.Context; 24 25 34 public abstract class VelocityAction extends VelocityActionEvent 35 { 36 43 public void doPerform(RunData data) 44 throws Exception 45 { 46 doPerform(data, getContext(data)); 47 } 48 49 57 public abstract void doPerform(RunData data, 58 Context context) 59 throws Exception ; 60 61 69 protected void perform(RunData data) 70 throws Exception 71 { 72 super.perform(data); 73 } 74 75 82 public void setTemplate(RunData data, 83 String template) 84 { 85 TemplateScreen.setTemplate(data, template); 86 } 87 88 94 protected Context getContext(RunData data) 95 { 96 return TurbineVelocity.getContext(data); 97 } 98 } 99 | Popular Tags |