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 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 594 return getService().getIndexableActionableDynamicQuery(); 595 } 596 597 /** 598 * Returns the OSGi service identifier. 599 * 600 * @return the OSGi service identifier 601 */ 602 public static java.lang.String getOSGiServiceIdentifier() { 603 return getService().getOSGiServiceIdentifier(); 604 } 605 606 /** 607 * Returns all the activity counters with the given name and period offsets. 608 * 609 * <p> 610 * The start and end offsets can belong to different periods. This method 611 * groups the counters by name and returns the sum of their current values. 612 * </p> 613 * 614 * @param groupId the primary key of the group 615 * @param name the counter name 616 * @param startOffset the offset for the start period 617 * @param endOffset the offset for the end period 618 * @return the matching activity counters 619 */ 620 public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetActivityCounters( 621 long groupId, java.lang.String name, int startOffset, int endOffset) { 622 return getService() 623 .getOffsetActivityCounters(groupId, name, startOffset, 624 endOffset); 625 } 626 627 /** 628 * Returns the distribution of the activity counters with the given name and 629 * period offsets. 630 * 631 * <p> 632 * The start and end offsets can belong to different periods. This method 633 * groups the counters by their owner entity (usually some asset) and 634 * returns a counter for each entity class with the sum of the counters' 635 * 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 distribution of matching activity counters 643 */ 644 public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getOffsetDistributionActivityCounters( 645 long groupId, java.lang.String name, int startOffset, int endOffset) { 646 return getService() 647 .getOffsetDistributionActivityCounters(groupId, name, 648 startOffset, endOffset); 649 } 650 651 /** 652 * Returns all the activity counters with the given name and time period. 653 * 654 * <p> 655 * The start and end period values can belong to different periods. This 656 * method groups the counters by name and returns the sum of their current 657 * values. 658 * </p> 659 * 660 * @param groupId the primary key of the group 661 * @param name the counter name 662 * @param startPeriod the start period 663 * @param endPeriod the end period 664 * @return the matching activity counters 665 */ 666 public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodActivityCounters( 667 long groupId, java.lang.String name, int startPeriod, int endPeriod) { 668 return getService() 669 .getPeriodActivityCounters(groupId, name, startPeriod, 670 endPeriod); 671 } 672 673 /** 674 * Returns the distribution of activity counters with the given name and 675 * time period. 676 * 677 * <p> 678 * The start and end period values can belong to different periods. This 679 * method groups the counters by their owner entity (usually some asset) and 680 * returns a counter for each entity class with the sum of the counters' 681 * current 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 distribution of matching activity counters 689 */ 690 public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getPeriodDistributionActivityCounters( 691 long groupId, java.lang.String name, int startPeriod, int endPeriod) { 692 return getService() 693 .getPeriodDistributionActivityCounters(groupId, name, 694 startPeriod, endPeriod); 695 } 696 697 public static com.liferay.portal.model.PersistedModel getPersistedModel( 698 java.io.Serializable primaryKeyObj) 699 throws com.liferay.portal.kernel.exception.PortalException { 700 return getService().getPersistedModel(primaryKeyObj); 701 } 702 703 /** 704 * Returns the social activity counter with the primary key. 705 * 706 * @param activityCounterId the primary key of the social activity counter 707 * @return the social activity counter 708 * @throws PortalException if a social activity counter with the primary key could not be found 709 */ 710 public static com.liferay.portlet.social.model.SocialActivityCounter getSocialActivityCounter( 711 long activityCounterId) 712 throws com.liferay.portal.kernel.exception.PortalException { 713 return getService().getSocialActivityCounter(activityCounterId); 714 } 715 716 /** 717 * Returns a range of all the social activity counters. 718 * 719 * <p> 720 * 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. 721 * </p> 722 * 723 * @param start the lower bound of the range of social activity counters 724 * @param end the upper bound of the range of social activity counters (not inclusive) 725 * @return the range of social activity counters 726 */ 727 public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getSocialActivityCounters( 728 int start, int end) { 729 return getService().getSocialActivityCounters(start, end); 730 } 731 732 /** 733 * Returns the number of social activity counters. 734 * 735 * @return the number of social activity counters 736 */ 737 public static int getSocialActivityCountersCount() { 738 return getService().getSocialActivityCountersCount(); 739 } 740 741 /** 742 * Returns the range of tuples that contain users and a list of activity 743 * counters. 744 * 745 * <p> 746 * The counters returned for each user are passed to this method in the 747 * selectedNames array. The method also accepts an array of counter names 748 * that are used to rank the users. 749 * </p> 750 * 751 * <p> 752 * Useful when paginating results. Returns a maximum of <code>end - 753 * start</code> instances. <code>start</code> and <code>end</code> are not 754 * primary keys, they are indexes in the result set. Thus, <code>0</code> 755 * refers to the first result in the set. Setting both <code>start</code> 756 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 757 * result set. 758 * </p> 759 * 760 * @param groupId the primary key of the group 761 * @param rankingNames the ranking counter names 762 * @param selectedNames the counter names that will be returned with each 763 user 764 * @param start the lower bound of the range of results 765 * @param end the upper bound of the range of results (not inclusive) 766 * @return the range of matching tuples 767 */ 768 public static java.util.List<com.liferay.portal.kernel.util.Tuple> getUserActivityCounters( 769 long groupId, java.lang.String[] rankingNames, 770 java.lang.String[] selectedNames, int start, int end) { 771 return getService() 772 .getUserActivityCounters(groupId, rankingNames, 773 selectedNames, start, end); 774 } 775 776 /** 777 * Returns the number of users having a rank based on the given counters. 778 * 779 * @param groupId the primary key of the group 780 * @param rankingNames the ranking counter names 781 * @return the number of matching users 782 */ 783 public static int getUserActivityCountersCount(long groupId, 784 java.lang.String[] rankingNames) { 785 return getService().getUserActivityCountersCount(groupId, rankingNames); 786 } 787 788 /** 789 * Increments the <code>user.achievements</code> counter for a user. 790 * 791 * <p> 792 * This method should be used by an external achievement class when the 793 * users unlocks an achievement. 794 * </p> 795 * 796 * @param userId the primary key of the user 797 * @param groupId the primary key of the group 798 */ 799 public static void incrementUserAchievementCounter(long userId, long groupId) 800 throws com.liferay.portal.kernel.exception.PortalException { 801 getService().incrementUserAchievementCounter(userId, groupId); 802 } 803 804 /** 805 * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 806 * 807 * @param socialActivityCounter the social activity counter 808 * @return the social activity counter that was updated 809 */ 810 public static com.liferay.portlet.social.model.SocialActivityCounter updateSocialActivityCounter( 811 com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter) { 812 return getService().updateSocialActivityCounter(socialActivityCounter); 813 } 814 815 public static SocialActivityCounterLocalService getService() { 816 if (_service == null) { 817 _service = (SocialActivityCounterLocalService)PortalBeanLocatorUtil.locate(SocialActivityCounterLocalService.class.getName()); 818 819 ReferenceRegistry.registerReference(SocialActivityCounterLocalServiceUtil.class, 820 "_service"); 821 } 822 823 return _service; 824 } 825 826 private static SocialActivityCounterLocalService _service; 827 }