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