01: /*
02: * This file is part of "SnipSnap Radeox Rendering Engine".
03: *
04: * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
05: * All Rights Reserved.
06: *
07: * Please visit http://radeox.org/ for updates and contact.
08: *
09: * --LICENSE NOTICE--
10: * Licensed under the Apache License, Version 2.0 (the "License");
11: * you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software
17: * distributed under the License is distributed on an "AS IS" BASIS,
18: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19: * See the License for the specific language governing permissions and
20: * limitations under the License.
21: * --LICENSE NOTICE--
22: */
23:
24: package org.radeox.api.engine.context;
25:
26: import java.util.Map;
27:
28: import org.radeox.api.engine.RenderEngine;
29:
30: /**
31: * RenderContext stores basic data for the context the RenderEngine is called
32: * in. RenderContext can be used by the Engine in whatever way it likes to. The
33: * Radeox RenderEngine uses RenderContext to construct FilterContext.
34: *
35: * @author Stephan J. Schmidt
36: * @version $Id: RenderContext.java 7707 2006-04-12 17:30:19Z
37: * ian@caret.cam.ac.uk $
38: */
39:
40: public interface RenderContext {
41: public final static String INPUT_BUNDLE_NAME = "RenderContext.input_bundle_name";
42:
43: public final static String OUTPUT_BUNDLE_NAME = "RenderContext.output_bundle_name";
44:
45: public final static String LANGUAGE_BUNDLE_NAME = "RenderContext.language_bundle_name";
46:
47: public final static String LANGUAGE_LOCALE = "RenderContext.language_locale";
48:
49: public final static String INPUT_LOCALE = "RenderContext.input_locale";
50:
51: public final static String OUTPUT_LOCALE = "RenderContext.output_locale";
52:
53: public final static String DEFAULT_FORMATTER = "RenderContext.default_formatter";
54:
55: /**
56: * Returns the RenderEngine handling this request.
57: *
58: * @return engine RenderEngine handling the request within this context
59: */
60: public RenderEngine getRenderEngine();
61:
62: /**
63: * Stores the current RenderEngine of the request
64: *
65: * @param engine
66: * Current RenderEnginge
67: */
68: public void setRenderEngine(RenderEngine engine);
69:
70: public Object get(String key);
71:
72: public void set(String key, Object value);
73:
74: public Map getParameters();
75:
76: /**
77: * Set the parameters for this execution context. These parameters are read
78: * when encountering a variable in macros like {search:$query} or by
79: * ParamFilter in {$query}. Query is then read from the parameter map before
80: * given to the macro
81: *
82: * @param parameters
83: * Map of parameters with name,value pairs
84: */
85: public void setParameters(Map parameters);
86:
87: public void setCacheable(boolean cacheable);
88:
89: public void commitCache();
90:
91: public boolean isCacheable();
92: }
|