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