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            /**
229            * Returns the OSGi service identifier.
230            *
231            * @return the OSGi service identifier
232            */
233            public static java.lang.String getOSGiServiceIdentifier() {
234                    return getService().getOSGiServiceIdentifier();
235            }
236    
237            public static com.liferay.portal.model.PersistedModel getPersistedModel(
238                    java.io.Serializable primaryKeyObj)
239                    throws com.liferay.portal.kernel.exception.PortalException {
240                    return getService().getPersistedModel(primaryKeyObj);
241            }
242    
243            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferences() {
244                    return getService().getPortletPreferences();
245            }
246    
247            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferences(
248                    long companyId, long groupId, long ownerId, int ownerType,
249                    java.lang.String portletId, boolean privateLayout) {
250                    return getService()
251                                       .getPortletPreferences(companyId, groupId, ownerId,
252                            ownerType, portletId, privateLayout);
253            }
254    
255            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferences(
256                    long ownerId, int ownerType, long plid) {
257                    return getService().getPortletPreferences(ownerId, ownerType, plid);
258            }
259    
260            public static com.liferay.portal.model.PortletPreferences getPortletPreferences(
261                    long ownerId, int ownerType, long plid, java.lang.String portletId)
262                    throws com.liferay.portal.kernel.exception.PortalException {
263                    return getService()
264                                       .getPortletPreferences(ownerId, ownerType, plid, portletId);
265            }
266    
267            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferences(
268                    int ownerType, long plid, java.lang.String portletId) {
269                    return getService().getPortletPreferences(ownerType, plid, portletId);
270            }
271    
272            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferences(
273                    long plid, java.lang.String portletId) {
274                    return getService().getPortletPreferences(plid, portletId);
275            }
276    
277            /**
278            * Returns the portlet preferences with the primary key.
279            *
280            * @param portletPreferencesId the primary key of the portlet preferences
281            * @return the portlet preferences
282            * @throws PortalException if a portlet preferences with the primary key could not be found
283            */
284            public static com.liferay.portal.model.PortletPreferences getPortletPreferences(
285                    long portletPreferencesId)
286                    throws com.liferay.portal.kernel.exception.PortalException {
287                    return getService().getPortletPreferences(portletPreferencesId);
288            }
289    
290            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferencesByPlid(
291                    long plid) {
292                    return getService().getPortletPreferencesByPlid(plid);
293            }
294    
295            public static long getPortletPreferencesCount(long ownerId, int ownerType,
296                    long plid, com.liferay.portal.model.Portlet portlet,
297                    boolean excludeDefaultPreferences) {
298                    return getService()
299                                       .getPortletPreferencesCount(ownerId, ownerType, plid,
300                            portlet, excludeDefaultPreferences);
301            }
302    
303            public static long getPortletPreferencesCount(long ownerId, int ownerType,
304                    java.lang.String portletId, boolean excludeDefaultPreferences) {
305                    return getService()
306                                       .getPortletPreferencesCount(ownerId, ownerType, portletId,
307                            excludeDefaultPreferences);
308            }
309    
310            public static long getPortletPreferencesCount(int ownerType, long plid,
311                    java.lang.String portletId) {
312                    return getService()
313                                       .getPortletPreferencesCount(ownerType, plid, portletId);
314            }
315    
316            public static long getPortletPreferencesCount(int ownerType,
317                    java.lang.String portletId) {
318                    return getService().getPortletPreferencesCount(ownerType, portletId);
319            }
320    
321            /**
322            * Returns a range of all the portlet preferenceses.
323            *
324            * <p>
325            * 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.
326            * </p>
327            *
328            * @param start the lower bound of the range of portlet preferenceses
329            * @param end the upper bound of the range of portlet preferenceses (not inclusive)
330            * @return the range of portlet preferenceses
331            */
332            public static java.util.List<com.liferay.portal.model.PortletPreferences> getPortletPreferenceses(
333                    int start, int end) {
334                    return getService().getPortletPreferenceses(start, end);
335            }
336    
337            /**
338            * Returns the number of portlet preferenceses.
339            *
340            * @return the number of portlet preferenceses
341            */
342            public static int getPortletPreferencesesCount() {
343                    return getService().getPortletPreferencesesCount();
344            }
345    
346            public static javax.portlet.PortletPreferences getPreferences(
347                    long companyId, long ownerId, int ownerType, long plid,
348                    java.lang.String portletId) {
349                    return getService()
350                                       .getPreferences(companyId, ownerId, ownerType, plid,
351                            portletId);
352            }
353    
354            public static javax.portlet.PortletPreferences getPreferences(
355                    long companyId, long ownerId, int ownerType, long plid,
356                    java.lang.String portletId, java.lang.String defaultPreferences) {
357                    return getService()
358                                       .getPreferences(companyId, ownerId, ownerType, plid,
359                            portletId, defaultPreferences);
360            }
361    
362            public static javax.portlet.PortletPreferences getPreferences(
363                    com.liferay.portal.model.PortletPreferencesIds portletPreferencesIds) {
364                    return getService().getPreferences(portletPreferencesIds);
365            }
366    
367            public static javax.portlet.PortletPreferences getStrictPreferences(
368                    long companyId, long ownerId, int ownerType, long plid,
369                    java.lang.String portletId) {
370                    return getService()
371                                       .getStrictPreferences(companyId, ownerId, ownerType, plid,
372                            portletId);
373            }
374    
375            public static javax.portlet.PortletPreferences getStrictPreferences(
376                    com.liferay.portal.model.PortletPreferencesIds portletPreferencesIds) {
377                    return getService().getStrictPreferences(portletPreferencesIds);
378            }
379    
380            /**
381            * Updates the portlet preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
382            *
383            * @param portletPreferences the portlet preferences
384            * @return the portlet preferences that was updated
385            */
386            public static com.liferay.portal.model.PortletPreferences updatePortletPreferences(
387                    com.liferay.portal.model.PortletPreferences portletPreferences) {
388                    return getService().updatePortletPreferences(portletPreferences);
389            }
390    
391            public static com.liferay.portal.model.PortletPreferences updatePreferences(
392                    long ownerId, int ownerType, long plid, java.lang.String portletId,
393                    javax.portlet.PortletPreferences portletPreferences) {
394                    return getService()
395                                       .updatePreferences(ownerId, ownerType, plid, portletId,
396                            portletPreferences);
397            }
398    
399            public static com.liferay.portal.model.PortletPreferences updatePreferences(
400                    long ownerId, int ownerType, long plid, java.lang.String portletId,
401                    java.lang.String xml) {
402                    return getService()
403                                       .updatePreferences(ownerId, ownerType, plid, portletId, xml);
404            }
405    
406            public static PortletPreferencesLocalService getService() {
407                    if (_service == null) {
408                            _service = (PortletPreferencesLocalService)PortalBeanLocatorUtil.locate(PortletPreferencesLocalService.class.getName());
409    
410                            ReferenceRegistry.registerReference(PortletPreferencesLocalServiceUtil.class,
411                                    "_service");
412                    }
413    
414                    return _service;
415            }
416    
417            /**
418             * @deprecated As of 6.2.0
419             */
420            @Deprecated
421            public void setService(PortletPreferencesLocalService service) {
422            }
423    
424            private static PortletPreferencesLocalService _service;
425    }