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