001 /** 002 * Copyright (c) 2000-2011 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 /** 018 * <p> 019 * This class is a wrapper for {@link SocialRelationLocalService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see SocialRelationLocalService 024 * @generated 025 */ 026 public class SocialRelationLocalServiceWrapper 027 implements SocialRelationLocalService { 028 public SocialRelationLocalServiceWrapper( 029 SocialRelationLocalService socialRelationLocalService) { 030 _socialRelationLocalService = socialRelationLocalService; 031 } 032 033 /** 034 * Adds the social relation to the database. Also notifies the appropriate model listeners. 035 * 036 * @param socialRelation the social relation 037 * @return the social relation that was added 038 * @throws SystemException if a system exception occurred 039 */ 040 public com.liferay.portlet.social.model.SocialRelation addSocialRelation( 041 com.liferay.portlet.social.model.SocialRelation socialRelation) 042 throws com.liferay.portal.kernel.exception.SystemException { 043 return _socialRelationLocalService.addSocialRelation(socialRelation); 044 } 045 046 /** 047 * Creates a new social relation with the primary key. Does not add the social relation to the database. 048 * 049 * @param relationId the primary key for the new social relation 050 * @return the new social relation 051 */ 052 public com.liferay.portlet.social.model.SocialRelation createSocialRelation( 053 long relationId) { 054 return _socialRelationLocalService.createSocialRelation(relationId); 055 } 056 057 /** 058 * Deletes the social relation with the primary key from the database. Also notifies the appropriate model listeners. 059 * 060 * @param relationId the primary key of the social relation 061 * @throws PortalException if a social relation with the primary key could not be found 062 * @throws SystemException if a system exception occurred 063 */ 064 public void deleteSocialRelation(long relationId) 065 throws com.liferay.portal.kernel.exception.PortalException, 066 com.liferay.portal.kernel.exception.SystemException { 067 _socialRelationLocalService.deleteSocialRelation(relationId); 068 } 069 070 /** 071 * Deletes the social relation from the database. Also notifies the appropriate model listeners. 072 * 073 * @param socialRelation the social relation 074 * @throws SystemException if a system exception occurred 075 */ 076 public void deleteSocialRelation( 077 com.liferay.portlet.social.model.SocialRelation socialRelation) 078 throws com.liferay.portal.kernel.exception.SystemException { 079 _socialRelationLocalService.deleteSocialRelation(socialRelation); 080 } 081 082 /** 083 * Performs a dynamic query on the database and returns the matching rows. 084 * 085 * @param dynamicQuery the dynamic query 086 * @return the matching rows 087 * @throws SystemException if a system exception occurred 088 */ 089 @SuppressWarnings("rawtypes") 090 public java.util.List dynamicQuery( 091 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 092 throws com.liferay.portal.kernel.exception.SystemException { 093 return _socialRelationLocalService.dynamicQuery(dynamicQuery); 094 } 095 096 /** 097 * Performs a dynamic query on the database and returns a range of the matching rows. 098 * 099 * <p> 100 * 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. 101 * </p> 102 * 103 * @param dynamicQuery the dynamic query 104 * @param start the lower bound of the range of model instances 105 * @param end the upper bound of the range of model instances (not inclusive) 106 * @return the range of matching rows 107 * @throws SystemException if a system exception occurred 108 */ 109 @SuppressWarnings("rawtypes") 110 public java.util.List dynamicQuery( 111 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 112 int end) throws com.liferay.portal.kernel.exception.SystemException { 113 return _socialRelationLocalService.dynamicQuery(dynamicQuery, start, end); 114 } 115 116 /** 117 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 118 * 119 * <p> 120 * 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. 121 * </p> 122 * 123 * @param dynamicQuery the dynamic query 124 * @param start the lower bound of the range of model instances 125 * @param end the upper bound of the range of model instances (not inclusive) 126 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 127 * @return the ordered range of matching rows 128 * @throws SystemException if a system exception occurred 129 */ 130 @SuppressWarnings("rawtypes") 131 public java.util.List dynamicQuery( 132 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 133 int end, 134 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 135 throws com.liferay.portal.kernel.exception.SystemException { 136 return _socialRelationLocalService.dynamicQuery(dynamicQuery, start, 137 end, orderByComparator); 138 } 139 140 /** 141 * Returns the number of rows that match the dynamic query. 142 * 143 * @param dynamicQuery the dynamic query 144 * @return the number of rows that match the dynamic query 145 * @throws SystemException if a system exception occurred 146 */ 147 public long dynamicQueryCount( 148 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 149 throws com.liferay.portal.kernel.exception.SystemException { 150 return _socialRelationLocalService.dynamicQueryCount(dynamicQuery); 151 } 152 153 /** 154 * Returns the social relation with the primary key. 155 * 156 * @param relationId the primary key of the social relation 157 * @return the social relation 158 * @throws PortalException if a social relation with the primary key could not be found 159 * @throws SystemException if a system exception occurred 160 */ 161 public com.liferay.portlet.social.model.SocialRelation getSocialRelation( 162 long relationId) 163 throws com.liferay.portal.kernel.exception.PortalException, 164 com.liferay.portal.kernel.exception.SystemException { 165 return _socialRelationLocalService.getSocialRelation(relationId); 166 } 167 168 public com.liferay.portal.model.PersistedModel getPersistedModel( 169 java.io.Serializable primaryKeyObj) 170 throws com.liferay.portal.kernel.exception.PortalException, 171 com.liferay.portal.kernel.exception.SystemException { 172 return _socialRelationLocalService.getPersistedModel(primaryKeyObj); 173 } 174 175 /** 176 * Returns a range of all the social relations. 177 * 178 * <p> 179 * 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. 180 * </p> 181 * 182 * @param start the lower bound of the range of social relations 183 * @param end the upper bound of the range of social relations (not inclusive) 184 * @return the range of social relations 185 * @throws SystemException if a system exception occurred 186 */ 187 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getSocialRelations( 188 int start, int end) 189 throws com.liferay.portal.kernel.exception.SystemException { 190 return _socialRelationLocalService.getSocialRelations(start, end); 191 } 192 193 /** 194 * Returns the number of social relations. 195 * 196 * @return the number of social relations 197 * @throws SystemException if a system exception occurred 198 */ 199 public int getSocialRelationsCount() 200 throws com.liferay.portal.kernel.exception.SystemException { 201 return _socialRelationLocalService.getSocialRelationsCount(); 202 } 203 204 /** 205 * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 206 * 207 * @param socialRelation the social relation 208 * @return the social relation that was updated 209 * @throws SystemException if a system exception occurred 210 */ 211 public com.liferay.portlet.social.model.SocialRelation updateSocialRelation( 212 com.liferay.portlet.social.model.SocialRelation socialRelation) 213 throws com.liferay.portal.kernel.exception.SystemException { 214 return _socialRelationLocalService.updateSocialRelation(socialRelation); 215 } 216 217 /** 218 * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 219 * 220 * @param socialRelation the social relation 221 * @param merge whether to merge the social relation with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 222 * @return the social relation that was updated 223 * @throws SystemException if a system exception occurred 224 */ 225 public com.liferay.portlet.social.model.SocialRelation updateSocialRelation( 226 com.liferay.portlet.social.model.SocialRelation socialRelation, 227 boolean merge) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return _socialRelationLocalService.updateSocialRelation(socialRelation, 230 merge); 231 } 232 233 /** 234 * Returns the Spring bean ID for this bean. 235 * 236 * @return the Spring bean ID for this bean 237 */ 238 public java.lang.String getBeanIdentifier() { 239 return _socialRelationLocalService.getBeanIdentifier(); 240 } 241 242 /** 243 * Sets the Spring bean ID for this bean. 244 * 245 * @param beanIdentifier the Spring bean ID for this bean 246 */ 247 public void setBeanIdentifier(java.lang.String beanIdentifier) { 248 _socialRelationLocalService.setBeanIdentifier(beanIdentifier); 249 } 250 251 /** 252 * Adds a social relation between the two users to the database. 253 * 254 * @param userId1 the user that is the subject of the relation 255 * @param userId2 the user at the other end of the relation 256 * @param type the type of the relation 257 * @return the social relation 258 * @throws PortalException if the users could not be found, if the users 259 were not from the same company, or if either of the users was 260 the default user 261 * @throws SystemException if a system exception occurred 262 */ 263 public com.liferay.portlet.social.model.SocialRelation addRelation( 264 long userId1, long userId2, int type) 265 throws com.liferay.portal.kernel.exception.PortalException, 266 com.liferay.portal.kernel.exception.SystemException { 267 return _socialRelationLocalService.addRelation(userId1, userId2, type); 268 } 269 270 /** 271 * Removes the relation (and its inverse in case of a bidirectional 272 * relation) from the database. 273 * 274 * @param relationId the primary key of the relation 275 * @throws PortalException if the relation could not be found 276 * @throws SystemException if a system exception occurred 277 */ 278 public void deleteRelation(long relationId) 279 throws com.liferay.portal.kernel.exception.PortalException, 280 com.liferay.portal.kernel.exception.SystemException { 281 _socialRelationLocalService.deleteRelation(relationId); 282 } 283 284 /** 285 * Removes the matching relation (and its inverse in case of a 286 * bidirectional relation) from the database. 287 * 288 * @param userId1 the user that is the subject of the relation 289 * @param userId2 the user at the other end of the relation 290 * @param type the relation's type 291 * @throws PortalException if the relation or its inverse relation (if 292 applicable) could not be found 293 * @throws SystemException if a system exception occurred 294 */ 295 public void deleteRelation(long userId1, long userId2, int type) 296 throws com.liferay.portal.kernel.exception.PortalException, 297 com.liferay.portal.kernel.exception.SystemException { 298 _socialRelationLocalService.deleteRelation(userId1, userId2, type); 299 } 300 301 /** 302 * Removes the relation (and its inverse in case of a bidirectional 303 * relation) from the database. 304 * 305 * @param relation the relation to be removed 306 * @throws PortalException if the relation is bidirectional and its inverse 307 relation could not be found 308 * @throws SystemException if a system exception occurred 309 */ 310 public void deleteRelation( 311 com.liferay.portlet.social.model.SocialRelation relation) 312 throws com.liferay.portal.kernel.exception.PortalException, 313 com.liferay.portal.kernel.exception.SystemException { 314 _socialRelationLocalService.deleteRelation(relation); 315 } 316 317 /** 318 * Removes all relations involving the user from the database. 319 * 320 * @param userId the primary key of the user 321 * @throws SystemException if a system exception occurred 322 */ 323 public void deleteRelations(long userId) 324 throws com.liferay.portal.kernel.exception.SystemException { 325 _socialRelationLocalService.deleteRelations(userId); 326 } 327 328 /** 329 * Removes all relations between User1 and User2. 330 * 331 * @param userId1 the user that is the subject of the relation 332 * @param userId2 the user at the other end of the relation 333 * @throws PortalException if the inverse relation could not be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public void deleteRelations(long userId1, long userId2) 337 throws com.liferay.portal.kernel.exception.PortalException, 338 com.liferay.portal.kernel.exception.SystemException { 339 _socialRelationLocalService.deleteRelations(userId1, userId2); 340 } 341 342 /** 343 * Returns a range of all the inverse relations of the given type for which 344 * the user is User2 of the relation. 345 * 346 * <p> 347 * Useful when paginating results. Returns a maximum of <code>end - 348 * start</code> instances. <code>start</code> and <code>end</code> are not 349 * primary keys, they are indexes in the result set. Thus, <code>0</code> 350 * refers to the first result in the set. Setting both <code>start</code> 351 * and <code>end</code> to {@link 352 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 353 * full result set. 354 * </p> 355 * 356 * @param userId the primary key of the user 357 * @param type the relation's type 358 * @param start the lower bound of the range of results 359 * @param end the upper bound of the range of results (not inclusive) 360 * @return the range of matching relations 361 * @throws SystemException if a system exception occurred 362 */ 363 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getInverseRelations( 364 long userId, int type, int start, int end) 365 throws com.liferay.portal.kernel.exception.SystemException { 366 return _socialRelationLocalService.getInverseRelations(userId, type, 367 start, end); 368 } 369 370 /** 371 * Returns the number of inverse relations of the given type for which the 372 * user is User2 of the relation. 373 * 374 * @param userId the primary key of the user 375 * @param type the relation's type 376 * @return the number of matching relations 377 * @throws SystemException if a system exception occurred 378 */ 379 public int getInverseRelationsCount(long userId, int type) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return _socialRelationLocalService.getInverseRelationsCount(userId, type); 382 } 383 384 /** 385 * Returns the relation identified by its primary key. 386 * 387 * @param relationId the primary key of the relation 388 * @return Returns the relation 389 * @throws PortalException if the relation could not be found 390 * @throws SystemException if a system exception occurred 391 */ 392 public com.liferay.portlet.social.model.SocialRelation getRelation( 393 long relationId) 394 throws com.liferay.portal.kernel.exception.PortalException, 395 com.liferay.portal.kernel.exception.SystemException { 396 return _socialRelationLocalService.getRelation(relationId); 397 } 398 399 /** 400 * Returns the relation of the given type between User1 and User2. 401 * 402 * @param userId1 the user that is the subject of the relation 403 * @param userId2 the user at the other end of the relation 404 * @param type the relation's type 405 * @return Returns the relation 406 * @throws PortalException if the relation could not be found 407 * @throws SystemException if a system exception occurred 408 */ 409 public com.liferay.portlet.social.model.SocialRelation getRelation( 410 long userId1, long userId2, int type) 411 throws com.liferay.portal.kernel.exception.PortalException, 412 com.liferay.portal.kernel.exception.SystemException { 413 return _socialRelationLocalService.getRelation(userId1, userId2, type); 414 } 415 416 /** 417 * Returns a range of all the relations of the given type where the user is 418 * the subject of the relation. 419 * 420 * <p> 421 * Useful when paginating results. Returns a maximum of <code>end - 422 * start</code> instances. <code>start</code> and <code>end</code> are not 423 * primary keys, they are indexes in the result set. Thus, <code>0</code> 424 * refers to the first result in the set. Setting both <code>start</code> 425 * and <code>end</code> to {@link 426 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 427 * full result set. 428 * </p> 429 * 430 * @param userId the primary key of the user 431 * @param type the relation's type 432 * @param start the lower bound of the range of results 433 * @param end the upper bound of the range of results (not inclusive) 434 * @return the range of relations 435 * @throws SystemException if a system exception occurred 436 */ 437 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations( 438 long userId, int type, int start, int end) 439 throws com.liferay.portal.kernel.exception.SystemException { 440 return _socialRelationLocalService.getRelations(userId, type, start, end); 441 } 442 443 /** 444 * Returns a range of all the relations between User1 and User2. 445 * 446 * <p> 447 * Useful when paginating results. Returns a maximum of <code>end - 448 * start</code> instances. <code>start</code> and <code>end</code> are not 449 * primary keys, they are indexes in the result set. Thus, <code>0</code> 450 * refers to the first result in the set. Setting both <code>start</code> 451 * and <code>end</code> to {@link 452 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 453 * full result set. 454 * </p> 455 * 456 * @param userId1 the user that is the subject of the relation 457 * @param userId2 the user at the other end of the relation 458 * @param start the lower bound of the range of results 459 * @param end the upper bound of the range of results (not inclusive) 460 * @return the range of relations 461 * @throws SystemException if a system exception occurred 462 */ 463 public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations( 464 long userId1, long userId2, int start, int end) 465 throws com.liferay.portal.kernel.exception.SystemException { 466 return _socialRelationLocalService.getRelations(userId1, userId2, 467 start, end); 468 } 469 470 /** 471 * Returns the number of relations of the given type where the user is the 472 * subject of the relation. 473 * 474 * @param userId the primary key of the user 475 * @param type the relation's type 476 * @return the number of relations 477 * @throws SystemException if a system exception occurred 478 */ 479 public int getRelationsCount(long userId, int type) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 return _socialRelationLocalService.getRelationsCount(userId, type); 482 } 483 484 /** 485 * Returns the number of relations between User1 and User2. 486 * 487 * @param userId1 the user that is the subject of the relation 488 * @param userId2 the user at the other end of the relation 489 * @return the number of relations 490 * @throws SystemException if a system exception occurred 491 */ 492 public int getRelationsCount(long userId1, long userId2) 493 throws com.liferay.portal.kernel.exception.SystemException { 494 return _socialRelationLocalService.getRelationsCount(userId1, userId2); 495 } 496 497 /** 498 * Returns <code>true</code> if a relation of the given type exists where 499 * the user with primary key <code>userId1</code> is User1 of the relation 500 * and the user with the primary key <code>userId2</code> is User2 of the 501 * relation. 502 * 503 * @param userId1 the user that is the subject of the relation 504 * @param userId2 the user at the other end of the relation 505 * @param type the relation's type 506 * @return <code>true</code> if the relation exists; <code>false</code> 507 otherwise 508 * @throws SystemException if a system exception occurred 509 */ 510 public boolean hasRelation(long userId1, long userId2, int type) 511 throws com.liferay.portal.kernel.exception.SystemException { 512 return _socialRelationLocalService.hasRelation(userId1, userId2, type); 513 } 514 515 /** 516 * Returns <code>true</code> if the users can be in a relation of the given 517 * type where the user with primary key <code>userId1</code> is User1 of 518 * the relation and the user with the primary key <code>userId2</code> is 519 * User2 of the relation. 520 * 521 * <p> 522 * This method returns <code>false</code> if User1 and User2 are the same, 523 * if either user is the default user, or if a matching relation already 524 * exists. 525 * </p> 526 * 527 * @param userId1 the user that is the subject of the relation 528 * @param userId2 the user at the other end of the relation 529 * @param type the relation's type 530 * @return <code>true</code> if the two users can be in a new relation of 531 the given type; <code>false</code> otherwise 532 * @throws SystemException if a system exception occurred 533 */ 534 public boolean isRelatable(long userId1, long userId2, int type) 535 throws com.liferay.portal.kernel.exception.SystemException { 536 return _socialRelationLocalService.isRelatable(userId1, userId2, type); 537 } 538 539 public SocialRelationLocalService getWrappedSocialRelationLocalService() { 540 return _socialRelationLocalService; 541 } 542 543 public void setWrappedSocialRelationLocalService( 544 SocialRelationLocalService socialRelationLocalService) { 545 _socialRelationLocalService = socialRelationLocalService; 546 } 547 548 private SocialRelationLocalService _socialRelationLocalService; 549 }