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