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            public static boolean hasPortlet(long companyId, java.lang.String portletId) {
044                    return getService().hasPortlet(companyId, portletId);
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
048                    return getService().getActionableDynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
052                    return getService().dynamicQuery();
053            }
054    
055            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
056                    return getService().getIndexableActionableDynamicQuery();
057            }
058    
059            /**
060            * @throws PortalException
061            */
062            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
063                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
064                    throws com.liferay.portal.kernel.exception.PortalException {
065                    return getService().deletePersistedModel(persistedModel);
066            }
067    
068            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
069                    java.io.Serializable primaryKeyObj)
070                    throws com.liferay.portal.kernel.exception.PortalException {
071                    return getService().getPersistedModel(primaryKeyObj);
072            }
073    
074            /**
075            * Adds the portlet to the database. Also notifies the appropriate model listeners.
076            *
077            * @param portlet the portlet
078            * @return the portlet that was added
079            */
080            public static com.liferay.portal.kernel.model.Portlet addPortlet(
081                    com.liferay.portal.kernel.model.Portlet portlet) {
082                    return getService().addPortlet(portlet);
083            }
084    
085            public static com.liferay.portal.kernel.model.Portlet clonePortlet(
086                    java.lang.String portletId) {
087                    return getService().clonePortlet(portletId);
088            }
089    
090            /**
091            * Creates a new portlet with the primary key. Does not add the portlet to the database.
092            *
093            * @param id the primary key for the new portlet
094            * @return the new portlet
095            */
096            public static com.liferay.portal.kernel.model.Portlet createPortlet(long id) {
097                    return getService().createPortlet(id);
098            }
099    
100            /**
101            * Deletes the portlet from the database. Also notifies the appropriate model listeners.
102            *
103            * @param portlet the portlet
104            * @return the portlet that was removed
105            */
106            public static com.liferay.portal.kernel.model.Portlet deletePortlet(
107                    com.liferay.portal.kernel.model.Portlet portlet) {
108                    return getService().deletePortlet(portlet);
109            }
110    
111            /**
112            * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
113            *
114            * @param id the primary key of the portlet
115            * @return the portlet that was removed
116            * @throws PortalException if a portlet with the primary key could not be found
117            */
118            public static com.liferay.portal.kernel.model.Portlet deletePortlet(long id)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    return getService().deletePortlet(id);
121            }
122    
123            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
124                    com.liferay.portal.kernel.model.Portlet portlet,
125                    java.lang.String categoryName)
126                    throws com.liferay.portal.kernel.exception.PortalException {
127                    return getService().deployRemotePortlet(portlet, categoryName);
128            }
129    
130            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
131                    com.liferay.portal.kernel.model.Portlet portlet,
132                    java.lang.String[] categoryNames)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    return getService().deployRemotePortlet(portlet, categoryNames);
135            }
136    
137            public static com.liferay.portal.kernel.model.Portlet deployRemotePortlet(
138                    com.liferay.portal.kernel.model.Portlet portlet,
139                    java.lang.String[] categoryNames, boolean eagerDestroy)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    return getService()
142                                       .deployRemotePortlet(portlet, categoryNames, eagerDestroy);
143            }
144    
145            public static com.liferay.portal.kernel.model.Portlet fetchPortlet(long id) {
146                    return getService().fetchPortlet(id);
147            }
148    
149            /**
150            * Returns the portlet with the primary key.
151            *
152            * @param id the primary key of the portlet
153            * @return the portlet
154            * @throws PortalException if a portlet with the primary key could not be found
155            */
156            public static com.liferay.portal.kernel.model.Portlet getPortlet(long id)
157                    throws com.liferay.portal.kernel.exception.PortalException {
158                    return getService().getPortlet(id);
159            }
160    
161            public static com.liferay.portal.kernel.model.Portlet getPortletById(
162                    java.lang.String portletId) {
163                    return getService().getPortletById(portletId);
164            }
165    
166            public static com.liferay.portal.kernel.model.Portlet getPortletById(
167                    long companyId, java.lang.String portletId) {
168                    return getService().getPortletById(companyId, portletId);
169            }
170    
171            public static com.liferay.portal.kernel.model.Portlet getPortletByStrutsPath(
172                    long companyId, java.lang.String strutsPath) {
173                    return getService().getPortletByStrutsPath(companyId, strutsPath);
174            }
175    
176            /**
177            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
178            *
179            * @param portlet the portlet
180            * @return the portlet that was updated
181            */
182            public static com.liferay.portal.kernel.model.Portlet updatePortlet(
183                    com.liferay.portal.kernel.model.Portlet portlet) {
184                    return getService().updatePortlet(portlet);
185            }
186    
187            public static com.liferay.portal.kernel.model.Portlet updatePortlet(
188                    long companyId, java.lang.String portletId, java.lang.String roles,
189                    boolean active) {
190                    return getService().updatePortlet(companyId, portletId, roles, active);
191            }
192    
193            public static com.liferay.portal.kernel.model.PortletApp getPortletApp(
194                    java.lang.String servletContextName) {
195                    return getService().getPortletApp(servletContextName);
196            }
197    
198            public static com.liferay.portal.kernel.model.PortletCategory getEARDisplay(
199                    java.lang.String xml) {
200                    return getService().getEARDisplay(xml);
201            }
202    
203            public static com.liferay.portal.kernel.model.PortletCategory getWARDisplay(
204                    java.lang.String servletContextName, java.lang.String xml) {
205                    return getService().getWARDisplay(servletContextName, xml);
206            }
207    
208            /**
209            * Returns the number of portlets.
210            *
211            * @return the number of portlets
212            */
213            public static int getPortletsCount() {
214                    return getService().getPortletsCount();
215            }
216    
217            /**
218            * Returns the OSGi service identifier.
219            *
220            * @return the OSGi service identifier
221            */
222            public static java.lang.String getOSGiServiceIdentifier() {
223                    return getService().getOSGiServiceIdentifier();
224            }
225    
226            /**
227            * Performs a dynamic query on the database and returns the matching rows.
228            *
229            * @param dynamicQuery the dynamic query
230            * @return the matching rows
231            */
232            public static <T> java.util.List<T> dynamicQuery(
233                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
234                    return getService().dynamicQuery(dynamicQuery);
235            }
236    
237            /**
238            * Performs a dynamic query on the database and returns a range of the matching rows.
239            *
240            * <p>
241            * 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.
242            * </p>
243            *
244            * @param dynamicQuery the dynamic query
245            * @param start the lower bound of the range of model instances
246            * @param end the upper bound of the range of model instances (not inclusive)
247            * @return the range of matching rows
248            */
249            public static <T> java.util.List<T> dynamicQuery(
250                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
251                    int end) {
252                    return getService().dynamicQuery(dynamicQuery, start, end);
253            }
254    
255            /**
256            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
257            *
258            * <p>
259            * 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.
260            * </p>
261            *
262            * @param dynamicQuery the dynamic query
263            * @param start the lower bound of the range of model instances
264            * @param end the upper bound of the range of model instances (not inclusive)
265            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
266            * @return the ordered range of matching rows
267            */
268            public static <T> java.util.List<T> dynamicQuery(
269                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
270                    int end,
271                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
272                    return getService()
273                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
274            }
275    
276            public static java.util.List<com.liferay.expando.kernel.model.CustomAttributesDisplay> getCustomAttributesDisplays() {
277                    return getService().getCustomAttributesDisplays();
278            }
279    
280            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getFriendlyURLMapperPortlets() {
281                    return getService().getFriendlyURLMapperPortlets();
282            }
283    
284            public static java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers() {
285                    return getService().getFriendlyURLMappers();
286            }
287    
288            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets() {
289                    return getService().getPortlets();
290            }
291    
292            /**
293            * Returns a range of all the portlets.
294            *
295            * <p>
296            * 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.
297            * </p>
298            *
299            * @param start the lower bound of the range of portlets
300            * @param end the upper bound of the range of portlets (not inclusive)
301            * @return the range of portlets
302            */
303            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
304                    int start, int end) {
305                    return getService().getPortlets(start, end);
306            }
307    
308            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
309                    long companyId) {
310                    return getService().getPortlets(companyId);
311            }
312    
313            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getPortlets(
314                    long companyId, boolean showSystem, boolean showPortal) {
315                    return getService().getPortlets(companyId, showSystem, showPortal);
316            }
317    
318            public static java.util.List<com.liferay.portal.kernel.model.Portlet> getScopablePortlets() {
319                    return getService().getScopablePortlets();
320            }
321    
322            public static java.util.List<com.liferay.portal.kernel.model.Portlet> initWAR(
323                    java.lang.String servletContextName,
324                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
325                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
326                    return getService()
327                                       .initWAR(servletContextName, servletContext, xmls,
328                            pluginPackage);
329            }
330    
331            public static java.util.Map<java.lang.String, com.liferay.portal.kernel.model.Portlet> loadGetPortletsMap(
332                    long companyId) {
333                    return getService().loadGetPortletsMap(companyId);
334            }
335    
336            /**
337            * @deprecated As of 7.0.0, replaced by {@link #loadGetPortletsMap(long))}
338            */
339            @Deprecated
340            public static java.util.Map<java.lang.String, com.liferay.portal.kernel.model.Portlet> loadGetPortletsPool(
341                    long companyId) {
342                    return getService().loadGetPortletsPool(companyId);
343            }
344    
345            /**
346            * Returns the number of rows matching the dynamic query.
347            *
348            * @param dynamicQuery the dynamic query
349            * @return the number of rows matching the dynamic query
350            */
351            public static long dynamicQueryCount(
352                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
353                    return getService().dynamicQueryCount(dynamicQuery);
354            }
355    
356            /**
357            * Returns the number of rows matching the dynamic query.
358            *
359            * @param dynamicQuery the dynamic query
360            * @param projection the projection to apply to the query
361            * @return the number of rows matching the dynamic query
362            */
363            public static long dynamicQueryCount(
364                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
365                    com.liferay.portal.kernel.dao.orm.Projection projection) {
366                    return getService().dynamicQueryCount(dynamicQuery, projection);
367            }
368    
369            public static void addPortletCategory(long companyId,
370                    java.lang.String categoryName) {
371                    getService().addPortletCategory(companyId, categoryName);
372            }
373    
374            public static void checkPortlet(
375                    com.liferay.portal.kernel.model.Portlet portlet)
376                    throws com.liferay.portal.kernel.exception.PortalException {
377                    getService().checkPortlet(portlet);
378            }
379    
380            public static void checkPortlets(long companyId)
381                    throws com.liferay.portal.kernel.exception.PortalException {
382                    getService().checkPortlets(companyId);
383            }
384    
385            public static void clearCache() {
386                    getService().clearCache();
387            }
388    
389            /**
390            * @deprecated As of 7.0.0, replaced by {@link #clearPortletsMap)}
391            */
392            @Deprecated
393            public static void clearCompanyPortletsPool() {
394                    getService().clearCompanyPortletsPool();
395            }
396    
397            public static void clearPortletsMap() {
398                    getService().clearPortletsMap();
399            }
400    
401            public static void deletePortlet(long companyId,
402                    java.lang.String portletId, long plid)
403                    throws com.liferay.portal.kernel.exception.PortalException {
404                    getService().deletePortlet(companyId, portletId, plid);
405            }
406    
407            public static void deletePortlets(long companyId,
408                    java.lang.String[] portletIds, long plid)
409                    throws com.liferay.portal.kernel.exception.PortalException {
410                    getService().deletePortlets(companyId, portletIds, plid);
411            }
412    
413            public static void destroyPortlet(
414                    com.liferay.portal.kernel.model.Portlet portlet) {
415                    getService().destroyPortlet(portlet);
416            }
417    
418            public static void destroyRemotePortlet(
419                    com.liferay.portal.kernel.model.Portlet portlet) {
420                    getService().destroyRemotePortlet(portlet);
421            }
422    
423            public static void initEAR(javax.servlet.ServletContext servletContext,
424                    java.lang.String[] xmls,
425                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
426                    getService().initEAR(servletContext, xmls, pluginPackage);
427            }
428    
429            public static void removeCompanyPortletsPool(long companyId) {
430                    getService().removeCompanyPortletsPool(companyId);
431            }
432    
433            public static PortletLocalService getService() {
434                    if (_service == null) {
435                            _service = (PortletLocalService)PortalBeanLocatorUtil.locate(PortletLocalService.class.getName());
436    
437                            ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
438                                    "_service");
439                    }
440    
441                    return _service;
442            }
443    
444            private static PortletLocalService _service;
445    }