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.model.PortletPreferences addPortletPreferences(
044                    long companyId, long ownerId, int ownerType, long plid,
045                    java.lang.String portletId,
046                    com.liferay.portal.kernel.model.Portlet portlet,
047                    java.lang.String defaultPreferences) {
048                    return getService()
049                                       .addPortletPreferences(companyId, ownerId, ownerType, plid,
050                            portletId, portlet, defaultPreferences);
051            }
052    
053            /**
054            * Adds the portlet preferences to the database. Also notifies the appropriate model listeners.
055            *
056            * @param portletPreferences the portlet preferences
057            * @return the portlet preferences that was added
058            */
059            public static com.liferay.portal.kernel.model.PortletPreferences addPortletPreferences(
060                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
061                    return getService().addPortletPreferences(portletPreferences);
062            }
063    
064            /**
065            * Creates a new portlet preferences with the primary key. Does not add the portlet preferences to the database.
066            *
067            * @param portletPreferencesId the primary key for the new portlet preferences
068            * @return the new portlet preferences
069            */
070            public static com.liferay.portal.kernel.model.PortletPreferences createPortletPreferences(
071                    long portletPreferencesId) {
072                    return getService().createPortletPreferences(portletPreferencesId);
073            }
074    
075            /**
076            * @throws PortalException
077            */
078            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
079                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
080                    throws com.liferay.portal.kernel.exception.PortalException {
081                    return getService().deletePersistedModel(persistedModel);
082            }
083    
084            public static void deletePortletPreferences(long ownerId, int ownerType,
085                    long plid) {
086                    getService().deletePortletPreferences(ownerId, ownerType, plid);
087            }
088    
089            public static void deletePortletPreferences(long ownerId, int ownerType,
090                    long plid, java.lang.String portletId)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    getService()
093                            .deletePortletPreferences(ownerId, ownerType, plid, portletId);
094            }
095    
096            /**
097            * Deletes the portlet preferences from the database. Also notifies the appropriate model listeners.
098            *
099            * @param portletPreferences the portlet preferences
100            * @return the portlet preferences that was removed
101            */
102            public static com.liferay.portal.kernel.model.PortletPreferences deletePortletPreferences(
103                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
104                    return getService().deletePortletPreferences(portletPreferences);
105            }
106    
107            /**
108            * Deletes the portlet preferences with the primary key from the database. Also notifies the appropriate model listeners.
109            *
110            * @param portletPreferencesId the primary key of the portlet preferences
111            * @return the portlet preferences that was removed
112            * @throws PortalException if a portlet preferences with the primary key could not be found
113            */
114            public static com.liferay.portal.kernel.model.PortletPreferences deletePortletPreferences(
115                    long portletPreferencesId)
116                    throws com.liferay.portal.kernel.exception.PortalException {
117                    return getService().deletePortletPreferences(portletPreferencesId);
118            }
119    
120            public static void deletePortletPreferencesByPlid(long plid) {
121                    getService().deletePortletPreferencesByPlid(plid);
122            }
123    
124            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
125                    return getService().dynamicQuery();
126            }
127    
128            /**
129            * Performs a dynamic query on the database and returns the matching rows.
130            *
131            * @param dynamicQuery the dynamic query
132            * @return the matching rows
133            */
134            public static <T> java.util.List<T> dynamicQuery(
135                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
136                    return getService().dynamicQuery(dynamicQuery);
137            }
138    
139            /**
140            * Performs a dynamic query on the database and returns a range of the matching rows.
141            *
142            * <p>
143            * 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.
144            * </p>
145            *
146            * @param dynamicQuery the dynamic query
147            * @param start the lower bound of the range of model instances
148            * @param end the upper bound of the range of model instances (not inclusive)
149            * @return the range of matching rows
150            */
151            public static <T> java.util.List<T> dynamicQuery(
152                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
153                    int end) {
154                    return getService().dynamicQuery(dynamicQuery, start, end);
155            }
156    
157            /**
158            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
159            *
160            * <p>
161            * 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.
162            * </p>
163            *
164            * @param dynamicQuery the dynamic query
165            * @param start the lower bound of the range of model instances
166            * @param end the upper bound of the range of model instances (not inclusive)
167            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
168            * @return the ordered range of matching rows
169            */
170            public static <T> java.util.List<T> dynamicQuery(
171                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
172                    int end,
173                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
174                    return getService()
175                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
176            }
177    
178            /**
179            * Returns the number of rows matching the dynamic query.
180            *
181            * @param dynamicQuery the dynamic query
182            * @return the number of rows matching the dynamic query
183            */
184            public static long dynamicQueryCount(
185                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
186                    return getService().dynamicQueryCount(dynamicQuery);
187            }
188    
189            /**
190            * Returns the number of rows matching the dynamic query.
191            *
192            * @param dynamicQuery the dynamic query
193            * @param projection the projection to apply to the query
194            * @return the number of rows matching the dynamic query
195            */
196            public static long dynamicQueryCount(
197                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
198                    com.liferay.portal.kernel.dao.orm.Projection projection) {
199                    return getService().dynamicQueryCount(dynamicQuery, projection);
200            }
201    
202            public static com.liferay.portal.kernel.model.PortletPreferences fetchPortletPreferences(
203                    long portletPreferencesId) {
204                    return getService().fetchPortletPreferences(portletPreferencesId);
205            }
206    
207            public static javax.portlet.PortletPreferences fetchPreferences(
208                    long companyId, long ownerId, int ownerType, long plid,
209                    java.lang.String portletId) {
210                    return getService()
211                                       .fetchPreferences(companyId, ownerId, ownerType, plid,
212                            portletId);
213            }
214    
215            public static javax.portlet.PortletPreferences fetchPreferences(
216                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
217                    return getService().fetchPreferences(portletPreferencesIds);
218            }
219    
220            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
221                    return getService().getActionableDynamicQuery();
222            }
223    
224            public static javax.portlet.PortletPreferences getDefaultPreferences(
225                    long companyId, java.lang.String portletId) {
226                    return getService().getDefaultPreferences(companyId, portletId);
227            }
228    
229            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
230                    return getService().getIndexableActionableDynamicQuery();
231            }
232    
233            /**
234            * Returns the OSGi service identifier.
235            *
236            * @return the OSGi service identifier
237            */
238            public static java.lang.String getOSGiServiceIdentifier() {
239                    return getService().getOSGiServiceIdentifier();
240            }
241    
242            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
243                    java.io.Serializable primaryKeyObj)
244                    throws com.liferay.portal.kernel.exception.PortalException {
245                    return getService().getPersistedModel(primaryKeyObj);
246            }
247    
248            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences() {
249                    return getService().getPortletPreferences();
250            }
251    
252            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
253                    long companyId, long groupId, long ownerId, int ownerType,
254                    java.lang.String portletId, boolean privateLayout) {
255                    return getService()
256                                       .getPortletPreferences(companyId, groupId, ownerId,
257                            ownerType, portletId, privateLayout);
258            }
259    
260            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
261                    long ownerId, int ownerType, long plid) {
262                    return getService().getPortletPreferences(ownerId, ownerType, plid);
263            }
264    
265            public static com.liferay.portal.kernel.model.PortletPreferences getPortletPreferences(
266                    long ownerId, int ownerType, long plid, java.lang.String portletId)
267                    throws com.liferay.portal.kernel.exception.PortalException {
268                    return getService()
269                                       .getPortletPreferences(ownerId, ownerType, plid, portletId);
270            }
271    
272            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
273                    int ownerType, long plid, java.lang.String portletId) {
274                    return getService().getPortletPreferences(ownerType, plid, portletId);
275            }
276    
277            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferences(
278                    long plid, java.lang.String portletId) {
279                    return getService().getPortletPreferences(plid, portletId);
280            }
281    
282            /**
283            * Returns the portlet preferences with the primary key.
284            *
285            * @param portletPreferencesId the primary key of the portlet preferences
286            * @return the portlet preferences
287            * @throws PortalException if a portlet preferences with the primary key could not be found
288            */
289            public static com.liferay.portal.kernel.model.PortletPreferences getPortletPreferences(
290                    long portletPreferencesId)
291                    throws com.liferay.portal.kernel.exception.PortalException {
292                    return getService().getPortletPreferences(portletPreferencesId);
293            }
294    
295            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferencesByPlid(
296                    long plid) {
297                    return getService().getPortletPreferencesByPlid(plid);
298            }
299    
300            public static long getPortletPreferencesCount(long ownerId, int ownerType,
301                    long plid, com.liferay.portal.kernel.model.Portlet portlet,
302                    boolean excludeDefaultPreferences) {
303                    return getService()
304                                       .getPortletPreferencesCount(ownerId, ownerType, plid,
305                            portlet, excludeDefaultPreferences);
306            }
307    
308            public static long getPortletPreferencesCount(long ownerId, int ownerType,
309                    java.lang.String portletId, boolean excludeDefaultPreferences) {
310                    return getService()
311                                       .getPortletPreferencesCount(ownerId, ownerType, portletId,
312                            excludeDefaultPreferences);
313            }
314    
315            public static long getPortletPreferencesCount(int ownerType, long plid,
316                    java.lang.String portletId) {
317                    return getService()
318                                       .getPortletPreferencesCount(ownerType, plid, portletId);
319            }
320    
321            public static long getPortletPreferencesCount(int ownerType,
322                    java.lang.String portletId) {
323                    return getService().getPortletPreferencesCount(ownerType, portletId);
324            }
325    
326            /**
327            * Returns a range of all the portlet preferenceses.
328            *
329            * <p>
330            * 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.
331            * </p>
332            *
333            * @param start the lower bound of the range of portlet preferenceses
334            * @param end the upper bound of the range of portlet preferenceses (not inclusive)
335            * @return the range of portlet preferenceses
336            */
337            public static java.util.List<com.liferay.portal.kernel.model.PortletPreferences> getPortletPreferenceses(
338                    int start, int end) {
339                    return getService().getPortletPreferenceses(start, end);
340            }
341    
342            /**
343            * Returns the number of portlet preferenceses.
344            *
345            * @return the number of portlet preferenceses
346            */
347            public static int getPortletPreferencesesCount() {
348                    return getService().getPortletPreferencesesCount();
349            }
350    
351            public static javax.portlet.PortletPreferences getPreferences(
352                    long companyId, long ownerId, int ownerType, long plid,
353                    java.lang.String portletId) {
354                    return getService()
355                                       .getPreferences(companyId, ownerId, ownerType, plid,
356                            portletId);
357            }
358    
359            public static javax.portlet.PortletPreferences getPreferences(
360                    long companyId, long ownerId, int ownerType, long plid,
361                    java.lang.String portletId, java.lang.String defaultPreferences) {
362                    return getService()
363                                       .getPreferences(companyId, ownerId, ownerType, plid,
364                            portletId, defaultPreferences);
365            }
366    
367            public static javax.portlet.PortletPreferences getPreferences(
368                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
369                    return getService().getPreferences(portletPreferencesIds);
370            }
371    
372            public static javax.portlet.PortletPreferences getStrictPreferences(
373                    long companyId, long ownerId, int ownerType, long plid,
374                    java.lang.String portletId) {
375                    return getService()
376                                       .getStrictPreferences(companyId, ownerId, ownerType, plid,
377                            portletId);
378            }
379    
380            public static javax.portlet.PortletPreferences getStrictPreferences(
381                    com.liferay.portal.kernel.model.PortletPreferencesIds portletPreferencesIds) {
382                    return getService().getStrictPreferences(portletPreferencesIds);
383            }
384    
385            /**
386            * Updates the portlet preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
387            *
388            * @param portletPreferences the portlet preferences
389            * @return the portlet preferences that was updated
390            */
391            public static com.liferay.portal.kernel.model.PortletPreferences updatePortletPreferences(
392                    com.liferay.portal.kernel.model.PortletPreferences portletPreferences) {
393                    return getService().updatePortletPreferences(portletPreferences);
394            }
395    
396            public static com.liferay.portal.kernel.model.PortletPreferences updatePreferences(
397                    long ownerId, int ownerType, long plid, java.lang.String portletId,
398                    javax.portlet.PortletPreferences portletPreferences) {
399                    return getService()
400                                       .updatePreferences(ownerId, ownerType, plid, portletId,
401                            portletPreferences);
402            }
403    
404            public static com.liferay.portal.kernel.model.PortletPreferences updatePreferences(
405                    long ownerId, int ownerType, long plid, java.lang.String portletId,
406                    java.lang.String xml) {
407                    return getService()
408                                       .updatePreferences(ownerId, ownerType, plid, portletId, xml);
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    }