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