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 SocialActivity. This utility wraps 024 * {@link com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl} 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 SocialActivityLocalService 032 * @see com.liferay.portlet.social.service.base.SocialActivityLocalServiceBaseImpl 033 * @see com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class SocialActivityLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 044 return getService().getActionableDynamicQuery(); 045 } 046 047 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 048 return getService().dynamicQuery(); 049 } 050 051 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 052 return getService().getIndexableActionableDynamicQuery(); 053 } 054 055 /** 056 * @throws PortalException 057 */ 058 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 059 com.liferay.portal.kernel.model.PersistedModel persistedModel) 060 throws com.liferay.portal.kernel.exception.PortalException { 061 return getService().deletePersistedModel(persistedModel); 062 } 063 064 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 065 java.io.Serializable primaryKeyObj) 066 throws com.liferay.portal.kernel.exception.PortalException { 067 return getService().getPersistedModel(primaryKeyObj); 068 } 069 070 /** 071 * Adds the social activity to the database. Also notifies the appropriate model listeners. 072 * 073 * @param socialActivity the social activity 074 * @return the social activity that was added 075 */ 076 public static com.liferay.social.kernel.model.SocialActivity addSocialActivity( 077 com.liferay.social.kernel.model.SocialActivity socialActivity) { 078 return getService().addSocialActivity(socialActivity); 079 } 080 081 /** 082 * Creates a new social activity with the primary key. Does not add the social activity to the database. 083 * 084 * @param activityId the primary key for the new social activity 085 * @return the new social activity 086 */ 087 public static com.liferay.social.kernel.model.SocialActivity createSocialActivity( 088 long activityId) { 089 return getService().createSocialActivity(activityId); 090 } 091 092 /** 093 * Deletes the social activity from the database. Also notifies the appropriate model listeners. 094 * 095 * @param socialActivity the social activity 096 * @return the social activity that was removed 097 */ 098 public static com.liferay.social.kernel.model.SocialActivity deleteSocialActivity( 099 com.liferay.social.kernel.model.SocialActivity socialActivity) { 100 return getService().deleteSocialActivity(socialActivity); 101 } 102 103 /** 104 * Deletes the social activity with the primary key from the database. Also notifies the appropriate model listeners. 105 * 106 * @param activityId the primary key of the social activity 107 * @return the social activity that was removed 108 * @throws PortalException if a social activity with the primary key could not be found 109 */ 110 public static com.liferay.social.kernel.model.SocialActivity deleteSocialActivity( 111 long activityId) 112 throws com.liferay.portal.kernel.exception.PortalException { 113 return getService().deleteSocialActivity(activityId); 114 } 115 116 public static com.liferay.social.kernel.model.SocialActivity fetchFirstActivity( 117 java.lang.String className, long classPK, int type) { 118 return getService().fetchFirstActivity(className, classPK, type); 119 } 120 121 public static com.liferay.social.kernel.model.SocialActivity fetchSocialActivity( 122 long activityId) { 123 return getService().fetchSocialActivity(activityId); 124 } 125 126 /** 127 * Returns the activity identified by its primary key. 128 * 129 * @param activityId the primary key of the activity 130 * @return Returns the activity 131 */ 132 public static com.liferay.social.kernel.model.SocialActivity getActivity( 133 long activityId) 134 throws com.liferay.portal.kernel.exception.PortalException { 135 return getService().getActivity(activityId); 136 } 137 138 /** 139 * Returns the activity that has the mirror activity. 140 * 141 * @param mirrorActivityId the primary key of the mirror activity 142 * @return Returns the mirror activity 143 */ 144 public static com.liferay.social.kernel.model.SocialActivity getMirrorActivity( 145 long mirrorActivityId) 146 throws com.liferay.portal.kernel.exception.PortalException { 147 return getService().getMirrorActivity(mirrorActivityId); 148 } 149 150 /** 151 * Returns the social activity with the primary key. 152 * 153 * @param activityId the primary key of the social activity 154 * @return the social activity 155 * @throws PortalException if a social activity with the primary key could not be found 156 */ 157 public static com.liferay.social.kernel.model.SocialActivity getSocialActivity( 158 long activityId) 159 throws com.liferay.portal.kernel.exception.PortalException { 160 return getService().getSocialActivity(activityId); 161 } 162 163 /** 164 * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 165 * 166 * @param socialActivity the social activity 167 * @return the social activity that was updated 168 */ 169 public static com.liferay.social.kernel.model.SocialActivity updateSocialActivity( 170 com.liferay.social.kernel.model.SocialActivity socialActivity) { 171 return getService().updateSocialActivity(socialActivity); 172 } 173 174 /** 175 * Returns the number of activities done on assets identified by class name. 176 * 177 * @param className the target asset's class name 178 * @return the number of matching activities 179 */ 180 public static int getActivitiesCount(java.lang.String className) { 181 return getService().getActivitiesCount(className); 182 } 183 184 /** 185 * Returns the number of activities done on assets identified by the class 186 * name ID. 187 * 188 * @param classNameId the target asset's class name ID 189 * @return the number of matching activities 190 */ 191 public static int getActivitiesCount(long classNameId) { 192 return getService().getActivitiesCount(classNameId); 193 } 194 195 /** 196 * Returns the number of activities done on the asset identified by the 197 * class name and class primary key that are mirrors of the activity 198 * identified by the mirror activity ID. 199 * 200 * @param mirrorActivityId the primary key of the mirror activity 201 * @param className the target asset's class name 202 * @param classPK the primary key of the target asset 203 * @return the number of matching activities 204 */ 205 public static int getActivitiesCount(long mirrorActivityId, 206 java.lang.String className, long classPK) { 207 return getService() 208 .getActivitiesCount(mirrorActivityId, className, classPK); 209 } 210 211 /** 212 * Returns the number of activities done on the asset identified by the 213 * class name ID and class primary key that are mirrors of the activity 214 * identified by the mirror activity ID. 215 * 216 * @param mirrorActivityId the primary key of the mirror activity 217 * @param classNameId the target asset's class name ID 218 * @param classPK the primary key of the target asset 219 * @return the number of matching activities 220 */ 221 public static int getActivitiesCount(long mirrorActivityId, 222 long classNameId, long classPK) { 223 return getService() 224 .getActivitiesCount(mirrorActivityId, classNameId, classPK); 225 } 226 227 /** 228 * Returns the number of activities done in the group. 229 * 230 * <p> 231 * This method only counts activities without mirrors. 232 * </p> 233 * 234 * @param groupId the primary key of the group 235 * @return the number of matching activities 236 */ 237 public static int getGroupActivitiesCount(long groupId) { 238 return getService().getGroupActivitiesCount(groupId); 239 } 240 241 /** 242 * Returns the number of activities done by users that are members of the 243 * group. 244 * 245 * <p> 246 * This method only counts activities without mirrors. 247 * </p> 248 * 249 * @param groupId the primary key of the group 250 * @return the number of matching activities 251 */ 252 public static int getGroupUsersActivitiesCount(long groupId) { 253 return getService().getGroupUsersActivitiesCount(groupId); 254 } 255 256 /** 257 * Returns the number of activities done in the organization. This method 258 * only counts activities without mirrors. 259 * 260 * @param organizationId the primary key of the organization 261 * @return the number of matching activities 262 */ 263 public static int getOrganizationActivitiesCount(long organizationId) { 264 return getService().getOrganizationActivitiesCount(organizationId); 265 } 266 267 /** 268 * Returns the number of activities done by users of the organization. This 269 * method only counts activities without mirrors. 270 * 271 * @param organizationId the primary key of the organization 272 * @return the number of matching activities 273 */ 274 public static int getOrganizationUsersActivitiesCount(long organizationId) { 275 return getService().getOrganizationUsersActivitiesCount(organizationId); 276 } 277 278 /** 279 * Returns the number of activities done by users in a relationship with the 280 * user identified by userId. 281 * 282 * @param userId the primary key of the user 283 * @return the number of matching activities 284 */ 285 public static int getRelationActivitiesCount(long userId) { 286 return getService().getRelationActivitiesCount(userId); 287 } 288 289 /** 290 * Returns the number of activities done by users in a relationship of type 291 * <code>type</code> with the user identified by <code>userId</code>. This 292 * method only counts activities without mirrors. 293 * 294 * @param userId the primary key of the user 295 * @param type the relationship type 296 * @return the number of matching activities 297 */ 298 public static int getRelationActivitiesCount(long userId, int type) { 299 return getService().getRelationActivitiesCount(userId, type); 300 } 301 302 /** 303 * Returns the number of social activities. 304 * 305 * @return the number of social activities 306 */ 307 public static int getSocialActivitiesCount() { 308 return getService().getSocialActivitiesCount(); 309 } 310 311 /** 312 * Returns the number of activities done by the user. 313 * 314 * @param userId the primary key of the user 315 * @return the number of matching activities 316 */ 317 public static int getUserActivitiesCount(long userId) { 318 return getService().getUserActivitiesCount(userId); 319 } 320 321 /** 322 * Returns the number of activities done in user's groups. This method only 323 * counts activities without mirrors. 324 * 325 * @param userId the primary key of the user 326 * @return the number of matching activities 327 */ 328 public static int getUserGroupsActivitiesCount(long userId) { 329 return getService().getUserGroupsActivitiesCount(userId); 330 } 331 332 /** 333 * Returns the number of activities done in user's groups and organizations. 334 * This method only counts activities without mirrors. 335 * 336 * @param userId the primary key of the user 337 * @return the number of matching activities 338 */ 339 public static int getUserGroupsAndOrganizationsActivitiesCount(long userId) { 340 return getService().getUserGroupsAndOrganizationsActivitiesCount(userId); 341 } 342 343 /** 344 * Returns the number of activities done in the user's organizations. This 345 * method only counts activities without mirrors. 346 * 347 * @param userId the primary key of the user 348 * @return the number of matching activities 349 */ 350 public static int getUserOrganizationsActivitiesCount(long userId) { 351 return getService().getUserOrganizationsActivitiesCount(userId); 352 } 353 354 /** 355 * Returns the OSGi service identifier. 356 * 357 * @return the OSGi service identifier 358 */ 359 public static java.lang.String getOSGiServiceIdentifier() { 360 return getService().getOSGiServiceIdentifier(); 361 } 362 363 /** 364 * Performs a dynamic query on the database and returns the matching rows. 365 * 366 * @param dynamicQuery the dynamic query 367 * @return the matching rows 368 */ 369 public static <T> java.util.List<T> dynamicQuery( 370 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 371 return getService().dynamicQuery(dynamicQuery); 372 } 373 374 /** 375 * Performs a dynamic query on the database and returns a range of the matching rows. 376 * 377 * <p> 378 * 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.SocialActivityModelImpl}. 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. 379 * </p> 380 * 381 * @param dynamicQuery the dynamic query 382 * @param start the lower bound of the range of model instances 383 * @param end the upper bound of the range of model instances (not inclusive) 384 * @return the range of matching rows 385 */ 386 public static <T> java.util.List<T> dynamicQuery( 387 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 388 int end) { 389 return getService().dynamicQuery(dynamicQuery, start, end); 390 } 391 392 /** 393 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 394 * 395 * <p> 396 * 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.SocialActivityModelImpl}. 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. 397 * </p> 398 * 399 * @param dynamicQuery the dynamic query 400 * @param start the lower bound of the range of model instances 401 * @param end the upper bound of the range of model instances (not inclusive) 402 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 403 * @return the ordered range of matching rows 404 */ 405 public static <T> java.util.List<T> dynamicQuery( 406 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 407 int end, 408 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 409 return getService() 410 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 411 } 412 413 /** 414 * Returns a range of all the activities done on assets identified by the 415 * class name. 416 * 417 * <p> 418 * Useful when paginating results. Returns a maximum of <code>end - 419 * start</code> instances. <code>start</code> and <code>end</code> are not 420 * primary keys, they are indexes in the result set. Thus, <code>0</code> 421 * refers to the first result in the set. Setting both <code>start</code> 422 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 423 * result set. 424 * </p> 425 * 426 * @param className the target asset's class name 427 * @param start the lower bound of the range of results 428 * @param end the upper bound of the range of results (not inclusive) 429 * @return the range of matching activities 430 */ 431 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getActivities( 432 java.lang.String className, int start, int end) { 433 return getService().getActivities(className, start, end); 434 } 435 436 /** 437 * Returns a range of all the activities done on assets identified by the 438 * class name ID. 439 * 440 * <p> 441 * Useful when paginating results. Returns a maximum of <code>end - 442 * start</code> instances. <code>start</code> and <code>end</code> are not 443 * primary keys, they are indexes in the result set. Thus, <code>0</code> 444 * refers to the first result in the set. Setting both <code>start</code> 445 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 446 * result set. 447 * </p> 448 * 449 * @param classNameId the target asset's class name ID 450 * @param start the lower bound of the range of results 451 * @param end the upper bound of the range of results (not inclusive) 452 * @return the range of matching activities 453 */ 454 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getActivities( 455 long classNameId, int start, int end) { 456 return getService().getActivities(classNameId, start, end); 457 } 458 459 /** 460 * Returns a range of all the activities done on the asset identified by the 461 * class name and the class primary key that are mirrors of the activity 462 * identified by the mirror activity ID. 463 * 464 * <p> 465 * Useful when paginating results. Returns a maximum of <code>end - 466 * start</code> instances. <code>start</code> and <code>end</code> are not 467 * primary keys, they are indexes in the result set. Thus, <code>0</code> 468 * refers to the first result in the set. Setting both <code>start</code> 469 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 470 * result set. 471 * </p> 472 * 473 * @param mirrorActivityId the primary key of the mirror activity 474 * @param className the target asset's class name 475 * @param classPK the primary key of the target asset 476 * @param start the lower bound of the range of results 477 * @param end the upper bound of the range of results (not inclusive) 478 * @return the range of matching activities 479 */ 480 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getActivities( 481 long mirrorActivityId, java.lang.String className, long classPK, 482 int start, int end) { 483 return getService() 484 .getActivities(mirrorActivityId, className, classPK, start, 485 end); 486 } 487 488 /** 489 * Returns a range of all the activities done on the asset identified by the 490 * class name ID and class primary key that are mirrors of the activity 491 * identified by the mirror activity ID. 492 * 493 * <p> 494 * Useful when paginating results. Returns a maximum of <code>end - 495 * start</code> instances. <code>start</code> and <code>end</code> are not 496 * primary keys, they are indexes in the result set. Thus, <code>0</code> 497 * refers to the first result in the set. Setting both <code>start</code> 498 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 499 * result set. 500 * </p> 501 * 502 * @param mirrorActivityId the primary key of the mirror activity 503 * @param classNameId the target asset's class name ID 504 * @param classPK the primary key of the target asset 505 * @param start the lower bound of the range of results 506 * @param end the upper bound of the range of results (not inclusive) 507 * @return the range of matching activities 508 */ 509 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getActivities( 510 long mirrorActivityId, long classNameId, long classPK, int start, 511 int end) { 512 return getService() 513 .getActivities(mirrorActivityId, classNameId, classPK, 514 start, end); 515 } 516 517 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getActivitySetActivities( 518 long activitySetId, int start, int end) { 519 return getService().getActivitySetActivities(activitySetId, start, end); 520 } 521 522 /** 523 * Returns a range of all the activities done in the group. 524 * 525 * <p> 526 * This method only finds activities without mirrors. 527 * </p> 528 * 529 * <p> 530 * Useful when paginating results. Returns a maximum of <code>end - 531 * start</code> instances. <code>start</code> and <code>end</code> are not 532 * primary keys, they are indexes in the result set. Thus, <code>0</code> 533 * refers to the first result in the set. Setting both <code>start</code> 534 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 535 * result set. 536 * </p> 537 * 538 * @param groupId the primary key of the group 539 * @param start the lower bound of the range of results 540 * @param end the upper bound of the range of results (not inclusive) 541 * @return the range of matching activities 542 */ 543 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getGroupActivities( 544 long groupId, int start, int end) { 545 return getService().getGroupActivities(groupId, start, end); 546 } 547 548 /** 549 * Returns a range of activities done by users that are members of the 550 * group. 551 * 552 * <p> 553 * This method only finds activities without mirrors. 554 * </p> 555 * 556 * <p> 557 * Useful when paginating results. Returns a maximum of <code>end - 558 * start</code> instances. <code>start</code> and <code>end</code> are not 559 * primary keys, they are indexes in the result set. Thus, <code>0</code> 560 * refers to the first result in the set. Setting both <code>start</code> 561 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 562 * result set. 563 * </p> 564 * 565 * @param groupId the primary key of the group 566 * @param start the lower bound of the range of results 567 * @param end the upper bound of the range of results (not inclusive) 568 * @return the range of matching activities 569 */ 570 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getGroupUsersActivities( 571 long groupId, int start, int end) { 572 return getService().getGroupUsersActivities(groupId, start, end); 573 } 574 575 /** 576 * Returns a range of all the activities done in the organization. This 577 * method only finds activities without mirrors. 578 * 579 * <p> 580 * Useful when paginating results. Returns a maximum of <code>end - 581 * start</code> instances. <code>start</code> and <code>end</code> are not 582 * primary keys, they are indexes in the result set. Thus, <code>0</code> 583 * refers to the first result in the set. Setting both <code>start</code> 584 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 585 * result set. 586 * </p> 587 * 588 * @param organizationId the primary key of the organization 589 * @param start the lower bound of the range of results 590 * @param end the upper bound of the range of results (not inclusive) 591 * @return the range of matching activities 592 */ 593 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getOrganizationActivities( 594 long organizationId, int start, int end) { 595 return getService().getOrganizationActivities(organizationId, start, end); 596 } 597 598 /** 599 * Returns a range of all the activities done by users of the organization. 600 * This method only finds activities without mirrors. 601 * 602 * <p> 603 * Useful when paginating results. Returns a maximum of <code>end - 604 * start</code> instances. <code>start</code> and <code>end</code> are not 605 * primary keys, they are indexes in the result set. Thus, <code>0</code> 606 * refers to the first result in the set. Setting both <code>start</code> 607 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 608 * result set. 609 * </p> 610 * 611 * @param organizationId the primary key of the organization 612 * @param start the lower bound of the range of results 613 * @param end the upper bound of the range of results (not inclusive) 614 * @return the range of matching activities 615 */ 616 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getOrganizationUsersActivities( 617 long organizationId, int start, int end) { 618 return getService() 619 .getOrganizationUsersActivities(organizationId, start, end); 620 } 621 622 /** 623 * Returns a range of all the activities done by users in a relationship 624 * with the user identified by the user ID. 625 * 626 * <p> 627 * Useful when paginating results. Returns a maximum of <code>end - 628 * start</code> instances. <code>start</code> and <code>end</code> are not 629 * primary keys, they are indexes in the result set. Thus, <>0</code> refers 630 * to the first result in the set. Setting both <code>start</code> and 631 * <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result 632 * set. 633 * </p> 634 * 635 * @param userId the primary key of the user 636 * @param start the lower bound of the range of results 637 * @param end the upper bound of the range of results (not inclusive) 638 * @return the range of matching activities 639 */ 640 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getRelationActivities( 641 long userId, int start, int end) { 642 return getService().getRelationActivities(userId, start, end); 643 } 644 645 /** 646 * Returns a range of all the activities done by users in a relationship of 647 * type <code>type</code> with the user identified by <code>userId</code>. 648 * This method only finds activities without mirrors. 649 * 650 * <p> 651 * Useful when paginating results. Returns a maximum of <code>end - 652 * start</code> instances. <code>start</code> and <code>end</code> are not 653 * primary keys, they are indexes in the result set. Thus, <code>0</code> 654 * refers to the first result in the set. Setting both <code>start</code> 655 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 656 * result set. 657 * </p> 658 * 659 * @param userId the primary key of the user 660 * @param type the relationship type 661 * @param start the lower bound of the range of results 662 * @param end the upper bound of the range of results (not inclusive) 663 * @return the range of matching activities 664 */ 665 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getRelationActivities( 666 long userId, int type, int start, int end) { 667 return getService().getRelationActivities(userId, type, start, end); 668 } 669 670 /** 671 * Returns a range of all the social activities. 672 * 673 * <p> 674 * 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.SocialActivityModelImpl}. 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. 675 * </p> 676 * 677 * @param start the lower bound of the range of social activities 678 * @param end the upper bound of the range of social activities (not inclusive) 679 * @return the range of social activities 680 */ 681 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getSocialActivities( 682 int start, int end) { 683 return getService().getSocialActivities(start, end); 684 } 685 686 /** 687 * Returns a range of all the activities done by the user. 688 * 689 * <p> 690 * Useful when paginating results. Returns a maximum of <code>end - 691 * start</code> instances. <code>start</code> and <code>end</code> are not 692 * primary keys, they are indexes in the result set. Thus, <code>0</code> 693 * refers to the first result in the set. Setting both <code>start</code> 694 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 695 * result set. 696 * </p> 697 * 698 * @param userId the primary key of the user 699 * @param start the lower bound of the range of results 700 * @param end the upper bound of the range of results (not inclusive) 701 * @return the range of matching activities 702 */ 703 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getUserActivities( 704 long userId, int start, int end) { 705 return getService().getUserActivities(userId, start, end); 706 } 707 708 /** 709 * Returns a range of all the activities done in the user's groups. This 710 * method only finds activities without mirrors. 711 * 712 * <p> 713 * Useful when paginating results. Returns a maximum of <code>end - 714 * start</code> instances. <code>start</code> and <code>end</code> are not 715 * primary keys, they are indexes in the result set. Thus, <code>0</code> 716 * refers to the first result in the set. Setting both <code>start</code> 717 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 718 * result set. 719 * </p> 720 * 721 * @param userId the primary key of the user 722 * @param start the lower bound of the range of results 723 * @param end the upper bound of the range of results (not inclusive) 724 * @return the range of matching activities 725 */ 726 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getUserGroupsActivities( 727 long userId, int start, int end) { 728 return getService().getUserGroupsActivities(userId, start, end); 729 } 730 731 /** 732 * Returns a range of all the activities done in the user's groups and 733 * organizations. This method only finds activities without mirrors. 734 * 735 * <p> 736 * Useful when paginating results. Returns a maximum of <code>end - 737 * start</code> instances. <code>start</code> and <code>end</code> are not 738 * primary keys, they are indexes in the result set. Thus, <code>0</code> 739 * refers to the first result in the set. Setting both <code>start</code> 740 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 741 * result set. 742 * </p> 743 * 744 * @param userId the primary key of the user 745 * @param start the lower bound of the range of results 746 * @param end the upper bound of the range of results (not inclusive) 747 * @return the range of matching activities 748 */ 749 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getUserGroupsAndOrganizationsActivities( 750 long userId, int start, int end) { 751 return getService() 752 .getUserGroupsAndOrganizationsActivities(userId, start, end); 753 } 754 755 /** 756 * Returns a range of all activities done in the user's organizations. This 757 * method only finds activities without mirrors. 758 * 759 * <p> 760 * Useful when paginating results. Returns a maximum of <code>end - 761 * start</code> instances. <code>start</code> and <code>end</code> are not 762 * primary keys, they are indexes in the result set. Thus, <code>0</code> 763 * refers to the first result in the set. Setting both <code>start</code> 764 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 765 * result set. 766 * </p> 767 * 768 * @param userId the primary key of the user 769 * @param start the lower bound of the range of results 770 * @param end the upper bound of the range of results (not inclusive) 771 * @return the range of matching activities 772 */ 773 public static java.util.List<com.liferay.social.kernel.model.SocialActivity> getUserOrganizationsActivities( 774 long userId, int start, int end) { 775 return getService().getUserOrganizationsActivities(userId, start, end); 776 } 777 778 /** 779 * Returns the number of rows matching the dynamic query. 780 * 781 * @param dynamicQuery the dynamic query 782 * @return the number of rows matching the dynamic query 783 */ 784 public static long dynamicQueryCount( 785 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 786 return getService().dynamicQueryCount(dynamicQuery); 787 } 788 789 /** 790 * Returns the number of rows matching the dynamic query. 791 * 792 * @param dynamicQuery the dynamic query 793 * @param projection the projection to apply to the query 794 * @return the number of rows matching the dynamic query 795 */ 796 public static long dynamicQueryCount( 797 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 798 com.liferay.portal.kernel.dao.orm.Projection projection) { 799 return getService().dynamicQueryCount(dynamicQuery, projection); 800 } 801 802 public static void addActivity( 803 com.liferay.social.kernel.model.SocialActivity activity, 804 com.liferay.social.kernel.model.SocialActivity mirrorActivity) 805 throws com.liferay.portal.kernel.exception.PortalException { 806 getService().addActivity(activity, mirrorActivity); 807 } 808 809 /** 810 * Records an activity in the database, using a time based on the current 811 * time in an attempt to make the activity's time unique. 812 * 813 * @param userId the primary key of the acting user 814 * @param groupId the primary key of the group 815 * @param className the target asset's class name 816 * @param classPK the primary key of the target asset 817 * @param type the activity's type 818 * @param extraData any extra data regarding the activity 819 * @param receiverUserId the primary key of the receiving user 820 */ 821 public static void addActivity(long userId, long groupId, 822 java.lang.String className, long classPK, int type, 823 java.lang.String extraData, long receiverUserId) 824 throws com.liferay.portal.kernel.exception.PortalException { 825 getService() 826 .addActivity(userId, groupId, className, classPK, type, extraData, 827 receiverUserId); 828 } 829 830 /** 831 * Records an activity with the given time in the database. 832 * 833 * <p> 834 * This method records a social activity done on an asset, identified by its 835 * class name and class primary key, in the database. Additional information 836 * (such as the original message ID for a reply to a forum post) is passed 837 * in via the <code>extraData</code> in JSON format. For activities 838 * affecting another user, a mirror activity is generated that describes the 839 * action from the user's point of view. The target user's ID is passed in 840 * via the <code>receiverUserId</code>. 841 * </p> 842 * 843 * <p> 844 * Example for a mirrored activity:<br> When a user replies to a message 845 * boards post, the reply action is stored in the database with the 846 * <code>receiverUserId</code> being the ID of the author of the original 847 * message. The <code>extraData</code> contains the ID of the original 848 * message in JSON format. A mirror activity is generated with the values of 849 * the <code>userId</code> and the <code>receiverUserId</code> swapped. This 850 * mirror activity basically describes a "replied to" event. 851 * </p> 852 * 853 * <p> 854 * Mirror activities are most often used in relation to friend requests and 855 * activities. 856 * </p> 857 * 858 * @param userId the primary key of the acting user 859 * @param groupId the primary key of the group 860 * @param createDate the activity's date 861 * @param className the target asset's class name 862 * @param classPK the primary key of the target asset 863 * @param type the activity's type 864 * @param extraData any extra data regarding the activity 865 * @param receiverUserId the primary key of the receiving user 866 */ 867 public static void addActivity(long userId, long groupId, 868 java.util.Date createDate, java.lang.String className, long classPK, 869 int type, java.lang.String extraData, long receiverUserId) 870 throws com.liferay.portal.kernel.exception.PortalException { 871 getService() 872 .addActivity(userId, groupId, createDate, className, classPK, type, 873 extraData, receiverUserId); 874 } 875 876 /** 877 * Records an activity with the current time in the database, but only if 878 * there isn't one with the same parameters. 879 * 880 * <p> 881 * For the main functionality see {@link #addActivity(long, long, Date, 882 * String, long, int, String, long)} 883 * </p> 884 * 885 * @param userId the primary key of the acting user 886 * @param groupId the primary key of the group 887 * @param className the target asset's class name 888 * @param classPK the primary key of the target asset 889 * @param type the activity's type 890 * @param extraData any extra data regarding the activity 891 * @param receiverUserId the primary key of the receiving user 892 */ 893 public static void addUniqueActivity(long userId, long groupId, 894 java.lang.String className, long classPK, int type, 895 java.lang.String extraData, long receiverUserId) 896 throws com.liferay.portal.kernel.exception.PortalException { 897 getService() 898 .addUniqueActivity(userId, groupId, className, classPK, type, 899 extraData, receiverUserId); 900 } 901 902 /** 903 * Records an activity in the database, but only if there isn't already an 904 * activity with the same parameters. 905 * 906 * <p> 907 * For the main functionality see {@link #addActivity(long, long, Date, 908 * String, long, int, String, long)} 909 * </p> 910 * 911 * @param userId the primary key of the acting user 912 * @param groupId the primary key of the group 913 * @param createDate the activity's date 914 * @param className the target asset's class name 915 * @param classPK the primary key of the target asset 916 * @param type the activity's type 917 * @param extraData any extra data regarding the activity 918 * @param receiverUserId the primary key of the receiving user 919 */ 920 public static void addUniqueActivity(long userId, long groupId, 921 java.util.Date createDate, java.lang.String className, long classPK, 922 int type, java.lang.String extraData, long receiverUserId) 923 throws com.liferay.portal.kernel.exception.PortalException { 924 getService() 925 .addUniqueActivity(userId, groupId, createDate, className, classPK, 926 type, extraData, receiverUserId); 927 } 928 929 /** 930 * Removes stored activities for the asset. 931 * 932 * @param assetEntry the asset from which to remove stored activities 933 */ 934 public static void deleteActivities( 935 com.liferay.asset.kernel.model.AssetEntry assetEntry) 936 throws com.liferay.portal.kernel.exception.PortalException { 937 getService().deleteActivities(assetEntry); 938 } 939 940 /** 941 * Removes stored activities for the asset identified by the class name and 942 * class primary key. 943 * 944 * @param className the target asset's class name 945 * @param classPK the primary key of the target asset 946 */ 947 public static void deleteActivities(java.lang.String className, long classPK) 948 throws com.liferay.portal.kernel.exception.PortalException { 949 getService().deleteActivities(className, classPK); 950 } 951 952 public static void deleteActivities(long groupId) { 953 getService().deleteActivities(groupId); 954 } 955 956 /** 957 * Removes the stored activity and its mirror activity from the database. 958 * 959 * @param activity the activity to be removed 960 */ 961 public static void deleteActivity( 962 com.liferay.social.kernel.model.SocialActivity activity) 963 throws com.liferay.portal.kernel.exception.PortalException { 964 getService().deleteActivity(activity); 965 } 966 967 /** 968 * Removes the stored activity from the database. 969 * 970 * @param activityId the primary key of the stored activity 971 */ 972 public static void deleteActivity(long activityId) 973 throws com.liferay.portal.kernel.exception.PortalException { 974 getService().deleteActivity(activityId); 975 } 976 977 /** 978 * Removes the user's stored activities from the database. 979 * 980 * <p> 981 * This method removes all activities where the user is either the actor or 982 * the receiver. 983 * </p> 984 * 985 * @param userId the primary key of the user 986 */ 987 public static void deleteUserActivities(long userId) 988 throws com.liferay.portal.kernel.exception.PortalException { 989 getService().deleteUserActivities(userId); 990 } 991 992 public static SocialActivityLocalService getService() { 993 if (_service == null) { 994 _service = (SocialActivityLocalService)PortalBeanLocatorUtil.locate(SocialActivityLocalService.class.getName()); 995 996 ReferenceRegistry.registerReference(SocialActivityLocalServiceUtil.class, 997 "_service"); 998 } 999 1000 return _service; 1001 } 1002 1003 private static SocialActivityLocalService _service; 1004 }