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