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