001 /** 002 * Copyright (c) 2000-2012 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 150 public com.liferay.portlet.social.model.SocialRequest fetchSocialRequest( 151 long requestId) 152 throws com.liferay.portal.kernel.exception.SystemException; 153 154 /** 155 * Returns the social request with the primary key. 156 * 157 * @param requestId the primary key of the social request 158 * @return the social request 159 * @throws PortalException if a social request with the primary key could not be found 160 * @throws SystemException if a system exception occurred 161 */ 162 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 163 public com.liferay.portlet.social.model.SocialRequest getSocialRequest( 164 long requestId) 165 throws com.liferay.portal.kernel.exception.PortalException, 166 com.liferay.portal.kernel.exception.SystemException; 167 168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 169 public com.liferay.portal.model.PersistedModel getPersistedModel( 170 java.io.Serializable primaryKeyObj) 171 throws com.liferay.portal.kernel.exception.PortalException, 172 com.liferay.portal.kernel.exception.SystemException; 173 174 /** 175 * Returns the social request with the UUID in the group. 176 * 177 * @param uuid the UUID of social request 178 * @param groupId the group id of the social request 179 * @return the social request 180 * @throws PortalException if a social request with the UUID in the group could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId( 185 java.lang.String uuid, long groupId) 186 throws com.liferay.portal.kernel.exception.PortalException, 187 com.liferay.portal.kernel.exception.SystemException; 188 189 /** 190 * Returns a range of all the social requests. 191 * 192 * <p> 193 * 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. 194 * </p> 195 * 196 * @param start the lower bound of the range of social requests 197 * @param end the upper bound of the range of social requests (not inclusive) 198 * @return the range of social requests 199 * @throws SystemException if a system exception occurred 200 */ 201 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 202 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests( 203 int start, int end) 204 throws com.liferay.portal.kernel.exception.SystemException; 205 206 /** 207 * Returns the number of social requests. 208 * 209 * @return the number of social requests 210 * @throws SystemException if a system exception occurred 211 */ 212 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 213 public int getSocialRequestsCount() 214 throws com.liferay.portal.kernel.exception.SystemException; 215 216 /** 217 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 218 * 219 * @param socialRequest the social request 220 * @return the social request that was updated 221 * @throws SystemException if a system exception occurred 222 */ 223 public com.liferay.portlet.social.model.SocialRequest updateSocialRequest( 224 com.liferay.portlet.social.model.SocialRequest socialRequest) 225 throws com.liferay.portal.kernel.exception.SystemException; 226 227 /** 228 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 229 * 230 * @param socialRequest the social request 231 * @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. 232 * @return the social request that was updated 233 * @throws SystemException if a system exception occurred 234 */ 235 public com.liferay.portlet.social.model.SocialRequest updateSocialRequest( 236 com.liferay.portlet.social.model.SocialRequest socialRequest, 237 boolean merge) 238 throws com.liferay.portal.kernel.exception.SystemException; 239 240 /** 241 * Returns the Spring bean ID for this bean. 242 * 243 * @return the Spring bean ID for this bean 244 */ 245 public java.lang.String getBeanIdentifier(); 246 247 /** 248 * Sets the Spring bean ID for this bean. 249 * 250 * @param beanIdentifier the Spring bean ID for this bean 251 */ 252 public void setBeanIdentifier(java.lang.String beanIdentifier); 253 254 /** 255 * Adds a social request to the database. 256 * 257 * <p> 258 * In order to add a social request, both the requesting user and the 259 * receiving user must be from the same company and neither of them can be 260 * the default user. 261 * </p> 262 * 263 * @param userId the primary key of the requesting user 264 * @param groupId the primary key of the group 265 * @param className the class name of the asset that is the subject of the 266 request 267 * @param classPK the primary key of the asset that is the subject of the 268 request 269 * @param type the request's type 270 * @param extraData the extra data regarding the request 271 * @param receiverUserId the primary key of the user receiving the request 272 * @return the social request 273 * @throws PortalException if the users could not be found, if the users 274 were not from the same company, or if either of the users was the 275 default user 276 * @throws SystemException if a system exception occurred 277 */ 278 public com.liferay.portlet.social.model.SocialRequest addRequest( 279 long userId, long groupId, java.lang.String className, long classPK, 280 int type, java.lang.String extraData, long receiverUserId) 281 throws com.liferay.portal.kernel.exception.PortalException, 282 com.liferay.portal.kernel.exception.SystemException; 283 284 /** 285 * Removes all the social requests for the receiving user. 286 * 287 * @param receiverUserId the primary key of the receiving user 288 * @throws SystemException if a system exception occurred 289 */ 290 public void deleteReceiverUserRequests(long receiverUserId) 291 throws com.liferay.portal.kernel.exception.SystemException; 292 293 /** 294 * Removes the social request identified by its primary key from the 295 * database. 296 * 297 * @param requestId the primary key of the social request 298 * @throws PortalException if the social request could not be found 299 * @throws SystemException if a system exception occurred 300 */ 301 public void deleteRequest(long requestId) 302 throws com.liferay.portal.kernel.exception.PortalException, 303 com.liferay.portal.kernel.exception.SystemException; 304 305 /** 306 * Removes the social request from the database. 307 * 308 * @param request the social request to be removed 309 * @throws SystemException if a system exception occurred 310 */ 311 public void deleteRequest( 312 com.liferay.portlet.social.model.SocialRequest request) 313 throws com.liferay.portal.kernel.exception.SystemException; 314 315 /** 316 * Removes all the social requests for the requesting user. 317 * 318 * @param userId the primary key of the requesting user 319 * @throws SystemException if a system exception occurred 320 */ 321 public void deleteUserRequests(long userId) 322 throws com.liferay.portal.kernel.exception.SystemException; 323 324 /** 325 * Returns a range of all the social requests for the receiving user. 326 * 327 * <p> 328 * Useful when paginating results. Returns a maximum of <code>end - 329 * start</code> instances. <code>start</code> and <code>end</code> are not 330 * primary keys, they are indexes in the result set. Thus, <code>0</code> 331 * refers to the first result in the set. Setting both <code>start</code> 332 * and <code>end</code> to {@link 333 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 334 * result set. 335 * </p> 336 * 337 * @param receiverUserId the primary key of the receiving user 338 * @param start the lower bound of the range of results 339 * @param end the upper bound of the range of results (not inclusive) 340 * @return the range of matching social requests 341 * @throws SystemException if a system exception occurred 342 */ 343 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 344 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 345 long receiverUserId, int start, int end) 346 throws com.liferay.portal.kernel.exception.SystemException; 347 348 /** 349 * Returns a range of all the social requests with the given status for the 350 * receiving user. 351 * 352 * <p> 353 * Useful when paginating results. Returns a maximum of <code>end - 354 * start</code> instances. <code>start</code> and <code>end</code> are not 355 * primary keys, they are indexes in the result set. Thus, <code>0</code> 356 * refers to the first result in the set. Setting both <code>start</code> 357 * and <code>end</code> to {@link 358 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 359 * result set. 360 * </p> 361 * 362 * @param receiverUserId the primary key of the receiving user 363 * @param status the social request's status 364 * @param start the lower bound of the range of results 365 * @param end the upper bound of the range of results (not inclusive) 366 * @return the range of matching social requests 367 * @throws SystemException if a system exception occurred 368 */ 369 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 370 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 371 long receiverUserId, int status, int start, int end) 372 throws com.liferay.portal.kernel.exception.SystemException; 373 374 /** 375 * Returns the number of social requests for the receiving user. 376 * 377 * @param receiverUserId the primary key of the receiving user 378 * @return the number of matching social requests 379 * @throws SystemException if a system exception occurred 380 */ 381 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 382 public int getReceiverUserRequestsCount(long receiverUserId) 383 throws com.liferay.portal.kernel.exception.SystemException; 384 385 /** 386 * Returns the number of social requests with the given status for the 387 * receiving user. 388 * 389 * @param receiverUserId the primary key of the receiving user 390 * @param status the social request's status 391 * @return the number of matching social requests 392 * @throws SystemException if a system exception occurred 393 */ 394 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 395 public int getReceiverUserRequestsCount(long receiverUserId, int status) 396 throws com.liferay.portal.kernel.exception.SystemException; 397 398 /** 399 * Returns a range of all the social requests for the requesting user. 400 * 401 * <p> 402 * Useful when paginating results. Returns a maximum of <code>end - 403 * start</code> instances. <code>start</code> and <code>end</code> are not 404 * primary keys, they are indexes in the result set. Thus, <code>0</code> 405 * refers to the first result in the set. Setting both <code>start</code> 406 * and <code>end</code> to {@link 407 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 408 * result set. 409 * </p> 410 * 411 * @param userId the primary key of the requesting user 412 * @param start the lower bound of the range of results 413 * @param end the upper bound of the range of results (not inclusive) 414 * @return the range of matching social requests 415 * @throws SystemException if a system exception occurred 416 */ 417 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 418 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 419 long userId, int start, int end) 420 throws com.liferay.portal.kernel.exception.SystemException; 421 422 /** 423 * Returns a range of all the social requests with the given status for the 424 * requesting user. 425 * 426 * <p> 427 * Useful when paginating results. Returns a maximum of <code>end - 428 * start</code> instances. <code>start</code> and <code>end</code> are not 429 * primary keys, they are indexes in the result set. Thus, <code>0</code> 430 * refers to the first result in the set. Setting both <code>start</code> 431 * and <code>end</code> to {@link 432 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 433 * result set. 434 * </p> 435 * 436 * @param userId the primary key of the requesting user 437 * @param status the social request's status 438 * @param start the lower bound of the range of results 439 * @param end the upper bound of the range of results (not inclusive) 440 * @return the range of matching social requests 441 * @throws SystemException if a system exception occurred 442 */ 443 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 444 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 445 long userId, int status, int start, int end) 446 throws com.liferay.portal.kernel.exception.SystemException; 447 448 /** 449 * Returns the number of social requests for the requesting user. 450 * 451 * @param userId the primary key of the requesting user 452 * @return the number of matching social requests 453 * @throws SystemException if a system exception occurred 454 */ 455 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 456 public int getUserRequestsCount(long userId) 457 throws com.liferay.portal.kernel.exception.SystemException; 458 459 /** 460 * Returns the number of social requests with the given status for the 461 * requesting user. 462 * 463 * @param userId the primary key of the requesting user 464 * @param status the social request's status 465 * @return the number of matching social request 466 * @throws SystemException if a system exception occurred 467 */ 468 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 469 public int getUserRequestsCount(long userId, int status) 470 throws com.liferay.portal.kernel.exception.SystemException; 471 472 /** 473 * Returns <code>true</code> if a matching social requests exists in the 474 * database. 475 * 476 * @param userId the primary key of the requesting user 477 * @param className the class name of the asset that is the subject of the 478 request 479 * @param classPK the primary key of the asset that is the subject of the 480 request 481 * @param type the request's type 482 * @param status the social request's status 483 * @return <code>true</code> if the request exists; <code>false</code> 484 otherwise 485 * @throws SystemException if a system exception occurred 486 */ 487 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 488 public boolean hasRequest(long userId, java.lang.String className, 489 long classPK, int type, int status) 490 throws com.liferay.portal.kernel.exception.SystemException; 491 492 /** 493 * Returns <code>true</code> if a matching social request exists in the 494 * database. 495 * 496 * @param userId the primary key of the requesting user 497 * @param className the class name of the asset that is the subject of the 498 request 499 * @param classPK the primary key of the asset that is the subject of the 500 request 501 * @param type the request's type 502 * @param receiverUserId the primary key of the receiving user 503 * @param status the social request's status 504 * @return <code>true</code> if the social request exists; 505 <code>false</code> otherwise 506 * @throws SystemException if a system exception occurred 507 */ 508 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 509 public boolean hasRequest(long userId, java.lang.String className, 510 long classPK, int type, long receiverUserId, int status) 511 throws com.liferay.portal.kernel.exception.SystemException; 512 513 /** 514 * Updates the social request replacing its status. 515 * 516 * <p> 517 * If the status is updated to {@link 518 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM} 519 * then {@link 520 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation( 521 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 522 * {@link 523 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE} 524 * then {@link 525 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection( 526 * SocialRequest, ThemeDisplay)} is called. 527 * </p> 528 * 529 * @param requestId the primary key of the social request 530 * @param status the new status 531 * @param themeDisplay the theme display 532 * @return the updated social request 533 * @throws PortalException if the social request could not be found 534 * @throws SystemException if a system exception occurred 535 */ 536 public com.liferay.portlet.social.model.SocialRequest updateRequest( 537 long requestId, int status, 538 com.liferay.portal.theme.ThemeDisplay themeDisplay) 539 throws com.liferay.portal.kernel.exception.PortalException, 540 com.liferay.portal.kernel.exception.SystemException; 541 }