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.services;
1819//jetspeed stuff20import org.apache.jetspeed.portal.Portlet;
21import org.apache.jetspeed.portal.PortletException;
22import org.apache.jetspeed.om.profile.Entry;
23import org.apache.jetspeed.services.portletfactory.PortletFactoryService;
24import org.apache.turbine.services.TurbineServices;
2526/***27 * Static wrapper around the PortletFactoryService28 * 29 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>30 * @version $Id: PortletFactory.java,v 1.4 2004/02/23 04:00:57 jford Exp $31 */32publicclassPortletFactory33 {
3435/*** 36 * Commodity method for getting a reference to the service37 * singleton38 */39privatestaticPortletFactoryService getService()
40 {
41return (PortletFactoryService)TurbineServices
42 .getInstance()
43 .getService(PortletFactoryService.SERVICE_NAME);
44 }
4546/***47 * Given a PSML Entry return an instanciated Portlet.48 *49 * @param entry a PSML Entry describing a portlet50 * @return an instanciated portlet corresponding to this entry51 */52publicstaticPortlet getPortlet( Entry entry ) throws PortletException
53 {
54return getService().getPortlet( entry );
55 }
5657/***58 * Given a Portlet registry entry name, instanciate it59 *60 * @param name the name of a portlet in the registry61 * @return an instanciated portlet corresponding to this entry62 */63publicstaticPortlet getPortlet( String name, String id ) throws PortletException
64 {
65return getService().getPortlet( name, id );
66 }
67 }
68