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