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