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            public static com.liferay.portal.model.PortalPreferences addPortalPreferences(
044                    long ownerId, int ownerType, java.lang.String defaultPreferences) {
045                    return getService()
046                                       .addPortalPreferences(ownerId, ownerType, defaultPreferences);
047            }
048    
049            /**
050            * Adds the portal preferences to the database. Also notifies the appropriate model listeners.
051            *
052            * @param portalPreferences the portal preferences
053            * @return the portal preferences that was added
054            */
055            public static com.liferay.portal.model.PortalPreferences addPortalPreferences(
056                    com.liferay.portal.model.PortalPreferences portalPreferences) {
057                    return getService().addPortalPreferences(portalPreferences);
058            }
059    
060            /**
061            * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database.
062            *
063            * @param portalPreferencesId the primary key for the new portal preferences
064            * @return the new portal preferences
065            */
066            public static com.liferay.portal.model.PortalPreferences createPortalPreferences(
067                    long portalPreferencesId) {
068                    return getService().createPortalPreferences(portalPreferencesId);
069            }
070    
071            /**
072            * @throws PortalException
073            */
074            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
075                    com.liferay.portal.model.PersistedModel persistedModel)
076                    throws com.liferay.portal.kernel.exception.PortalException {
077                    return getService().deletePersistedModel(persistedModel);
078            }
079    
080            /**
081            * Deletes the portal preferences from the database. Also notifies the appropriate model listeners.
082            *
083            * @param portalPreferences the portal preferences
084            * @return the portal preferences that was removed
085            */
086            public static com.liferay.portal.model.PortalPreferences deletePortalPreferences(
087                    com.liferay.portal.model.PortalPreferences portalPreferences) {
088                    return getService().deletePortalPreferences(portalPreferences);
089            }
090    
091            /**
092            * Deletes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners.
093            *
094            * @param portalPreferencesId the primary key of the portal preferences
095            * @return the portal preferences that was removed
096            * @throws PortalException if a portal preferences with the primary key could not be found
097            */
098            public static com.liferay.portal.model.PortalPreferences deletePortalPreferences(
099                    long portalPreferencesId)
100                    throws com.liferay.portal.kernel.exception.PortalException {
101                    return getService().deletePortalPreferences(portalPreferencesId);
102            }
103    
104            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
105                    return getService().dynamicQuery();
106            }
107    
108            /**
109            * Performs a dynamic query on the database and returns the matching rows.
110            *
111            * @param dynamicQuery the dynamic query
112            * @return the matching rows
113            */
114            public static <T> java.util.List<T> dynamicQuery(
115                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
116                    return getService().dynamicQuery(dynamicQuery);
117            }
118    
119            /**
120            * Performs a dynamic query on the database and returns a range of the matching rows.
121            *
122            * <p>
123            * 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.
124            * </p>
125            *
126            * @param dynamicQuery the dynamic query
127            * @param start the lower bound of the range of model instances
128            * @param end the upper bound of the range of model instances (not inclusive)
129            * @return the range of matching rows
130            */
131            public static <T> java.util.List<T> dynamicQuery(
132                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
133                    int end) {
134                    return getService().dynamicQuery(dynamicQuery, start, end);
135            }
136    
137            /**
138            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
139            *
140            * <p>
141            * 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.
142            * </p>
143            *
144            * @param dynamicQuery the dynamic query
145            * @param start the lower bound of the range of model instances
146            * @param end the upper bound of the range of model instances (not inclusive)
147            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
148            * @return the ordered 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                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
154                    return getService()
155                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns the number of rows matching the dynamic query.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the number of rows matching the dynamic query
163            */
164            public static long dynamicQueryCount(
165                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
166                    return getService().dynamicQueryCount(dynamicQuery);
167            }
168    
169            /**
170            * Returns the number of rows matching the dynamic query.
171            *
172            * @param dynamicQuery the dynamic query
173            * @param projection the projection to apply to the query
174            * @return the number of rows matching the dynamic query
175            */
176            public static long dynamicQueryCount(
177                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
178                    com.liferay.portal.kernel.dao.orm.Projection projection) {
179                    return getService().dynamicQueryCount(dynamicQuery, projection);
180            }
181    
182            public static com.liferay.portal.model.PortalPreferences fetchPortalPreferences(
183                    long portalPreferencesId) {
184                    return getService().fetchPortalPreferences(portalPreferencesId);
185            }
186    
187            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
188                    return getService().getActionableDynamicQuery();
189            }
190    
191            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
192                    return getService().getIndexableActionableDynamicQuery();
193            }
194    
195            /**
196            * Returns the OSGi service identifier.
197            *
198            * @return the OSGi service identifier
199            */
200            public static java.lang.String getOSGiServiceIdentifier() {
201                    return getService().getOSGiServiceIdentifier();
202            }
203    
204            public static com.liferay.portal.model.PersistedModel getPersistedModel(
205                    java.io.Serializable primaryKeyObj)
206                    throws com.liferay.portal.kernel.exception.PortalException {
207                    return getService().getPersistedModel(primaryKeyObj);
208            }
209    
210            /**
211            * Returns the portal preferences with the primary key.
212            *
213            * @param portalPreferencesId the primary key of the portal preferences
214            * @return the portal preferences
215            * @throws PortalException if a portal preferences with the primary key could not be found
216            */
217            public static com.liferay.portal.model.PortalPreferences getPortalPreferences(
218                    long portalPreferencesId)
219                    throws com.liferay.portal.kernel.exception.PortalException {
220                    return getService().getPortalPreferences(portalPreferencesId);
221            }
222    
223            /**
224            * Returns a range of all the portal preferenceses.
225            *
226            * <p>
227            * 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.
228            * </p>
229            *
230            * @param start the lower bound of the range of portal preferenceses
231            * @param end the upper bound of the range of portal preferenceses (not inclusive)
232            * @return the range of portal preferenceses
233            */
234            public static java.util.List<com.liferay.portal.model.PortalPreferences> getPortalPreferenceses(
235                    int start, int end) {
236                    return getService().getPortalPreferenceses(start, end);
237            }
238    
239            /**
240            * Returns the number of portal preferenceses.
241            *
242            * @return the number of portal preferenceses
243            */
244            public static int getPortalPreferencesesCount() {
245                    return getService().getPortalPreferencesesCount();
246            }
247    
248            public static javax.portlet.PortletPreferences getPreferences(
249                    long ownerId, int ownerType) {
250                    return getService().getPreferences(ownerId, ownerType);
251            }
252    
253            public static javax.portlet.PortletPreferences getPreferences(
254                    long ownerId, int ownerType, java.lang.String defaultPreferences) {
255                    return getService()
256                                       .getPreferences(ownerId, ownerType, defaultPreferences);
257            }
258    
259            /**
260            * Updates the portal preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
261            *
262            * @param portalPreferences the portal preferences
263            * @return the portal preferences that was updated
264            */
265            public static com.liferay.portal.model.PortalPreferences updatePortalPreferences(
266                    com.liferay.portal.model.PortalPreferences portalPreferences) {
267                    return getService().updatePortalPreferences(portalPreferences);
268            }
269    
270            public static com.liferay.portal.model.PortalPreferences updatePreferences(
271                    long ownerId, int ownerType,
272                    com.liferay.portlet.PortalPreferences portalPreferences) {
273                    return getService()
274                                       .updatePreferences(ownerId, ownerType, portalPreferences);
275            }
276    
277            public static com.liferay.portal.model.PortalPreferences updatePreferences(
278                    long ownerId, int ownerType, java.lang.String xml) {
279                    return getService().updatePreferences(ownerId, ownerType, xml);
280            }
281    
282            public static PortalPreferencesLocalService getService() {
283                    if (_service == null) {
284                            _service = (PortalPreferencesLocalService)PortalBeanLocatorUtil.locate(PortalPreferencesLocalService.class.getName());
285    
286                            ReferenceRegistry.registerReference(PortalPreferencesLocalServiceUtil.class,
287                                    "_service");
288                    }
289    
290                    return _service;
291            }
292    
293            private static PortalPreferencesLocalService _service;
294    }