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.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. 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.portlet.social.model.impl.SocialRequestModelImpl}. 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. 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. 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.portlet.social.model.impl.SocialRequestModelImpl}. 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. 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. 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.portlet.social.model.impl.SocialRequestModelImpl}. 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. 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 * Returns the Spring bean ID for this bean. 236 * 237 * @return the Spring bean ID for this bean 238 */ 239 public java.lang.String getBeanIdentifier(); 240 241 /** 242 * Sets the Spring bean ID for this bean. 243 * 244 * @param beanIdentifier the Spring bean ID for this bean 245 */ 246 public void setBeanIdentifier(java.lang.String beanIdentifier); 247 248 /** 249 * Adds a social request to the database. 250 * 251 * <p> 252 * In order to add a social request, both the requesting user and the 253 * receiving user must be from the same company and neither of them can be 254 * the default user. 255 * </p> 256 * 257 * @param userId the primary key of the requesting user 258 * @param groupId the primary key of the group 259 * @param className the class name of the asset that is the subject of the 260 request 261 * @param classPK the primary key of the asset that is the subject of the 262 request 263 * @param type the request's type 264 * @param extraData the extra data regarding the request 265 * @param receiverUserId the primary key of the user receiving the request 266 * @return the social request 267 * @throws PortalException if the users could not be found, if the users 268 were not from the same company, or if either of the users was the 269 default user 270 * @throws SystemException if a system exception occurred 271 */ 272 public com.liferay.portlet.social.model.SocialRequest addRequest( 273 long userId, long groupId, java.lang.String className, long classPK, 274 int type, java.lang.String extraData, long receiverUserId) 275 throws com.liferay.portal.kernel.exception.PortalException, 276 com.liferay.portal.kernel.exception.SystemException; 277 278 /** 279 * Removes all the social requests for the receiving user. 280 * 281 * @param receiverUserId the primary key of the receiving user 282 * @throws SystemException if a system exception occurred 283 */ 284 public void deleteReceiverUserRequests(long receiverUserId) 285 throws com.liferay.portal.kernel.exception.SystemException; 286 287 /** 288 * Removes the social request identified by its primary key from the 289 * database. 290 * 291 * @param requestId the primary key of the social request 292 * @throws PortalException if the social request could not be found 293 * @throws SystemException if a system exception occurred 294 */ 295 public void deleteRequest(long requestId) 296 throws com.liferay.portal.kernel.exception.PortalException, 297 com.liferay.portal.kernel.exception.SystemException; 298 299 /** 300 * Removes the social request from the database. 301 * 302 * @param request the social request to be removed 303 * @throws SystemException if a system exception occurred 304 */ 305 public void deleteRequest( 306 com.liferay.portlet.social.model.SocialRequest request) 307 throws com.liferay.portal.kernel.exception.SystemException; 308 309 /** 310 * Removes all the social requests for the requesting user. 311 * 312 * @param userId the primary key of the requesting user 313 * @throws SystemException if a system exception occurred 314 */ 315 public void deleteUserRequests(long userId) 316 throws com.liferay.portal.kernel.exception.SystemException; 317 318 /** 319 * Returns a range of all the social requests for the receiving user. 320 * 321 * <p> 322 * Useful when paginating results. Returns a maximum of <code>end - 323 * start</code> instances. <code>start</code> and <code>end</code> are not 324 * primary keys, they are indexes in the result set. Thus, <code>0</code> 325 * refers to the first result in the set. Setting both <code>start</code> 326 * and <code>end</code> to {@link 327 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 328 * result set. 329 * </p> 330 * 331 * @param receiverUserId the primary key of the receiving user 332 * @param start the lower bound of the range of results 333 * @param end the upper bound of the range of results (not inclusive) 334 * @return the range of matching social requests 335 * @throws SystemException if a system exception occurred 336 */ 337 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 338 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 339 long receiverUserId, int start, int end) 340 throws com.liferay.portal.kernel.exception.SystemException; 341 342 /** 343 * Returns a range of all the social requests with the given status for the 344 * receiving user. 345 * 346 * <p> 347 * Useful when paginating results. Returns a maximum of <code>end - 348 * start</code> instances. <code>start</code> and <code>end</code> are not 349 * primary keys, they are indexes in the result set. Thus, <code>0</code> 350 * refers to the first result in the set. Setting both <code>start</code> 351 * and <code>end</code> to {@link 352 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 353 * result set. 354 * </p> 355 * 356 * @param receiverUserId the primary key of the receiving user 357 * @param status the social request's status 358 * @param start the lower bound of the range of results 359 * @param end the upper bound of the range of results (not inclusive) 360 * @return the range of matching social requests 361 * @throws SystemException if a system exception occurred 362 */ 363 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 364 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 365 long receiverUserId, int status, int start, int end) 366 throws com.liferay.portal.kernel.exception.SystemException; 367 368 /** 369 * Returns the number of social requests for the receiving user. 370 * 371 * @param receiverUserId the primary key of the receiving user 372 * @return the number of matching social requests 373 * @throws SystemException if a system exception occurred 374 */ 375 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 376 public int getReceiverUserRequestsCount(long receiverUserId) 377 throws com.liferay.portal.kernel.exception.SystemException; 378 379 /** 380 * Returns the number of social requests with the given status for the 381 * receiving user. 382 * 383 * @param receiverUserId the primary key of the receiving user 384 * @param status the social request's status 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, int status) 390 throws com.liferay.portal.kernel.exception.SystemException; 391 392 /** 393 * Returns a range of all the social requests for the requesting user. 394 * 395 * <p> 396 * Useful when paginating results. Returns a maximum of <code>end - 397 * start</code> instances. <code>start</code> and <code>end</code> are not 398 * primary keys, they are indexes in the result set. Thus, <code>0</code> 399 * refers to the first result in the set. Setting both <code>start</code> 400 * and <code>end</code> to {@link 401 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 402 * result set. 403 * </p> 404 * 405 * @param userId the primary key of the requesting user 406 * @param start the lower bound of the range of results 407 * @param end the upper bound of the range of results (not inclusive) 408 * @return the range of matching social requests 409 * @throws SystemException if a system exception occurred 410 */ 411 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 412 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 413 long userId, int start, int end) 414 throws com.liferay.portal.kernel.exception.SystemException; 415 416 /** 417 * Returns a range of all the social requests with the given status for the 418 * requesting user. 419 * 420 * <p> 421 * Useful when paginating results. Returns a maximum of <code>end - 422 * start</code> instances. <code>start</code> and <code>end</code> are not 423 * primary keys, they are indexes in the result set. Thus, <code>0</code> 424 * refers to the first result in the set. Setting both <code>start</code> 425 * and <code>end</code> to {@link 426 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 427 * result set. 428 * </p> 429 * 430 * @param userId the primary key of the requesting user 431 * @param status the social request's status 432 * @param start the lower bound of the range of results 433 * @param end the upper bound of the range of results (not inclusive) 434 * @return the range of matching social requests 435 * @throws SystemException if a system exception occurred 436 */ 437 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 438 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 439 long userId, int status, int start, int end) 440 throws com.liferay.portal.kernel.exception.SystemException; 441 442 /** 443 * Returns the number of social requests for the requesting user. 444 * 445 * @param userId the primary key of the requesting user 446 * @return the number of matching social requests 447 * @throws SystemException if a system exception occurred 448 */ 449 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 450 public int getUserRequestsCount(long userId) 451 throws com.liferay.portal.kernel.exception.SystemException; 452 453 /** 454 * Returns the number of social requests with the given status for the 455 * requesting user. 456 * 457 * @param userId the primary key of the requesting user 458 * @param status the social request's status 459 * @return the number of matching social request 460 * @throws SystemException if a system exception occurred 461 */ 462 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 463 public int getUserRequestsCount(long userId, int status) 464 throws com.liferay.portal.kernel.exception.SystemException; 465 466 /** 467 * Returns <code>true</code> if a matching social requests exists in the 468 * database. 469 * 470 * @param userId the primary key of the requesting user 471 * @param className the class name of the asset that is the subject of the 472 request 473 * @param classPK the primary key of the asset that is the subject of the 474 request 475 * @param type the request's type 476 * @param status the social request's status 477 * @return <code>true</code> if the request exists; <code>false</code> 478 otherwise 479 * @throws SystemException if a system exception occurred 480 */ 481 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 482 public boolean hasRequest(long userId, java.lang.String className, 483 long classPK, int type, int status) 484 throws com.liferay.portal.kernel.exception.SystemException; 485 486 /** 487 * Returns <code>true</code> if a matching social request exists in the 488 * database. 489 * 490 * @param userId the primary key of the requesting user 491 * @param className the class name of the asset that is the subject of the 492 request 493 * @param classPK the primary key of the asset that is the subject of the 494 request 495 * @param type the request's type 496 * @param receiverUserId the primary key of the receiving user 497 * @param status the social request's status 498 * @return <code>true</code> if the social request exists; 499 <code>false</code> otherwise 500 * @throws SystemException if a system exception occurred 501 */ 502 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 503 public boolean hasRequest(long userId, java.lang.String className, 504 long classPK, int type, long receiverUserId, int status) 505 throws com.liferay.portal.kernel.exception.SystemException; 506 507 /** 508 * Updates the social request replacing its status. 509 * 510 * <p> 511 * If the status is updated to {@link 512 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM} 513 * then {@link 514 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation( 515 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 516 * {@link 517 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE} 518 * then {@link 519 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection( 520 * SocialRequest, ThemeDisplay)} is called. 521 * </p> 522 * 523 * @param requestId the primary key of the social request 524 * @param status the new status 525 * @param themeDisplay the theme display 526 * @return the updated social request 527 * @throws PortalException if the social request could not be found 528 * @throws SystemException if a system exception occurred 529 */ 530 public com.liferay.portlet.social.model.SocialRequest updateRequest( 531 long requestId, int status, 532 com.liferay.portal.theme.ThemeDisplay themeDisplay) 533 throws com.liferay.portal.kernel.exception.PortalException, 534 com.liferay.portal.kernel.exception.SystemException; 535 }