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.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 022 import com.liferay.portal.kernel.security.access.control.AccessControlled; 023 import com.liferay.portal.kernel.service.BaseService; 024 import com.liferay.portal.kernel.transaction.Isolation; 025 import com.liferay.portal.kernel.transaction.Propagation; 026 import com.liferay.portal.kernel.transaction.Transactional; 027 028 import com.liferay.social.kernel.model.SocialActivity; 029 030 import java.util.List; 031 032 /** 033 * Provides the remote service interface for SocialActivity. Methods of this 034 * service are expected to have security checks based on the propagated JAAS 035 * credentials because this service can be accessed remotely. 036 * 037 * @author Brian Wing Shun Chan 038 * @see SocialActivityServiceUtil 039 * @see com.liferay.portlet.social.service.base.SocialActivityServiceBaseImpl 040 * @see com.liferay.portlet.social.service.impl.SocialActivityServiceImpl 041 * @generated 042 */ 043 @AccessControlled 044 @JSONWebService 045 @ProviderType 046 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 047 PortalException.class, SystemException.class}) 048 public interface SocialActivityService extends BaseService { 049 /* 050 * NOTE FOR DEVELOPERS: 051 * 052 * Never modify or reference this interface directly. Always use {@link SocialActivityServiceUtil} to access the social activity remote service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 053 */ 054 055 /** 056 * Returns the activity identified by its primary key. 057 * 058 * @param activityId the primary key of the activity 059 * @return Returns the activity 060 */ 061 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 062 public SocialActivity getActivity(long activityId) 063 throws PortalException; 064 065 /** 066 * Returns the activity that has the mirror activity. 067 * 068 * @param mirrorActivityId the primary key of the mirror activity 069 * @return Returns the mirror activity 070 */ 071 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 072 public SocialActivity getMirrorActivity(long mirrorActivityId) 073 throws PortalException; 074 075 /** 076 * Returns the number of activities done on assets identified by class name. 077 * 078 * @param className the target asset's class name 079 * @return the number of matching activities 080 */ 081 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 082 public int getActivitiesCount(java.lang.String className); 083 084 /** 085 * Returns the number of activities done on assets identified by the class 086 * name ID. 087 * 088 * @param classNameId the target asset's class name ID 089 * @return the number of matching activities 090 */ 091 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 092 public int getActivitiesCount(long classNameId); 093 094 /** 095 * Returns the number of activities done on the asset identified by the 096 * class name and class primary key that are mirrors of the activity 097 * identified by the mirror activity ID. 098 * 099 * @param mirrorActivityId the primary key of the mirror activity 100 * @param className the target asset's class name 101 * @param classPK the primary key of the target asset 102 * @return the number of matching activities 103 */ 104 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 105 public int getActivitiesCount(long mirrorActivityId, 106 java.lang.String className, long classPK); 107 108 /** 109 * Returns the number of activities done on the asset identified by the 110 * class name ID and class primary key that are mirrors of the activity 111 * identified by the mirror activity ID. 112 * 113 * @param mirrorActivityId the primary key of the mirror activity 114 * @param classNameId the target asset's class name ID 115 * @param classPK the primary key of the target asset 116 * @return the number of matching activities 117 */ 118 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 119 public int getActivitiesCount(long mirrorActivityId, long classNameId, 120 long classPK); 121 122 /** 123 * Returns the number of activities done in the group. 124 * 125 * <p> 126 * This method only counts activities without mirrors. 127 * </p> 128 * 129 * @param groupId the primary key of the group 130 * @return the number of matching activities 131 */ 132 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 133 public int getGroupActivitiesCount(long groupId); 134 135 /** 136 * Returns the number of activities done by users that are members of the 137 * group. 138 * 139 * <p> 140 * This method only counts activities without mirrors. 141 * </p> 142 * 143 * @param groupId the primary key of the group 144 * @return the number of matching activities 145 */ 146 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 147 public int getGroupUsersActivitiesCount(long groupId); 148 149 /** 150 * Returns the number of activities done in the organization. This method 151 * only counts activities without mirrors. 152 * 153 * @param organizationId the primary key of the organization 154 * @return the number of matching activities 155 */ 156 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 157 public int getOrganizationActivitiesCount(long organizationId); 158 159 /** 160 * Returns the number of activities done by users of the organization. This 161 * method only counts activities without mirrors. 162 * 163 * @param organizationId the primary key of the organization 164 * @return the number of matching activities 165 */ 166 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 167 public int getOrganizationUsersActivitiesCount(long organizationId); 168 169 /** 170 * Returns the number of activities done by users in a relationship with the 171 * user identified by userId. 172 * 173 * @param userId the primary key of the user 174 * @return the number of matching activities 175 */ 176 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 177 public int getRelationActivitiesCount(long userId); 178 179 /** 180 * Returns the number of activities done by users in a relationship of type 181 * <code>type</code> with the user identified by <code>userId</code>. This 182 * method only counts activities without mirrors. 183 * 184 * @param userId the primary key of the user 185 * @param type the relationship type 186 * @return the number of matching activities 187 */ 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public int getRelationActivitiesCount(long userId, int type); 190 191 /** 192 * Returns the number of activities done by the user. 193 * 194 * @param userId the primary key of the user 195 * @return the number of matching activities 196 */ 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public int getUserActivitiesCount(long userId); 199 200 /** 201 * Returns the number of activities done in user's groups. This method only 202 * counts activities without mirrors. 203 * 204 * @param userId the primary key of the user 205 * @return the number of matching activities 206 */ 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public int getUserGroupsActivitiesCount(long userId); 209 210 /** 211 * Returns the number of activities done in user's groups and organizations. 212 * This method only counts activities without mirrors. 213 * 214 * @param userId the primary key of the user 215 * @return the number of matching activities 216 */ 217 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 218 public int getUserGroupsAndOrganizationsActivitiesCount(long userId); 219 220 /** 221 * Returns the number of activities done in the user's organizations. This 222 * method only counts activities without mirrors. 223 * 224 * @param userId the primary key of the user 225 * @return the number of matching activities 226 */ 227 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 228 public int getUserOrganizationsActivitiesCount(long userId); 229 230 /** 231 * Returns the OSGi service identifier. 232 * 233 * @return the OSGi service identifier 234 */ 235 public java.lang.String getOSGiServiceIdentifier(); 236 237 /** 238 * Returns a range of all the activities done on assets identified by the 239 * class name. 240 * 241 * <p> 242 * Useful when paginating results. Returns a maximum of <code>end - 243 * start</code> instances. <code>start</code> and <code>end</code> are not 244 * primary keys, they are indexes in the result set. Thus, <code>0</code> 245 * refers to the first result in the set. Setting both <code>start</code> 246 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 247 * result set. 248 * </p> 249 * 250 * @param className the target asset's class name 251 * @param start the lower bound of the range of results 252 * @param end the upper bound of the range of results (not inclusive) 253 * @return the range of matching activities 254 */ 255 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 256 public List<SocialActivity> getActivities(java.lang.String className, 257 int start, int end) throws PortalException; 258 259 /** 260 * Returns a range of all the activities done on assets identified by the 261 * class name ID. 262 * 263 * <p> 264 * Useful when paginating results. Returns a maximum of <code>end - 265 * start</code> instances. <code>start</code> and <code>end</code> are not 266 * primary keys, they are indexes in the result set. Thus, <code>0</code> 267 * refers to the first result in the set. Setting both <code>start</code> 268 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 269 * result set. 270 * </p> 271 * 272 * @param classNameId the target asset's class name ID 273 * @param start the lower bound of the range of results 274 * @param end the upper bound of the range of results (not inclusive) 275 * @return the range of matching activities 276 */ 277 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 278 public List<SocialActivity> getActivities(long classNameId, int start, 279 int end) throws PortalException; 280 281 /** 282 * Returns a range of all the activities done on the asset identified by the 283 * class name and the class primary key that are mirrors of the activity 284 * identified by the mirror activity ID. 285 * 286 * <p> 287 * Useful when paginating results. Returns a maximum of <code>end - 288 * start</code> instances. <code>start</code> and <code>end</code> are not 289 * primary keys, they are indexes in the result set. Thus, <code>0</code> 290 * refers to the first result in the set. Setting both <code>start</code> 291 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 292 * result set. 293 * </p> 294 * 295 * @param mirrorActivityId the primary key of the mirror activity 296 * @param className the target asset's class name 297 * @param classPK the primary key of the target asset 298 * @param start the lower bound of the range of results 299 * @param end the upper bound of the range of results (not inclusive) 300 * @return the range of matching activities 301 */ 302 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 303 public List<SocialActivity> getActivities(long mirrorActivityId, 304 java.lang.String className, long classPK, int start, int end) 305 throws PortalException; 306 307 /** 308 * Returns a range of all the activities done on the asset identified by the 309 * class name ID and class primary key that are mirrors of the activity 310 * identified by the mirror activity ID. 311 * 312 * <p> 313 * Useful when paginating results. Returns a maximum of <code>end - 314 * start</code> instances. <code>start</code> and <code>end</code> are not 315 * primary keys, they are indexes in the result set. Thus, <code>0</code> 316 * refers to the first result in the set. Setting both <code>start</code> 317 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 318 * result set. 319 * </p> 320 * 321 * @param mirrorActivityId the primary key of the mirror activity 322 * @param classNameId the target asset's class name ID 323 * @param classPK the primary key of the target asset 324 * @param start the lower bound of the range of results 325 * @param end the upper bound of the range of results (not inclusive) 326 * @return the range of matching activities 327 */ 328 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 329 public List<SocialActivity> getActivities(long mirrorActivityId, 330 long classNameId, long classPK, int start, int end) 331 throws PortalException; 332 333 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 334 public List<SocialActivity> getActivitySetActivities(long activitySetId, 335 int start, int end) throws PortalException; 336 337 /** 338 * Returns a range of all the activities done in the group. 339 * 340 * <p> 341 * This method only finds activities without mirrors. 342 * </p> 343 * 344 * <p> 345 * Useful when paginating results. Returns a maximum of <code>end - 346 * start</code> instances. <code>start</code> and <code>end</code> are not 347 * primary keys, they are indexes in the result set. Thus, <code>0</code> 348 * refers to the first result in the set. Setting both <code>start</code> 349 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 350 * result set. 351 * </p> 352 * 353 * @param groupId the primary key of the group 354 * @param start the lower bound of the range of results 355 * @param end the upper bound of the range of results (not inclusive) 356 * @return the range of matching activities 357 */ 358 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 359 public List<SocialActivity> getGroupActivities(long groupId, int start, 360 int end) throws PortalException; 361 362 /** 363 * Returns a range of activities done by users that are members of the 364 * group. 365 * 366 * <p> 367 * This method only finds activities without mirrors. 368 * </p> 369 * 370 * <p> 371 * Useful when paginating results. Returns a maximum of <code>end - 372 * start</code> instances. <code>start</code> and <code>end</code> are not 373 * primary keys, they are indexes in the result set. Thus, <code>0</code> 374 * refers to the first result in the set. Setting both <code>start</code> 375 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 376 * result set. 377 * </p> 378 * 379 * @param groupId the primary key of the group 380 * @param start the lower bound of the range of results 381 * @param end the upper bound of the range of results (not inclusive) 382 * @return the range of matching activities 383 */ 384 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 385 public List<SocialActivity> getGroupUsersActivities(long groupId, 386 int start, int end) throws PortalException; 387 388 /** 389 * Returns a range of all the activities done in the organization. This 390 * method only finds activities without mirrors. 391 * 392 * <p> 393 * Useful when paginating results. Returns a maximum of <code>end - 394 * start</code> instances. <code>start</code> and <code>end</code> are not 395 * primary keys, they are indexes in the result set. Thus, <code>0</code> 396 * refers to the first result in the set. Setting both <code>start</code> 397 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 398 * result set. 399 * </p> 400 * 401 * @param organizationId the primary key of the organization 402 * @param start the lower bound of the range of results 403 * @param end the upper bound of the range of results (not inclusive) 404 * @return the range of matching activities 405 */ 406 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 407 public List<SocialActivity> getOrganizationActivities(long organizationId, 408 int start, int end) throws PortalException; 409 410 /** 411 * Returns a range of all the activities done by users of the organization. 412 * This method only finds activities without mirrors. 413 * 414 * <p> 415 * Useful when paginating results. Returns a maximum of <code>end - 416 * start</code> instances. <code>start</code> and <code>end</code> are not 417 * primary keys, they are indexes in the result set. Thus, <code>0</code> 418 * refers to the first result in the set. Setting both <code>start</code> 419 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 420 * result set. 421 * </p> 422 * 423 * @param organizationId the primary key of the organization 424 * @param start the lower bound of the range of results 425 * @param end the upper bound of the range of results (not inclusive) 426 * @return the range of matching activities 427 */ 428 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 429 public List<SocialActivity> getOrganizationUsersActivities( 430 long organizationId, int start, int end) throws PortalException; 431 432 /** 433 * Returns a range of all the activities done by users in a relationship 434 * with the user identified by the user ID. 435 * 436 * <p> 437 * Useful when paginating results. Returns a maximum of <code>end - 438 * start</code> instances. <code>start</code> and <code>end</code> are not 439 * primary keys, they are indexes in the result set. Thus, <>0</code> refers 440 * to the first result in the set. Setting both <code>start</code> and 441 * <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result 442 * set. 443 * </p> 444 * 445 * @param userId the primary key of the user 446 * @param start the lower bound of the range of results 447 * @param end the upper bound of the range of results (not inclusive) 448 * @return the range of matching activities 449 */ 450 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 451 public List<SocialActivity> getRelationActivities(long userId, int start, 452 int end) throws PortalException; 453 454 /** 455 * Returns a range of all the activities done by users in a relationship of 456 * type <code>type</code> with the user identified by <code>userId</code>. 457 * This method only finds activities without mirrors. 458 * 459 * <p> 460 * Useful when paginating results. Returns a maximum of <code>end - 461 * start</code> instances. <code>start</code> and <code>end</code> are not 462 * primary keys, they are indexes in the result set. Thus, <code>0</code> 463 * refers to the first result in the set. Setting both <code>start</code> 464 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 465 * result set. 466 * </p> 467 * 468 * @param userId the primary key of the user 469 * @param type the relationship type 470 * @param start the lower bound of the range of results 471 * @param end the upper bound of the range of results (not inclusive) 472 * @return the range of matching activities 473 */ 474 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 475 public List<SocialActivity> getRelationActivities(long userId, int type, 476 int start, int end) throws PortalException; 477 478 /** 479 * Returns a range of all the activities done by the user. 480 * 481 * <p> 482 * Useful when paginating results. Returns a maximum of <code>end - 483 * start</code> instances. <code>start</code> and <code>end</code> are not 484 * primary keys, they are indexes in the result set. Thus, <code>0</code> 485 * refers to the first result in the set. Setting both <code>start</code> 486 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 487 * result set. 488 * </p> 489 * 490 * @param userId the primary key of the user 491 * @param start the lower bound of the range of results 492 * @param end the upper bound of the range of results (not inclusive) 493 * @return the range of matching activities 494 */ 495 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 496 public List<SocialActivity> getUserActivities(long userId, int start, 497 int end) throws PortalException; 498 499 /** 500 * Returns a range of all the activities done in the user's groups. This 501 * method only finds activities without mirrors. 502 * 503 * <p> 504 * Useful when paginating results. Returns a maximum of <code>end - 505 * start</code> instances. <code>start</code> and <code>end</code> are not 506 * primary keys, they are indexes in the result set. Thus, <code>0</code> 507 * refers to the first result in the set. Setting both <code>start</code> 508 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 509 * result set. 510 * </p> 511 * 512 * @param userId the primary key of the user 513 * @param start the lower bound of the range of results 514 * @param end the upper bound of the range of results (not inclusive) 515 * @return the range of matching activities 516 */ 517 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 518 public List<SocialActivity> getUserGroupsActivities(long userId, int start, 519 int end) throws PortalException; 520 521 /** 522 * Returns a range of all the activities done in the user's groups and 523 * organizations. This method only finds activities without mirrors. 524 * 525 * <p> 526 * Useful when paginating results. Returns a maximum of <code>end - 527 * start</code> instances. <code>start</code> and <code>end</code> are not 528 * primary keys, they are indexes in the result set. Thus, <code>0</code> 529 * refers to the first result in the set. Setting both <code>start</code> 530 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 531 * result set. 532 * </p> 533 * 534 * @param userId the primary key of the user 535 * @param start the lower bound of the range of results 536 * @param end the upper bound of the range of results (not inclusive) 537 * @return the range of matching activities 538 */ 539 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 540 public List<SocialActivity> getUserGroupsAndOrganizationsActivities( 541 long userId, int start, int end) throws PortalException; 542 543 /** 544 * Returns a range of all activities done in the user's organizations. This 545 * method only finds activities without mirrors. 546 * 547 * <p> 548 * Useful when paginating results. Returns a maximum of <code>end - 549 * start</code> instances. <code>start</code> and <code>end</code> are not 550 * primary keys, they are indexes in the result set. Thus, <code>0</code> 551 * refers to the first result in the set. Setting both <code>start</code> 552 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 553 * result set. 554 * </p> 555 * 556 * @param userId the primary key of the user 557 * @param start the lower bound of the range of results 558 * @param end the upper bound of the range of results (not inclusive) 559 * @return the range of matching activities 560 */ 561 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 562 public List<SocialActivity> getUserOrganizationsActivities(long userId, 563 int start, int end) throws PortalException; 564 }