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 */ 071 public com.liferay.portlet.social.model.SocialRequest addRequest( 072 long userId, long groupId, java.lang.String className, long classPK, 073 int type, java.lang.String extraData, long receiverUserId) 074 throws PortalException; 075 076 /** 077 * Adds the social request to the database. Also notifies the appropriate model listeners. 078 * 079 * @param socialRequest the social request 080 * @return the social request that was added 081 */ 082 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 083 public com.liferay.portlet.social.model.SocialRequest addSocialRequest( 084 com.liferay.portlet.social.model.SocialRequest socialRequest); 085 086 /** 087 * Creates a new social request with the primary key. Does not add the social request to the database. 088 * 089 * @param requestId the primary key for the new social request 090 * @return the new social request 091 */ 092 public com.liferay.portlet.social.model.SocialRequest createSocialRequest( 093 long requestId); 094 095 /** 096 * @throws PortalException 097 */ 098 @Override 099 public com.liferay.portal.model.PersistedModel deletePersistedModel( 100 com.liferay.portal.model.PersistedModel persistedModel) 101 throws PortalException; 102 103 /** 104 * Removes all the social requests for the receiving user. 105 * 106 * @param receiverUserId the primary key of the receiving user 107 */ 108 public void deleteReceiverUserRequests(long receiverUserId); 109 110 /** 111 * Removes the social request from the database. 112 * 113 * @param request the social request to be removed 114 */ 115 public void deleteRequest( 116 com.liferay.portlet.social.model.SocialRequest request); 117 118 /** 119 * Removes the social request identified by its primary key from the 120 * database. 121 * 122 * @param requestId the primary key of the social request 123 */ 124 public void deleteRequest(long requestId) throws PortalException; 125 126 public void deleteRequests(long className, long classPK); 127 128 /** 129 * Deletes the social request with the primary key from the database. Also notifies the appropriate model listeners. 130 * 131 * @param requestId the primary key of the social request 132 * @return the social request that was removed 133 * @throws PortalException if a social request with the primary key could not be found 134 */ 135 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 136 public com.liferay.portlet.social.model.SocialRequest deleteSocialRequest( 137 long requestId) throws PortalException; 138 139 /** 140 * Deletes the social request from the database. Also notifies the appropriate model listeners. 141 * 142 * @param socialRequest the social request 143 * @return the social request that was removed 144 */ 145 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 146 public com.liferay.portlet.social.model.SocialRequest deleteSocialRequest( 147 com.liferay.portlet.social.model.SocialRequest socialRequest); 148 149 /** 150 * Removes all the social requests for the requesting user. 151 * 152 * @param userId the primary key of the requesting user 153 */ 154 public void deleteUserRequests(long userId); 155 156 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 157 158 /** 159 * Performs a dynamic query on the database and returns the matching rows. 160 * 161 * @param dynamicQuery the dynamic query 162 * @return the matching rows 163 */ 164 public <T> java.util.List<T> dynamicQuery( 165 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 166 167 /** 168 * Performs a dynamic query on the database and returns a range of the matching rows. 169 * 170 * <p> 171 * 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. 172 * </p> 173 * 174 * @param dynamicQuery the dynamic query 175 * @param start the lower bound of the range of model instances 176 * @param end the upper bound of the range of model instances (not inclusive) 177 * @return the range of matching rows 178 */ 179 public <T> java.util.List<T> dynamicQuery( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 181 int end); 182 183 /** 184 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 185 * 186 * <p> 187 * 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. 188 * </p> 189 * 190 * @param dynamicQuery the dynamic query 191 * @param start the lower bound of the range of model instances 192 * @param end the upper bound of the range of model instances (not inclusive) 193 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 194 * @return the ordered range of matching rows 195 */ 196 public <T> java.util.List<T> dynamicQuery( 197 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 198 int end, 199 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 200 201 /** 202 * Returns the number of rows matching the dynamic query. 203 * 204 * @param dynamicQuery the dynamic query 205 * @return the number of rows matching the dynamic query 206 */ 207 public long dynamicQueryCount( 208 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 209 210 /** 211 * Returns the number of rows matching the dynamic query. 212 * 213 * @param dynamicQuery the dynamic query 214 * @param projection the projection to apply to the query 215 * @return the number of rows matching the dynamic query 216 */ 217 public long dynamicQueryCount( 218 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 219 com.liferay.portal.kernel.dao.orm.Projection projection); 220 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public com.liferay.portlet.social.model.SocialRequest fetchSocialRequest( 223 long requestId); 224 225 /** 226 * Returns the social request matching the UUID and group. 227 * 228 * @param uuid the social request's UUID 229 * @param groupId the primary key of the group 230 * @return the matching social request, or <code>null</code> if a matching social request could not be found 231 */ 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public com.liferay.portlet.social.model.SocialRequest fetchSocialRequestByUuidAndGroupId( 234 java.lang.String uuid, long groupId); 235 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 238 239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 240 public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 241 242 /** 243 * Returns the OSGi service identifier. 244 * 245 * @return the OSGi service identifier 246 */ 247 public java.lang.String getOSGiServiceIdentifier(); 248 249 @Override 250 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 251 public com.liferay.portal.model.PersistedModel getPersistedModel( 252 java.io.Serializable primaryKeyObj) throws PortalException; 253 254 /** 255 * Returns a range of all the social requests for the receiving user. 256 * 257 * <p> 258 * Useful when paginating results. Returns a maximum of <code>end - 259 * start</code> instances. <code>start</code> and <code>end</code> are not 260 * primary keys, they are indexes in the result set. Thus, <code>0</code> 261 * refers to the first result in the set. Setting both <code>start</code> 262 * and <code>end</code> to {@link 263 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 264 * result set. 265 * </p> 266 * 267 * @param receiverUserId the primary key of the receiving user 268 * @param start the lower bound of the range of results 269 * @param end the upper bound of the range of results (not inclusive) 270 * @return the range of matching social requests 271 */ 272 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 273 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 274 long receiverUserId, int start, int end); 275 276 /** 277 * Returns a range of all the social requests with the given status for the 278 * receiving user. 279 * 280 * <p> 281 * Useful when paginating results. Returns a maximum of <code>end - 282 * start</code> instances. <code>start</code> and <code>end</code> are not 283 * primary keys, they are indexes in the result set. Thus, <code>0</code> 284 * refers to the first result in the set. Setting both <code>start</code> 285 * and <code>end</code> to {@link 286 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 287 * result set. 288 * </p> 289 * 290 * @param receiverUserId the primary key of the receiving user 291 * @param status the social request's status 292 * @param start the lower bound of the range of results 293 * @param end the upper bound of the range of results (not inclusive) 294 * @return the range of matching social requests 295 */ 296 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 297 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests( 298 long receiverUserId, int status, int start, int end); 299 300 /** 301 * Returns the number of social requests for the receiving user. 302 * 303 * @param receiverUserId the primary key of the receiving user 304 * @return the number of matching social requests 305 */ 306 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 307 public int getReceiverUserRequestsCount(long receiverUserId); 308 309 /** 310 * Returns the number of social requests with the given status for the 311 * receiving user. 312 * 313 * @param receiverUserId the primary key of the receiving user 314 * @param status the social request's status 315 * @return the number of matching social requests 316 */ 317 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 318 public int getReceiverUserRequestsCount(long receiverUserId, int status); 319 320 /** 321 * Returns the social request with the primary key. 322 * 323 * @param requestId the primary key of the social request 324 * @return the social request 325 * @throws PortalException if a social request with the primary key could not be found 326 */ 327 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 328 public com.liferay.portlet.social.model.SocialRequest getSocialRequest( 329 long requestId) throws PortalException; 330 331 /** 332 * Returns the social request matching the UUID and group. 333 * 334 * @param uuid the social request's UUID 335 * @param groupId the primary key of the group 336 * @return the matching social request 337 * @throws PortalException if a matching social request could not be found 338 */ 339 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 340 public com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId( 341 java.lang.String uuid, long groupId) throws PortalException; 342 343 /** 344 * Returns a range of all the social requests. 345 * 346 * <p> 347 * 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. 348 * </p> 349 * 350 * @param start the lower bound of the range of social requests 351 * @param end the upper bound of the range of social requests (not inclusive) 352 * @return the range of social requests 353 */ 354 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 355 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests( 356 int start, int end); 357 358 /** 359 * Returns all the social requests matching the UUID and company. 360 * 361 * @param uuid the UUID of the social requests 362 * @param companyId the primary key of the company 363 * @return the matching social requests, or an empty list if no matches were found 364 */ 365 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 366 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 367 java.lang.String uuid, long companyId); 368 369 /** 370 * Returns a range of social requests matching the UUID and company. 371 * 372 * @param uuid the UUID of the social requests 373 * @param companyId the primary key of the company 374 * @param start the lower bound of the range of social requests 375 * @param end the upper bound of the range of social requests (not inclusive) 376 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 377 * @return the range of matching social requests, or an empty list if no matches were found 378 */ 379 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 380 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 381 java.lang.String uuid, long companyId, int start, int end, 382 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.social.model.SocialRequest> orderByComparator); 383 384 /** 385 * Returns the number of social requests. 386 * 387 * @return the number of social requests 388 */ 389 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 390 public int getSocialRequestsCount(); 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 */ 410 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 411 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 412 long userId, int start, int end); 413 414 /** 415 * Returns a range of all the social requests with the given status for the 416 * requesting user. 417 * 418 * <p> 419 * Useful when paginating results. Returns a maximum of <code>end - 420 * start</code> instances. <code>start</code> and <code>end</code> are not 421 * primary keys, they are indexes in the result set. Thus, <code>0</code> 422 * refers to the first result in the set. Setting both <code>start</code> 423 * and <code>end</code> to {@link 424 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 425 * result set. 426 * </p> 427 * 428 * @param userId the primary key of the requesting user 429 * @param status the social request's status 430 * @param start the lower bound of the range of results 431 * @param end the upper bound of the range of results (not inclusive) 432 * @return the range of matching social requests 433 */ 434 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 435 public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests( 436 long userId, int status, int start, int end); 437 438 /** 439 * Returns the number of social requests for the requesting user. 440 * 441 * @param userId the primary key of the requesting user 442 * @return the number of matching social requests 443 */ 444 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 445 public int getUserRequestsCount(long userId); 446 447 /** 448 * Returns the number of social requests with the given status for the 449 * requesting user. 450 * 451 * @param userId the primary key of the requesting user 452 * @param status the social request's status 453 * @return the number of matching social request 454 */ 455 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 456 public int getUserRequestsCount(long userId, int status); 457 458 /** 459 * Returns <code>true</code> if a matching social request exists in the 460 * database. 461 * 462 * @param userId the primary key of the requesting user 463 * @param className the class name of the asset that is the subject of the 464 request 465 * @param classPK the primary key of the asset that is the subject of the 466 request 467 * @param type the request's type 468 * @param receiverUserId the primary key of the receiving user 469 * @param status the social request's status 470 * @return <code>true</code> if the social request exists; 471 <code>false</code> otherwise 472 */ 473 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 474 public boolean hasRequest(long userId, java.lang.String className, 475 long classPK, int type, long receiverUserId, int status); 476 477 /** 478 * Returns <code>true</code> if a matching social requests exists in the 479 * database. 480 * 481 * @param userId the primary key of the requesting user 482 * @param className the class name of the asset that is the subject of the 483 request 484 * @param classPK the primary key of the asset that is the subject of the 485 request 486 * @param type the request's type 487 * @param status the social request's status 488 * @return <code>true</code> if the request exists; <code>false</code> 489 otherwise 490 */ 491 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 492 public boolean hasRequest(long userId, java.lang.String className, 493 long classPK, int type, int status); 494 495 /** 496 * Updates the social request replacing its status. 497 * 498 * <p> 499 * If the status is updated to {@link SocialRequestConstants#STATUS_CONFIRM} 500 * then {@link 501 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation( 502 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 503 * {@link SocialRequestConstants#STATUS_IGNORE} then {@link 504 * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection( 505 * SocialRequest, ThemeDisplay)} is called. 506 * </p> 507 * 508 * @param requestId the primary key of the social request 509 * @param status the new status 510 * @param themeDisplay the theme display 511 * @return the updated social request 512 */ 513 public com.liferay.portlet.social.model.SocialRequest updateRequest( 514 long requestId, int status, 515 com.liferay.portal.theme.ThemeDisplay themeDisplay) 516 throws 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 }