1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.modules.pages;
181920// Jetspeed classes21import org.apache.jetspeed.util.template.JetspeedTemplateNavigation;
2223// Turbine Utility Classes24import org.apache.turbine.util.RunData;
25import org.apache.turbine.services.jsp.JspService;
26import org.apache.turbine.services.TurbineServices;
27import org.apache.turbine.services.velocity.VelocityService;
28import org.apache.turbine.services.velocity.TurbineVelocity;
29import org.apache.velocity.context.Context;
3031/***32 * Same as turbine's JspPage, only that it extends JetspeedTemplatePage.33 * Adds some convenience objects to the request.34 *35 * @author <a href="mailto:ingo@raleigh.ibm.com">Ingo Schuster</a>36 * @version $Revision: 1.7 $ 37 */38publicclassJetspeedJspPageextendsJetspeedTemplatePage39 {
4041/***42 * Same method as in turbine's JspPage43 * Stuffs some useful objects into the request so that 44 * it is available to the Action module and the Screen module45 */46protectedvoid doBuildBeforeAction(RunData data) throws Exception
47 {
48super.doBuildBeforeAction( data);
49 JspService jsp = (JspService)TurbineServices.getInstance()
50 .getService(JspService.SERVICE_NAME);
5152 jsp.addDefaultObjects(data);
5354 data.getResponse().setBufferSize(jsp.getDefaultBufferSize());
5556// FIXME: this tools are now in TR.p file, as standard request tools instantiated by turbine.57// All tools but jnavigation are there, jnavigation need to be instantiated here58// because TemplateNavigation in which depends does have a no args constructor..and59// turbine need one to be able to instantiate such class as request tool60 Context context = TurbineVelocity.getContext(data);
61 TurbineVelocity.getContext(data).put("jnavigation", newJetspeedTemplateNavigation(data));
62 data.getTemplateInfo().setTemplateContext(VelocityService.CONTEXT, context);
6364 }
6566 }