001 /** 002 * Copyright (c) 2000-2011 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.portlet.social.service; 016 017 import com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.transaction.Isolation; 020 import com.liferay.portal.kernel.transaction.Propagation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 import com.liferay.portal.service.PersistedModelLocalService; 023 024 /** 025 * The interface for the social request local service. 026 * 027 * <p> 028 * 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. 029 * </p> 030 * 031 * @author Brian Wing Shun Chan 032 * @see SocialRequestLocalServiceUtil 033 * @see com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl 034 * @see com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl 035 * @generated 036 */ 037 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 038 PortalException.class, SystemException.class}) 039 public interface SocialRequestLocalService extends PersistedModelLocalService { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify or reference this interface directly. Always use {@link SocialRequestLocalServiceUtil} to access the social request local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 044 */ 045 046 /** 047 * Adds the social request to the database. Also notifies the appropriate model listeners. 048 * 049 * @param socialRequest the social request 050 * @return the social request that was added 051 * @throws SystemException if a system exception occurred 052 */ 053 public com.liferay.portlet.social.model.SocialRequest addSocialRequest( 054 com.liferay.portlet.social.model.SocialRequest socialRequest) 055 throws com.liferay.portal.kernel.exception.SystemException; 056 057 /** 058 * Creates a new social request with the primary key. Does not add the social request to the database. 059 * 060 * @param requestId the primary key for the new social request 061 * @return the new social request 062 */ 063 public com.liferay.portlet.social.model.SocialRequest createSocialRequest( 064 long requestId); 065 066 /** 067 * Deletes the social request with the primary key from the database. Also notifies the appropriate model listeners. 068 * 069 * @param requestId the primary key of the social request 070 * @throws PortalException if a social request with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public void deleteSocialRequest(long requestId) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Deletes the social request from the database. Also notifies the appropriate model listeners. 079 * 080 * @param socialRequest the social request 081 * @throws SystemException if a system exception occurred 082 */ 083 public void deleteSocialRequest( 084 com.liferay.portlet.social.model.SocialRequest socialRequest) 085 throws com.liferay.portal.kernel.exception.SystemException; 086 087 /** 088 * Performs a dynamic query on the database and returns the matching rows. 089 * 090 * @param dynamicQuery the dynamic query 091 * @return the matching rows 092 * @throws SystemException if a system exception occurred 093 */ 094 @SuppressWarnings("rawtypes") 095 public java.util.List dynamicQuery( 096 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 097 throws com.liferay.portal.kernel.exception.SystemException; 098 099 /** 100 * Performs a dynamic query on the database and returns a range of the matching rows. 101 * 102 * <p> 103 * 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. 104 * </p> 105 * 106 * @param dynamicQuery the dynamic query 107 * @param start the lower bound of the range of model instances 108 * @param end the upper bound of the range of model instances (not inclusive) 109 * @return the range of matching rows 110 * @throws SystemException if a system exception occurred 111 */ 112 @SuppressWarnings("rawtypes") 113 public java.util.List dynamicQuery( 114 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 115 int end) throws com.liferay.portal.kernel.exception.SystemException; 116 117 /** 118 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 119 * 120 * <p> 121 * 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. 122 * </p> 123 * 124 * @param dynamicQuery the dynamic query 125 * @param start the lower bound of the range of model instances 126 * @param end the upper bound of the range of model instances (not inclusive) 127 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 128 * @return the ordered range of matching rows 129 * @throws SystemException if a system exception occurred 130 */ 131 @SuppressWarnings("rawtypes") 132 public java.util.List dynamicQuery( 133 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 134 int end, 135 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 136 throws com.liferay.portal.kernel.exception.SystemException; 137 138 /** 139 * Returns the number of rows that match the dynamic query. 140 * 141 * @param dynamicQuery the dynamic query 142 * @return the number of rows that match the dynamic query 143 * @throws SystemException if a system exception occurred 144 */ 145 public long dynamicQueryCount( 146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 147 throws com.liferay.portal.kernel.exception.SystemException; 148 149 /** 150 * Returns the social request with the primary key. 151 * 152 * @param requestId the primary key of the social request 153 * @return the social request 154 * @throws PortalException if a social request with the primary key could not be found 155 * @throws SystemException if a system exception occurred 156 */ 157 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 158 public com.liferay.portlet.social.model.SocialRequest getSocialRequest( 159 long requestId) 160 throws com.liferay.portal.kernel.exception.PortalException, 161 com.liferay.portal.kernel.exception.SystemException; 162 163 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 164 public com.liferay.portal.model.PersistedModel getPersistedModel( 165 java.io.Serializable primaryKeyObj) 166 throws com.liferay.portal.kernel.exception.PortalException, 167 com.liferay.portal.kernel.exception.SystemException; 168 169 /** 170 * Returns the social request with the UUID in the group. 171 * 172 * @param uuid the UUID of social request 173 * @param groupId the group id of the social request 174 * @return the social request 175 * @throws PortalException if a social request with the UUID in the group could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 179 public com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId( 180 java.lang.String uuid, long groupId) 181 throws com.liferay.portal.kernel.exception.PortalException, 182 com.liferay.portal.kernel.exception.SystemException; 183 184 /** 185 * Returns a range of all the social requests. 186 * 187 * <p> 188 * 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. 189 * </p> 190 * 191 * @param start the lower bound of the range of social requests 192 * @param end the upper bound of the range of social requests (not inclusive) 193 * @return the range of social requests 194 * @throws SystemException if a system exception occurred 195 */ 196 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 197 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests( 198 int start, int end) 199 throws com.liferay.portal.kernel.exception.SystemException; 200 201 /** 202 * Returns the number of social requests. 203 * 204 * @return the number of social requests 205 * @throws SystemException if a system exception occurred 206 */ 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public int getSocialRequestsCount() 209 throws com.liferay.portal.kernel.exception.SystemException; 210 211 /** 212 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 213 * 214 * @param socialRequest the social request 215 * @return the social request that was updated 216 * @throws SystemException if a system exception occurred 217 */ 218 public com.liferay.portlet.social.model.SocialRequest updateSocialRequest( 219 com.liferay.portlet.social.model.SocialRequest socialRequest) 220 throws com.liferay.portal.kernel.exception.SystemException; 221 222 /** 223 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 224 * 225 * @param socialRequest the social request 226 * @param merge whether to merge the social request with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 227 * @return the social request that was updated 228 * @throws SystemException if a system exception occurred 229 */ 230 public com.liferay.portlet.social.model.SocialRequest updateSocialRequest( 231 com.liferay.portlet.social.model.SocialRequest socialRequest, 232 boolean merge) 233 throws com.liferay.portal.kernel.exception.SystemException; 234 235 /** 236 * Returns the Spring bean ID for this bean. 237 * 238 * @return the Spring bean ID for this bean 239 */ 240 public java.lang.String getBeanIdentifier(); 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 void setBeanIdentifier(java.lang.String beanIdentifier); 248 249 /** 250 * Adds a social request to the database. 251 * 252 * <p> 253 * In order to add a social request, both the requesting user and the 254 * receiving user must be from the same company and neither of them can be 255 * the default user. 256 * </p> 257 * 258 * @param userId the primary key of the requesting user 259 * @param groupId the primary key of the group 260 * @param className the class name of the asset that is the subject of the 261 request 262 * @param classPK the primary key of the asset that is the subject of the 263 request 264 * @param type the request's type 265 * @param extraData the extra data regarding the request 266 * @param receiverUserId the primary key of the user receiving the request 267 * @return the social request 268 * @throws PortalException if the users could not be found, if the users 269 were not from the same company, or if either of the users was 270 the default user 271 * @throws SystemException if a system exception occurred 272 */ 273 public com.liferay.portlet.social.model.SocialRequest addRequest( 274 long userId, long groupId, java.lang.String className, long classPK, 275 int type, java.lang.String extraData, long receiverUserId) 276 throws com.liferay.portal.kernel.exception.PortalException, 277 com.liferay.portal.kernel.exception.SystemException; 278 279 /** 280 * Removes all the social requests for the receiving user. 281 * 282 * @param receiverUserId the primary key of the receiving user 283 * @throws SystemException if a system exception occurred 284 */ 285 public void deleteReceiverUserRequests(long receiverUserId) 286 throws com.liferay.portal.kernel.exception.SystemException; 287 288 /** 289 * Removes the social request identified by its primary key from the 290 * database. 291 * 292 * @param requestId the primary key of the social request 293 * @throws PortalException if the social request could not be found 294 * @throws SystemException if a system exception occurred 295 */ 296 public void deleteRequest(long requestId) 297 throws com.liferay.portal.kernel.exception.PortalException, 298 com.liferay.portal.kernel.exception.SystemException; 299 300 /** 301 * Removes the social request from the database. 302 * 303 * @param request the social request to be removed 304 * @throws SystemException if a system exception occurred 305 */ 306 public void deleteRequest( 307 com.liferay.portlet.social.model.SocialRequest request) 308 throws com.liferay.portal.kernel.exception.SystemException; 309 310 /** 311 * Removes all the social requests for the requesting user. 312 * 313 * @param userId the primary key of the requesting user 314 * @throws SystemException if a system exception occurred 315 */ 316 public void deleteUserRequests(long userId) 317 throws com.liferay.portal.kernel.exception.SystemException; 318 319 /** 320 * Returns a range of all the social requests for the receiving user. 321 * 322 * <p> 323 * Useful when paginating results. Returns a maximum of <code>end - 324 * start</code> instances. <code>start</code> and <code>end</code> are not 325 * primary keys, they are indexes in the result set. Thus, <code>0</code> 326 * refers to the first result in the set. Setting both <code>start</code> 327 * and <code>end</code> to {@link 328 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 329 * full result set. 330 * </p> 331 * 332 * @param receiverUserId the primary key of the receiving user 333 * @param start the lower bound of the range of results 334 * @param end the upper bound of the range of results (not inclusive) 335 * @return the range of matching social requests 336 * @throws SystemException if a system exception occurred 337 */ 338 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 339 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 340 long receiverUserId, int start, int end) 341 throws com.liferay.portal.kernel.exception.SystemException; 342 343 /** 344 * Returns a range of all the social requests with the given status for the 345 * receiving user. 346 * 347 * <p> 348 * Useful when paginating results. Returns a maximum of <code>end - 349 * start</code> instances. <code>start</code> and <code>end</code> are not 350 * primary keys, they are indexes in the result set. Thus, <code>0</code> 351 * refers to the first result in the set. Setting both <code>start</code> 352 * and <code>end</code> to {@link 353 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 354 * full result set. 355 * </p> 356 * 357 * @param receiverUserId the primary key of the receiving user 358 * @param status the social request's status 359 * @param start the lower bound of the range of results 360 * @param end the upper bound of the range of results (not inclusive) 361 * @return the range of matching social requests 362 * @throws SystemException if a system exception occurred 363 */ 364 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 365 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 366 long receiverUserId, int status, int start, int end) 367 throws com.liferay.portal.kernel.exception.SystemException; 368 369 /** 370 * Returns the number of social requests for the receiving user. 371 * 372 * @param receiverUserId the primary key of the receiving user 373 * @return the number of matching social requests 374 * @throws SystemException if a system exception occurred 375 */ 376 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 377 public int getReceiverUserRequestsCount(long receiverUserId) 378 throws com.liferay.portal.kernel.exception.SystemException; 379 380 /** 381 * Returns the number of social requests with the given status for the 382 * receiving user. 383 * 384 * @param receiverUserId the primary key of the receiving user 385 * @param status the social request's status 386 * @return the number of matching social requests 387 * @throws SystemException if a system exception occurred 388 */ 389 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 390 public int getReceiverUserRequestsCount(long receiverUserId, int status) 391 throws com.liferay.portal.kernel.exception.SystemException; 392 393 /** 394 * Returns a range of all the social requests for the requesting user. 395 * 396 * <p> 397 * Useful when paginating results. Returns a maximum of <code>end - 398 * start</code> instances. <code>start</code> and <code>end</code> are not 399 * primary keys, they are indexes in the result set. Thus, <code>0</code> 400 * refers to the first result in the set. Setting both <code>start</code> 401 * and <code>end</code> to {@link 402 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 403 * full result set. 404 * </p> 405 * 406 * @param userId the primary key of the requesting user 407 * @param start the lower bound of the range of results 408 * @param end the upper bound of the range of results (not inclusive) 409 * @return the range of matching social requests 410 * @throws SystemException if a system exception occurred 411 */ 412 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 413 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 414 long userId, int start, int end) 415 throws com.liferay.portal.kernel.exception.SystemException; 416 417 /** 418 * Returns a range of all the social requests with the given status for the 419 * requesting user. 420 * 421 * <p> 422 * Useful when paginating results. Returns a maximum of <code>end - 423 * start</code> instances. <code>start</code> and <code>end</code> are not 424 * primary keys, they are indexes in the result set. Thus, <code>0</code> 425 * refers to the first result in the set. Setting both <code>start</code> 426 * and <code>end</code> to {@link 427 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 428 * full result set. 429 * </p> 430 * 431 * @param userId the primary key of the requesting user 432 * @param status the social request's status 433 * @param start the lower bound of the range of results 434 * @param end the upper bound of the range of results (not inclusive) 435 * @return the range of matching social requests 436 * @throws SystemException if a system exception occurred 437 */ 438 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 439 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 440 long userId, int status, int start, int end) 441 throws com.liferay.portal.kernel.exception.SystemException; 442 443 /** 444 * Returns the number of social requests for the requesting user. 445 * 446 * @param userId the primary key of the requesting user 447 * @return the number of matching social requests 448 * @throws SystemException if a system exception occurred 449 */ 450 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 451 public int getUserRequestsCount(long userId) 452 throws com.liferay.portal.kernel.exception.SystemException; 453 454 /** 455 * Returns the number of social requests with the given status for the 456 * requesting user. 457 * 458 * @param userId the primary key of the requesting user 459 * @param status the social request's status 460 * @return the number of matching social request 461 * @throws SystemException if a system exception occurred 462 */ 463 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 464 public int getUserRequestsCount(long userId, int status) 465 throws com.liferay.portal.kernel.exception.SystemException; 466 467 /** 468 * Returns <code>true</code> if a matching social requests exists in the 469 * database. 470 * 471 * @param userId the primary key of the requesting user 472 * @param className the class name of the asset that is the subject of the 473 request 474 * @param classPK the primary key of the asset that is the subject of the 475 request 476 * @param type the request's type 477 * @param status the social request's status 478 * @return <code>true</code> if the request exists; <code>false</code> 479 otherwise 480 * @throws SystemException if a system exception occurred 481 */ 482 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 483 public boolean hasRequest(long userId, java.lang.String className, 484 long classPK, int type, int status) 485 throws com.liferay.portal.kernel.exception.SystemException; 486 487 /** 488 * Returns <code>true</code> if a matching social request exists in the 489 * database. 490 * 491 * @param userId the primary key of the requesting user 492 * @param className the class name of the asset that is the subject of the 493 request 494 * @param classPK the primary key of the asset that is the subject of the 495 request 496 * @param type the request's type 497 * @param receiverUserId the primary key of the receiving user 498 * @param status the social request's status 499 * @return <code>true</code> if the social request exists; 500 <code>false</code> otherwise 501 * @throws SystemException if a system exception occurred 502 */ 503 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 504 public boolean hasRequest(long userId, java.lang.String className, 505 long classPK, int type, long receiverUserId, int status) 506 throws com.liferay.portal.kernel.exception.SystemException; 507 508 /** 509 * Updates the social request replacing its status. 510 * 511 * <p> 512 * If the status is updated to {@link 513 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM} 514 * then {@link 515 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation( 516 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 517 * {@link 518 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE} 519 * then {@link 520 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection( 521 * SocialRequest, ThemeDisplay)} is called. 522 * </p> 523 * 524 * @param requestId the primary key of the social request 525 * @param status the new status 526 * @param themeDisplay the theme display 527 * @return the updated social request 528 * @throws PortalException if the social request could not be found 529 * @throws SystemException if a system exception occurred 530 */ 531 public com.liferay.portlet.social.model.SocialRequest updateRequest( 532 long requestId, int status, 533 com.liferay.portal.theme.ThemeDisplay themeDisplay) 534 throws com.liferay.portal.kernel.exception.PortalException, 535 com.liferay.portal.kernel.exception.SystemException; 536 }