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