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