1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.portlet; |
16 |
| |
17 |
| import java.util.Iterator; |
18 |
| |
19 |
| import javax.portlet.PortletConfig; |
20 |
| |
21 |
| import org.apache.tapestry.describe.DescribableStrategy; |
22 |
| import org.apache.tapestry.describe.DescriptionReceiver; |
23 |
| import org.apache.tapestry.web.WebUtils; |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| public class PortletConfigStrategy implements DescribableStrategy |
32 |
| { |
33 |
| |
34 |
0
| public void describeObject(Object object, DescriptionReceiver receiver)
|
35 |
| { |
36 |
0
| PortletConfig pc = (PortletConfig) object;
|
37 |
| |
38 |
0
| receiver.title("Portlet Config");
|
39 |
| |
40 |
0
| receiver.property("portletName", pc.getPortletName());
|
41 |
| |
42 |
0
| receiver.section("Init Parameters");
|
43 |
| |
44 |
0
| Iterator i = WebUtils.toSortedList(pc.getInitParameterNames()).iterator();
|
45 |
| |
46 |
0
| while (i.hasNext())
|
47 |
| { |
48 |
0
| String name = (String) i.next();
|
49 |
0
| receiver.property(name, pc.getInitParameter(name));
|
50 |
| } |
51 |
| } |
52 |
| } |