1 package org.apache.turbine.modules.navigations;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.ecs.ConcreteElement;
20
21 import org.apache.turbine.modules.Navigation;
22
23 import org.apache.turbine.util.RunData;
24
25 /***
26 * Base Template Navigation.
27 *
28 * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
29 * @version $Id: TemplateNavigation.java 264148 2005-08-29 14:21:04Z henning $
30 */
31 public abstract class TemplateNavigation
32 extends Navigation
33 {
34 /***
35 * WebMacro Navigations extending this class should overide this
36 * method to perform any particular business logic and add
37 * information to the context.
38 *
39 * @param data Turbine information.
40 * @throws Exception a generic exception.
41 */
42 protected abstract void doBuildTemplate(RunData data)
43 throws Exception;
44
45 /***
46 * This Builds the WebMacro/FreeMarker/etc template.
47 *
48 * @param data Turbine information.
49 * @return A ConcreteElement.
50 * @throws Exception a generic exception.
51 */
52 public abstract ConcreteElement buildTemplate(RunData data)
53 throws Exception;
54
55 /***
56 * Calls doBuildTemplate() and then buildTemplate().
57 *
58 * @param data Turbine information.
59 * @return A ConcreteElement.
60 * @throws Exception a generic exception.
61 */
62 protected ConcreteElement doBuild(RunData data)
63 throws Exception
64 {
65 doBuildTemplate(data);
66 return buildTemplate(data);
67 }
68 }