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