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