1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="PortletLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link PortletLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       PortletLocalService
39   * @generated
40   */
41  public class PortletLocalServiceUtil {
42      public static com.liferay.portal.model.Portlet addPortlet(
43          com.liferay.portal.model.Portlet portlet)
44          throws com.liferay.portal.SystemException {
45          return getService().addPortlet(portlet);
46      }
47  
48      public static com.liferay.portal.model.Portlet createPortlet(long id) {
49          return getService().createPortlet(id);
50      }
51  
52      public static void deletePortlet(long id)
53          throws com.liferay.portal.PortalException,
54              com.liferay.portal.SystemException {
55          getService().deletePortlet(id);
56      }
57  
58      public static void deletePortlet(com.liferay.portal.model.Portlet portlet)
59          throws com.liferay.portal.SystemException {
60          getService().deletePortlet(portlet);
61      }
62  
63      @SuppressWarnings("rawtypes")
64      public static java.util.List dynamicQuery(
65          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
66          throws com.liferay.portal.SystemException {
67          return getService().dynamicQuery(dynamicQuery);
68      }
69  
70      @SuppressWarnings("rawtypes")
71      public static java.util.List dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
73          int end) throws com.liferay.portal.SystemException {
74          return getService().dynamicQuery(dynamicQuery, start, end);
75      }
76  
77      @SuppressWarnings("rawtypes")
78      public static java.util.List dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
80          int end,
81          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
82          throws com.liferay.portal.SystemException {
83          return getService()
84                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
85      }
86  
87      public static int dynamicQueryCount(
88          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
89          throws com.liferay.portal.SystemException {
90          return getService().dynamicQueryCount(dynamicQuery);
91      }
92  
93      public static com.liferay.portal.model.Portlet getPortlet(long id)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException {
96          return getService().getPortlet(id);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
100         int start, int end) throws com.liferay.portal.SystemException {
101         return getService().getPortlets(start, end);
102     }
103 
104     public static int getPortletsCount()
105         throws com.liferay.portal.SystemException {
106         return getService().getPortletsCount();
107     }
108 
109     public static com.liferay.portal.model.Portlet updatePortlet(
110         com.liferay.portal.model.Portlet portlet)
111         throws com.liferay.portal.SystemException {
112         return getService().updatePortlet(portlet);
113     }
114 
115     public static com.liferay.portal.model.Portlet updatePortlet(
116         com.liferay.portal.model.Portlet portlet, boolean merge)
117         throws com.liferay.portal.SystemException {
118         return getService().updatePortlet(portlet, merge);
119     }
120 
121     public static com.liferay.portal.model.Portlet clonePortlet(
122         long companyId, java.lang.String portletId)
123         throws com.liferay.portal.SystemException {
124         return getService().clonePortlet(companyId, portletId);
125     }
126 
127     public static com.liferay.portal.model.Portlet deployRemotePortlet(
128         com.liferay.portal.model.Portlet portlet, java.lang.String categoryName)
129         throws com.liferay.portal.SystemException {
130         return getService().deployRemotePortlet(portlet, categoryName);
131     }
132 
133     public static void destroyPortlet(com.liferay.portal.model.Portlet portlet) {
134         getService().destroyPortlet(portlet);
135     }
136 
137     public static void destroyRemotePortlet(
138         com.liferay.portal.model.Portlet portlet) {
139         getService().destroyRemotePortlet(portlet);
140     }
141 
142     public static com.liferay.portal.model.PortletCategory getEARDisplay(
143         java.lang.String xml) throws com.liferay.portal.SystemException {
144         return getService().getEARDisplay(xml);
145     }
146 
147     public static java.util.List<com.liferay.portal.model.Portlet> getFriendlyURLMapperPortlets() {
148         return getService().getFriendlyURLMapperPortlets();
149     }
150 
151     public static java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers() {
152         return getService().getFriendlyURLMappers();
153     }
154 
155     public static com.liferay.portal.model.PortletApp getPortletApp(
156         java.lang.String servletContextName) {
157         return getService().getPortletApp(servletContextName);
158     }
159 
160     public static com.liferay.portal.model.Portlet getPortletById(
161         long companyId, java.lang.String portletId)
162         throws com.liferay.portal.SystemException {
163         return getService().getPortletById(companyId, portletId);
164     }
165 
166     public static com.liferay.portal.model.Portlet getPortletById(
167         java.lang.String portletId) {
168         return getService().getPortletById(portletId);
169     }
170 
171     public static com.liferay.portal.model.Portlet getPortletByStrutsPath(
172         long companyId, java.lang.String strutsPath)
173         throws com.liferay.portal.SystemException {
174         return getService().getPortletByStrutsPath(companyId, strutsPath);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Portlet> getPortlets() {
178         return getService().getPortlets();
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
182         long companyId) throws com.liferay.portal.SystemException {
183         return getService().getPortlets(companyId);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
187         long companyId, boolean showSystem, boolean showPortal)
188         throws com.liferay.portal.SystemException {
189         return getService().getPortlets(companyId, showSystem, showPortal);
190     }
191 
192     public static com.liferay.portal.model.PortletCategory getWARDisplay(
193         java.lang.String servletContextName, java.lang.String xml)
194         throws com.liferay.portal.SystemException {
195         return getService().getWARDisplay(servletContextName, xml);
196     }
197 
198     public static boolean hasPortlet(long companyId, java.lang.String portletId)
199         throws com.liferay.portal.SystemException {
200         return getService().hasPortlet(companyId, portletId);
201     }
202 
203     public static void initEAR(javax.servlet.ServletContext servletContext,
204         java.lang.String[] xmls,
205         com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
206         getService().initEAR(servletContext, xmls, pluginPackage);
207     }
208 
209     public static java.util.List<com.liferay.portal.model.Portlet> initWAR(
210         java.lang.String servletContextName,
211         javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
212         com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
213         return getService()
214                    .initWAR(servletContextName, servletContext, xmls,
215             pluginPackage);
216     }
217 
218     /**
219     * @deprecated {@link #clonePortlet(long, String)}
220     */
221     public static com.liferay.portal.model.Portlet newPortlet(long companyId,
222         java.lang.String portletId) {
223         return getService().newPortlet(companyId, portletId);
224     }
225 
226     public static com.liferay.portal.model.Portlet updatePortlet(
227         long companyId, java.lang.String portletId, java.lang.String roles,
228         boolean active) throws com.liferay.portal.SystemException {
229         return getService().updatePortlet(companyId, portletId, roles, active);
230     }
231 
232     public static PortletLocalService getService() {
233         if (_service == null) {
234             _service = (PortletLocalService)PortalBeanLocatorUtil.locate(PortletLocalService.class.getName());
235 
236             ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
237                 "_service");
238             MethodCache.remove(PortletLocalService.class);
239         }
240 
241         return _service;
242     }
243 
244     public void setService(PortletLocalService service) {
245         MethodCache.remove(PortletLocalService.class);
246 
247         _service = service;
248 
249         ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
250             "_service");
251         MethodCache.remove(PortletLocalService.class);
252     }
253 
254     private static PortletLocalService _service;
255 }