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 PortalPreferences. This utility wraps
024     * {@link com.liferay.portal.service.impl.PortalPreferencesLocalServiceImpl} 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 PortalPreferencesLocalService
032     * @see com.liferay.portal.service.base.PortalPreferencesLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PortalPreferencesLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class PortalPreferencesLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortalPreferencesLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * @deprecated As of 6.2.0, replaced by {@link #addPortalPreferences(long,
046            int, String)}
047            */
048            @Deprecated
049            public static com.liferay.portal.model.PortalPreferences addPortalPreferences(
050                    long companyId, long ownerId, int ownerType,
051                    java.lang.String defaultPreferences) {
052                    return getService()
053                                       .addPortalPreferences(companyId, ownerId, ownerType,
054                            defaultPreferences);
055            }
056    
057            public static com.liferay.portal.model.PortalPreferences addPortalPreferences(
058                    long ownerId, int ownerType, java.lang.String defaultPreferences) {
059                    return getService()
060                                       .addPortalPreferences(ownerId, ownerType, defaultPreferences);
061            }
062    
063            /**
064            * Adds the portal preferences to the database. Also notifies the appropriate model listeners.
065            *
066            * @param portalPreferences the portal preferences
067            * @return the portal preferences that was added
068            */
069            public static com.liferay.portal.model.PortalPreferences addPortalPreferences(
070                    com.liferay.portal.model.PortalPreferences portalPreferences) {
071                    return getService().addPortalPreferences(portalPreferences);
072            }
073    
074            /**
075            * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database.
076            *
077            * @param portalPreferencesId the primary key for the new portal preferences
078            * @return the new portal preferences
079            */
080            public static com.liferay.portal.model.PortalPreferences createPortalPreferences(
081                    long portalPreferencesId) {
082                    return getService().createPortalPreferences(portalPreferencesId);
083            }
084    
085            /**
086            * @throws PortalException
087            */
088            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
089                    com.liferay.portal.model.PersistedModel persistedModel)
090                    throws com.liferay.portal.kernel.exception.PortalException {
091                    return getService().deletePersistedModel(persistedModel);
092            }
093    
094            /**
095            * Deletes the portal preferences from the database. Also notifies the appropriate model listeners.
096            *
097            * @param portalPreferences the portal preferences
098            * @return the portal preferences that was removed
099            */
100            public static com.liferay.portal.model.PortalPreferences deletePortalPreferences(
101                    com.liferay.portal.model.PortalPreferences portalPreferences) {
102                    return getService().deletePortalPreferences(portalPreferences);
103            }
104    
105            /**
106            * Deletes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners.
107            *
108            * @param portalPreferencesId the primary key of the portal preferences
109            * @return the portal preferences that was removed
110            * @throws PortalException if a portal preferences with the primary key could not be found
111            */
112            public static com.liferay.portal.model.PortalPreferences deletePortalPreferences(
113                    long portalPreferencesId)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    return getService().deletePortalPreferences(portalPreferencesId);
116            }
117    
118            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
119                    return getService().dynamicQuery();
120            }
121    
122            /**
123            * Performs a dynamic query on the database and returns the matching rows.
124            *
125            * @param dynamicQuery the dynamic query
126            * @return the matching rows
127            */
128            public static <T> java.util.List<T> dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
130                    return getService().dynamicQuery(dynamicQuery);
131            }
132    
133            /**
134            * Performs a dynamic query on the database and returns a range of the matching rows.
135            *
136            * <p>
137            * 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.PortalPreferencesModelImpl}. 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.
138            * </p>
139            *
140            * @param dynamicQuery the dynamic query
141            * @param start the lower bound of the range of model instances
142            * @param end the upper bound of the range of model instances (not inclusive)
143            * @return the range of matching rows
144            */
145            public static <T> java.util.List<T> dynamicQuery(
146                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
147                    int end) {
148                    return getService().dynamicQuery(dynamicQuery, start, end);
149            }
150    
151            /**
152            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
153            *
154            * <p>
155            * 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.PortalPreferencesModelImpl}. 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.
156            * </p>
157            *
158            * @param dynamicQuery the dynamic query
159            * @param start the lower bound of the range of model instances
160            * @param end the upper bound of the range of model instances (not inclusive)
161            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
162            * @return the ordered range of matching rows
163            */
164            public static <T> java.util.List<T> dynamicQuery(
165                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
166                    int end,
167                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
168                    return getService()
169                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
170            }
171    
172            /**
173            * Returns the number of rows matching the dynamic query.
174            *
175            * @param dynamicQuery the dynamic query
176            * @return the number of rows matching the dynamic query
177            */
178            public static long dynamicQueryCount(
179                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
180                    return getService().dynamicQueryCount(dynamicQuery);
181            }
182    
183            /**
184            * Returns the number of rows matching the dynamic query.
185            *
186            * @param dynamicQuery the dynamic query
187            * @param projection the projection to apply to the query
188            * @return the number of rows matching the dynamic query
189            */
190            public static long dynamicQueryCount(
191                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
192                    com.liferay.portal.kernel.dao.orm.Projection projection) {
193                    return getService().dynamicQueryCount(dynamicQuery, projection);
194            }
195    
196            public static com.liferay.portal.model.PortalPreferences fetchPortalPreferences(
197                    long portalPreferencesId) {
198                    return getService().fetchPortalPreferences(portalPreferencesId);
199            }
200    
201            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
202                    return getService().getActionableDynamicQuery();
203            }
204    
205            /**
206            * Returns the Spring bean ID for this bean.
207            *
208            * @return the Spring bean ID for this bean
209            */
210            public static java.lang.String getBeanIdentifier() {
211                    return getService().getBeanIdentifier();
212            }
213    
214            public static com.liferay.portal.model.PersistedModel getPersistedModel(
215                    java.io.Serializable primaryKeyObj)
216                    throws com.liferay.portal.kernel.exception.PortalException {
217                    return getService().getPersistedModel(primaryKeyObj);
218            }
219    
220            /**
221            * Returns the portal preferences with the primary key.
222            *
223            * @param portalPreferencesId the primary key of the portal preferences
224            * @return the portal preferences
225            * @throws PortalException if a portal preferences with the primary key could not be found
226            */
227            public static com.liferay.portal.model.PortalPreferences getPortalPreferences(
228                    long portalPreferencesId)
229                    throws com.liferay.portal.kernel.exception.PortalException {
230                    return getService().getPortalPreferences(portalPreferencesId);
231            }
232    
233            /**
234            * Returns a range of all the portal preferenceses.
235            *
236            * <p>
237            * 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.PortalPreferencesModelImpl}. 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.
238            * </p>
239            *
240            * @param start the lower bound of the range of portal preferenceses
241            * @param end the upper bound of the range of portal preferenceses (not inclusive)
242            * @return the range of portal preferenceses
243            */
244            public static java.util.List<com.liferay.portal.model.PortalPreferences> getPortalPreferenceses(
245                    int start, int end) {
246                    return getService().getPortalPreferenceses(start, end);
247            }
248    
249            /**
250            * Returns the number of portal preferenceses.
251            *
252            * @return the number of portal preferenceses
253            */
254            public static int getPortalPreferencesesCount() {
255                    return getService().getPortalPreferencesesCount();
256            }
257    
258            /**
259            * @deprecated As of 6.2.0, replaced by {@link #getPreferences(long, int)}
260            */
261            @Deprecated
262            public static javax.portlet.PortletPreferences getPreferences(
263                    long companyId, long ownerId, int ownerType) {
264                    return getService().getPreferences(companyId, ownerId, ownerType);
265            }
266    
267            /**
268            * @deprecated As of 6.2.0, replaced by {@link #getPreferences(long, int,
269            String)}
270            */
271            @Deprecated
272            public static javax.portlet.PortletPreferences getPreferences(
273                    long companyId, long ownerId, int ownerType,
274                    java.lang.String defaultPreferences) {
275                    return getService()
276                                       .getPreferences(companyId, ownerId, ownerType,
277                            defaultPreferences);
278            }
279    
280            public static javax.portlet.PortletPreferences getPreferences(
281                    long ownerId, int ownerType) {
282                    return getService().getPreferences(ownerId, ownerType);
283            }
284    
285            public static javax.portlet.PortletPreferences getPreferences(
286                    long ownerId, int ownerType, java.lang.String defaultPreferences) {
287                    return getService()
288                                       .getPreferences(ownerId, ownerType, defaultPreferences);
289            }
290    
291            /**
292            * Sets the Spring bean ID for this bean.
293            *
294            * @param beanIdentifier the Spring bean ID for this bean
295            */
296            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
297                    getService().setBeanIdentifier(beanIdentifier);
298            }
299    
300            /**
301            * Updates the portal preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
302            *
303            * @param portalPreferences the portal preferences
304            * @return the portal preferences that was updated
305            */
306            public static com.liferay.portal.model.PortalPreferences updatePortalPreferences(
307                    com.liferay.portal.model.PortalPreferences portalPreferences) {
308                    return getService().updatePortalPreferences(portalPreferences);
309            }
310    
311            public static com.liferay.portal.model.PortalPreferences updatePreferences(
312                    long ownerId, int ownerType,
313                    com.liferay.portlet.PortalPreferences portalPreferences) {
314                    return getService()
315                                       .updatePreferences(ownerId, ownerType, portalPreferences);
316            }
317    
318            public static com.liferay.portal.model.PortalPreferences updatePreferences(
319                    long ownerId, int ownerType, java.lang.String xml) {
320                    return getService().updatePreferences(ownerId, ownerType, xml);
321            }
322    
323            public static PortalPreferencesLocalService getService() {
324                    if (_service == null) {
325                            _service = (PortalPreferencesLocalService)PortalBeanLocatorUtil.locate(PortalPreferencesLocalService.class.getName());
326    
327                            ReferenceRegistry.registerReference(PortalPreferencesLocalServiceUtil.class,
328                                    "_service");
329                    }
330    
331                    return _service;
332            }
333    
334            /**
335             * @deprecated As of 6.2.0
336             */
337            @Deprecated
338            public void setService(PortalPreferencesLocalService service) {
339            }
340    
341            private static PortalPreferencesLocalService _service;
342    }