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