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
20
21
22 import org.apache.ecs.ConcreteElement;
23
24 import org.apache.turbine.modules.Navigation;
25
26 import org.apache.turbine.util.RunData;
27
28 /***
29 * Base Template Navigation.
30 *
31 * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
32 * @version $Id: TemplateNavigation.java 534527 2007-05-02 16:10:59Z tv $
33 */
34 public abstract class TemplateNavigation
35 extends Navigation
36 {
37 /***
38 * WebMacro Navigations extending this class should overide this
39 * method to perform any particular business logic and add
40 * information to the context.
41 *
42 * @param data Turbine information.
43 * @throws Exception a generic exception.
44 */
45 protected abstract void doBuildTemplate(RunData data)
46 throws Exception;
47
48 /***
49 * This Builds the WebMacro/FreeMarker/etc template.
50 *
51 * @param data Turbine information.
52 * @return A ConcreteElement.
53 * @throws Exception a generic exception.
54 */
55 public abstract ConcreteElement buildTemplate(RunData data)
56 throws Exception;
57
58 /***
59 * Calls doBuildTemplate() and then buildTemplate().
60 *
61 * @param data Turbine information.
62 * @return A ConcreteElement.
63 * @throws Exception a generic exception.
64 */
65 protected ConcreteElement doBuild(RunData data)
66 throws Exception
67 {
68 doBuildTemplate(data);
69 return buildTemplate(data);
70 }
71 }