1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.information;
18
19 import javax.servlet.ServletConfig;
20
21 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
22 import org.apache.pluto.om.common.ObjectID;
23 import org.apache.pluto.om.portlet.PortletDefinition;
24 import org.apache.pluto.services.information.PortalContextProvider;
25 import org.apache.pluto.services.information.StaticInformationProvider;
26
27 /***
28 * Provides static information to Pluto Container:
29 *
30 * 1. PortletDefinition - given a unique registry id,
31 * retrieve the portlet definition from the portlet registry
32 *
33 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
34 * @version $Id: StaticInformationProviderImpl.java 516448 2007-03-09 16:25:47Z ate $
35 */
36 public class StaticInformationProviderImpl implements StaticInformationProvider
37 {
38 private final PortletRegistry portletRegistry;
39
40 /***
41 * @obsolete
42 */
43 public StaticInformationProviderImpl(ServletConfig config, PortalContextProvider portalContextProvider, PortletRegistry portletRegistry)
44 {
45 this(portletRegistry);
46 }
47
48 public StaticInformationProviderImpl(PortletRegistry portletRegistry)
49 {
50 this.portletRegistry = portletRegistry;
51 }
52
53 /***
54 * Given a unique registry id,
55 * retrieve the portlet definition from the portlet registry
56 *
57 * @param uniqueId The uniquely identifying portlet id in the registry
58 */
59 public PortletDefinition getPortletDefinition(String uniqueId)
60 {
61 return portletRegistry.getPortletDefinitionByIdentifier(uniqueId);
62 }
63
64 /***
65 * <p>
66 * getPortalContextProvider
67 * </p>
68 *
69 * @see org.apache.pluto.services.information.StaticInformationProvider#getPortalContextProvider()
70 * @return
71 */
72 public PortalContextProvider getPortalContextProvider()
73 {
74 throw new UnsupportedOperationException();
75 }
76
77 /***
78 * <p>
79 * getPortletDefinition
80 * </p>
81 *
82 * @see org.apache.pluto.services.information.StaticInformationProvider#getPortletDefinition(org.apache.pluto.om.common.ObjectID)
83 * @param arg0
84 * @return
85 */
86 public PortletDefinition getPortletDefinition(ObjectID id)
87 {
88 return portletRegistry.getPortletDefinition(id);
89 }
90
91 }