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