001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for PortletPreferences. This utility wraps
024     * {@link com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl} 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 PortletPreferencesLocalService
032     * @see com.liferay.portal.service.base.PortletPreferencesLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class PortletPreferencesLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * @throws PortalException
057            */
058            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
059                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    return getService().deletePersistedModel(persistedModel);
062            }
063    
064            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
065                    java.io.Serializable primaryKeyObj)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService().getPersistedModel(primaryKeyObj);
068            }
069    
070            /**
071            * Adds the portlet preferences to the database. Also notifies the appropriate model listeners.
072            *
073            * @param portletPreferences the portlet preferences
074            * @return the portlet preferences that was added
075            */
076            public static com.liferay.portal.kernel.model.PortletPreferences addPortletPreferences(
077                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
078                    return getService().addPortletPreferences(portletPreferences);
079            }
080    
081            public static com.liferay.portal.kernel.model.PortletPreferences addPortletPreferences(
082                    long companyId, long ownerId, int ownerType, long plid,
083                    java.lang.String portletId,
084                    com.liferay.portal.kernel.model.Portlet portlet,
085                    java.lang.String defaultPreferences) {
086                    return getService()
087                                       .addPortletPreferences(companyId, ownerId, ownerType, plid,
088                            portletId, portlet, defaultPreferences);
089            }
090    
091            /**
092            * Creates a new portlet preferences with the primary key. Does not add the portlet preferences to the database.
093            *
094            * @param portletPreferencesId the primary key for the new portlet preferences
095            * @return the new portlet preferences
096            */
097            public static com.liferay.portal.kernel.model.PortletPreferences createPortletPreferences(
098                    long portletPreferencesId) {
099                    return getService().createPortletPreferences(portletPreferencesId);
100            }
101    
102            /**
103            * Deletes the portlet preferences from the database. Also notifies the appropriate model listeners.
104            *
105            * @param portletPreferences the portlet preferences
106            * @return the portlet preferences that was removed
107            */
108            public static com.liferay.portal.kernel.model.PortletPreferences deletePortletPreferences(
109                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
110                    return getService().deletePortletPreferences(portletPreferences);
111            }
112    
113            /**
114            * Deletes the portlet preferences with the primary key from the database. Also notifies the appropriate model listeners.
115            *
116            * @param portletPreferencesId the primary key of the portlet preferences
117            * @return the portlet preferences that was removed
118            * @throws PortalException if a portlet preferences with the primary key could not be found
119            */
120            public static com.liferay.portal.kernel.model.PortletPreferences deletePortletPreferences(
121                    long portletPreferencesId)
122                    throws com.liferay.portal.kernel.exception.PortalException {
123                    return getService().deletePortletPreferences(portletPreferencesId);
124            }
125    
126            public static com.liferay.portal.kernel.model.PortletPreferences fetchPortletPreferences(
127                    long portletPreferencesId) {
128                    return getService().fetchPortletPreferences(portletPreferencesId);
129            }
130    
131            public static com.liferay.portal.kernel.model.PortletPreferences getPortletPreferences(
132                    long ownerId, int ownerType, long plid, java.lang.String portletId)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    return getService()
135                                       .getPortletPreferences(ownerId, ownerType, plid, portletId);
136            }
137    
138            /**
139            * Returns the portlet preferences with the primary key.
140            *
141            * @param portletPreferencesId the primary key of the portlet preferences
142            * @return the portlet preferences
143            * @throws PortalException if a portlet preferences with the primary key could not be found
144            */
145            public static com.liferay.portal.kernel.model.PortletPreferences getPortletPreferences(
146                    long portletPreferencesId)
147                    throws com.liferay.portal.kernel.exception.PortalException {
148                    return getService().getPortletPreferences(portletPreferencesId);
149            }
150    
151            /**
152            * Updates the portlet preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
153            *
154            * @param portletPreferences the portlet preferences
155            * @return the portlet preferences that was updated
156            */
157            public static com.liferay.portal.kernel.model.PortletPreferences updatePortletPreferences(
158                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
159                    return getService().updatePortletPreferences(portletPreferences);
160            }
161    
162            public static com.liferay.portal.kernel.model.PortletPreferences updatePreferences(
163                    long ownerId, int ownerType, long plid, java.lang.String portletId,
164                    java.lang.String xml) {
165                    return getService()
166                                       .updatePreferences(ownerId, ownerType, plid, portletId, xml);
167            }
168    
169            public static com.liferay.portal.kernel.model.PortletPreferences updatePreferences(
170                    long ownerId, int ownerType, long plid, java.lang.String portletId,
171                    javax.portlet.PortletPreferences portletPreferences) {
172                    return getService()
173                                       .updatePreferences(ownerId, ownerType, plid, portletId,
174                            portletPreferences);
175            }
176    
177            /**
178            * Returns the number of portlet preferenceses.
179            *
180            * @return the number of portlet preferenceses
181            */
182            public static int getPortletPreferencesesCount() {
183                    return getService().getPortletPreferencesesCount();
184            }
185    
186            /**
187            * Returns the OSGi service identifier.
188            *
189            * @return the OSGi service identifier
190            */
191            public static java.lang.String getOSGiServiceIdentifier() {
192                    return getService().getOSGiServiceIdentifier();
193            }
194    
195            /**
196            * Performs a dynamic query on the database and returns the matching rows.
197            *
198            * @param dynamicQuery the dynamic query
199            * @return the matching rows
200            */
201            public static <T> java.util.List<T> dynamicQuery(
202                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
203                    return getService().dynamicQuery(dynamicQuery);
204            }
205    
206            /**
207            * Performs a dynamic query on the database and returns a range of the matching rows.
208            *
209            * <p>
210            * 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.PortletPreferencesModelImpl}. 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.
211            * </p>
212            *
213            * @param dynamicQuery the dynamic query
214            * @param start the lower bound of the range of model instances
215            * @param end the upper bound of the range of model instances (not inclusive)
216            * @return the range of matching rows
217            */
218            public static <T> java.util.List<T> dynamicQuery(
219                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
220                    int end) {
221                    return getService().dynamicQuery(dynamicQuery, start, end);
222            }
223    
224            /**
225            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
226            *
227            * <p>
228            * 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.PortletPreferencesModelImpl}. 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.
229            * </p>
230            *
231            * @param dynamicQuery the dynamic query
232            * @param start the lower bound of the range of model instances
233            * @param end the upper bound of the range of model instances (not inclusive)
234            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
235            * @return the ordered range of matching rows
236            */
237            public static <T> java.util.List<T> dynamicQuery(
238                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
239                    int end,
240                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
241                    return getService()
242                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
243            }
244    
245            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences() {
246                    return getService().getPortletPreferences();
247            }
248    
249            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
250                    int ownerType, long plid, java.lang.String portletId) {
251                    return getService().getPortletPreferences(ownerType, plid, portletId);
252            }
253    
254            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
255                    long companyId, long groupId, long ownerId, int ownerType,
256                    java.lang.String portletId, boolean privateLayout) {
257                    return getService()
258                                       .getPortletPreferences(companyId, groupId, ownerId,
259                            ownerType, portletId, privateLayout);
260            }
261    
262            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
263                    long ownerId, int ownerType, long plid) {
264                    return getService().getPortletPreferences(ownerId, ownerType, plid);
265            }
266    
267            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
268                    long plid, java.lang.String portletId) {
269                    return getService().getPortletPreferences(plid, portletId);
270            }
271    
272            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferencesByPlid(
273                    long plid) {
274                    return getService().getPortletPreferencesByPlid(plid);
275            }
276    
277            /**
278            * Returns a range of all the portlet preferenceses.
279            *
280            * <p>
281            * 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.PortletPreferencesModelImpl}. 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.
282            * </p>
283            *
284            * @param start the lower bound of the range of portlet preferenceses
285            * @param end the upper bound of the range of portlet preferenceses (not inclusive)
286            * @return the range of portlet preferenceses
287            */
288            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferenceses(
289                    int start, int end) {
290                    return getService().getPortletPreferenceses(start, end);
291            }
292    
293            public static javax.portlet.PortletPreferences fetchPreferences(
294                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
295                    return getService().fetchPreferences(portletPreferencesIds);
296            }
297    
298            public static javax.portlet.PortletPreferences fetchPreferences(
299                    long companyId, long ownerId, int ownerType, long plid,
300                    java.lang.String portletId) {
301                    return getService()
302                                       .fetchPreferences(companyId, ownerId, ownerType, plid,
303                            portletId);
304            }
305    
306            public static javax.portlet.PortletPreferences getDefaultPreferences(
307                    long companyId, java.lang.String portletId) {
308                    return getService().getDefaultPreferences(companyId, portletId);
309            }
310    
311            public static javax.portlet.PortletPreferences getPreferences(
312                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
313                    return getService().getPreferences(portletPreferencesIds);
314            }
315    
316            public static javax.portlet.PortletPreferences getPreferences(
317                    long companyId, long ownerId, int ownerType, long plid,
318                    java.lang.String portletId) {
319                    return getService()
320                                       .getPreferences(companyId, ownerId, ownerType, plid,
321                            portletId);
322            }
323    
324            public static javax.portlet.PortletPreferences getPreferences(
325                    long companyId, long ownerId, int ownerType, long plid,
326                    java.lang.String portletId, java.lang.String defaultPreferences) {
327                    return getService()
328                                       .getPreferences(companyId, ownerId, ownerType, plid,
329                            portletId, defaultPreferences);
330            }
331    
332            public static javax.portlet.PortletPreferences getStrictPreferences(
333                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
334                    return getService().getStrictPreferences(portletPreferencesIds);
335            }
336    
337            public static javax.portlet.PortletPreferences getStrictPreferences(
338                    long companyId, long ownerId, int ownerType, long plid,
339                    java.lang.String portletId) {
340                    return getService()
341                                       .getStrictPreferences(companyId, ownerId, ownerType, plid,
342                            portletId);
343            }
344    
345            /**
346            * Returns the number of rows matching the dynamic query.
347            *
348            * @param dynamicQuery the dynamic query
349            * @return the number of rows matching the dynamic query
350            */
351            public static long dynamicQueryCount(
352                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
353                    return getService().dynamicQueryCount(dynamicQuery);
354            }
355    
356            /**
357            * Returns the number of rows matching the dynamic query.
358            *
359            * @param dynamicQuery the dynamic query
360            * @param projection the projection to apply to the query
361            * @return the number of rows matching the dynamic query
362            */
363            public static long dynamicQueryCount(
364                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
365                    com.liferay.portal.kernel.dao.orm.Projection projection) {
366                    return getService().dynamicQueryCount(dynamicQuery, projection);
367            }
368    
369            public static long getPortletPreferencesCount(int ownerType,
370                    java.lang.String portletId) {
371                    return getService().getPortletPreferencesCount(ownerType, portletId);
372            }
373    
374            public static long getPortletPreferencesCount(int ownerType, long plid,
375                    java.lang.String portletId) {
376                    return getService()
377                                       .getPortletPreferencesCount(ownerType, plid, portletId);
378            }
379    
380            public static long getPortletPreferencesCount(long ownerId, int ownerType,
381                    java.lang.String portletId, boolean excludeDefaultPreferences) {
382                    return getService()
383                                       .getPortletPreferencesCount(ownerId, ownerType, portletId,
384                            excludeDefaultPreferences);
385            }
386    
387            public static long getPortletPreferencesCount(long ownerId, int ownerType,
388                    long plid, com.liferay.portal.kernel.model.Portlet portlet,
389                    boolean excludeDefaultPreferences) {
390                    return getService()
391                                       .getPortletPreferencesCount(ownerId, ownerType, plid,
392                            portlet, excludeDefaultPreferences);
393            }
394    
395            public static void deletePortletPreferences(long ownerId, int ownerType,
396                    long plid) {
397                    getService().deletePortletPreferences(ownerId, ownerType, plid);
398            }
399    
400            public static void deletePortletPreferences(long ownerId, int ownerType,
401                    long plid, java.lang.String portletId)
402                    throws com.liferay.portal.kernel.exception.PortalException {
403                    getService()
404                            .deletePortletPreferences(ownerId, ownerType, plid, portletId);
405            }
406    
407            public static void deletePortletPreferencesByPlid(long plid) {
408                    getService().deletePortletPreferencesByPlid(plid);
409            }
410    
411            public static PortletPreferencesLocalService getService() {
412                    if (_service == null) {
413                            _service = (PortletPreferencesLocalService)PortalBeanLocatorUtil.locate(PortletPreferencesLocalService.class.getName());
414    
415                            ReferenceRegistry.registerReference(PortletPreferencesLocalServiceUtil.class,
416                                    "_service");
417                    }
418    
419                    return _service;
420            }
421    
422            private static PortletPreferencesLocalService _service;
423    }