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