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