001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for Portlet. This utility wraps
024     * {@link com.liferay.portal.service.impl.PortletLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see PortletLocalService
032     * @see com.liferay.portal.service.base.PortletLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PortletLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class PortletLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortletLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the portlet to the database. Also notifies the appropriate model listeners.
046            *
047            * @param portlet the portlet
048            * @return the portlet that was added
049            */
050            public static com.liferay.portal.kernel.model.Portlet addPortlet(
051                    com.liferay.portal.kernel.model.Portlet portlet) {
052                    return getService().addPortlet(portlet);
053            }
054    
055            public static void addPortletCategory(long companyId,
056                    java.lang.String categoryName) {
057                    getService().addPortletCategory(companyId, categoryName);
058            }
059    
060            public static void checkPortlet(
061                    com.liferay.portal.kernel.model.Portlet portlet)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    getService().checkPortlet(portlet);
064            }
065    
066            public static void checkPortlets(long companyId)
067                    throws com.liferay.portal.kernel.exception.PortalException {
068                    getService().checkPortlets(companyId);
069            }
070    
071            public static void clearCache() {
072                    getService().clearCache();
073            }
074    
075            /**
076            * @deprecated As of 7.0.0, replaced by {@link #clearPortletsMap)}
077            */
078            @Deprecated
079            public static void clearCompanyPortletsPool() {
080                    getService().clearCompanyPortletsPool();
081            }
082    
083            public static void clearPortletsMap() {
084                    getService().clearPortletsMap();
085            }
086    
087            public static com.liferay.portal.kernel.model.Portlet clonePortlet(
088                    java.lang.String portletId) {
089                    return getService().clonePortlet(portletId);
090            }
091    
092            /**
093            * Creates a new portlet with the primary key. Does not add the portlet to the database.
094            *
095            * @param id the primary key for the new portlet
096            * @return the new portlet
097            */
098            public static com.liferay.portal.kernel.model.Portlet createPortlet(long id) {
099                    return getService().createPortlet(id);
100            }
101    
102            /**
103            * @throws PortalException
104            */
105            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
106                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
107                    throws com.liferay.portal.kernel.exception.PortalException {
108                    return getService().deletePersistedModel(persistedModel);
109            }
110    
111            public static void deletePortlet(long companyId,
112                    java.lang.String portletId, long plid)
113                    throws com.liferay.portal.kernel.exception.PortalException {
114                    getService().deletePortlet(companyId, portletId, plid);
115            }
116    
117            /**
118            * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
119            *
120            * @param id the primary key of the portlet
121            * @return the portlet that was removed
122            * @throws PortalException if a portlet with the primary key could not be found
123            */
124            public static com.liferay.portal.kernel.model.Portlet deletePortlet(long id)
125                    throws com.liferay.portal.kernel.exception.PortalException {
126                    return getService().deletePortlet(id);
127            }
128    
129            /**
130            * Deletes the portlet from the database. Also notifies the appropriate model listeners.
131            *
132            * @param portlet the portlet
133            * @return the portlet that was removed
134            */
135            public static com.liferay.portal.kernel.model.Portlet deletePortlet(
136                    com.liferay.portal.kernel.model.Portlet portlet) {
137                    return getService().deletePortlet(portlet);
138            }
139    
140            public static void deletePortlets(long companyId,
141                    java.lang.String[] portletIds, long plid)
142                    throws com.liferay.portal.kernel.exception.PortalException {
143                    getService().deletePortlets(companyId, portletIds, plid);
144            }
145    
146            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
147                    com.liferay.portal.kernel.model.Portlet portlet,
148                    java.lang.String categoryName)
149                    throws com.liferay.portal.kernel.exception.PortalException {
150                    return getService().deployRemotePortlet(portlet, categoryName);
151            }
152    
153            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
154                    com.liferay.portal.kernel.model.Portlet portlet,
155                    java.lang.String[] categoryNames)
156                    throws com.liferay.portal.kernel.exception.PortalException {
157                    return getService().deployRemotePortlet(portlet, categoryNames);
158            }
159    
160            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
161                    com.liferay.portal.kernel.model.Portlet portlet,
162                    java.lang.String[] categoryNames, boolean eagerDestroy)
163                    throws com.liferay.portal.kernel.exception.PortalException {
164                    return getService()
165                                       .deployRemotePortlet(portlet, categoryNames, eagerDestroy);
166            }
167    
168            public static void destroyPortlet(
169                    com.liferay.portal.kernel.model.Portlet portlet) {
170                    getService().destroyPortlet(portlet);
171            }
172    
173            public static void destroyRemotePortlet(
174                    com.liferay.portal.kernel.model.Portlet portlet) {
175                    getService().destroyRemotePortlet(portlet);
176            }
177    
178            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
179                    return getService().dynamicQuery();
180            }
181    
182            /**
183            * Performs a dynamic query on the database and returns the matching rows.
184            *
185            * @param dynamicQuery the dynamic query
186            * @return the matching rows
187            */
188            public static <T> java.util.List<T> dynamicQuery(
189                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
190                    return getService().dynamicQuery(dynamicQuery);
191            }
192    
193            /**
194            * Performs a dynamic query on the database and returns a range of the matching rows.
195            *
196            * <p>
197            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
198            * </p>
199            *
200            * @param dynamicQuery the dynamic query
201            * @param start the lower bound of the range of model instances
202            * @param end the upper bound of the range of model instances (not inclusive)
203            * @return the range of matching rows
204            */
205            public static <T> java.util.List<T> dynamicQuery(
206                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
207                    int end) {
208                    return getService().dynamicQuery(dynamicQuery, start, end);
209            }
210    
211            /**
212            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
213            *
214            * <p>
215            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
216            * </p>
217            *
218            * @param dynamicQuery the dynamic query
219            * @param start the lower bound of the range of model instances
220            * @param end the upper bound of the range of model instances (not inclusive)
221            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
222            * @return the ordered range of matching rows
223            */
224            public static <T> java.util.List<T> dynamicQuery(
225                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
226                    int end,
227                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
228                    return getService()
229                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
230            }
231    
232            /**
233            * Returns the number of rows matching the dynamic query.
234            *
235            * @param dynamicQuery the dynamic query
236            * @return the number of rows matching the dynamic query
237            */
238            public static long dynamicQueryCount(
239                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
240                    return getService().dynamicQueryCount(dynamicQuery);
241            }
242    
243            /**
244            * Returns the number of rows matching the dynamic query.
245            *
246            * @param dynamicQuery the dynamic query
247            * @param projection the projection to apply to the query
248            * @return the number of rows matching the dynamic query
249            */
250            public static long dynamicQueryCount(
251                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
252                    com.liferay.portal.kernel.dao.orm.Projection projection) {
253                    return getService().dynamicQueryCount(dynamicQuery, projection);
254            }
255    
256            public static com.liferay.portal.kernel.model.Portlet fetchPortlet(long id) {
257                    return getService().fetchPortlet(id);
258            }
259    
260            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
261                    return getService().getActionableDynamicQuery();
262            }
263    
264            public static java.util.List<com.liferay.expando.kernel.model.CustomAttributesDisplay> getCustomAttributesDisplays() {
265                    return getService().getCustomAttributesDisplays();
266            }
267    
268            public static com.liferay.portal.kernel.model.PortletCategory getEARDisplay(
269                    java.lang.String xml) {
270                    return getService().getEARDisplay(xml);
271            }
272    
273            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getFriendlyURLMapperPortlets() {
274                    return getService().getFriendlyURLMapperPortlets();
275            }
276    
277            public static java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers() {
278                    return getService().getFriendlyURLMappers();
279            }
280    
281            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
282                    return getService().getIndexableActionableDynamicQuery();
283            }
284    
285            /**
286            * Returns the OSGi service identifier.
287            *
288            * @return the OSGi service identifier
289            */
290            public static java.lang.String getOSGiServiceIdentifier() {
291                    return getService().getOSGiServiceIdentifier();
292            }
293    
294            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
295                    java.io.Serializable primaryKeyObj)
296                    throws com.liferay.portal.kernel.exception.PortalException {
297                    return getService().getPersistedModel(primaryKeyObj);
298            }
299    
300            /**
301            * Returns the portlet with the primary key.
302            *
303            * @param id the primary key of the portlet
304            * @return the portlet
305            * @throws PortalException if a portlet with the primary key could not be found
306            */
307            public static com.liferay.portal.kernel.model.Portlet getPortlet(long id)
308                    throws com.liferay.portal.kernel.exception.PortalException {
309                    return getService().getPortlet(id);
310            }
311    
312            public static com.liferay.portal.kernel.model.PortletApp getPortletApp(
313                    java.lang.String servletContextName) {
314                    return getService().getPortletApp(servletContextName);
315            }
316    
317            public static com.liferay.portal.kernel.model.Portlet getPortletById(
318                    long companyId, java.lang.String portletId) {
319                    return getService().getPortletById(companyId, portletId);
320            }
321    
322            public static com.liferay.portal.kernel.model.Portlet getPortletById(
323                    java.lang.String portletId) {
324                    return getService().getPortletById(portletId);
325            }
326    
327            public static com.liferay.portal.kernel.model.Portlet getPortletByStrutsPath(
328                    long companyId, java.lang.String strutsPath) {
329                    return getService().getPortletByStrutsPath(companyId, strutsPath);
330            }
331    
332            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets() {
333                    return getService().getPortlets();
334            }
335    
336            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
337                    long companyId) {
338                    return getService().getPortlets(companyId);
339            }
340    
341            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
342                    long companyId, boolean showSystem, boolean showPortal) {
343                    return getService().getPortlets(companyId, showSystem, showPortal);
344            }
345    
346            /**
347            * Returns a range of all the portlets.
348            *
349            * <p>
350            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
351            * </p>
352            *
353            * @param start the lower bound of the range of portlets
354            * @param end the upper bound of the range of portlets (not inclusive)
355            * @return the range of portlets
356            */
357            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
358                    int start, int end) {
359                    return getService().getPortlets(start, end);
360            }
361    
362            /**
363            * Returns the number of portlets.
364            *
365            * @return the number of portlets
366            */
367            public static int getPortletsCount() {
368                    return getService().getPortletsCount();
369            }
370    
371            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getScopablePortlets() {
372                    return getService().getScopablePortlets();
373            }
374    
375            public static com.liferay.portal.kernel.model.PortletCategory getWARDisplay(
376                    java.lang.String servletContextName, java.lang.String xml) {
377                    return getService().getWARDisplay(servletContextName, xml);
378            }
379    
380            public static boolean hasPortlet(long companyId, java.lang.String portletId) {
381                    return getService().hasPortlet(companyId, portletId);
382            }
383    
384            public static void initEAR(javax.servlet.ServletContext servletContext,
385                    java.lang.String[] xmls,
386                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
387                    getService().initEAR(servletContext, xmls, pluginPackage);
388            }
389    
390            public static java.util.List<com.liferay.portal.kernel.model.Portlet> initWAR(
391                    java.lang.String servletContextName,
392                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
393                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
394                    return getService()
395                                       .initWAR(servletContextName, servletContext, xmls,
396                            pluginPackage);
397            }
398    
399            public static java.util.Map<java.lang.String, com.liferay.portal.kernel.model.Portlet> loadGetPortletsMap(
400                    long companyId) {
401                    return getService().loadGetPortletsMap(companyId);
402            }
403    
404            /**
405            * @deprecated As of 7.0.0, replaced by {@link #loadGetPortletsMap(long))}
406            */
407            @Deprecated
408            public static java.util.Map<java.lang.String, com.liferay.portal.kernel.model.Portlet> loadGetPortletsPool(
409                    long companyId) {
410                    return getService().loadGetPortletsPool(companyId);
411            }
412    
413            public static void removeCompanyPortletsPool(long companyId) {
414                    getService().removeCompanyPortletsPool(companyId);
415            }
416    
417            public static com.liferay.portal.kernel.model.Portlet updatePortlet(
418                    long companyId, java.lang.String portletId, java.lang.String roles,
419                    boolean active) {
420                    return getService().updatePortlet(companyId, portletId, roles, active);
421            }
422    
423            /**
424            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
425            *
426            * @param portlet the portlet
427            * @return the portlet that was updated
428            */
429            public static com.liferay.portal.kernel.model.Portlet updatePortlet(
430                    com.liferay.portal.kernel.model.Portlet portlet) {
431                    return getService().updatePortlet(portlet);
432            }
433    
434            public static PortletLocalService getService() {
435                    if (_service == null) {
436                            _service = (PortletLocalService)PortalBeanLocatorUtil.locate(PortletLocalService.class.getName());
437    
438                            ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
439                                    "_service");
440                    }
441    
442                    return _service;
443            }
444    
445            private static PortletLocalService _service;
446    }