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