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