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.portal.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for Organization. This utility wraps 024 * {@link com.liferay.portal.service.impl.OrganizationLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see OrganizationLocalService 032 * @see com.liferay.portal.service.base.OrganizationLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.OrganizationLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class OrganizationLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the organization to the database. Also notifies the appropriate model listeners. 046 * 047 * @param organization the organization 048 * @return the organization that was added 049 * @throws SystemException if a system exception occurred 050 */ 051 public static com.liferay.portal.model.Organization addOrganization( 052 com.liferay.portal.model.Organization organization) 053 throws com.liferay.portal.kernel.exception.SystemException { 054 return getService().addOrganization(organization); 055 } 056 057 /** 058 * Creates a new organization with the primary key. Does not add the organization to the database. 059 * 060 * @param organizationId the primary key for the new organization 061 * @return the new organization 062 */ 063 public static com.liferay.portal.model.Organization createOrganization( 064 long organizationId) { 065 return getService().createOrganization(organizationId); 066 } 067 068 /** 069 * Deletes the organization with the primary key from the database. Also notifies the appropriate model listeners. 070 * 071 * @param organizationId the primary key of the organization 072 * @return the organization that was removed 073 * @throws PortalException if a organization with the primary key could not be found 074 * @throws SystemException if a system exception occurred 075 */ 076 public static com.liferay.portal.model.Organization deleteOrganization( 077 long organizationId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException { 080 return getService().deleteOrganization(organizationId); 081 } 082 083 /** 084 * Deletes the organization from the database. Also notifies the appropriate model listeners. 085 * 086 * @param organization the organization 087 * @return the organization that was removed 088 * @throws PortalException 089 * @throws SystemException if a system exception occurred 090 */ 091 public static com.liferay.portal.model.Organization deleteOrganization( 092 com.liferay.portal.model.Organization organization) 093 throws com.liferay.portal.kernel.exception.PortalException, 094 com.liferay.portal.kernel.exception.SystemException { 095 return getService().deleteOrganization(organization); 096 } 097 098 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 099 return getService().dynamicQuery(); 100 } 101 102 /** 103 * Performs a dynamic query on the database and returns the matching rows. 104 * 105 * @param dynamicQuery the dynamic query 106 * @return the matching rows 107 * @throws SystemException if a system exception occurred 108 */ 109 @SuppressWarnings("rawtypes") 110 public static java.util.List dynamicQuery( 111 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 112 throws com.liferay.portal.kernel.exception.SystemException { 113 return getService().dynamicQuery(dynamicQuery); 114 } 115 116 /** 117 * Performs a dynamic query on the database and returns a 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. 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.portal.model.impl.OrganizationModelImpl}. 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. 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 * @return the range of matching rows 127 * @throws SystemException if a system exception occurred 128 */ 129 @SuppressWarnings("rawtypes") 130 public static java.util.List dynamicQuery( 131 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 132 int end) throws com.liferay.portal.kernel.exception.SystemException { 133 return getService().dynamicQuery(dynamicQuery, start, end); 134 } 135 136 /** 137 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 138 * 139 * <p> 140 * 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.portal.model.impl.OrganizationModelImpl}. 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. 141 * </p> 142 * 143 * @param dynamicQuery the dynamic query 144 * @param start the lower bound of the range of model instances 145 * @param end the upper bound of the range of model instances (not inclusive) 146 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 147 * @return the ordered range of matching rows 148 * @throws SystemException if a system exception occurred 149 */ 150 @SuppressWarnings("rawtypes") 151 public static 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 getService() 157 .dynamicQuery(dynamicQuery, 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 public static long dynamicQueryCount( 168 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 169 throws com.liferay.portal.kernel.exception.SystemException { 170 return getService().dynamicQueryCount(dynamicQuery); 171 } 172 173 /** 174 * Returns the number of rows that match the dynamic query. 175 * 176 * @param dynamicQuery the dynamic query 177 * @param projection the projection to apply to the query 178 * @return the number of rows that match the dynamic query 179 * @throws SystemException if a system exception occurred 180 */ 181 public static long dynamicQueryCount( 182 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 183 com.liferay.portal.kernel.dao.orm.Projection projection) 184 throws com.liferay.portal.kernel.exception.SystemException { 185 return getService().dynamicQueryCount(dynamicQuery, projection); 186 } 187 188 public static com.liferay.portal.model.Organization fetchOrganization( 189 long organizationId) 190 throws com.liferay.portal.kernel.exception.SystemException { 191 return getService().fetchOrganization(organizationId); 192 } 193 194 /** 195 * Returns the organization with the matching UUID and company. 196 * 197 * @param uuid the organization's UUID 198 * @param companyId the primary key of the company 199 * @return the matching organization, or <code>null</code> if a matching organization could not be found 200 * @throws SystemException if a system exception occurred 201 */ 202 public static com.liferay.portal.model.Organization fetchOrganizationByUuidAndCompanyId( 203 java.lang.String uuid, long companyId) 204 throws com.liferay.portal.kernel.exception.SystemException { 205 return getService().fetchOrganizationByUuidAndCompanyId(uuid, companyId); 206 } 207 208 /** 209 * Returns the organization with the primary key. 210 * 211 * @param organizationId the primary key of the organization 212 * @return the organization 213 * @throws PortalException if a organization with the primary key could not be found 214 * @throws SystemException if a system exception occurred 215 */ 216 public static com.liferay.portal.model.Organization getOrganization( 217 long organizationId) 218 throws com.liferay.portal.kernel.exception.PortalException, 219 com.liferay.portal.kernel.exception.SystemException { 220 return getService().getOrganization(organizationId); 221 } 222 223 public static com.liferay.portal.model.PersistedModel getPersistedModel( 224 java.io.Serializable primaryKeyObj) 225 throws com.liferay.portal.kernel.exception.PortalException, 226 com.liferay.portal.kernel.exception.SystemException { 227 return getService().getPersistedModel(primaryKeyObj); 228 } 229 230 /** 231 * Returns the organization with the matching UUID and company. 232 * 233 * @param uuid the organization's UUID 234 * @param companyId the primary key of the company 235 * @return the matching organization 236 * @throws PortalException if a matching organization could not be found 237 * @throws SystemException if a system exception occurred 238 */ 239 public static com.liferay.portal.model.Organization getOrganizationByUuidAndCompanyId( 240 java.lang.String uuid, long companyId) 241 throws com.liferay.portal.kernel.exception.PortalException, 242 com.liferay.portal.kernel.exception.SystemException { 243 return getService().getOrganizationByUuidAndCompanyId(uuid, companyId); 244 } 245 246 /** 247 * Returns a range of all the organizations. 248 * 249 * <p> 250 * 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.portal.model.impl.OrganizationModelImpl}. 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. 251 * </p> 252 * 253 * @param start the lower bound of the range of organizations 254 * @param end the upper bound of the range of organizations (not inclusive) 255 * @return the range of organizations 256 * @throws SystemException if a system exception occurred 257 */ 258 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 259 int start, int end) 260 throws com.liferay.portal.kernel.exception.SystemException { 261 return getService().getOrganizations(start, end); 262 } 263 264 /** 265 * Returns the number of organizations. 266 * 267 * @return the number of organizations 268 * @throws SystemException if a system exception occurred 269 */ 270 public static int getOrganizationsCount() 271 throws com.liferay.portal.kernel.exception.SystemException { 272 return getService().getOrganizationsCount(); 273 } 274 275 /** 276 * Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 277 * 278 * @param organization the organization 279 * @return the organization that was updated 280 * @throws SystemException if a system exception occurred 281 */ 282 public static com.liferay.portal.model.Organization updateOrganization( 283 com.liferay.portal.model.Organization organization) 284 throws com.liferay.portal.kernel.exception.SystemException { 285 return getService().updateOrganization(organization); 286 } 287 288 /** 289 * @throws SystemException if a system exception occurred 290 */ 291 public static void addGroupOrganization(long groupId, long organizationId) 292 throws com.liferay.portal.kernel.exception.SystemException { 293 getService().addGroupOrganization(groupId, organizationId); 294 } 295 296 /** 297 * @throws SystemException if a system exception occurred 298 */ 299 public static void addGroupOrganization(long groupId, 300 com.liferay.portal.model.Organization organization) 301 throws com.liferay.portal.kernel.exception.SystemException { 302 getService().addGroupOrganization(groupId, organization); 303 } 304 305 /** 306 * @throws PortalException 307 * @throws SystemException if a system exception occurred 308 */ 309 public static void addGroupOrganizations(long groupId, 310 long[] organizationIds) 311 throws com.liferay.portal.kernel.exception.PortalException, 312 com.liferay.portal.kernel.exception.SystemException { 313 getService().addGroupOrganizations(groupId, organizationIds); 314 } 315 316 /** 317 * @throws PortalException 318 * @throws SystemException if a system exception occurred 319 */ 320 public static void addGroupOrganizations(long groupId, 321 java.util.List<com.liferay.portal.model.Organization> Organizations) 322 throws com.liferay.portal.kernel.exception.PortalException, 323 com.liferay.portal.kernel.exception.SystemException { 324 getService().addGroupOrganizations(groupId, Organizations); 325 } 326 327 /** 328 * @throws SystemException if a system exception occurred 329 */ 330 public static void clearGroupOrganizations(long groupId) 331 throws com.liferay.portal.kernel.exception.SystemException { 332 getService().clearGroupOrganizations(groupId); 333 } 334 335 /** 336 * @throws SystemException if a system exception occurred 337 */ 338 public static void deleteGroupOrganization(long groupId, long organizationId) 339 throws com.liferay.portal.kernel.exception.SystemException { 340 getService().deleteGroupOrganization(groupId, organizationId); 341 } 342 343 /** 344 * @throws SystemException if a system exception occurred 345 */ 346 public static void deleteGroupOrganization(long groupId, 347 com.liferay.portal.model.Organization organization) 348 throws com.liferay.portal.kernel.exception.SystemException { 349 getService().deleteGroupOrganization(groupId, organization); 350 } 351 352 /** 353 * @throws SystemException if a system exception occurred 354 */ 355 public static void deleteGroupOrganizations(long groupId, 356 long[] organizationIds) 357 throws com.liferay.portal.kernel.exception.SystemException { 358 getService().deleteGroupOrganizations(groupId, organizationIds); 359 } 360 361 /** 362 * @throws SystemException if a system exception occurred 363 */ 364 public static void deleteGroupOrganizations(long groupId, 365 java.util.List<com.liferay.portal.model.Organization> Organizations) 366 throws com.liferay.portal.kernel.exception.SystemException { 367 getService().deleteGroupOrganizations(groupId, Organizations); 368 } 369 370 /** 371 * @throws SystemException if a system exception occurred 372 */ 373 public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 374 long groupId) 375 throws com.liferay.portal.kernel.exception.SystemException { 376 return getService().getGroupOrganizations(groupId); 377 } 378 379 /** 380 * @throws SystemException if a system exception occurred 381 */ 382 public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 383 long groupId, int start, int end) 384 throws com.liferay.portal.kernel.exception.SystemException { 385 return getService().getGroupOrganizations(groupId, start, end); 386 } 387 388 /** 389 * @throws SystemException if a system exception occurred 390 */ 391 public static java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 392 long groupId, int start, int end, 393 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 394 throws com.liferay.portal.kernel.exception.SystemException { 395 return getService() 396 .getGroupOrganizations(groupId, start, end, orderByComparator); 397 } 398 399 /** 400 * @throws SystemException if a system exception occurred 401 */ 402 public static int getGroupOrganizationsCount(long groupId) 403 throws com.liferay.portal.kernel.exception.SystemException { 404 return getService().getGroupOrganizationsCount(groupId); 405 } 406 407 /** 408 * @throws SystemException if a system exception occurred 409 */ 410 public static boolean hasGroupOrganization(long groupId, long organizationId) 411 throws com.liferay.portal.kernel.exception.SystemException { 412 return getService().hasGroupOrganization(groupId, organizationId); 413 } 414 415 /** 416 * @throws SystemException if a system exception occurred 417 */ 418 public static boolean hasGroupOrganizations(long groupId) 419 throws com.liferay.portal.kernel.exception.SystemException { 420 return getService().hasGroupOrganizations(groupId); 421 } 422 423 /** 424 * @throws PortalException 425 * @throws SystemException if a system exception occurred 426 */ 427 public static void setGroupOrganizations(long groupId, 428 long[] organizationIds) 429 throws com.liferay.portal.kernel.exception.PortalException, 430 com.liferay.portal.kernel.exception.SystemException { 431 getService().setGroupOrganizations(groupId, organizationIds); 432 } 433 434 /** 435 * @throws SystemException if a system exception occurred 436 */ 437 public static void addUserOrganization(long userId, long organizationId) 438 throws com.liferay.portal.kernel.exception.SystemException { 439 getService().addUserOrganization(userId, organizationId); 440 } 441 442 /** 443 * @throws SystemException if a system exception occurred 444 */ 445 public static void addUserOrganization(long userId, 446 com.liferay.portal.model.Organization organization) 447 throws com.liferay.portal.kernel.exception.SystemException { 448 getService().addUserOrganization(userId, organization); 449 } 450 451 /** 452 * @throws SystemException if a system exception occurred 453 */ 454 public static void addUserOrganizations(long userId, long[] organizationIds) 455 throws com.liferay.portal.kernel.exception.SystemException { 456 getService().addUserOrganizations(userId, organizationIds); 457 } 458 459 /** 460 * @throws SystemException if a system exception occurred 461 */ 462 public static void addUserOrganizations(long userId, 463 java.util.List<com.liferay.portal.model.Organization> Organizations) 464 throws com.liferay.portal.kernel.exception.SystemException { 465 getService().addUserOrganizations(userId, Organizations); 466 } 467 468 /** 469 * @throws SystemException if a system exception occurred 470 */ 471 public static void clearUserOrganizations(long userId) 472 throws com.liferay.portal.kernel.exception.SystemException { 473 getService().clearUserOrganizations(userId); 474 } 475 476 /** 477 * @throws SystemException if a system exception occurred 478 */ 479 public static void deleteUserOrganization(long userId, long organizationId) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 getService().deleteUserOrganization(userId, organizationId); 482 } 483 484 /** 485 * @throws SystemException if a system exception occurred 486 */ 487 public static void deleteUserOrganization(long userId, 488 com.liferay.portal.model.Organization organization) 489 throws com.liferay.portal.kernel.exception.SystemException { 490 getService().deleteUserOrganization(userId, organization); 491 } 492 493 /** 494 * @throws SystemException if a system exception occurred 495 */ 496 public static void deleteUserOrganizations(long userId, 497 long[] organizationIds) 498 throws com.liferay.portal.kernel.exception.SystemException { 499 getService().deleteUserOrganizations(userId, organizationIds); 500 } 501 502 /** 503 * @throws SystemException if a system exception occurred 504 */ 505 public static void deleteUserOrganizations(long userId, 506 java.util.List<com.liferay.portal.model.Organization> Organizations) 507 throws com.liferay.portal.kernel.exception.SystemException { 508 getService().deleteUserOrganizations(userId, Organizations); 509 } 510 511 /** 512 * @throws SystemException if a system exception occurred 513 */ 514 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 515 long userId) throws com.liferay.portal.kernel.exception.SystemException { 516 return getService().getUserOrganizations(userId); 517 } 518 519 /** 520 * @throws SystemException if a system exception occurred 521 */ 522 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 523 long userId, int start, int end) 524 throws com.liferay.portal.kernel.exception.SystemException { 525 return getService().getUserOrganizations(userId, start, end); 526 } 527 528 /** 529 * @throws SystemException if a system exception occurred 530 */ 531 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 532 long userId, int start, int end, 533 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 534 throws com.liferay.portal.kernel.exception.SystemException { 535 return getService() 536 .getUserOrganizations(userId, start, end, orderByComparator); 537 } 538 539 /** 540 * @throws SystemException if a system exception occurred 541 */ 542 public static int getUserOrganizationsCount(long userId) 543 throws com.liferay.portal.kernel.exception.SystemException { 544 return getService().getUserOrganizationsCount(userId); 545 } 546 547 /** 548 * @throws SystemException if a system exception occurred 549 */ 550 public static boolean hasUserOrganization(long userId, long organizationId) 551 throws com.liferay.portal.kernel.exception.SystemException { 552 return getService().hasUserOrganization(userId, organizationId); 553 } 554 555 /** 556 * @throws SystemException if a system exception occurred 557 */ 558 public static boolean hasUserOrganizations(long userId) 559 throws com.liferay.portal.kernel.exception.SystemException { 560 return getService().hasUserOrganizations(userId); 561 } 562 563 /** 564 * @throws SystemException if a system exception occurred 565 */ 566 public static void setUserOrganizations(long userId, long[] organizationIds) 567 throws com.liferay.portal.kernel.exception.SystemException { 568 getService().setUserOrganizations(userId, organizationIds); 569 } 570 571 /** 572 * Returns the Spring bean ID for this bean. 573 * 574 * @return the Spring bean ID for this bean 575 */ 576 public static java.lang.String getBeanIdentifier() { 577 return getService().getBeanIdentifier(); 578 } 579 580 /** 581 * Sets the Spring bean ID for this bean. 582 * 583 * @param beanIdentifier the Spring bean ID for this bean 584 */ 585 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 586 getService().setBeanIdentifier(beanIdentifier); 587 } 588 589 /** 590 * Adds an organization. 591 * 592 * <p> 593 * This method handles the creation and bookkeeping of the organization 594 * including its resources, metadata, and internal data structures. It is 595 * not necessary to make a subsequent call to {@link 596 * #addOrganizationResources(long, Organization)}. 597 * </p> 598 * 599 * @param userId the primary key of the creator/owner of the organization 600 * @param parentOrganizationId the primary key of the organization's parent 601 organization 602 * @param name the organization's name 603 * @param site whether the organization is to be associated with a main 604 site 605 * @return the organization 606 * @throws PortalException if a creator or parent organization with the 607 primary key could not be found or if the organization's 608 information was invalid 609 * @throws SystemException if a system exception occurred 610 */ 611 public static com.liferay.portal.model.Organization addOrganization( 612 long userId, long parentOrganizationId, java.lang.String name, 613 boolean site) 614 throws com.liferay.portal.kernel.exception.PortalException, 615 com.liferay.portal.kernel.exception.SystemException { 616 return getService() 617 .addOrganization(userId, parentOrganizationId, name, site); 618 } 619 620 /** 621 * Adds an organization. 622 * 623 * <p> 624 * This method handles the creation and bookkeeping of the organization 625 * including its resources, metadata, and internal data structures. It is 626 * not necessary to make a subsequent call to {@link 627 * #addOrganizationResources(long, Organization)}. 628 * </p> 629 * 630 * @param userId the primary key of the creator/owner of the 631 organization 632 * @param parentOrganizationId the primary key of the organization's 633 parent organization 634 * @param name the organization's name 635 * @param type the organization's type 636 * @param recursable whether the permissions of the organization are to 637 be inherited by its suborganizations 638 * @param regionId the primary key of the organization's region 639 * @param countryId the primary key of the organization's country 640 * @param statusId the organization's workflow status 641 * @param comments the comments about the organization 642 * @param site whether the organization is to be associated with a main 643 site 644 * @param serviceContext the service context to be applied (optionally 645 <code>null</code>). Can set asset category IDs, asset tag 646 names, and expando bridge attributes for the organization. 647 * @return the organization 648 * @throws PortalException if a creator or parent organization with the 649 primary key could not be found or if the organization's 650 information was invalid 651 * @throws SystemException if a system exception occurred 652 * @deprecated As of 6.2.0, replaced by {@link #addOrganization(long, long, 653 String, String, long, long, int, String, boolean, 654 ServiceContext)} 655 */ 656 public static com.liferay.portal.model.Organization addOrganization( 657 long userId, long parentOrganizationId, java.lang.String name, 658 java.lang.String type, boolean recursable, long regionId, 659 long countryId, int statusId, java.lang.String comments, boolean site, 660 com.liferay.portal.service.ServiceContext serviceContext) 661 throws com.liferay.portal.kernel.exception.PortalException, 662 com.liferay.portal.kernel.exception.SystemException { 663 return getService() 664 .addOrganization(userId, parentOrganizationId, name, type, 665 recursable, regionId, countryId, statusId, comments, site, 666 serviceContext); 667 } 668 669 /** 670 * Adds an organization. 671 * 672 * <p> 673 * This method handles the creation and bookkeeping of the organization 674 * including its resources, metadata, and internal data structures. It is 675 * not necessary to make a subsequent call to {@link 676 * #addOrganizationResources(long, Organization)}. 677 * </p> 678 * 679 * @param userId the primary key of the creator/owner of the organization 680 * @param parentOrganizationId the primary key of the organization's parent 681 organization 682 * @param name the organization's name 683 * @param type the organization's type 684 * @param regionId the primary key of the organization's region 685 * @param countryId the primary key of the organization's country 686 * @param statusId the organization's workflow status 687 * @param comments the comments about the organization 688 * @param site whether the organization is to be associated with a main 689 site 690 * @param serviceContext the service context to be applied (optionally 691 <code>null</code>). Can set asset category IDs, asset tag names, 692 and expando bridge attributes for the organization. 693 * @return the organization 694 * @throws PortalException if a creator or parent organization with the 695 primary key could not be found or if the organization's 696 information was invalid 697 * @throws SystemException if a system exception occurred 698 */ 699 public static com.liferay.portal.model.Organization addOrganization( 700 long userId, long parentOrganizationId, java.lang.String name, 701 java.lang.String type, long regionId, long countryId, int statusId, 702 java.lang.String comments, boolean site, 703 com.liferay.portal.service.ServiceContext serviceContext) 704 throws com.liferay.portal.kernel.exception.PortalException, 705 com.liferay.portal.kernel.exception.SystemException { 706 return getService() 707 .addOrganization(userId, parentOrganizationId, name, type, 708 regionId, countryId, statusId, comments, site, serviceContext); 709 } 710 711 /** 712 * Adds a resource for each type of permission available on the 713 * organization. 714 * 715 * @param userId the primary key of the creator/owner of the organization 716 * @param organization the organization 717 * @throws PortalException if a portal exception occurred 718 * @throws SystemException if a system exception occurred 719 */ 720 public static void addOrganizationResources(long userId, 721 com.liferay.portal.model.Organization organization) 722 throws com.liferay.portal.kernel.exception.PortalException, 723 com.liferay.portal.kernel.exception.SystemException { 724 getService().addOrganizationResources(userId, organization); 725 } 726 727 /** 728 * Assigns the password policy to the organizations, removing any other 729 * currently assigned password policies. 730 * 731 * @param passwordPolicyId the primary key of the password policy 732 * @param organizationIds the primary keys of the organizations 733 * @throws SystemException if a system exception occurred 734 */ 735 public static void addPasswordPolicyOrganizations(long passwordPolicyId, 736 long[] organizationIds) 737 throws com.liferay.portal.kernel.exception.SystemException { 738 getService() 739 .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds); 740 } 741 742 /** 743 * Deletes the logo of the organization. 744 * 745 * @param organizationId the primary key of the organization 746 * @throws PortalException if an organization or parent organization with 747 the primary key could not be found or if the organization's logo 748 could not be found 749 * @throws SystemException if a system exception occurred 750 */ 751 public static void deleteLogo(long organizationId) 752 throws com.liferay.portal.kernel.exception.PortalException, 753 com.liferay.portal.kernel.exception.SystemException { 754 getService().deleteLogo(organizationId); 755 } 756 757 public static com.liferay.portal.model.Organization fetchOrganization( 758 long companyId, java.lang.String name) 759 throws com.liferay.portal.kernel.exception.SystemException { 760 return getService().fetchOrganization(companyId, name); 761 } 762 763 public static java.util.List<com.liferay.portal.model.Organization> getNoAssetOrganizations() 764 throws com.liferay.portal.kernel.exception.SystemException { 765 return getService().getNoAssetOrganizations(); 766 } 767 768 /** 769 * Returns the organization with the name. 770 * 771 * @param companyId the primary key of the organization's company 772 * @param name the organization's name 773 * @return the organization with the name 774 * @throws PortalException if the organization with the name could not be 775 found 776 * @throws SystemException if a system exception occurred 777 */ 778 public static com.liferay.portal.model.Organization getOrganization( 779 long companyId, java.lang.String name) 780 throws com.liferay.portal.kernel.exception.PortalException, 781 com.liferay.portal.kernel.exception.SystemException { 782 return getService().getOrganization(companyId, name); 783 } 784 785 /** 786 * Returns the primary key of the organization with the name. 787 * 788 * @param companyId the primary key of the organization's company 789 * @param name the organization's name 790 * @return the primary key of the organization with the name, or 791 <code>0</code> if the organization could not be found 792 * @throws SystemException if a system exception occurred 793 */ 794 public static long getOrganizationId(long companyId, java.lang.String name) 795 throws com.liferay.portal.kernel.exception.SystemException { 796 return getService().getOrganizationId(companyId, name); 797 } 798 799 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 800 long userId, int start, int end, 801 com.liferay.portal.kernel.util.OrderByComparator obc) 802 throws com.liferay.portal.kernel.exception.PortalException, 803 com.liferay.portal.kernel.exception.SystemException { 804 return getService().getOrganizations(userId, start, end, obc); 805 } 806 807 /** 808 * Returns all the organizations belonging to the parent organization. 809 * 810 * @param companyId the primary key of the organization's company 811 * @param parentOrganizationId the primary key of the organization's parent 812 organization 813 * @return the organizations belonging to the parent organization 814 * @throws SystemException if a system exception occurred 815 */ 816 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 817 long companyId, long parentOrganizationId) 818 throws com.liferay.portal.kernel.exception.SystemException { 819 return getService().getOrganizations(companyId, parentOrganizationId); 820 } 821 822 /** 823 * Returns a range of all the organizations belonging to the parent 824 * organization. 825 * 826 * <p> 827 * Useful when paginating results. Returns a maximum of <code>end - 828 * start</code> instances. <code>start</code> and <code>end</code> are not 829 * primary keys, they are indexes in the result set. Thus, <code>0</code> 830 * refers to the first result in the set. Setting both <code>start</code> 831 * and <code>end</code> to {@link 832 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 833 * result set. 834 * </p> 835 * 836 * @param companyId the primary key of the organization's company 837 * @param parentOrganizationId the primary key of the organization's parent 838 organization 839 * @param start the lower bound of the range of organizations to return 840 * @param end the upper bound of the range of organizations to return (not 841 inclusive) 842 * @return the range of organizations belonging to the parent organization 843 * @throws SystemException if a system exception occurred 844 * @see com.liferay.portal.service.persistence.OrganizationPersistence#findByC_P( 845 long, long, int, int) 846 */ 847 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 848 long companyId, long parentOrganizationId, int start, int end) 849 throws com.liferay.portal.kernel.exception.SystemException { 850 return getService() 851 .getOrganizations(companyId, parentOrganizationId, start, end); 852 } 853 854 /** 855 * Returns the organizations with the primary keys. 856 * 857 * @param organizationIds the primary keys of the organizations 858 * @return the organizations with the primary keys 859 * @throws PortalException if any one of the organizations could not be 860 found 861 * @throws SystemException if a system exception occurred 862 */ 863 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 864 long[] organizationIds) 865 throws com.liferay.portal.kernel.exception.PortalException, 866 com.liferay.portal.kernel.exception.SystemException { 867 return getService().getOrganizations(organizationIds); 868 } 869 870 /** 871 * Returns the number of organizations belonging to the parent organization. 872 * 873 * @param companyId the primary key of the organization's company 874 * @param parentOrganizationId the primary key of the organization's parent 875 organization 876 * @return the number of organizations belonging to the parent organization 877 * @throws SystemException if a system exception occurred 878 */ 879 public static int getOrganizationsCount(long companyId, 880 long parentOrganizationId) 881 throws com.liferay.portal.kernel.exception.SystemException { 882 return getService() 883 .getOrganizationsCount(companyId, parentOrganizationId); 884 } 885 886 /** 887 * Returns the parent organizations in order by closest ancestor. The list 888 * starts with the organization itself. 889 * 890 * @param organizationId the primary key of the organization 891 * @return the parent organizations in order by closest ancestor 892 * @throws PortalException if an organization with the primary key could not 893 be found 894 * @throws SystemException if a system exception occurred 895 */ 896 public static java.util.List<com.liferay.portal.model.Organization> getParentOrganizations( 897 long organizationId) 898 throws com.liferay.portal.kernel.exception.PortalException, 899 com.liferay.portal.kernel.exception.SystemException { 900 return getService().getParentOrganizations(organizationId); 901 } 902 903 /** 904 * Returns the suborganizations of the organizations. 905 * 906 * @param organizations the organizations from which to get 907 suborganizations 908 * @return the suborganizations of the organizations 909 * @throws SystemException if a system exception occurred 910 */ 911 public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations( 912 java.util.List<com.liferay.portal.model.Organization> organizations) 913 throws com.liferay.portal.kernel.exception.SystemException { 914 return getService().getSuborganizations(organizations); 915 } 916 917 /** 918 * Returns the suborganizations of the organization. 919 * 920 * @param companyId the primary key of the organization's company 921 * @param organizationId the primary key of the organization 922 * @return the suborganizations of the organization 923 * @throws SystemException if a system exception occurred 924 */ 925 public static java.util.List<com.liferay.portal.model.Organization> getSuborganizations( 926 long companyId, long organizationId) 927 throws com.liferay.portal.kernel.exception.SystemException { 928 return getService().getSuborganizations(companyId, organizationId); 929 } 930 931 /** 932 * Returns the count of suborganizations of the organization. 933 * 934 * @param companyId the primary key of the organization's company 935 * @param organizationId the primary key of the organization 936 * @return the count of suborganizations of the organization 937 * @throws SystemException if a system exception occurred 938 */ 939 public static int getSuborganizationsCount(long companyId, 940 long organizationId) 941 throws com.liferay.portal.kernel.exception.SystemException { 942 return getService().getSuborganizationsCount(companyId, organizationId); 943 } 944 945 /** 946 * Returns the intersection of <code>allOrganizations</code> and 947 * <code>availableOrganizations</code>. 948 * 949 * @param allOrganizations the organizations to check for availability 950 * @param availableOrganizations the available organizations 951 * @return the intersection of <code>allOrganizations</code> and 952 <code>availableOrganizations</code> 953 */ 954 public static java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations( 955 java.util.List<com.liferay.portal.model.Organization> allOrganizations, 956 java.util.List<com.liferay.portal.model.Organization> availableOrganizations) { 957 return getService() 958 .getSubsetOrganizations(allOrganizations, 959 availableOrganizations); 960 } 961 962 /** 963 * Returns all the organizations associated with the user. If 964 * includeAdministrative is <code>true</code>, the result includes those 965 * organizations that are not directly associated to the user but he is an 966 * administrator or an owner of the organization. 967 * 968 * @param userId the primary key of the user 969 * @param includeAdministrative whether to includes organizations that are 970 indirectly associated to the user because he is an administrator 971 or an owner of the organization 972 * @return the organizations associated with the user 973 * @throws PortalException if a user with the primary key could not be found 974 * @throws SystemException if a system exception occurred 975 */ 976 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 977 long userId, boolean includeAdministrative) 978 throws com.liferay.portal.kernel.exception.PortalException, 979 com.liferay.portal.kernel.exception.SystemException { 980 return getService().getUserOrganizations(userId, includeAdministrative); 981 } 982 983 /** 984 * Returns <code>true</code> if the password policy has been assigned to the 985 * organization. 986 * 987 * @param passwordPolicyId the primary key of the password policy 988 * @param organizationId the primary key of the organization 989 * @return <code>true</code> if the password policy has been assigned to the 990 organization; <code>false</code> otherwise 991 * @throws SystemException if a system exception occurred 992 */ 993 public static boolean hasPasswordPolicyOrganization(long passwordPolicyId, 994 long organizationId) 995 throws com.liferay.portal.kernel.exception.SystemException { 996 return getService() 997 .hasPasswordPolicyOrganization(passwordPolicyId, 998 organizationId); 999 } 1000 1001 /** 1002 * Returns <code>true</code> if the user is a member of the organization, 1003 * optionally focusing on suborganizations or the specified organization. 1004 * This method is usually called to determine if the user has view access to 1005 * a resource belonging to the organization. 1006 * 1007 * <ol> 1008 * <li> 1009 * If <code>inheritSuborganizations=<code>false</code></code>: 1010 * the method checks whether the user belongs to the organization specified 1011 * by <code>organizationId</code>. The parameter 1012 * <code>includeSpecifiedOrganization</code> is ignored. 1013 * </li> 1014 * <li> 1015 * The parameter <code>includeSpecifiedOrganization</code> is 1016 * ignored unless <code>inheritSuborganizations</code> is also 1017 * <code>true</code>. 1018 * </li> 1019 * <li> 1020 * If <code>inheritSuborganizations=<code>true</code></code> and 1021 * <code>includeSpecifiedOrganization=<code>false</code></code>: the method 1022 * checks 1023 * whether the user belongs to one of the child organizations of the one 1024 * specified by <code>organizationId</code>. 1025 * </li> 1026 * <li> 1027 * If <code>inheritSuborganizations=<code>true</code></code> and 1028 * <code>includeSpecifiedOrganization=<code>true</code></code>: the method 1029 * checks whether 1030 * the user belongs to the organization specified by 1031 * <code>organizationId</code> or any of 1032 * its child organizations. 1033 * </li> 1034 * </ol> 1035 * 1036 * @param userId the primary key of the organization's user 1037 * @param organizationId the primary key of the organization 1038 * @param inheritSuborganizations if <code>true</code> suborganizations are 1039 considered in the determination 1040 * @param includeSpecifiedOrganization if <code>true</code> the 1041 organization specified by <code>organizationId</code> is 1042 considered in the determination 1043 * @return <code>true</code> if the user has access to the organization; 1044 <code>false</code> otherwise 1045 * @throws PortalException if an organization with the primary key could not 1046 be found 1047 * @throws SystemException if a system exception occurred 1048 * @see com.liferay.portal.service.persistence.OrganizationFinder 1049 */ 1050 public static boolean hasUserOrganization(long userId, long organizationId, 1051 boolean inheritSuborganizations, boolean includeSpecifiedOrganization) 1052 throws com.liferay.portal.kernel.exception.PortalException, 1053 com.liferay.portal.kernel.exception.SystemException { 1054 return getService() 1055 .hasUserOrganization(userId, organizationId, 1056 inheritSuborganizations, includeSpecifiedOrganization); 1057 } 1058 1059 /** 1060 * Rebuilds the organizations tree. 1061 * 1062 * <p> 1063 * Only call this method if the tree has become stale through operations 1064 * other than normal CRUD. Under normal circumstances the tree is 1065 * automatically rebuilt whenever necessary. 1066 * </p> 1067 * 1068 * @param companyId the primary key of the organization's company 1069 * @throws PortalException if an organization with the primary key could not 1070 be found 1071 * @throws SystemException if a system exception occurred 1072 */ 1073 public static void rebuildTree(long companyId) 1074 throws com.liferay.portal.kernel.exception.PortalException, 1075 com.liferay.portal.kernel.exception.SystemException { 1076 getService().rebuildTree(companyId); 1077 } 1078 1079 /** 1080 * Returns an ordered range of all the organizations that match the 1081 * keywords, using the indexer. It is preferable to use this method instead 1082 * of the non-indexed version whenever possible for performance reasons. 1083 * 1084 * <p> 1085 * Useful when paginating results. Returns a maximum of <code>end - 1086 * start</code> instances. <code>start</code> and <code>end</code> are not 1087 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1088 * refers to the first result in the set. Setting both <code>start</code> 1089 * and <code>end</code> to {@link 1090 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1091 * result set. 1092 * </p> 1093 * 1094 * @param companyId the primary key of the organization's company 1095 * @param parentOrganizationId the primary key of the organization's parent 1096 organization 1097 * @param keywords the keywords (space separated), which may occur in the 1098 organization's name, street, city, zipcode, type, region or 1099 country (optionally <code>null</code>) 1100 * @param params the finder parameters (optionally <code>null</code>). For 1101 more information see {@link 1102 com.liferay.portlet.usersadmin.util.OrganizationIndexer} 1103 * @param start the lower bound of the range of organizations to return 1104 * @param end the upper bound of the range of organizations to return (not 1105 inclusive) 1106 * @param sort the field and direction by which to sort (optionally 1107 <code>null</code>) 1108 * @return the matching organizations ordered by name 1109 * @throws SystemException if a system exception occurred 1110 * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer 1111 */ 1112 public static com.liferay.portal.kernel.search.Hits search(long companyId, 1113 long parentOrganizationId, java.lang.String keywords, 1114 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1115 int start, int end, com.liferay.portal.kernel.search.Sort sort) 1116 throws com.liferay.portal.kernel.exception.SystemException { 1117 return getService() 1118 .search(companyId, parentOrganizationId, keywords, params, 1119 start, end, sort); 1120 } 1121 1122 /** 1123 * Returns a name ordered range of all the organizations that match the 1124 * keywords, type, region, and country, without using the indexer. It is 1125 * preferable to use the indexed version {@link #search(long, long, String, 1126 * LinkedHashMap, int, int, Sort)} instead of this method wherever possible 1127 * for performance reasons. 1128 * 1129 * <p> 1130 * Useful when paginating results. Returns a maximum of <code>end - 1131 * start</code> instances. <code>start</code> and <code>end</code> are not 1132 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1133 * refers to the first result in the set. Setting both <code>start</code> 1134 * and <code>end</code> to {@link 1135 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1136 * result set. 1137 * </p> 1138 * 1139 * @param companyId the primary key of the organization's company 1140 * @param parentOrganizationId the primary key of the organization's parent 1141 organization 1142 * @param keywords the keywords (space separated), which may occur in the 1143 organization's name, street, city, or zipcode (optionally 1144 <code>null</code>) 1145 * @param type the organization's type (optionally <code>null</code>) 1146 * @param regionId the primary key of the organization's region (optionally 1147 <code>null</code>) 1148 * @param countryId the primary key of the organization's country 1149 (optionally <code>null</code>) 1150 * @param params the finder params. For more information see {@link 1151 com.liferay.portal.service.persistence.OrganizationFinder} 1152 * @param start the lower bound of the range of organizations to return 1153 * @param end the upper bound of the range of organizations to return (not 1154 inclusive) 1155 * @return the matching organizations ordered by name 1156 * @throws SystemException if a system exception occurred 1157 * @see com.liferay.portal.service.persistence.OrganizationFinder 1158 */ 1159 public static java.util.List<com.liferay.portal.model.Organization> search( 1160 long companyId, long parentOrganizationId, java.lang.String keywords, 1161 java.lang.String type, java.lang.Long regionId, 1162 java.lang.Long countryId, 1163 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1164 int start, int end) 1165 throws com.liferay.portal.kernel.exception.SystemException { 1166 return getService() 1167 .search(companyId, parentOrganizationId, keywords, type, 1168 regionId, countryId, params, start, end); 1169 } 1170 1171 /** 1172 * Returns an ordered range of all the organizations that match the 1173 * keywords, type, region, and country, without using the indexer. It is 1174 * preferable to use the indexed version {@link #search(long, long, String, 1175 * String, String, String, String, String, String, LinkedHashMap, boolean, 1176 * int, int, Sort)} instead of this method wherever possible for performance 1177 * reasons. 1178 * 1179 * <p> 1180 * Useful when paginating results. Returns a maximum of <code>end - 1181 * start</code> instances. <code>start</code> and <code>end</code> are not 1182 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1183 * refers to the first result in the set. Setting both <code>start</code> 1184 * and <code>end</code> to {@link 1185 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1186 * result set. 1187 * </p> 1188 * 1189 * @param companyId the primary key of the organization's company 1190 * @param parentOrganizationId the primary key of the organization's parent 1191 organization 1192 * @param keywords the keywords (space separated), which may occur in the 1193 organization's name, street, city, or zipcode (optionally 1194 <code>null</code>) 1195 * @param type the organization's type (optionally <code>null</code>) 1196 * @param regionId the primary key of the organization's region (optionally 1197 <code>null</code>) 1198 * @param countryId the primary key of the organization's country 1199 (optionally <code>null</code>) 1200 * @param params the finder params. For more information see {@link 1201 com.liferay.portal.service.persistence.OrganizationFinder} 1202 * @param start the lower bound of the range of organizations to return 1203 * @param end the upper bound of the range of organizations to return (not 1204 inclusive) 1205 * @param obc the comparator to order the organizations (optionally 1206 <code>null</code>) 1207 * @return the matching organizations ordered by comparator <code>obc</code> 1208 * @throws SystemException if a system exception occurred 1209 * @see com.liferay.portal.service.persistence.OrganizationFinder 1210 */ 1211 public static java.util.List<com.liferay.portal.model.Organization> search( 1212 long companyId, long parentOrganizationId, java.lang.String keywords, 1213 java.lang.String type, java.lang.Long regionId, 1214 java.lang.Long countryId, 1215 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1216 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1217 throws com.liferay.portal.kernel.exception.SystemException { 1218 return getService() 1219 .search(companyId, parentOrganizationId, keywords, type, 1220 regionId, countryId, params, start, end, obc); 1221 } 1222 1223 /** 1224 * Returns a name ordered range of all the organizations with the type, 1225 * region, and country, and whose name, street, city, and zipcode match the 1226 * keywords specified for them, without using the indexer. It is preferable 1227 * to use the indexed version {@link #search(long, long, String, String, 1228 * String, String, String, String, String, LinkedHashMap, boolean, int, int, 1229 * Sort)} instead of this method wherever possible for performance reasons. 1230 * 1231 * <p> 1232 * Useful when paginating results. Returns a maximum of <code>end - 1233 * start</code> instances. <code>start</code> and <code>end</code> are not 1234 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1235 * refers to the first result in the set. Setting both <code>start</code> 1236 * and <code>end</code> to {@link 1237 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1238 * result set. 1239 * </p> 1240 * 1241 * @param companyId the primary key of the organization's company 1242 * @param parentOrganizationId the primary key of the organization's parent 1243 * @param name the name keywords (space separated, optionally 1244 <code>null</code>) 1245 * @param type the organization's type (optionally <code>null</code>) 1246 * @param street the street keywords (optionally <code>null</code>) 1247 * @param city the city keywords (optionally <code>null</code>) 1248 * @param zip the zipcode keywords (optionally <code>null</code>) 1249 * @param regionId the primary key of the organization's region (optionally 1250 <code>null</code>) 1251 * @param countryId the primary key of the organization's country 1252 (optionally <code>null</code>) 1253 * @param params the finder parameters (optionally <code>null</code>). For 1254 more information see {@link 1255 com.liferay.portal.service.persistence.OrganizationFinder} 1256 * @param andOperator whether every field must match its keywords, or just 1257 one field. For example, "organizations with the name 1258 'Employees' and city 'Chicago'" vs "organizations with 1259 the name 'Employees' or the city 'Chicago'". 1260 * @param start the lower bound of the range of organizations to return 1261 * @param end the upper bound of the range of organizations to return (not 1262 inclusive) 1263 * @return the matching organizations ordered by name 1264 * @throws SystemException if a system exception occurred 1265 * @see com.liferay.portal.service.persistence.OrganizationFinder 1266 */ 1267 public static java.util.List<com.liferay.portal.model.Organization> search( 1268 long companyId, long parentOrganizationId, java.lang.String name, 1269 java.lang.String type, java.lang.String street, java.lang.String city, 1270 java.lang.String zip, java.lang.Long regionId, 1271 java.lang.Long countryId, 1272 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1273 boolean andOperator, int start, int end) 1274 throws com.liferay.portal.kernel.exception.SystemException { 1275 return getService() 1276 .search(companyId, parentOrganizationId, name, type, street, 1277 city, zip, regionId, countryId, params, andOperator, start, end); 1278 } 1279 1280 /** 1281 * Returns an ordered range of all the organizations with the type, region, 1282 * and country, and whose name, street, city, and zipcode match the keywords 1283 * specified for them, without using the indexer. It is preferable to use 1284 * the indexed version {@link #search(long, long, String, String, String, 1285 * String, String, String, String, LinkedHashMap, boolean, int, int, Sort)} 1286 * instead of this method wherever possible for performance reasons. 1287 * 1288 * <p> 1289 * Useful when paginating results. Returns a maximum of <code>end - 1290 * start</code> instances. <code>start</code> and <code>end</code> are not 1291 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1292 * refers to the first result in the set. Setting both <code>start</code> 1293 * and <code>end</code> to {@link 1294 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1295 * result set. 1296 * </p> 1297 * 1298 * @param companyId the primary key of the organization's company 1299 * @param parentOrganizationId the primary key of the organization's parent 1300 organization 1301 * @param name the name keywords (space separated, optionally 1302 <code>null</code>) 1303 * @param type the organization's type (optionally <code>null</code>) 1304 * @param street the street keywords (optionally <code>null</code>) 1305 * @param city the city keywords (optionally <code>null</code>) 1306 * @param zip the zipcode keywords (optionally <code>null</code>) 1307 * @param regionId the primary key of the organization's region (optionally 1308 <code>null</code>) 1309 * @param countryId the primary key of the organization's country 1310 (optionally <code>null</code>) 1311 * @param params the finder parameters (optionally <code>null</code>). For 1312 more information see {@link 1313 com.liferay.portal.service.persistence.OrganizationFinder} 1314 * @param andOperator whether every field must match its keywords, or just 1315 one field. For example, "organizations with the name 1316 'Employees' and city 'Chicago'" vs "organizations with 1317 the name 'Employees' or the city 'Chicago'". 1318 * @param start the lower bound of the range of organizations to return 1319 * @param end the upper bound of the range of organizations to return (not 1320 inclusive) 1321 * @param obc the comparator to order the organizations (optionally 1322 <code>null</code>) 1323 * @return the matching organizations ordered by comparator <code>obc</code> 1324 * @throws SystemException if a system exception occurred 1325 * @see com.liferay.portal.service.persistence.OrganizationFinder 1326 */ 1327 public static java.util.List<com.liferay.portal.model.Organization> search( 1328 long companyId, long parentOrganizationId, java.lang.String name, 1329 java.lang.String type, java.lang.String street, java.lang.String city, 1330 java.lang.String zip, java.lang.Long regionId, 1331 java.lang.Long countryId, 1332 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1333 boolean andOperator, int start, int end, 1334 com.liferay.portal.kernel.util.OrderByComparator obc) 1335 throws com.liferay.portal.kernel.exception.SystemException { 1336 return getService() 1337 .search(companyId, parentOrganizationId, name, type, street, 1338 city, zip, regionId, countryId, params, andOperator, start, end, obc); 1339 } 1340 1341 /** 1342 * Returns an ordered range of all the organizations whose name, type, or 1343 * location fields match the keywords specified for them, using the indexer. 1344 * It is preferable to use this method instead of the non-indexed version 1345 * whenever possible for performance reasons. 1346 * 1347 * <p> 1348 * Useful when paginating results. Returns a maximum of <code>end - 1349 * start</code> instances. <code>start</code> and <code>end</code> are not 1350 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1351 * refers to the first result in the set. Setting both <code>start</code> 1352 * and <code>end</code> to {@link 1353 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1354 * result set. 1355 * </p> 1356 * 1357 * @param companyId the primary key of the organization's company 1358 * @param parentOrganizationId the primary key of the organization's parent 1359 organization 1360 * @param name the name keywords (space separated, optionally 1361 <code>null</code>) 1362 * @param type the type keywords (optionally <code>null</code>) 1363 * @param street the street keywords (optionally <code>null</code>) 1364 * @param city the city keywords (optionally <code>null</code>) 1365 * @param zip the zipcode keywords (optionally <code>null</code>) 1366 * @param region the region keywords (optionally <code>null</code>) 1367 * @param country the country keywords (optionally <code>null</code>) 1368 * @param params the finder parameters (optionally <code>null</code>). For 1369 more information see {@link 1370 com.liferay.portlet.usersadmin.util.OrganizationIndexer}. 1371 * @param andSearch whether every field must match its keywords or just one 1372 field 1373 * @param start the lower bound of the range of organizations to return 1374 * @param end the upper bound of the range of organizations to return (not 1375 inclusive) 1376 * @param sort the field and direction by which to sort (optionally 1377 <code>null</code>) 1378 * @return the matching organizations ordered by <code>sort</code> 1379 * @throws SystemException if a system exception occurred 1380 * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer 1381 */ 1382 public static com.liferay.portal.kernel.search.Hits search(long companyId, 1383 long parentOrganizationId, java.lang.String name, 1384 java.lang.String type, java.lang.String street, java.lang.String city, 1385 java.lang.String zip, java.lang.String region, 1386 java.lang.String country, 1387 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1388 boolean andSearch, int start, int end, 1389 com.liferay.portal.kernel.search.Sort sort) 1390 throws com.liferay.portal.kernel.exception.SystemException { 1391 return getService() 1392 .search(companyId, parentOrganizationId, name, type, street, 1393 city, zip, region, country, params, andSearch, start, end, sort); 1394 } 1395 1396 /** 1397 * Returns the number of organizations that match the keywords, type, 1398 * region, and country. 1399 * 1400 * @param companyId the primary key of the organization's company 1401 * @param parentOrganizationId the primary key of the organization's parent 1402 organization 1403 * @param keywords the keywords (space separated), which may occur in the 1404 organization's name, street, city, or zipcode (optionally 1405 <code>null</code>) 1406 * @param type the organization's type (optionally <code>null</code>) 1407 * @param regionId the primary key of the organization's region (optionally 1408 <code>null</code>) 1409 * @param countryId the primary key of the organization's country 1410 (optionally <code>null</code>) 1411 * @param params the finder parameters (optionally <code>null</code>). For 1412 more information see {@link 1413 com.liferay.portal.service.persistence.OrganizationFinder} 1414 * @return the number of matching organizations 1415 * @throws SystemException if a system exception occurred 1416 * @see com.liferay.portal.service.persistence.OrganizationFinder 1417 */ 1418 public static int searchCount(long companyId, long parentOrganizationId, 1419 java.lang.String keywords, java.lang.String type, 1420 java.lang.Long regionId, java.lang.Long countryId, 1421 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1422 throws com.liferay.portal.kernel.exception.SystemException { 1423 return getService() 1424 .searchCount(companyId, parentOrganizationId, keywords, 1425 type, regionId, countryId, params); 1426 } 1427 1428 /** 1429 * Returns the number of organizations with the type, region, and country, 1430 * and whose name, street, city, and zipcode match the keywords specified 1431 * for them. 1432 * 1433 * @param companyId the primary key of the organization's company 1434 * @param parentOrganizationId the primary key of the organization's parent 1435 organization 1436 * @param name the name keywords (space separated, optionally 1437 <code>null</code>) 1438 * @param type the organization's type (optionally <code>null</code>) 1439 * @param street the street keywords (optionally <code>null</code>) 1440 * @param city the city keywords (optionally <code>null</code>) 1441 * @param zip the zipcode keywords (optionally <code>null</code>) 1442 * @param regionId the primary key of the organization's region (optionally 1443 <code>null</code>) 1444 * @param countryId the primary key of the organization's country 1445 (optionally <code>null</code>) 1446 * @param params the finder parameters (optionally <code>null</code>). For 1447 more information see {@link 1448 com.liferay.portal.service.persistence.OrganizationFinder} 1449 * @param andOperator whether every field must match its keywords, or just 1450 one field. For example, "organizations with the name 1451 'Employees' and city 'Chicago'" vs "organizations with 1452 the name 'Employees' or the city 'Chicago'". 1453 * @return the number of matching organizations 1454 * @throws SystemException if a system exception occurred 1455 * @see com.liferay.portal.service.persistence.OrganizationFinder 1456 */ 1457 public static int searchCount(long companyId, long parentOrganizationId, 1458 java.lang.String name, java.lang.String type, java.lang.String street, 1459 java.lang.String city, java.lang.String zip, java.lang.Long regionId, 1460 java.lang.Long countryId, 1461 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1462 boolean andOperator) 1463 throws com.liferay.portal.kernel.exception.SystemException { 1464 return getService() 1465 .searchCount(companyId, parentOrganizationId, name, type, 1466 street, city, zip, regionId, countryId, params, andOperator); 1467 } 1468 1469 /** 1470 * Removes the organizations from the group. 1471 * 1472 * @param groupId the primary key of the group 1473 * @param organizationIds the primary keys of the organizations 1474 * @throws PortalException if a portal exception occurred 1475 * @throws SystemException if a system exception occurred 1476 */ 1477 public static void unsetGroupOrganizations(long groupId, 1478 long[] organizationIds) 1479 throws com.liferay.portal.kernel.exception.PortalException, 1480 com.liferay.portal.kernel.exception.SystemException { 1481 getService().unsetGroupOrganizations(groupId, organizationIds); 1482 } 1483 1484 /** 1485 * Removes the organizations from the password policy. 1486 * 1487 * @param passwordPolicyId the primary key of the password policy 1488 * @param organizationIds the primary keys of the organizations 1489 * @throws SystemException if a system exception occurred 1490 */ 1491 public static void unsetPasswordPolicyOrganizations(long passwordPolicyId, 1492 long[] organizationIds) 1493 throws com.liferay.portal.kernel.exception.SystemException { 1494 getService() 1495 .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds); 1496 } 1497 1498 /** 1499 * Updates the organization's asset with the new asset categories and tag 1500 * names, removing and adding asset categories and tag names as necessary. 1501 * 1502 * @param userId the primary key of the user 1503 * @param organization the organization 1504 * @param assetCategoryIds the primary keys of the asset categories 1505 * @param assetTagNames the asset tag names 1506 * @throws PortalException if a user with the primary key could not be found 1507 * @throws SystemException if a system exception occurred 1508 */ 1509 public static void updateAsset(long userId, 1510 com.liferay.portal.model.Organization organization, 1511 long[] assetCategoryIds, java.lang.String[] assetTagNames) 1512 throws com.liferay.portal.kernel.exception.PortalException, 1513 com.liferay.portal.kernel.exception.SystemException { 1514 getService() 1515 .updateAsset(userId, organization, assetCategoryIds, assetTagNames); 1516 } 1517 1518 /** 1519 * Updates the organization. 1520 * 1521 * @param companyId the primary key of the organization's company 1522 * @param organizationId the primary key of the organization 1523 * @param parentOrganizationId the primary key of organization's parent 1524 organization 1525 * @param name the organization's name 1526 * @param type the organization's type 1527 * @param recursable whether permissions of the organization are to be 1528 inherited by its suborganizations 1529 * @param regionId the primary key of the organization's region 1530 * @param countryId the primary key of the organization's country 1531 * @param statusId the organization's workflow status 1532 * @param comments the comments about the organization 1533 * @param site whether the organization is to be associated with a main 1534 site 1535 * @param serviceContext the service context to be applied (optionally 1536 <code>null</code>). Can set asset category IDs and asset tag 1537 names for the organization, and merge expando bridge 1538 attributes for the organization. 1539 * @return the organization 1540 * @throws PortalException if an organization or parent organization 1541 with the primary key could not be found or if the new 1542 information was invalid 1543 * @throws SystemException if a system exception occurred 1544 * @deprecated As of 6.2.0, replaced by {@link #updateOrganization(long, 1545 long, long, String, String, long, long, int, String, boolean, 1546 ServiceContext)} 1547 */ 1548 public static com.liferay.portal.model.Organization updateOrganization( 1549 long companyId, long organizationId, long parentOrganizationId, 1550 java.lang.String name, java.lang.String type, boolean recursable, 1551 long regionId, long countryId, int statusId, java.lang.String comments, 1552 boolean site, com.liferay.portal.service.ServiceContext serviceContext) 1553 throws com.liferay.portal.kernel.exception.PortalException, 1554 com.liferay.portal.kernel.exception.SystemException { 1555 return getService() 1556 .updateOrganization(companyId, organizationId, 1557 parentOrganizationId, name, type, recursable, regionId, countryId, 1558 statusId, comments, site, serviceContext); 1559 } 1560 1561 /** 1562 * Updates the organization. 1563 * 1564 * @param companyId the primary key of the organization's company 1565 * @param organizationId the primary key of the organization 1566 * @param parentOrganizationId the primary key of organization's parent 1567 organization 1568 * @param name the organization's name 1569 * @param type the organization's type 1570 * @param regionId the primary key of the organization's region 1571 * @param countryId the primary key of the organization's country 1572 * @param statusId the organization's workflow status 1573 * @param comments the comments about the organization 1574 * @param site whether the organization is to be associated with a main 1575 site 1576 * @param serviceContext the service context to be applied (optionally 1577 <code>null</code>). Can set asset category IDs and asset tag 1578 names for the organization, and merge expando bridge attributes 1579 for the organization. 1580 * @return the organization 1581 * @throws PortalException if an organization or parent organization with 1582 the primary key could not be found or if the new information was 1583 invalid 1584 * @throws SystemException if a system exception occurred 1585 */ 1586 public static com.liferay.portal.model.Organization updateOrganization( 1587 long companyId, long organizationId, long parentOrganizationId, 1588 java.lang.String name, java.lang.String type, long regionId, 1589 long countryId, int statusId, java.lang.String comments, boolean site, 1590 com.liferay.portal.service.ServiceContext serviceContext) 1591 throws com.liferay.portal.kernel.exception.PortalException, 1592 com.liferay.portal.kernel.exception.SystemException { 1593 return getService() 1594 .updateOrganization(companyId, organizationId, 1595 parentOrganizationId, name, type, regionId, countryId, statusId, 1596 comments, site, serviceContext); 1597 } 1598 1599 public static OrganizationLocalService getService() { 1600 if (_service == null) { 1601 _service = (OrganizationLocalService)PortalBeanLocatorUtil.locate(OrganizationLocalService.class.getName()); 1602 1603 ReferenceRegistry.registerReference(OrganizationLocalServiceUtil.class, 1604 "_service"); 1605 } 1606 1607 return _service; 1608 } 1609 1610 /** 1611 * @deprecated As of 6.2.0 1612 */ 1613 public void setService(OrganizationLocalService service) { 1614 } 1615 1616 private static OrganizationLocalService _service; 1617 }