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 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 206 return getService().getIndexableActionableDynamicQuery(); 207 } 208 209 /** 210 * Returns the OSGi service identifier. 211 * 212 * @return the OSGi service identifier 213 */ 214 public static java.lang.String getOSGiServiceIdentifier() { 215 return getService().getOSGiServiceIdentifier(); 216 } 217 218 public static com.liferay.portal.model.PersistedModel getPersistedModel( 219 java.io.Serializable primaryKeyObj) 220 throws com.liferay.portal.kernel.exception.PortalException { 221 return getService().getPersistedModel(primaryKeyObj); 222 } 223 224 /** 225 * Returns the portal preferences with the primary key. 226 * 227 * @param portalPreferencesId the primary key of the portal preferences 228 * @return the portal preferences 229 * @throws PortalException if a portal preferences with the primary key could not be found 230 */ 231 public static com.liferay.portal.model.PortalPreferences getPortalPreferences( 232 long portalPreferencesId) 233 throws com.liferay.portal.kernel.exception.PortalException { 234 return getService().getPortalPreferences(portalPreferencesId); 235 } 236 237 /** 238 * Returns a range of all the portal preferenceses. 239 * 240 * <p> 241 * 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. 242 * </p> 243 * 244 * @param start the lower bound of the range of portal preferenceses 245 * @param end the upper bound of the range of portal preferenceses (not inclusive) 246 * @return the range of portal preferenceses 247 */ 248 public static java.util.List<com.liferay.portal.model.PortalPreferences> getPortalPreferenceses( 249 int start, int end) { 250 return getService().getPortalPreferenceses(start, end); 251 } 252 253 /** 254 * Returns the number of portal preferenceses. 255 * 256 * @return the number of portal preferenceses 257 */ 258 public static int getPortalPreferencesesCount() { 259 return getService().getPortalPreferencesesCount(); 260 } 261 262 /** 263 * @deprecated As of 6.2.0, replaced by {@link #getPreferences(long, int)} 264 */ 265 @Deprecated 266 public static javax.portlet.PortletPreferences getPreferences( 267 long companyId, long ownerId, int ownerType) { 268 return getService().getPreferences(companyId, ownerId, ownerType); 269 } 270 271 /** 272 * @deprecated As of 6.2.0, replaced by {@link #getPreferences(long, int, 273 String)} 274 */ 275 @Deprecated 276 public static javax.portlet.PortletPreferences getPreferences( 277 long companyId, long ownerId, int ownerType, 278 java.lang.String defaultPreferences) { 279 return getService() 280 .getPreferences(companyId, ownerId, ownerType, 281 defaultPreferences); 282 } 283 284 public static javax.portlet.PortletPreferences getPreferences( 285 long ownerId, int ownerType) { 286 return getService().getPreferences(ownerId, ownerType); 287 } 288 289 public static javax.portlet.PortletPreferences getPreferences( 290 long ownerId, int ownerType, java.lang.String defaultPreferences) { 291 return getService() 292 .getPreferences(ownerId, ownerType, defaultPreferences); 293 } 294 295 /** 296 * Updates the portal preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 297 * 298 * @param portalPreferences the portal preferences 299 * @return the portal preferences that was updated 300 */ 301 public static com.liferay.portal.model.PortalPreferences updatePortalPreferences( 302 com.liferay.portal.model.PortalPreferences portalPreferences) { 303 return getService().updatePortalPreferences(portalPreferences); 304 } 305 306 public static com.liferay.portal.model.PortalPreferences updatePreferences( 307 long ownerId, int ownerType, 308 com.liferay.portlet.PortalPreferences portalPreferences) { 309 return getService() 310 .updatePreferences(ownerId, ownerType, portalPreferences); 311 } 312 313 public static com.liferay.portal.model.PortalPreferences updatePreferences( 314 long ownerId, int ownerType, java.lang.String xml) { 315 return getService().updatePreferences(ownerId, ownerType, xml); 316 } 317 318 public static PortalPreferencesLocalService getService() { 319 if (_service == null) { 320 _service = (PortalPreferencesLocalService)PortalBeanLocatorUtil.locate(PortalPreferencesLocalService.class.getName()); 321 322 ReferenceRegistry.registerReference(PortalPreferencesLocalServiceUtil.class, 323 "_service"); 324 } 325 326 return _service; 327 } 328 329 private static PortalPreferencesLocalService _service; 330 }