01: package org.apache.turbine.modules;
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.util.InputFilterUtils;
22: import org.apache.turbine.util.RunData;
23:
24: /**
25: * This is the base class that defines what a Navigation module is.
26: *
27: * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
28: * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
29: * @version $Id: Navigation.java 264148 2005-08-29 14:21:04Z henning $
30: */
31: public abstract class Navigation extends Assembler {
32: /**
33: * A subclass must override this method to build itself.
34: * Subclasses override this method to store the navigation in
35: * RunData or to write the navigation to the output stream
36: * referenced in RunData.
37: *
38: * @param data Turbine information.
39: * @exception Exception a generic exception.
40: */
41: protected abstract ConcreteElement doBuild(RunData data)
42: throws Exception;
43:
44: /**
45: * Subclasses can override this method to add additional
46: * functionality. This method is protected to force clients to
47: * use NavigationLoader to build a Navigation.
48: *
49: * @param data Turbine information.
50: * @exception Exception a generic exception.
51: */
52: protected ConcreteElement build(RunData data) throws Exception {
53: return doBuild(data);
54: }
55:
56: /**
57: * This function can/should be used in any screen that will output
58: * User entered text. This will help prevent users from entering
59: * html (<SCRIPT>) tags that will get executed by the browser.
60: *
61: * @param s The string to prepare.
62: * @return A string with the input already prepared.
63: * @deprecated Use InputFilterUtils.prepareText(String s)
64: */
65: public static String prepareText(String s) {
66: return InputFilterUtils.prepareText(s);
67: }
68: }
|