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.actions.controls;
1819// Turbine stuff20import org.apache.turbine.modules.Action;
21import org.apache.turbine.util.RunData;
2223// Jetspeed stuff24import org.apache.jetspeed.services.rundata.JetspeedRunData;
25import org.apache.jetspeed.services.resources.JetspeedResources;
2627/***28 * Display portlet in print friendly format29 * 30 * @version $Id: Print.java,v 1.3 2004/02/23 02:50:53 jford Exp $ 31 * @author <a href="mailto:mark_orciuch@ngsltd.com">Mark Orciuch</a>32 */33publicclassPrintextends Action
34 {
3536/***37 * Default template to use with print friendly format38 */39privatestaticfinal String DEFAULT_TEMPLATE = "content";
4041/***42 * Default template to use with print friendly format43 */44privatestaticfinal String ACTION_PRINT_TEMPLATE_KEY = "action.print.template";
4546/***47 * Performs the action48 * 49 * @param rundata50 * @exception Exception51 */52publicvoid doPerform( RunData rundata ) throws Exception
53 {
5455 String peid = rundata.getParameters().getString("js_peid");
56if ( peid == null )
57 {
58 rundata.setScreenTemplate("Ecs");
59return;
60 }
6162JetspeedRunData jdata = (JetspeedRunData)rundata;
63 jdata.setJs_peid(peid);
6465// retrieve the print friendly format action template66 String template = JetspeedResources.getString(ACTION_PRINT_TEMPLATE_KEY, DEFAULT_TEMPLATE);
6768// redirect to the content template69 rundata.setScreenTemplate(template);
70 }
71 }