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