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