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