1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.modules.actions.controls;
18
19
20 import org.apache.turbine.modules.Action;
21 import org.apache.turbine.util.RunData;
22
23
24 import org.apache.jetspeed.services.rundata.JetspeedRunData;
25 import org.apache.jetspeed.services.resources.JetspeedResources;
26
27 /***
28 * Display portlet in print friendly format
29 *
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 */
33 public class Print extends Action
34 {
35
36 /***
37 * Default template to use with print friendly format
38 */
39 private static final String DEFAULT_TEMPLATE = "content";
40
41 /***
42 * Default template to use with print friendly format
43 */
44 private static final String ACTION_PRINT_TEMPLATE_KEY = "action.print.template";
45
46 /***
47 * Performs the action
48 *
49 * @param rundata
50 * @exception Exception
51 */
52 public void doPerform( RunData rundata ) throws Exception
53 {
54
55 String peid = rundata.getParameters().getString("js_peid");
56 if ( peid == null )
57 {
58 rundata.setScreenTemplate("Ecs");
59 return;
60 }
61
62 JetspeedRunData jdata = (JetspeedRunData)rundata;
63 jdata.setJs_peid(peid);
64
65
66 String template = JetspeedResources.getString(ACTION_PRINT_TEMPLATE_KEY, DEFAULT_TEMPLATE);
67
68
69 rundata.setScreenTemplate(template);
70 }
71 }