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