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.social.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for SocialRequest. This utility wraps 024 * {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see SocialRequestLocalService 032 * @see com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl 033 * @see com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class SocialRequestLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Returns <code>true</code> if a matching social requests exists in the 046 * database. 047 * 048 * @param userId the primary key of the requesting user 049 * @param className the class name of the asset that is the subject of the 050 request 051 * @param classPK the primary key of the asset that is the subject of the 052 request 053 * @param type the request's type 054 * @param status the social request's status 055 * @return <code>true</code> if the request exists; <code>false</code> 056 otherwise 057 */ 058 public static boolean hasRequest(long userId, java.lang.String className, 059 long classPK, int type, int status) { 060 return getService().hasRequest(userId, className, classPK, type, status); 061 } 062 063 /** 064 * Returns <code>true</code> if a matching social request exists in the 065 * database. 066 * 067 * @param userId the primary key of the requesting user 068 * @param className the class name of the asset that is the subject of the 069 request 070 * @param classPK the primary key of the asset that is the subject of the 071 request 072 * @param type the request's type 073 * @param receiverUserId the primary key of the receiving user 074 * @param status the social request's status 075 * @return <code>true</code> if the social request exists; 076 <code>false</code> otherwise 077 */ 078 public static boolean hasRequest(long userId, java.lang.String className, 079 long classPK, int type, long receiverUserId, int status) { 080 return getService() 081 .hasRequest(userId, className, classPK, type, 082 receiverUserId, status); 083 } 084 085 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 086 return getService().getActionableDynamicQuery(); 087 } 088 089 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 090 return getService().dynamicQuery(); 091 } 092 093 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 094 return getService().getIndexableActionableDynamicQuery(); 095 } 096 097 /** 098 * @throws PortalException 099 */ 100 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 101 com.liferay.portal.kernel.model.PersistedModel persistedModel) 102 throws com.liferay.portal.kernel.exception.PortalException { 103 return getService().deletePersistedModel(persistedModel); 104 } 105 106 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 107 java.io.Serializable primaryKeyObj) 108 throws com.liferay.portal.kernel.exception.PortalException { 109 return getService().getPersistedModel(primaryKeyObj); 110 } 111 112 /** 113 * Adds a social request to the database. 114 * 115 * <p> 116 * In order to add a social request, both the requesting user and the 117 * receiving user must be from the same company and neither of them can be 118 * the default user. 119 * </p> 120 * 121 * @param userId the primary key of the requesting user 122 * @param groupId the primary key of the group 123 * @param className the class name of the asset that is the subject of the 124 request 125 * @param classPK the primary key of the asset that is the subject of the 126 request 127 * @param type the request's type 128 * @param extraData the extra data regarding the request 129 * @param receiverUserId the primary key of the user receiving the request 130 * @return the social request 131 */ 132 public static com.liferay.social.kernel.model.SocialRequest addRequest( 133 long userId, long groupId, java.lang.String className, long classPK, 134 int type, java.lang.String extraData, long receiverUserId) 135 throws com.liferay.portal.kernel.exception.PortalException { 136 return getService() 137 .addRequest(userId, groupId, className, classPK, type, 138 extraData, receiverUserId); 139 } 140 141 /** 142 * Adds the social request to the database. Also notifies the appropriate model listeners. 143 * 144 * @param socialRequest the social request 145 * @return the social request that was added 146 */ 147 public static com.liferay.social.kernel.model.SocialRequest addSocialRequest( 148 com.liferay.social.kernel.model.SocialRequest socialRequest) { 149 return getService().addSocialRequest(socialRequest); 150 } 151 152 /** 153 * Creates a new social request with the primary key. Does not add the social request to the database. 154 * 155 * @param requestId the primary key for the new social request 156 * @return the new social request 157 */ 158 public static com.liferay.social.kernel.model.SocialRequest createSocialRequest( 159 long requestId) { 160 return getService().createSocialRequest(requestId); 161 } 162 163 /** 164 * Deletes the social request from the database. Also notifies the appropriate model listeners. 165 * 166 * @param socialRequest the social request 167 * @return the social request that was removed 168 */ 169 public static com.liferay.social.kernel.model.SocialRequest deleteSocialRequest( 170 com.liferay.social.kernel.model.SocialRequest socialRequest) { 171 return getService().deleteSocialRequest(socialRequest); 172 } 173 174 /** 175 * Deletes the social request with the primary key from the database. Also notifies the appropriate model listeners. 176 * 177 * @param requestId the primary key of the social request 178 * @return the social request that was removed 179 * @throws PortalException if a social request with the primary key could not be found 180 */ 181 public static com.liferay.social.kernel.model.SocialRequest deleteSocialRequest( 182 long requestId) 183 throws com.liferay.portal.kernel.exception.PortalException { 184 return getService().deleteSocialRequest(requestId); 185 } 186 187 public static com.liferay.social.kernel.model.SocialRequest fetchSocialRequest( 188 long requestId) { 189 return getService().fetchSocialRequest(requestId); 190 } 191 192 /** 193 * Returns the social request matching the UUID and group. 194 * 195 * @param uuid the social request's UUID 196 * @param groupId the primary key of the group 197 * @return the matching social request, or <code>null</code> if a matching social request could not be found 198 */ 199 public static com.liferay.social.kernel.model.SocialRequest fetchSocialRequestByUuidAndGroupId( 200 java.lang.String uuid, long groupId) { 201 return getService().fetchSocialRequestByUuidAndGroupId(uuid, groupId); 202 } 203 204 /** 205 * Returns the social request with the primary key. 206 * 207 * @param requestId the primary key of the social request 208 * @return the social request 209 * @throws PortalException if a social request with the primary key could not be found 210 */ 211 public static com.liferay.social.kernel.model.SocialRequest getSocialRequest( 212 long requestId) 213 throws com.liferay.portal.kernel.exception.PortalException { 214 return getService().getSocialRequest(requestId); 215 } 216 217 /** 218 * Returns the social request matching the UUID and group. 219 * 220 * @param uuid the social request's UUID 221 * @param groupId the primary key of the group 222 * @return the matching social request 223 * @throws PortalException if a matching social request could not be found 224 */ 225 public static com.liferay.social.kernel.model.SocialRequest getSocialRequestByUuidAndGroupId( 226 java.lang.String uuid, long groupId) 227 throws com.liferay.portal.kernel.exception.PortalException { 228 return getService().getSocialRequestByUuidAndGroupId(uuid, groupId); 229 } 230 231 /** 232 * Updates the social request replacing its status. 233 * 234 * <p> 235 * If the status is updated to {@link SocialRequestConstants#STATUS_CONFIRM} 236 * then {@link 237 * SocialRequestInterpreterLocalService#processConfirmation( 238 * SocialRequest, ThemeDisplay)} is called. If the status is updated to 239 * {@link SocialRequestConstants#STATUS_IGNORE} then {@link 240 * SocialRequestInterpreterLocalService#processRejection( 241 * SocialRequest, ThemeDisplay)} is called. 242 * </p> 243 * 244 * @param requestId the primary key of the social request 245 * @param status the new status 246 * @param themeDisplay the theme display 247 * @return the updated social request 248 */ 249 public static com.liferay.social.kernel.model.SocialRequest updateRequest( 250 long requestId, int status, 251 com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay) 252 throws com.liferay.portal.kernel.exception.PortalException { 253 return getService().updateRequest(requestId, status, themeDisplay); 254 } 255 256 /** 257 * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 258 * 259 * @param socialRequest the social request 260 * @return the social request that was updated 261 */ 262 public static com.liferay.social.kernel.model.SocialRequest updateSocialRequest( 263 com.liferay.social.kernel.model.SocialRequest socialRequest) { 264 return getService().updateSocialRequest(socialRequest); 265 } 266 267 /** 268 * Returns the number of social requests for the receiving user. 269 * 270 * @param receiverUserId the primary key of the receiving user 271 * @return the number of matching social requests 272 */ 273 public static int getReceiverUserRequestsCount(long receiverUserId) { 274 return getService().getReceiverUserRequestsCount(receiverUserId); 275 } 276 277 /** 278 * Returns the number of social requests with the given status for the 279 * receiving user. 280 * 281 * @param receiverUserId the primary key of the receiving user 282 * @param status the social request's status 283 * @return the number of matching social requests 284 */ 285 public static int getReceiverUserRequestsCount(long receiverUserId, 286 int status) { 287 return getService().getReceiverUserRequestsCount(receiverUserId, status); 288 } 289 290 /** 291 * Returns the number of social requests. 292 * 293 * @return the number of social requests 294 */ 295 public static int getSocialRequestsCount() { 296 return getService().getSocialRequestsCount(); 297 } 298 299 /** 300 * Returns the number of social requests for the requesting user. 301 * 302 * @param userId the primary key of the requesting user 303 * @return the number of matching social requests 304 */ 305 public static int getUserRequestsCount(long userId) { 306 return getService().getUserRequestsCount(userId); 307 } 308 309 /** 310 * Returns the number of social requests with the given status for the 311 * requesting user. 312 * 313 * @param userId the primary key of the requesting user 314 * @param status the social request's status 315 * @return the number of matching social request 316 */ 317 public static int getUserRequestsCount(long userId, int status) { 318 return getService().getUserRequestsCount(userId, status); 319 } 320 321 /** 322 * Returns the OSGi service identifier. 323 * 324 * @return the OSGi service identifier 325 */ 326 public static java.lang.String getOSGiServiceIdentifier() { 327 return getService().getOSGiServiceIdentifier(); 328 } 329 330 /** 331 * Performs a dynamic query on the database and returns the matching rows. 332 * 333 * @param dynamicQuery the dynamic query 334 * @return the matching rows 335 */ 336 public static <T> java.util.List<T> dynamicQuery( 337 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 338 return getService().dynamicQuery(dynamicQuery); 339 } 340 341 /** 342 * Performs a dynamic query on the database and returns a range of the matching rows. 343 * 344 * <p> 345 * 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. 346 * </p> 347 * 348 * @param dynamicQuery the dynamic query 349 * @param start the lower bound of the range of model instances 350 * @param end the upper bound of the range of model instances (not inclusive) 351 * @return the range of matching rows 352 */ 353 public static <T> java.util.List<T> dynamicQuery( 354 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 355 int end) { 356 return getService().dynamicQuery(dynamicQuery, start, end); 357 } 358 359 /** 360 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 361 * 362 * <p> 363 * 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. 364 * </p> 365 * 366 * @param dynamicQuery the dynamic query 367 * @param start the lower bound of the range of model instances 368 * @param end the upper bound of the range of model instances (not inclusive) 369 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 370 * @return the ordered range of matching rows 371 */ 372 public static <T> java.util.List<T> dynamicQuery( 373 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 374 int end, 375 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 376 return getService() 377 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 378 } 379 380 /** 381 * Returns a range of all the social requests for the receiving user. 382 * 383 * <p> 384 * Useful when paginating results. Returns a maximum of <code>end - 385 * start</code> instances. <code>start</code> and <code>end</code> are not 386 * primary keys, they are indexes in the result set. Thus, <code>0</code> 387 * refers to the first result in the set. Setting both <code>start</code> 388 * and <code>end</code> to {@link 389 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 390 * result set. 391 * </p> 392 * 393 * @param receiverUserId the primary key of the receiving user 394 * @param start the lower bound of the range of results 395 * @param end the upper bound of the range of results (not inclusive) 396 * @return the range of matching social requests 397 */ 398 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getReceiverUserRequests( 399 long receiverUserId, int start, int end) { 400 return getService().getReceiverUserRequests(receiverUserId, start, end); 401 } 402 403 /** 404 * Returns a range of all the social requests with the given status for the 405 * receiving 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 receiverUserId the primary key of the receiving 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 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getReceiverUserRequests( 424 long receiverUserId, int status, int start, int end) { 425 return getService() 426 .getReceiverUserRequests(receiverUserId, status, start, end); 427 } 428 429 /** 430 * Returns a range of all the social requests. 431 * 432 * <p> 433 * 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. 434 * </p> 435 * 436 * @param start the lower bound of the range of social requests 437 * @param end the upper bound of the range of social requests (not inclusive) 438 * @return the range of social requests 439 */ 440 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getSocialRequests( 441 int start, int end) { 442 return getService().getSocialRequests(start, end); 443 } 444 445 /** 446 * Returns all the social requests matching the UUID and company. 447 * 448 * @param uuid the UUID of the social requests 449 * @param companyId the primary key of the company 450 * @return the matching social requests, or an empty list if no matches were found 451 */ 452 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 453 java.lang.String uuid, long companyId) { 454 return getService().getSocialRequestsByUuidAndCompanyId(uuid, companyId); 455 } 456 457 /** 458 * Returns a range of social requests matching the UUID and company. 459 * 460 * @param uuid the UUID of the social requests 461 * @param companyId the primary key of the company 462 * @param start the lower bound of the range of social requests 463 * @param end the upper bound of the range of social requests (not inclusive) 464 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 465 * @return the range of matching social requests, or an empty list if no matches were found 466 */ 467 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getSocialRequestsByUuidAndCompanyId( 468 java.lang.String uuid, long companyId, int start, int end, 469 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.social.kernel.model.SocialRequest> orderByComparator) { 470 return getService() 471 .getSocialRequestsByUuidAndCompanyId(uuid, companyId, start, 472 end, orderByComparator); 473 } 474 475 /** 476 * Returns a range of all the social requests for the requesting user. 477 * 478 * <p> 479 * Useful when paginating results. Returns a maximum of <code>end - 480 * start</code> instances. <code>start</code> and <code>end</code> are not 481 * primary keys, they are indexes in the result set. Thus, <code>0</code> 482 * refers to the first result in the set. Setting both <code>start</code> 483 * and <code>end</code> to {@link 484 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 485 * result set. 486 * </p> 487 * 488 * @param userId the primary key of the requesting user 489 * @param start the lower bound of the range of results 490 * @param end the upper bound of the range of results (not inclusive) 491 * @return the range of matching social requests 492 */ 493 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getUserRequests( 494 long userId, int start, int end) { 495 return getService().getUserRequests(userId, start, end); 496 } 497 498 /** 499 * Returns a range of all the social requests with the given status for the 500 * requesting user. 501 * 502 * <p> 503 * Useful when paginating results. Returns a maximum of <code>end - 504 * start</code> instances. <code>start</code> and <code>end</code> are not 505 * primary keys, they are indexes in the result set. Thus, <code>0</code> 506 * refers to the first result in the set. Setting both <code>start</code> 507 * and <code>end</code> to {@link 508 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 509 * result set. 510 * </p> 511 * 512 * @param userId the primary key of the requesting user 513 * @param status the social request's status 514 * @param start the lower bound of the range of results 515 * @param end the upper bound of the range of results (not inclusive) 516 * @return the range of matching social requests 517 */ 518 public static java.util.List<com.liferay.social.kernel.model.SocialRequest> getUserRequests( 519 long userId, int status, int start, int end) { 520 return getService().getUserRequests(userId, status, start, end); 521 } 522 523 /** 524 * Returns the number of rows matching the dynamic query. 525 * 526 * @param dynamicQuery the dynamic query 527 * @return the number of rows matching the dynamic query 528 */ 529 public static long dynamicQueryCount( 530 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 531 return getService().dynamicQueryCount(dynamicQuery); 532 } 533 534 /** 535 * Returns the number of rows matching the dynamic query. 536 * 537 * @param dynamicQuery the dynamic query 538 * @param projection the projection to apply to the query 539 * @return the number of rows matching the dynamic query 540 */ 541 public static long dynamicQueryCount( 542 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 543 com.liferay.portal.kernel.dao.orm.Projection projection) { 544 return getService().dynamicQueryCount(dynamicQuery, projection); 545 } 546 547 /** 548 * Removes all the social requests for the receiving user. 549 * 550 * @param receiverUserId the primary key of the receiving user 551 */ 552 public static void deleteReceiverUserRequests(long receiverUserId) { 553 getService().deleteReceiverUserRequests(receiverUserId); 554 } 555 556 /** 557 * Removes the social request from the database. 558 * 559 * @param request the social request to be removed 560 */ 561 public static void deleteRequest( 562 com.liferay.social.kernel.model.SocialRequest request) { 563 getService().deleteRequest(request); 564 } 565 566 /** 567 * Removes the social request identified by its primary key from the 568 * database. 569 * 570 * @param requestId the primary key of the social request 571 */ 572 public static void deleteRequest(long requestId) 573 throws com.liferay.portal.kernel.exception.PortalException { 574 getService().deleteRequest(requestId); 575 } 576 577 public static void deleteRequests(long className, long classPK) { 578 getService().deleteRequests(className, classPK); 579 } 580 581 /** 582 * Removes all the social requests for the requesting user. 583 * 584 * @param userId the primary key of the requesting user 585 */ 586 public static void deleteUserRequests(long userId) { 587 getService().deleteUserRequests(userId); 588 } 589 590 public static SocialRequestLocalService getService() { 591 if (_service == null) { 592 _service = (SocialRequestLocalService)PortalBeanLocatorUtil.locate(SocialRequestLocalService.class.getName()); 593 594 ReferenceRegistry.registerReference(SocialRequestLocalServiceUtil.class, 595 "_service"); 596 } 597 598 return _service; 599 } 600 601 private static SocialRequestLocalService _service; 602 }