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 that match the dynamic query. 209 * 210 * @param dynamicQuery the dynamic query 211 * @return the number of rows that match 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 that match 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 that match 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 365 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 366 java.lang.String uuid, long companyId); 367 368 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 369 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 370 java.lang.String uuid, long companyId, int start, int end, 371 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.social.model.SocialRequest> orderByComparator); 372 373 /** 374 * Returns the number of social requests. 375 * 376 * @return the number of social requests 377 */ 378 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 379 public int getSocialRequestsCount(); 380 381 /** 382 * Returns a range of all the social requests for the requesting user. 383 * 384 * <p> 385 * Useful when paginating results. Returns a maximum of <code>end - 386 * start</code> instances. <code>start</code> and <code>end</code> are not 387 * primary keys, they are indexes in the result set. Thus, <code>0</code> 388 * refers to the first result in the set. Setting both <code>start</code> 389 * and <code>end</code> to {@link 390 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 391 * result set. 392 * </p> 393 * 394 * @param userId the primary key of the requesting user 395 * @param start the lower bound of the range of results 396 * @param end the upper bound of the range of results (not inclusive) 397 * @return the range of matching social requests 398 */ 399 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 400 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 401 long userId, int start, int end); 402 403 /** 404 * Returns a range of all the social requests with the given status for the 405 * requesting user. 406 * 407 * <p> 408 * Useful when paginating results. Returns a maximum of <code>end - 409 * start</code> instances. <code>start</code> and <code>end</code> are not 410 * primary keys, they are indexes in the result set. Thus, <code>0</code> 411 * refers to the first result in the set. Setting both <code>start</code> 412 * and <code>end</code> to {@link 413 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 414 * result set. 415 * </p> 416 * 417 * @param userId the primary key of the requesting user 418 * @param status the social request's status 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 */ 423 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 424 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 425 long userId, int status, int start, int end); 426 427 /** 428 * Returns the number of social requests for the requesting user. 429 * 430 * @param userId the primary key of the requesting user 431 * @return the number of matching social requests 432 */ 433 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 434 public int getUserRequestsCount(long userId); 435 436 /** 437 * Returns the number of social requests with the given status for the 438 * requesting user. 439 * 440 * @param userId the primary key of the requesting user 441 * @param status the social request's status 442 * @return the number of matching social request 443 */ 444 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 445 public int getUserRequestsCount(long userId, int status); 446 447 /** 448 * Returns <code>true</code> if a matching social request exists in the 449 * database. 450 * 451 * @param userId the primary key of the requesting user 452 * @param className the class name of the asset that is the subject of the 453 request 454 * @param classPK the primary key of the asset that is the subject of the 455 request 456 * @param type the request's type 457 * @param receiverUserId the primary key of the receiving user 458 * @param status the social request's status 459 * @return <code>true</code> if the social request exists; 460 <code>false</code> otherwise 461 */ 462 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 463 public boolean hasRequest(long userId, java.lang.String className, 464 long classPK, int type, long receiverUserId, int status); 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 */ 480 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 481 public boolean hasRequest(long userId, java.lang.String className, 482 long classPK, int type, int status); 483 484 /** 485 * Sets the Spring bean ID for this bean. 486 * 487 * @param beanIdentifier the Spring bean ID for this bean 488 */ 489 public void setBeanIdentifier(java.lang.String beanIdentifier); 490 491 /** 492 * Updates the social request replacing its status. 493 * 494 * <p> 495 * If the status is updated to {@link 496 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM} 497 * then {@link 498 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation( 499 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 500 * {@link 501 * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE} 502 * then {@link 503 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection( 504 * SocialRequest, ThemeDisplay)} is called. 505 * </p> 506 * 507 * @param requestId the primary key of the social request 508 * @param status the new status 509 * @param themeDisplay the theme display 510 * @return the updated social request 511 * @throws PortalException if the social request could not be found 512 */ 513 public com.liferay.portlet.social.model.SocialRequest updateRequest( 514 long requestId, int status, 515 com.liferay.portal.theme.ThemeDisplay themeDisplay) 516 throws com.liferay.portal.kernel.exception.PortalException; 517 518 /** 519 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 520 * 521 * @param socialRequest the social request 522 * @return the social request that was updated 523 */ 524 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 525 public com.liferay.portlet.social.model.SocialRequest updateSocialRequest( 526 com.liferay.portlet.social.model.SocialRequest socialRequest); 527 }