001 /** 002 * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * Provides the local service utility for Contact. This utility wraps 022 * {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} and is the 023 * primary access point for service operations in application layer code running 024 * on the local server. Methods of this service will not have security checks 025 * based on the propagated JAAS credentials because this service can only be 026 * accessed from within the same VM. 027 * 028 * @author Brian Wing Shun Chan 029 * @see ContactLocalService 030 * @see com.liferay.portal.service.base.ContactLocalServiceBaseImpl 031 * @see com.liferay.portal.service.impl.ContactLocalServiceImpl 032 * @generated 033 */ 034 public class ContactLocalServiceUtil { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 039 */ 040 041 /** 042 * Adds the contact to the database. Also notifies the appropriate model listeners. 043 * 044 * @param contact the contact 045 * @return the contact that was added 046 * @throws SystemException if a system exception occurred 047 */ 048 public static com.liferay.portal.model.Contact addContact( 049 com.liferay.portal.model.Contact contact) 050 throws com.liferay.portal.kernel.exception.SystemException { 051 return getService().addContact(contact); 052 } 053 054 /** 055 * Creates a new contact with the primary key. Does not add the contact to the database. 056 * 057 * @param contactId the primary key for the new contact 058 * @return the new contact 059 */ 060 public static com.liferay.portal.model.Contact createContact(long contactId) { 061 return getService().createContact(contactId); 062 } 063 064 /** 065 * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param contactId the primary key of the contact 068 * @return the contact that was removed 069 * @throws PortalException if a contact with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public static com.liferay.portal.model.Contact deleteContact(long contactId) 073 throws com.liferay.portal.kernel.exception.PortalException, 074 com.liferay.portal.kernel.exception.SystemException { 075 return getService().deleteContact(contactId); 076 } 077 078 /** 079 * Deletes the contact from the database. Also notifies the appropriate model listeners. 080 * 081 * @param contact the contact 082 * @return the contact that was removed 083 * @throws SystemException if a system exception occurred 084 */ 085 public static com.liferay.portal.model.Contact deleteContact( 086 com.liferay.portal.model.Contact contact) 087 throws com.liferay.portal.kernel.exception.SystemException { 088 return getService().deleteContact(contact); 089 } 090 091 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 092 return getService().dynamicQuery(); 093 } 094 095 /** 096 * Performs a dynamic query on the database and returns the matching rows. 097 * 098 * @param dynamicQuery the dynamic query 099 * @return the matching rows 100 * @throws SystemException if a system exception occurred 101 */ 102 @SuppressWarnings("rawtypes") 103 public static java.util.List dynamicQuery( 104 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 105 throws com.liferay.portal.kernel.exception.SystemException { 106 return getService().dynamicQuery(dynamicQuery); 107 } 108 109 /** 110 * Performs a dynamic query on the database and returns a range of the matching rows. 111 * 112 * <p> 113 * 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.ContactModelImpl}. 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. 114 * </p> 115 * 116 * @param dynamicQuery the dynamic query 117 * @param start the lower bound of the range of model instances 118 * @param end the upper bound of the range of model instances (not inclusive) 119 * @return the range of matching rows 120 * @throws SystemException if a system exception occurred 121 */ 122 @SuppressWarnings("rawtypes") 123 public static java.util.List dynamicQuery( 124 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 125 int end) throws com.liferay.portal.kernel.exception.SystemException { 126 return getService().dynamicQuery(dynamicQuery, start, end); 127 } 128 129 /** 130 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 131 * 132 * <p> 133 * 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.ContactModelImpl}. 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. 134 * </p> 135 * 136 * @param dynamicQuery the dynamic query 137 * @param start the lower bound of the range of model instances 138 * @param end the upper bound of the range of model instances (not inclusive) 139 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 140 * @return the ordered range of matching rows 141 * @throws SystemException if a system exception occurred 142 */ 143 @SuppressWarnings("rawtypes") 144 public static java.util.List dynamicQuery( 145 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 146 int end, 147 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 148 throws com.liferay.portal.kernel.exception.SystemException { 149 return getService() 150 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 151 } 152 153 /** 154 * Returns the number of rows that match the dynamic query. 155 * 156 * @param dynamicQuery the dynamic query 157 * @return the number of rows that match the dynamic query 158 * @throws SystemException if a system exception occurred 159 */ 160 public static long dynamicQueryCount( 161 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getService().dynamicQueryCount(dynamicQuery); 164 } 165 166 /** 167 * Returns the number of rows that match the dynamic query. 168 * 169 * @param dynamicQuery the dynamic query 170 * @param projection the projection to apply to the query 171 * @return the number of rows that match the dynamic query 172 * @throws SystemException if a system exception occurred 173 */ 174 public static long dynamicQueryCount( 175 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 176 com.liferay.portal.kernel.dao.orm.Projection projection) 177 throws com.liferay.portal.kernel.exception.SystemException { 178 return getService().dynamicQueryCount(dynamicQuery, projection); 179 } 180 181 public static com.liferay.portal.model.Contact fetchContact(long contactId) 182 throws com.liferay.portal.kernel.exception.SystemException { 183 return getService().fetchContact(contactId); 184 } 185 186 /** 187 * Returns the contact with the primary key. 188 * 189 * @param contactId the primary key of the contact 190 * @return the contact 191 * @throws PortalException if a contact with the primary key could not be found 192 * @throws SystemException if a system exception occurred 193 */ 194 public static com.liferay.portal.model.Contact getContact(long contactId) 195 throws com.liferay.portal.kernel.exception.PortalException, 196 com.liferay.portal.kernel.exception.SystemException { 197 return getService().getContact(contactId); 198 } 199 200 public static com.liferay.portal.model.PersistedModel getPersistedModel( 201 java.io.Serializable primaryKeyObj) 202 throws com.liferay.portal.kernel.exception.PortalException, 203 com.liferay.portal.kernel.exception.SystemException { 204 return getService().getPersistedModel(primaryKeyObj); 205 } 206 207 /** 208 * Returns a range of all the contacts. 209 * 210 * <p> 211 * 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.ContactModelImpl}. 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. 212 * </p> 213 * 214 * @param start the lower bound of the range of contacts 215 * @param end the upper bound of the range of contacts (not inclusive) 216 * @return the range of contacts 217 * @throws SystemException if a system exception occurred 218 */ 219 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 220 int start, int end) 221 throws com.liferay.portal.kernel.exception.SystemException { 222 return getService().getContacts(start, end); 223 } 224 225 /** 226 * Returns the number of contacts. 227 * 228 * @return the number of contacts 229 * @throws SystemException if a system exception occurred 230 */ 231 public static int getContactsCount() 232 throws com.liferay.portal.kernel.exception.SystemException { 233 return getService().getContactsCount(); 234 } 235 236 /** 237 * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 238 * 239 * @param contact the contact 240 * @return the contact that was updated 241 * @throws SystemException if a system exception occurred 242 */ 243 public static com.liferay.portal.model.Contact updateContact( 244 com.liferay.portal.model.Contact contact) 245 throws com.liferay.portal.kernel.exception.SystemException { 246 return getService().updateContact(contact); 247 } 248 249 /** 250 * Returns the Spring bean ID for this bean. 251 * 252 * @return the Spring bean ID for this bean 253 */ 254 public static java.lang.String getBeanIdentifier() { 255 return getService().getBeanIdentifier(); 256 } 257 258 /** 259 * Sets the Spring bean ID for this bean. 260 * 261 * @param beanIdentifier the Spring bean ID for this bean 262 */ 263 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 264 getService().setBeanIdentifier(beanIdentifier); 265 } 266 267 public static com.liferay.portal.model.Contact addContact(long userId, 268 java.lang.String className, long classPK, 269 java.lang.String emailAddress, java.lang.String firstName, 270 java.lang.String middleName, java.lang.String lastName, int prefixId, 271 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 272 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 273 java.lang.String facebookSn, java.lang.String icqSn, 274 java.lang.String jabberSn, java.lang.String msnSn, 275 java.lang.String mySpaceSn, java.lang.String skypeSn, 276 java.lang.String twitterSn, java.lang.String ymSn, 277 java.lang.String jobTitle) 278 throws com.liferay.portal.kernel.exception.PortalException, 279 com.liferay.portal.kernel.exception.SystemException { 280 return getService() 281 .addContact(userId, className, classPK, emailAddress, 282 firstName, middleName, lastName, prefixId, suffixId, male, 283 birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, 284 icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, 285 jobTitle); 286 } 287 288 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 289 long classNameId, long classPK, int start, int end, 290 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 291 throws com.liferay.portal.kernel.exception.SystemException { 292 return getService() 293 .getContacts(classNameId, classPK, start, end, 294 orderByComparator); 295 } 296 297 public static int getContactsCount(long classNameId, long classPK) 298 throws com.liferay.portal.kernel.exception.SystemException { 299 return getService().getContactsCount(classNameId, classPK); 300 } 301 302 public static com.liferay.portal.model.Contact updateContact( 303 long contactId, java.lang.String emailAddress, 304 java.lang.String firstName, java.lang.String middleName, 305 java.lang.String lastName, int prefixId, int suffixId, boolean male, 306 int birthdayMonth, int birthdayDay, int birthdayYear, 307 java.lang.String smsSn, java.lang.String aimSn, 308 java.lang.String facebookSn, java.lang.String icqSn, 309 java.lang.String jabberSn, java.lang.String msnSn, 310 java.lang.String mySpaceSn, java.lang.String skypeSn, 311 java.lang.String twitterSn, java.lang.String ymSn, 312 java.lang.String jobTitle) 313 throws com.liferay.portal.kernel.exception.PortalException, 314 com.liferay.portal.kernel.exception.SystemException { 315 return getService() 316 .updateContact(contactId, emailAddress, firstName, 317 middleName, lastName, prefixId, suffixId, male, birthdayMonth, 318 birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, icqSn, 319 jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle); 320 } 321 322 public static ContactLocalService getService() { 323 if (_service == null) { 324 _service = (ContactLocalService)PortalBeanLocatorUtil.locate(ContactLocalService.class.getName()); 325 326 ReferenceRegistry.registerReference(ContactLocalServiceUtil.class, 327 "_service"); 328 } 329 330 return _service; 331 } 332 333 /** 334 * @deprecated As of 6.2.0 335 */ 336 public void setService(ContactLocalService service) { 337 } 338 339 private static ContactLocalService _service; 340 }