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            public static java.util.List<com.liferay.portlet.expando.model.CustomAttributesDisplay> getCustomAttributesDisplays() {
271                    return getService().getCustomAttributesDisplays();
272            }
273    
274            public static com.liferay.portal.model.PortletCategory getEARDisplay(
275                    java.lang.String xml) {
276                    return getService().getEARDisplay(xml);
277            }
278    
279            public static java.util.List<com.liferay.portal.model.Portlet> getFriendlyURLMapperPortlets() {
280                    return getService().getFriendlyURLMapperPortlets();
281            }
282    
283            public static java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers() {
284                    return getService().getFriendlyURLMappers();
285            }
286    
287            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
288                    return getService().getIndexableActionableDynamicQuery();
289            }
290    
291            /**
292            * Returns the OSGi service identifier.
293            *
294            * @return the OSGi service identifier
295            */
296            public static java.lang.String getOSGiServiceIdentifier() {
297                    return getService().getOSGiServiceIdentifier();
298            }
299    
300            public static com.liferay.portal.model.PersistedModel getPersistedModel(
301                    java.io.Serializable primaryKeyObj)
302                    throws com.liferay.portal.kernel.exception.PortalException {
303                    return getService().getPersistedModel(primaryKeyObj);
304            }
305    
306            /**
307            * Returns the portlet with the primary key.
308            *
309            * @param id the primary key of the portlet
310            * @return the portlet
311            * @throws PortalException if a portlet with the primary key could not be found
312            */
313            public static com.liferay.portal.model.Portlet getPortlet(long id)
314                    throws com.liferay.portal.kernel.exception.PortalException {
315                    return getService().getPortlet(id);
316            }
317    
318            public static com.liferay.portal.model.PortletApp getPortletApp(
319                    java.lang.String servletContextName) {
320                    return getService().getPortletApp(servletContextName);
321            }
322    
323            public static com.liferay.portal.model.Portlet getPortletById(
324                    long companyId, java.lang.String portletId) {
325                    return getService().getPortletById(companyId, portletId);
326            }
327    
328            public static com.liferay.portal.model.Portlet getPortletById(
329                    java.lang.String portletId) {
330                    return getService().getPortletById(portletId);
331            }
332    
333            public static com.liferay.portal.model.Portlet getPortletByStrutsPath(
334                    long companyId, java.lang.String strutsPath) {
335                    return getService().getPortletByStrutsPath(companyId, strutsPath);
336            }
337    
338            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets() {
339                    return getService().getPortlets();
340            }
341    
342            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
343                    long companyId) {
344                    return getService().getPortlets(companyId);
345            }
346    
347            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
348                    long companyId, boolean showSystem, boolean showPortal) {
349                    return getService().getPortlets(companyId, showSystem, showPortal);
350            }
351    
352            /**
353            * Returns a range of all the portlets.
354            *
355            * <p>
356            * 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.
357            * </p>
358            *
359            * @param start the lower bound of the range of portlets
360            * @param end the upper bound of the range of portlets (not inclusive)
361            * @return the range of portlets
362            */
363            public static java.util.List<com.liferay.portal.model.Portlet> getPortlets(
364                    int start, int end) {
365                    return getService().getPortlets(start, end);
366            }
367    
368            /**
369            * Returns the number of portlets.
370            *
371            * @return the number of portlets
372            */
373            public static int getPortletsCount() {
374                    return getService().getPortletsCount();
375            }
376    
377            public static java.util.List<com.liferay.portal.model.Portlet> getScopablePortlets() {
378                    return getService().getScopablePortlets();
379            }
380    
381            public static com.liferay.portal.model.PortletCategory getWARDisplay(
382                    java.lang.String servletContextName, java.lang.String xml) {
383                    return getService().getWARDisplay(servletContextName, xml);
384            }
385    
386            public static boolean hasPortlet(long companyId, java.lang.String portletId) {
387                    return getService().hasPortlet(companyId, portletId);
388            }
389    
390            public static void initEAR(javax.servlet.ServletContext servletContext,
391                    java.lang.String[] xmls,
392                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
393                    getService().initEAR(servletContext, xmls, pluginPackage);
394            }
395    
396            public static java.util.List<com.liferay.portal.model.Portlet> initWAR(
397                    java.lang.String servletContextName,
398                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
399                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage) {
400                    return getService()
401                                       .initWAR(servletContextName, servletContext, xmls,
402                            pluginPackage);
403            }
404    
405            public static java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsMap(
406                    long companyId) {
407                    return getService().loadGetPortletsMap(companyId);
408            }
409    
410            /**
411            * @deprecated As of 7.0.0, replaced by {@link #loadGetPortletsMap(long))}
412            */
413            @Deprecated
414            public static java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsPool(
415                    long companyId) {
416                    return getService().loadGetPortletsPool(companyId);
417            }
418    
419            public static void removeCompanyPortletsPool(long companyId) {
420                    getService().removeCompanyPortletsPool(companyId);
421            }
422    
423            public static com.liferay.portal.model.Portlet updatePortlet(
424                    long companyId, java.lang.String portletId, java.lang.String roles,
425                    boolean active) {
426                    return getService().updatePortlet(companyId, portletId, roles, active);
427            }
428    
429            /**
430            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
431            *
432            * @param portlet the portlet
433            * @return the portlet that was updated
434            */
435            public static com.liferay.portal.model.Portlet updatePortlet(
436                    com.liferay.portal.model.Portlet portlet) {
437                    return getService().updatePortlet(portlet);
438            }
439    
440            public static PortletLocalService getService() {
441                    if (_service == null) {
442                            _service = (PortletLocalService)PortalBeanLocatorUtil.locate(PortletLocalService.class.getName());
443    
444                            ReferenceRegistry.registerReference(PortletLocalServiceUtil.class,
445                                    "_service");
446                    }
447    
448                    return _service;
449            }
450    
451            private static PortletLocalService _service;
452    }