01: package org.apache.turbine.modules.navigations;
02:
03: /*
04: * Copyright 2001-2005 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License")
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
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 extends Navigation {
32: /**
33: * WebMacro Navigations extending this class should overide this
34: * method to perform any particular business logic and add
35: * information to the context.
36: *
37: * @param data Turbine information.
38: * @throws Exception a generic exception.
39: */
40: protected abstract void doBuildTemplate(RunData data)
41: throws Exception;
42:
43: /**
44: * This Builds the WebMacro/FreeMarker/etc template.
45: *
46: * @param data Turbine information.
47: * @return A ConcreteElement.
48: * @throws Exception a generic exception.
49: */
50: public abstract ConcreteElement buildTemplate(RunData data)
51: throws Exception;
52:
53: /**
54: * Calls doBuildTemplate() and then buildTemplate().
55: *
56: * @param data Turbine information.
57: * @return A ConcreteElement.
58: * @throws Exception a generic exception.
59: */
60: protected ConcreteElement doBuild(RunData data) throws Exception {
61: doBuildTemplate(data);
62: return buildTemplate(data);
63: }
64: }
|