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