001 /** 002 * Copyright (c) 2000-2012 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 com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.transaction.Isolation; 020 import com.liferay.portal.kernel.transaction.Propagation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 import com.liferay.portal.service.BaseLocalService; 023 import com.liferay.portal.service.PersistedModelLocalService; 024 025 /** 026 * The interface for the social activity counter local service. 027 * 028 * <p> 029 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 030 * </p> 031 * 032 * @author Brian Wing Shun Chan 033 * @see SocialActivityCounterLocalServiceUtil 034 * @see com.liferay.portlet.social.service.base.SocialActivityCounterLocalServiceBaseImpl 035 * @see com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl 036 * @generated 037 */ 038 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 039 PortalException.class, SystemException.class}) 040 public interface SocialActivityCounterLocalService extends BaseLocalService, 041 PersistedModelLocalService { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify or reference this interface directly. Always use {@link SocialActivityCounterLocalServiceUtil} to access the social activity counter local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 046 */ 047 048 /** 049 * Adds the social activity counter to the database. Also notifies the appropriate model listeners. 050 * 051 * @param socialActivityCounter the social activity counter 052 * @return the social activity counter that was added 053 * @throws SystemException if a system exception occurred 054 */ 055 public com.liferay.portlet.social.model.SocialActivityCounter addSocialActivityCounter( 056 com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter) 057 throws com.liferay.portal.kernel.exception.SystemException; 058 059 /** 060 * Creates a new social activity counter with the primary key. Does not add the social activity counter to the database. 061 * 062 * @param activityCounterId the primary key for the new social activity counter 063 * @return the new social activity counter 064 */ 065 public com.liferay.portlet.social.model.SocialActivityCounter createSocialActivityCounter( 066 long activityCounterId); 067 068 /** 069 * Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners. 070 * 071 * @param activityCounterId the primary key of the social activity counter 072 * @return the social activity counter that was removed 073 * @throws PortalException if a social activity counter with the primary key could not be found 074 * @throws SystemException if a system exception occurred 075 */ 076 public com.liferay.portlet.social.model.SocialActivityCounter deleteSocialActivityCounter( 077 long activityCounterId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException; 080 081 /** 082 * Deletes the social activity counter from the database. Also notifies the appropriate model listeners. 083 * 084 * @param socialActivityCounter the social activity counter 085 * @return the social activity counter that was removed 086 * @throws SystemException if a system exception occurred 087 */ 088 public com.liferay.portlet.social.model.SocialActivityCounter deleteSocialActivityCounter( 089 com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter) 090 throws com.liferay.portal.kernel.exception.SystemException; 091 092 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 093 094 /** 095 * Performs a dynamic query on the database and returns the matching rows. 096 * 097 * @param dynamicQuery the dynamic query 098 * @return the matching rows 099 * @throws SystemException if a system exception occurred 100 */ 101 @SuppressWarnings("rawtypes") 102 public java.util.List dynamicQuery( 103 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 104 throws com.liferay.portal.kernel.exception.SystemException; 105 106 /** 107 * Performs a dynamic query on the database and returns a range of the matching rows. 108 * 109 * <p> 110 * 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. 111 * </p> 112 * 113 * @param dynamicQuery the dynamic query 114 * @param start the lower bound of the range of model instances 115 * @param end the upper bound of the range of model instances (not inclusive) 116 * @return the range of matching rows 117 * @throws SystemException if a system exception occurred 118 */ 119 @SuppressWarnings("rawtypes") 120 public java.util.List dynamicQuery( 121 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 122 int end) throws com.liferay.portal.kernel.exception.SystemException; 123 124 /** 125 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 126 * 127 * <p> 128 * 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. 129 * </p> 130 * 131 * @param dynamicQuery the dynamic query 132 * @param start the lower bound of the range of model instances 133 * @param end the upper bound of the range of model instances (not inclusive) 134 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 135 * @return the ordered range of matching rows 136 * @throws SystemException if a system exception occurred 137 */ 138 @SuppressWarnings("rawtypes") 139 public java.util.List dynamicQuery( 140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 141 int end, 142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 143 throws com.liferay.portal.kernel.exception.SystemException; 144 145 /** 146 * Returns the number of rows that match the dynamic query. 147 * 148 * @param dynamicQuery the dynamic query 149 * @return the number of rows that match the dynamic query 150 * @throws SystemException if a system exception occurred 151 */ 152 public long dynamicQueryCount( 153 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 154 throws com.liferay.portal.kernel.exception.SystemException; 155 156 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 157 public com.liferay.portlet.social.model.SocialActivityCounter fetchSocialActivityCounter( 158 long activityCounterId) 159 throws com.liferay.portal.kernel.exception.SystemException; 160 161 /** 162 * Returns the social activity counter with the primary key. 163 * 164 * @param activityCounterId the primary key of the social activity counter 165 * @return the social activity counter 166 * @throws PortalException if a social activity counter with the primary key could not be found 167 * @throws SystemException if a system exception occurred 168 */ 169 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 170 public com.liferay.portlet.social.model.SocialActivityCounter getSocialActivityCounter( 171 long activityCounterId) 172 throws com.liferay.portal.kernel.exception.PortalException, 173 com.liferay.portal.kernel.exception.SystemException; 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public com.liferay.portal.model.PersistedModel getPersistedModel( 177 java.io.Serializable primaryKeyObj) 178 throws com.liferay.portal.kernel.exception.PortalException, 179 com.liferay.portal.kernel.exception.SystemException; 180 181 /** 182 * Returns a range of all the social activity counters. 183 * 184 * <p> 185 * 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. 186 * </p> 187 * 188 * @param start the lower bound of the range of social activity counters 189 * @param end the upper bound of the range of social activity counters (not inclusive) 190 * @return the range of social activity counters 191 * @throws SystemException if a system exception occurred 192 */ 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getSocialActivityCounters( 195 int start, int end) 196 throws com.liferay.portal.kernel.exception.SystemException; 197 198 /** 199 * Returns the number of social activity counters. 200 * 201 * @return the number of social activity counters 202 * @throws SystemException if a system exception occurred 203 */ 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public int getSocialActivityCountersCount() 206 throws com.liferay.portal.kernel.exception.SystemException; 207 208 /** 209 * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 210 * 211 * @param socialActivityCounter the social activity counter 212 * @return the social activity counter that was updated 213 * @throws SystemException if a system exception occurred 214 */ 215 public com.liferay.portlet.social.model.SocialActivityCounter updateSocialActivityCounter( 216 com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter) 217 throws com.liferay.portal.kernel.exception.SystemException; 218 219 /** 220 * Returns the Spring bean ID for this bean. 221 * 222 * @return the Spring bean ID for this bean 223 */ 224 public java.lang.String getBeanIdentifier(); 225 226 /** 227 * Sets the Spring bean ID for this bean. 228 * 229 * @param beanIdentifier the Spring bean ID for this bean 230 */ 231 public void setBeanIdentifier(java.lang.String beanIdentifier); 232 233 /** 234 * Adds an activity counter with a default period length. 235 * 236 * <p> 237 * This method uses the lock service to guard against multiple threads 238 * trying to insert the same counter because this service is called 239 * asynchronously from the social activity service. 240 * </p> 241 * 242 * @param groupId the primary key of the group 243 * @param classNameId the primary key of the entity's class this counter 244 belongs to 245 * @param classPK the primary key of the entity this counter belongs to 246 * @param name the counter's name 247 * @param ownerType the counter's owner type. Acceptable values are 248 <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and 249 <code>TYPE_CREATOR</code> defined in {@link 250 com.liferay.portlet.social.model.SocialActivityCounterConstants}. 251 * @param currentValue the counter's current value (optionally 252 <code>0</code>) 253 * @param totalValue the counter's total value (optionally <code>0</code>) 254 * @param startPeriod the counter's start period 255 * @param endPeriod the counter's end period 256 * @return the added activity counter 257 * @throws PortalException if the group or the previous activity counter 258 could not be found 259 * @throws SystemException if a system exception occurred 260 */ 261 public com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter( 262 long groupId, long classNameId, long classPK, java.lang.String name, 263 int ownerType, int currentValue, int totalValue, int startPeriod, 264 int endPeriod) 265 throws com.liferay.portal.kernel.exception.PortalException, 266 com.liferay.portal.kernel.exception.SystemException; 267 268 /** 269 * Adds an activity counter specifying a previous activity and period 270 * length. 271 * 272 * <p> 273 * This method uses the lock service to guard against multiple threads 274 * trying to insert the same counter because this service is called 275 * asynchronously from the social activity service. 276 * </p> 277 * 278 * @param groupId the primary key of the group 279 * @param classNameId the primary key of the entity's class this counter 280 belongs to 281 * @param classPK the primary key of the entity this counter belongs to 282 * @param name the counter name 283 * @param ownerType the counter's owner type. Acceptable values are 284 <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and 285 <code>TYPE_CREATOR</code> defined in {@link 286 com.liferay.portlet.social.model.SocialActivityCounterConstants}. 287 * @param currentValue the current value of the counter (optionally 288 <code>0</code>) 289 * @param totalValue the counter's total value (optionally <code>0</code>) 290 * @param startPeriod the counter's start period 291 * @param endPeriod the counter's end period 292 * @param previousActivityCounterId the primary key of the activity counter 293 for the previous time period (optionally <code>0</code>, if this 294 is the first) 295 * @param periodLength the period length in days, 296 <code>PERIOD_LENGTH_INFINITE</code> for never ending counters or 297 <code>PERIOD_LENGTH_SYSTEM</code> for the period length defined 298 in <code>portal-ext.properties</code>. For more information see 299 {@link 300 com.liferay.portlet.social.model.SocialActivityCounterConstants}. 301 * @return the added activity counter 302 * @throws PortalException if the group or the previous activity counter 303 could not be found 304 * @throws SystemException if a system exception occurred 305 */ 306 public com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter( 307 long groupId, long classNameId, long classPK, java.lang.String name, 308 int ownerType, int currentValue, int totalValue, int startPeriod, 309 int endPeriod, long previousActivityCounterId, int periodLength) 310 throws com.liferay.portal.kernel.exception.PortalException, 311 com.liferay.portal.kernel.exception.SystemException; 312 313 /** 314 * Adds or increments activity counters related to an activity. 315 * 316 * </p> 317 * This method is called asynchronously from the social activity service 318 * when the user performs an activity defined in 319 * </code>liferay-social.xml</code>. 320 * </p> 321 * 322 * <p> 323 * This method first calls the activity processor class, if there is one 324 * defined for the activity, checks for limits and increments all the 325 * counters that belong to the activity. Afterwards, it processes the 326 * activity with respect to achievement classes, if any. Lastly it 327 * increments the built-in <code>user.activities</code> and 328 * <code>asset.activities</code> counters. 329 * </p> 330 * 331 * @param activity the social activity 332 * @throws PortalException if an expected group or expected previous 333 activity counters could not be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public void addActivityCounters( 337 com.liferay.portlet.social.model.SocialActivity activity) 338 throws com.liferay.portal.kernel.exception.PortalException, 339 com.liferay.portal.kernel.exception.SystemException; 340 341 /** 342 * Creates an activity counter with a default period length, adding it into 343 * the database. 344 * 345 * @param groupId the primary key of the group 346 * @param classNameId the primary key of the entity's class this 347 counter belongs to 348 * @param classPK the primary key of the entity this counter belongs to 349 * @param name the counter's name 350 * @param ownerType the counter's owner type. Acceptable values are 351 <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and 352 <code>TYPE_CREATOR</code> defined in {@link 353 com.liferay.portlet.social.model.SocialActivityCounterConstants}. 354 * @param currentValue the counter's current value (optionally 355 <code>0</code>) 356 * @param totalValue the counter's total value (optionally 357 <code>0</code>) 358 * @param startPeriod the counter's start period 359 * @param endPeriod the counter's end period 360 * @return the created activity counter 361 * @throws PortalException if the group or a previous activity counter 362 could not be found 363 * @throws SystemException if a system exception occurred 364 * @deprecated {@link #createActivityCounter(long, long, long, String, int, 365 int, int, int, int, long, int)} 366 */ 367 public com.liferay.portlet.social.model.SocialActivityCounter createActivityCounter( 368 long groupId, long classNameId, long classPK, java.lang.String name, 369 int ownerType, int currentValue, int totalValue, int startPeriod, 370 int endPeriod) 371 throws com.liferay.portal.kernel.exception.PortalException, 372 com.liferay.portal.kernel.exception.SystemException; 373 374 /** 375 * Creates an activity counter, adding it into the database. 376 * 377 * <p> 378 * This method actually creates the counter in the database. It requires a 379 * new transaction so that other threads can find the new counter when the 380 * lock in the calling method is released. 381 * </p> 382 * 383 * @param groupId the primary key of the group 384 * @param classNameId the primary key of the entity's class this counter 385 belongs to 386 * @param classPK the primary key of the entity this counter belongs to 387 * @param name the counter's name 388 * @param ownerType the counter's owner type. Acceptable values are 389 <code>TYPE_ACTOR</code>, <code>TYPE_ASSET</code> and 390 <code>TYPE_CREATOR</code> defined in {@link 391 com.liferay.portlet.social.model.SocialActivityCounterConstants}. 392 * @param currentValue the counter's current value (optionally 393 <code>0</code>) 394 * @param totalValue the counter's total value of the counter (optionally 395 <code>0</code>) 396 * @param startPeriod the counter's start period 397 * @param endPeriod the counter's end period 398 * @param previousActivityCounterId the primary key of the activity counter 399 for the previous time period (optionally <code>0</code>, if this 400 is the first) 401 * @param periodLength the period length in days, 402 <code>PERIOD_LENGTH_INFINITE</code> for never ending counters or 403 <code>PERIOD_LENGTH_SYSTEM</code> for the period length defined 404 in <code>portal-ext.properties</code>. For more information see 405 {@link com.liferay.portlet.social.model.SocialActivityConstants}. 406 * @return the created activity counter 407 * @throws PortalException if the group or the previous activity counter 408 could not be found 409 * @throws SystemException if a system exception occurred 410 */ 411 public com.liferay.portlet.social.model.SocialActivityCounter createActivityCounter( 412 long groupId, long classNameId, long classPK, java.lang.String name, 413 int ownerType, int currentValue, int totalValue, int startPeriod, 414 int endPeriod, long previousActivityCounterId, int periodLength) 415 throws com.liferay.portal.kernel.exception.PortalException, 416 com.liferay.portal.kernel.exception.SystemException; 417 418 /** 419 * Deletes all activity counters, limits, and settings related to the asset. 420 * 421 * <p> 422 * This method subtracts the asset's popularity from the owner's 423 * contribution points. It also creates a new contribution period if the 424 * latest one does not belong to the current period. 425 * </p> 426 * 427 * @param assetEntry the asset entry 428 * @throws PortalException if the new contribution counter could not be 429 created 430 * @throws SystemException if a system exception occurred 431 */ 432 public void deleteActivityCounters( 433 com.liferay.portlet.asset.model.AssetEntry assetEntry) 434 throws com.liferay.portal.kernel.exception.PortalException, 435 com.liferay.portal.kernel.exception.SystemException; 436 437 /** 438 * Deletes all activity counters, limits, and settings related to the entity 439 * identified by the class name ID and class primary key. 440 * 441 * @param classNameId the primary key of the entity's class 442 * @param classPK the primary key of the entity 443 * @throws PortalException if the entity is an asset and its owner's 444 contribution counter could not be updated 445 * @throws SystemException if a system exception occurred 446 */ 447 public void deleteActivityCounters(long classNameId, long classPK) 448 throws com.liferay.portal.kernel.exception.PortalException, 449 com.liferay.portal.kernel.exception.SystemException; 450 451 /** 452 * Deletes all activity counters for the entity identified by the class name 453 * and class primary key. 454 * 455 * @param className the entity's class name 456 * @param classPK the primary key of the entity 457 * @throws PortalException if the entity is an asset and its owner's 458 contribution counter could not be updated 459 * @throws SystemException if a system exception occurred 460 */ 461 public void deleteActivityCounters(java.lang.String className, long classPK) 462 throws com.liferay.portal.kernel.exception.PortalException, 463 com.liferay.portal.kernel.exception.SystemException; 464 465 /** 466 * Disables all the counters of an asset identified by the class name ID and 467 * class primary key. 468 * 469 * <p> 470 * This method is used by the recycle bin to disable all counters of assets 471 * put into the recycle bin. It adjusts the owner's contribution score. 472 * </p> 473 * 474 * @param classNameId the primary key of the asset's class 475 * @param classPK the primary key of the asset 476 * @throws PortalException if the asset owner's contribution counter could 477 not be updated 478 * @throws SystemException if a system exception occurred 479 */ 480 public void disableActivityCounters(long classNameId, long classPK) 481 throws com.liferay.portal.kernel.exception.PortalException, 482 com.liferay.portal.kernel.exception.SystemException; 483 484 /** 485 * Disables all the counters of an asset identified by the class name and 486 * class primary key. 487 * 488 * <p> 489 * This method is used by the recycle bin to disable all counters of assets 490 * put into the recycle bin. It adjusts the owner's contribution score. 491 * </p> 492 * 493 * @param className the asset's class name 494 * @param classPK the primary key of the asset 495 * @throws PortalException if the asset owner's contribution counter could 496 not be updated 497 * @throws SystemException if a system exception occurred 498 */ 499 public void disableActivityCounters(java.lang.String className, long classPK) 500 throws com.liferay.portal.kernel.exception.PortalException, 501 com.liferay.portal.kernel.exception.SystemException; 502 503 /** 504 * Enables all activity counters of an asset identified by the class name ID 505 * and class primary key. 506 * 507 * <p> 508 * This method is used by the recycle bin to enable all counters of assets 509 * restored from the recycle bin. It adjusts the owner's contribution score. 510 * </p> 511 * 512 * @param classNameId the primary key of the asset's class 513 * @param classPK the primary key of the asset 514 * @throws PortalException if the asset owner's contribution counter could 515 not be updated 516 * @throws SystemException if a system exception occurred 517 */ 518 public void enableActivityCounters(long classNameId, long classPK) 519 throws com.liferay.portal.kernel.exception.PortalException, 520 com.liferay.portal.kernel.exception.SystemException; 521 522 /** 523 * Enables all the counters of an asset identified by the class name and 524 * class primary key. 525 * 526 * <p> 527 * This method is used by the recycle bin to enable all counters of assets 528 * restored from the recycle bin. It adjusts the owner's contribution score. 529 * </p> 530 * 531 * @param className the asset's class name 532 * @param classPK the primary key of the asset 533 * @throws PortalException if the asset owner's contribution counter could 534 not be updated 535 * @throws SystemException if a system exception occurred 536 */ 537 public void enableActivityCounters(java.lang.String className, long classPK) 538 throws com.liferay.portal.kernel.exception.PortalException, 539 com.liferay.portal.kernel.exception.SystemException; 540 541 /** 542 * Returns the activity counter with the given name, owner, and end period 543 * that belong to the given entity. 544 * 545 * @param groupId the primary key of the group 546 * @param classNameId the primary key of the entity's class 547 * @param classPK the primary key of the entity 548 * @param name the counter name 549 * @param ownerType the owner type 550 * @param endPeriod the end period, <code>-1</code> for the latest one 551 * @return the matching activity counter 552 * @throws SystemException if a system exception occurred 553 */ 554 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 555 public com.liferay.portlet.social.model.SocialActivityCounter fetchActivityCounterByEndPeriod( 556 long groupId, long classNameId, long classPK, java.lang.String name, 557 int ownerType, int endPeriod) 558 throws com.liferay.portal.kernel.exception.SystemException; 559 560 /** 561 * Returns the activity counter with the given name, owner, and start period 562 * that belong to the given entity. 563 * 564 * @param groupId the primary key of the group 565 * @param classNameId the primary key of the entity's class 566 * @param classPK the primary key of the entity 567 * @param name the counter name 568 * @param ownerType the owner type 569 * @param startPeriod the start period 570 * @return the matching activity counter 571 * @throws SystemException if a system exception occurred 572 */ 573 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 574 public com.liferay.portlet.social.model.SocialActivityCounter fetchActivityCounterByStartPeriod( 575 long groupId, long classNameId, long classPK, java.lang.String name, 576 int ownerType, int startPeriod) 577 throws com.liferay.portal.kernel.exception.SystemException; 578 579 /** 580 * Returns the latest activity counter with the given name and owner that 581 * belong to the given entity. 582 * 583 * @param groupId the primary key of the group 584 * @param classNameId the primary key of the entity's class 585 * @param classPK the primary key of the entity 586 * @param name the counter name 587 * @param ownerType the owner type 588 * @return the matching activity counter 589 * @throws SystemException if a system exception occurred 590 */ 591 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 592 public com.liferay.portlet.social.model.SocialActivityCounter fetchLatestActivityCounter( 593 long groupId, long classNameId, long classPK, java.lang.String name, 594 int ownerType) 595 throws com.liferay.portal.kernel.exception.SystemException; 596 597 /** 598 * Returns all the activity counters with the given name and period offsets. 599 * 600 * <p> 601 * The start and end offsets can belong to different periods. This method 602 * groups the counters by name and returns the sum of their current values. 603 * </p> 604 * 605 * @param groupId the primary key of the group 606 * @param name the counter name 607 * @param startOffset the offset for the start period 608 * @param endOffset the offset for the end period 609 * @return the matching activity counters 610 * @throws SystemException if a system exception occurred 611 */ 612 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 613 public java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetActivityCounters( 614 long groupId, java.lang.String name, int startOffset, int endOffset) 615 throws com.liferay.portal.kernel.exception.SystemException; 616 617 /** 618 * Returns the distribution of the activity counters with the given name and 619 * period offsets. 620 * 621 * <p> 622 * The start and end offsets can belong to different periods. This method 623 * groups the counters by their owner entity (usually some asset) and 624 * returns a counter for each entity class with the sum of the counters' 625 * current values. 626 * </p> 627 * 628 * @param groupId the primary key of the group 629 * @param name the counter name 630 * @param startOffset the offset for the start period 631 * @param endOffset the offset for the end period 632 * @return the distribution of matching activity counters 633 * @throws SystemException if a system exception occurred 634 */ 635 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 636 public java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetDistributionActivityCounters( 637 long groupId, java.lang.String name, int startOffset, int endOffset) 638 throws com.liferay.portal.kernel.exception.SystemException; 639 640 /** 641 * Returns all the activity counters with the given name and time period. 642 * 643 * <p> 644 * The start and end period values can belong to different periods. This 645 * method groups the counters by name and returns the sum of their current 646 * values. 647 * </p> 648 * 649 * @param groupId the primary key of the group 650 * @param name the counter name 651 * @param startPeriod the start period 652 * @param endPeriod the end period 653 * @return the matching activity counters 654 * @throws SystemException if a system exception occurred 655 */ 656 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 657 public java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodActivityCounters( 658 long groupId, java.lang.String name, int startPeriod, int endPeriod) 659 throws com.liferay.portal.kernel.exception.SystemException; 660 661 /** 662 * Returns the distribution of activity counters with the given name and 663 * time period. 664 * 665 * <p> 666 * The start and end period values can belong to different periods. This 667 * method groups the counters by their owner entity (usually some asset) and 668 * returns a counter for each entity class with the sum of the counters' 669 * current values. 670 * </p> 671 * 672 * @param groupId the primary key of the group 673 * @param name the counter name 674 * @param startPeriod the start period 675 * @param endPeriod the end period 676 * @return the distribution of matching activity counters 677 * @throws SystemException if a system exception occurred 678 */ 679 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 680 public java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodDistributionActivityCounters( 681 long groupId, java.lang.String name, int startPeriod, int endPeriod) 682 throws com.liferay.portal.kernel.exception.SystemException; 683 684 /** 685 * Returns the range of tuples that contain users and a list of activity 686 * counters. 687 * 688 * <p> 689 * The counters returned for each user are passed to this method in the 690 * selectedNames array. The method also accepts an array of counter names 691 * that are used to rank the users. 692 * </p> 693 * 694 * <p> 695 * Useful when paginating results. Returns a maximum of <code>end - 696 * start</code> instances. <code>start</code> and <code>end</code> are not 697 * primary keys, they are indexes in the result set. Thus, <code>0</code> 698 * refers to the first result in the set. Setting both <code>start</code> 699 * and <code>end</code> to {@link 700 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 701 * result set. 702 * </p> 703 * 704 * @param groupId the primary key of the group 705 * @param rankingNames the ranking counter names 706 * @param selectedNames the counter names that will be returned with each 707 user 708 * @param start the lower bound of the range of results 709 * @param end the upper bound of the range of results (not inclusive) 710 * @return the range of matching tuples 711 * @throws SystemException if a system exception occurred 712 */ 713 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 714 public java.util.List<com.liferay.portal.kernel.util.Tuple> getUserActivityCounters( 715 long groupId, java.lang.String[] rankingNames, 716 java.lang.String[] selectedNames, int start, int end) 717 throws com.liferay.portal.kernel.exception.SystemException; 718 719 /** 720 * Returns the number of users having a rank based on the given counters. 721 * 722 * @param groupId the primary key of the group 723 * @param rankingNames the ranking counter names 724 * @return the number of matching users 725 * @throws SystemException if a system exception occurred 726 */ 727 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 728 public int getUserActivityCountersCount(long groupId, 729 java.lang.String[] rankingNames) 730 throws com.liferay.portal.kernel.exception.SystemException; 731 732 /** 733 * Increments the <code>user.achievements</code> counter for a user. 734 * 735 * <p> 736 * This method should be used by an external achievement class when the 737 * users unlocks an achievement. 738 * </p> 739 * 740 * @param userId the primary key of the user 741 * @param groupId the primary key of the group 742 * @throws PortalException if the group or an expected previous activity 743 counter could not be found 744 * @throws SystemException if a system exception occurred 745 */ 746 public void incrementUserAchievementCounter(long userId, long groupId) 747 throws com.liferay.portal.kernel.exception.PortalException, 748 com.liferay.portal.kernel.exception.SystemException; 749 }