01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
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
37: StaticInformationProvider {
38: private final PortletRegistry portletRegistry;
39:
40: /**
41: * @obsolete
42: */
43: public StaticInformationProviderImpl(ServletConfig config,
44: PortalContextProvider portalContextProvider,
45: PortletRegistry portletRegistry) {
46: this (portletRegistry);
47: }
48:
49: public StaticInformationProviderImpl(PortletRegistry portletRegistry) {
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: return portletRegistry
61: .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: throw new UnsupportedOperationException();
74: }
75:
76: /**
77: * <p>
78: * getPortletDefinition
79: * </p>
80: *
81: * @see org.apache.pluto.services.information.StaticInformationProvider#getPortletDefinition(org.apache.pluto.om.common.ObjectID)
82: * @param arg0
83: * @return
84: */
85: public PortletDefinition getPortletDefinition(ObjectID id) {
86: return portletRegistry.getPortletDefinition(id);
87: }
88:
89: }
|