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