001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the portlet local service. This utility wraps {@link com.liferay.portal.service.impl.PortletLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see PortletLocalService
030     * @see com.liferay.portal.service.base.PortletLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.PortletLocalServiceImpl
032     * @generated
033     */
034    public class PortletLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortletLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the portlet to the database. Also notifies the appropriate model listeners.
043            *
044            * @param portlet the portlet
045            * @return the portlet that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.Portlet addPortlet(
049                    com.liferay.portal.model.Portlet portlet)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addPortlet(portlet);
052            }
053    
054            /**
055            * Creates a new portlet with the primary key. Does not add the portlet to the database.
056            *
057            * @param id the primary key for the new portlet
058            * @return the new portlet
059            */
060            public static com.liferay.portal.model.Portlet createPortlet(long id) {
061                    return getService().createPortlet(id);
062            }
063    
064            /**
065            * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param id the primary key of the portlet
068            * @throws PortalException if a portlet with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public static void deletePortlet(long id)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService().deletePortlet(id);
075            }
076    
077            /**
078            * Deletes the portlet from the database. Also notifies the appropriate model listeners.
079            *
080            * @param portlet the portlet
081            * @throws SystemException if a system exception occurred
082            */
083            public static void deletePortlet(com.liferay.portal.model.Portlet portlet)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    getService().deletePortlet(portlet);
086            }
087    
088            /**
089            * Performs a dynamic query on the database and returns the matching rows.
090            *
091            * @param dynamicQuery the dynamic query
092            * @return the matching rows
093            * @throws SystemException if a system exception occurred
094            */
095            @SuppressWarnings("rawtypes")
096            public static java.util.List dynamicQuery(
097                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
098                    throws com.liferay.portal.kernel.exception.SystemException {
099                    return getService().dynamicQuery(dynamicQuery);
100            }
101    
102            /**
103            * Performs a dynamic query on the database and returns a range of the matching rows.
104            *
105            * <p>
106            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
107            * </p>
108            *
109            * @param dynamicQuery the dynamic query
110            * @param start the lower bound of the range of model instances
111            * @param end the upper bound of the range of model instances (not inclusive)
112            * @return the range of matching rows
113            * @throws SystemException if a system exception occurred
114            */
115            @SuppressWarnings("rawtypes")
116            public static java.util.List dynamicQuery(
117                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
118                    int end) throws com.liferay.portal.kernel.exception.SystemException {
119                    return getService().dynamicQuery(dynamicQuery, start, end);
120            }
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public static java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getService()
143                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
144            }
145    
146            /**
147            * Returns the number of rows that match the dynamic query.
148            *
149            * @param dynamicQuery the dynamic query
150            * @return the number of rows that match the dynamic query
151            * @throws SystemException if a system exception occurred
152            */
153            public static long dynamicQueryCount(
154                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
155                    throws com.liferay.portal.kernel.exception.SystemException {
156                    return getService().dynamicQueryCount(dynamicQuery);
157            }
158    
159            /**
160            * Returns the portlet with the primary key.
161            *
162            * @param id the primary key of the portlet
163            * @return the portlet
164            * @throws PortalException if a portlet with the primary key could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            public static com.liferay.portal.model.Portlet getPortlet(long id)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getService().getPortlet(id);
171            }
172    
173            public static com.liferay.portal.model.PersistedModel getPersistedModel(
174                    java.io.Serializable primaryKeyObj)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getService().getPersistedModel(primaryKeyObj);
178            }
179    
180            /**
181            * Returns a range of all the portlets.
182            *
183            * <p>
184            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
185            * </p>
186            *
187            * @param start the lower bound of the range of portlets
188            * @param end the upper bound of the range of portlets (not inclusive)
189            * @return the range of portlets
190            * @throws SystemException if a system exception occurred
191            */
192            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
193                    int start, int end)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService().getPortlets(start, end);
196            }
197    
198            /**
199            * Returns the number of portlets.
200            *
201            * @return the number of portlets
202            * @throws SystemException if a system exception occurred
203            */
204            public static int getPortletsCount()
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getPortletsCount();
207            }
208    
209            /**
210            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
211            *
212            * @param portlet the portlet
213            * @return the portlet that was updated
214            * @throws SystemException if a system exception occurred
215            */
216            public static com.liferay.portal.model.Portlet updatePortlet(
217                    com.liferay.portal.model.Portlet portlet)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getService().updatePortlet(portlet);
220            }
221    
222            /**
223            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
224            *
225            * @param portlet the portlet
226            * @param merge whether to merge the portlet with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
227            * @return the portlet that was updated
228            * @throws SystemException if a system exception occurred
229            */
230            public static com.liferay.portal.model.Portlet updatePortlet(
231                    com.liferay.portal.model.Portlet portlet, boolean merge)
232                    throws com.liferay.portal.kernel.exception.SystemException {
233                    return getService().updatePortlet(portlet, merge);
234            }
235    
236            /**
237            * Returns the Spring bean ID for this bean.
238            *
239            * @return the Spring bean ID for this bean
240            */
241            public static java.lang.String getBeanIdentifier() {
242                    return getService().getBeanIdentifier();
243            }
244    
245            /**
246            * Sets the Spring bean ID for this bean.
247            *
248            * @param beanIdentifier the Spring bean ID for this bean
249            */
250            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
251                    getService().setBeanIdentifier(beanIdentifier);
252            }
253    
254            public static void addPortletCategory(long companyId,
255                    java.lang.String categoryName) {
256                    getService().addPortletCategory(companyId, categoryName);
257            }
258    
259            public static void checkPortlet(com.liferay.portal.model.Portlet portlet)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException {
262                    getService().checkPortlet(portlet);
263            }
264    
265            public static void checkPortlets(long companyId)
266                    throws com.liferay.portal.kernel.exception.PortalException,
267                            com.liferay.portal.kernel.exception.SystemException {
268                    getService().checkPortlets(companyId);
269            }
270    
271            public static void clearCache() {
272                    getService().clearCache();
273            }
274    
275            /**
276            * @deprecated {@link #clonePortlet(String)}
277            */
278            public static com.liferay.portal.model.Portlet clonePortlet(
279                    long companyId, java.lang.String portletId) {
280                    return getService().clonePortlet(companyId, portletId);
281            }
282    
283            public static com.liferay.portal.model.Portlet clonePortlet(
284                    java.lang.String portletId) {
285                    return getService().clonePortlet(portletId);
286            }
287    
288            public static com.liferay.portal.model.Portlet deployRemotePortlet(
289                    com.liferay.portal.model.Portlet portlet, java.lang.String categoryName)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    return getService().deployRemotePortlet(portlet, categoryName);
293            }
294    
295            public static com.liferay.portal.model.Portlet deployRemotePortlet(
296                    com.liferay.portal.model.Portlet portlet,
297                    java.lang.String[] categoryNames)
298                    throws com.liferay.portal.kernel.exception.PortalException,
299                            com.liferay.portal.kernel.exception.SystemException {
300                    return getService().deployRemotePortlet(portlet, categoryNames);
301            }
302    
303            public static void destroyPortlet(com.liferay.portal.model.Portlet portlet) {
304                    getService().destroyPortlet(portlet);
305            }
306    
307            public static void destroyRemotePortlet(
308                    com.liferay.portal.model.Portlet portlet) {
309                    getService().destroyRemotePortlet(portlet);
310            }
311    
312            public static java.util.List<com.liferay.portlet.expando.model.CustomAttributesDisplay> getCustomAttributesDisplays() {
313                    return getService().getCustomAttributesDisplays();
314            }
315    
316            public static com.liferay.portal.model.PortletCategory getEARDisplay(
317                    java.lang.String xml)
318                    throws com.liferay.portal.kernel.exception.SystemException {
319                    return getService().getEARDisplay(xml);
320            }
321    
322            public static java.util.List<com.liferay.portal.model.Portlet> getFriendlyURLMapperPortlets() {
323                    return getService().getFriendlyURLMapperPortlets();
324            }
325    
326            public static java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers() {
327                    return getService().getFriendlyURLMappers();
328            }
329    
330            public static com.liferay.portal.model.PortletApp getPortletApp(
331                    java.lang.String servletContextName) {
332                    return getService().getPortletApp(servletContextName);
333            }
334    
335            public static com.liferay.portal.model.Portlet getPortletById(
336                    long companyId, java.lang.String portletId)
337                    throws com.liferay.portal.kernel.exception.SystemException {
338                    return getService().getPortletById(companyId, portletId);
339            }
340    
341            public static com.liferay.portal.model.Portlet getPortletById(
342                    java.lang.String portletId) {
343                    return getService().getPortletById(portletId);
344            }
345    
346            public static com.liferay.portal.model.Portlet getPortletByStrutsPath(
347                    long companyId, java.lang.String strutsPath)
348                    throws com.liferay.portal.kernel.exception.SystemException {
349                    return getService().getPortletByStrutsPath(companyId, strutsPath);
350            }
351    
352            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets() {
353                    return getService().getPortlets();
354            }
355    
356            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
357                    long companyId)
358                    throws com.liferay.portal.kernel.exception.SystemException {
359                    return getService().getPortlets(companyId);
360            }
361    
362            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
363                    long companyId, boolean showSystem, boolean showPortal)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getService().getPortlets(companyId, showSystem, showPortal);
366            }
367    
368            public static com.liferay.portal.model.PortletCategory getWARDisplay(
369                    java.lang.String servletContextName, java.lang.String xml)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getService().getWARDisplay(servletContextName, xml);
372            }
373    
374            public static boolean hasPortlet(long companyId, java.lang.String portletId)
375                    throws com.liferay.portal.kernel.exception.SystemException {
376                    return getService().hasPortlet(companyId, portletId);
377            }
378    
379            public static void initEAR(javax.servlet.ServletContext servletContext,
380                    java.lang.String[] xmls,
381                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
382                    getService().initEAR(servletContext, xmls, pluginPackage);
383            }
384    
385            public static java.util.List<com.liferay.portal.model.Portlet> initWAR(
386                    java.lang.String servletContextName,
387                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
388                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
389                    return getService()
390                                       .initWAR(servletContextName, servletContext, xmls,
391                            pluginPackage);
392            }
393    
394            public static com.liferay.portal.model.Portlet updatePortlet(
395                    long companyId, java.lang.String portletId, java.lang.String roles,
396                    boolean active)
397                    throws com.liferay.portal.kernel.exception.SystemException {
398                    return getService().updatePortlet(companyId, portletId, roles, active);
399            }
400    
401            public static PortletLocalService getService() {
402                    if (_service == null) {
403                            _service = (PortletLocalService)PortalBeanLocatorUtil.locate(PortletLocalService.class.getName());
404    
405                            ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
406                                    "_service");
407                            MethodCache.remove(PortletLocalService.class);
408                    }
409    
410                    return _service;
411            }
412    
413            public void setService(PortletLocalService service) {
414                    MethodCache.remove(PortletLocalService.class);
415    
416                    _service = service;
417    
418                    ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
419                            "_service");
420                    MethodCache.remove(PortletLocalService.class);
421            }
422    
423            private static PortletLocalService _service;
424    }