001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the organization remote service. This utility wraps {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and is the primary access point for service operations in application layer code running on a remote server. 022 * 023 * <p> 024 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see OrganizationService 029 * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl 030 * @see com.liferay.portal.service.impl.OrganizationServiceImpl 031 * @generated 032 */ 033 public class OrganizationServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Returns the Spring bean ID for this bean. 042 * 043 * @return the Spring bean ID for this bean 044 */ 045 public static java.lang.String getBeanIdentifier() { 046 return getService().getBeanIdentifier(); 047 } 048 049 /** 050 * Sets the Spring bean ID for this bean. 051 * 052 * @param beanIdentifier the Spring bean ID for this bean 053 */ 054 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 055 getService().setBeanIdentifier(beanIdentifier); 056 } 057 058 /** 059 * Adds the organizations to the group. 060 * 061 * @param groupId the primary key of the group 062 * @param organizationIds the primary keys of the organizations 063 * @throws PortalException if a group or organization with the primary key 064 could not be found or if the user did not have permission to 065 assign group members 066 * @throws SystemException if a system exception occurred 067 */ 068 public static void addGroupOrganizations(long groupId, 069 long[] organizationIds) 070 throws com.liferay.portal.kernel.exception.PortalException, 071 com.liferay.portal.kernel.exception.SystemException { 072 getService().addGroupOrganizations(groupId, organizationIds); 073 } 074 075 /** 076 * Adds an organization with additional parameters. 077 * 078 * <p> 079 * This method handles the creation and bookkeeping of the organization 080 * including its resources, metadata, and internal data structures. 081 * </p> 082 * 083 * @param parentOrganizationId the primary key of the organization's parent 084 organization 085 * @param name the organization's name 086 * @param type the organization's type 087 * @param recursable whether the permissions of the organization are to be 088 inherited by its sub-organizations 089 * @param regionId the primary key of the organization's region 090 * @param countryId the primary key of the organization's country 091 * @param statusId the organization's workflow status 092 * @param comments the comments about the organization 093 * @param site whether the organization is to be associated with a main 094 site 095 * @param addresses the organization's addresses 096 * @param emailAddresses the organization's email addresses 097 * @param orgLabors the organization's hours of operation 098 * @param phones the organization's phone numbers 099 * @param websites the organization's websites 100 * @param serviceContext the organization's service context (optionally 101 <code>null</code>). Can set asset category IDs, asset tag names, 102 and expando bridge attributes for the organization. 103 * @return the organization 104 * @throws PortalException if a parent organization with the primary key 105 could not be found, if the organization's information was 106 invalid, or if the user did not have permission to add the 107 organization 108 * @throws SystemException if a system exception occurred 109 */ 110 public static com.liferay.portal.model.Organization addOrganization( 111 long parentOrganizationId, java.lang.String name, 112 java.lang.String type, boolean recursable, long regionId, 113 long countryId, int statusId, java.lang.String comments, boolean site, 114 java.util.List<com.liferay.portal.model.Address> addresses, 115 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 116 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors, 117 java.util.List<com.liferay.portal.model.Phone> phones, 118 java.util.List<com.liferay.portal.model.Website> websites, 119 com.liferay.portal.service.ServiceContext serviceContext) 120 throws com.liferay.portal.kernel.exception.PortalException, 121 com.liferay.portal.kernel.exception.SystemException { 122 return getService() 123 .addOrganization(parentOrganizationId, name, type, 124 recursable, regionId, countryId, statusId, comments, site, 125 addresses, emailAddresses, orgLabors, phones, websites, 126 serviceContext); 127 } 128 129 /** 130 * Adds an organization. 131 * 132 * <p> 133 * This method handles the creation and bookkeeping of the organization 134 * including its resources, metadata, and internal data structures. 135 * </p> 136 * 137 * @param parentOrganizationId the primary key of the organization's parent 138 organization 139 * @param name the organization's name 140 * @param type the organization's type 141 * @param recursable whether the permissions of the organization are to be 142 inherited by its sub-organizations 143 * @param regionId the primary key of the organization's region 144 * @param countryId the primary key of the organization's country 145 * @param statusId the organization's workflow status 146 * @param comments the comments about the organization 147 * @param site whether the organization is to be associated with a main 148 site 149 * @param serviceContext the organization's service context (optionally 150 <code>null</code>). Can set asset category IDs, asset tag names, 151 and expando bridge attributes for the organization. 152 * @return the organization 153 * @throws PortalException if the parent organization with the primary key 154 could not be found, if the organization information was invalid, 155 or if the user did not have permission to add the organization 156 * @throws SystemException if a system exception occurred 157 */ 158 public static com.liferay.portal.model.Organization addOrganization( 159 long parentOrganizationId, java.lang.String name, 160 java.lang.String type, boolean recursable, long regionId, 161 long countryId, int statusId, java.lang.String comments, boolean site, 162 com.liferay.portal.service.ServiceContext serviceContext) 163 throws com.liferay.portal.kernel.exception.PortalException, 164 com.liferay.portal.kernel.exception.SystemException { 165 return getService() 166 .addOrganization(parentOrganizationId, name, type, 167 recursable, regionId, countryId, statusId, comments, site, 168 serviceContext); 169 } 170 171 /** 172 * Assigns the password policy to the organizations, removing any other 173 * currently assigned password policies. 174 * 175 * @param passwordPolicyId the primary key of the password policy 176 * @param organizationIds the primary keys of the organizations 177 * @throws PortalException if the user did not have permission to update the 178 password policy 179 * @throws SystemException if a system exception occurred 180 */ 181 public static void addPasswordPolicyOrganizations(long passwordPolicyId, 182 long[] organizationIds) 183 throws com.liferay.portal.kernel.exception.PortalException, 184 com.liferay.portal.kernel.exception.SystemException { 185 getService() 186 .addPasswordPolicyOrganizations(passwordPolicyId, organizationIds); 187 } 188 189 /** 190 * Deletes the logo of the organization. 191 * 192 * @param organizationId the primary key of the organization 193 * @throws PortalException if an organization with the primary key could not 194 be found, if the organization's logo could not be found, or if 195 the user did not have permission to update the organization 196 * @throws SystemException if a system exception occurred 197 */ 198 public static void deleteLogo(long organizationId) 199 throws com.liferay.portal.kernel.exception.PortalException, 200 com.liferay.portal.kernel.exception.SystemException { 201 getService().deleteLogo(organizationId); 202 } 203 204 /** 205 * Deletes the organization. The organization's associated resources and 206 * assets are also deleted. 207 * 208 * @param organizationId the primary key of the organization 209 * @throws PortalException if an organization with the primary key could not 210 be found, if the user did not have permission to delete the 211 organization, if the organization had a workflow in approved 212 status, or if the organization was a parent organization 213 * @throws SystemException if a system exception occurred 214 */ 215 public static void deleteOrganization(long organizationId) 216 throws com.liferay.portal.kernel.exception.PortalException, 217 com.liferay.portal.kernel.exception.SystemException { 218 getService().deleteOrganization(organizationId); 219 } 220 221 /** 222 * Returns all the organizations which the user has permission to manage. 223 * 224 * @param actionId the permitted action 225 * @param max the maximum number of the organizations to be considered 226 * @return the organizations which the user has permission to manage 227 * @throws PortalException if a portal exception occurred 228 * @throws SystemException if a system exception occurred 229 * @deprecated Replaced by {@link #getOrganizations(long, long, int, int)} 230 */ 231 public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations( 232 java.lang.String actionId, int max) 233 throws com.liferay.portal.kernel.exception.PortalException, 234 com.liferay.portal.kernel.exception.SystemException { 235 return getService().getManageableOrganizations(actionId, max); 236 } 237 238 /** 239 * Returns the organization with the primary key. 240 * 241 * @param organizationId the primary key of the organization 242 * @return the organization with the primary key 243 * @throws PortalException if an organization with the primary key could not 244 be found or if the user did not have permission to view the 245 organization 246 * @throws SystemException if a system exception occurred 247 */ 248 public static com.liferay.portal.model.Organization getOrganization( 249 long organizationId) 250 throws com.liferay.portal.kernel.exception.PortalException, 251 com.liferay.portal.kernel.exception.SystemException { 252 return getService().getOrganization(organizationId); 253 } 254 255 /** 256 * Returns the primary key of the organization with the name. 257 * 258 * @param companyId the primary key of the organization's company 259 * @param name the organization's name 260 * @return the primary key of the organization with the name, or 261 <code>0</code> if the organization could not be found 262 * @throws SystemException if a system exception occurred 263 */ 264 public static long getOrganizationId(long companyId, java.lang.String name) 265 throws com.liferay.portal.kernel.exception.PortalException, 266 com.liferay.portal.kernel.exception.SystemException { 267 return getService().getOrganizationId(companyId, name); 268 } 269 270 /** 271 * Returns all the organizations belonging to the parent organization. 272 * 273 * @param companyId the primary key of the organizations' company 274 * @param parentOrganizationId the primary key of the organizations' parent 275 organization 276 * @return the organizations belonging to the parent organization 277 * @throws SystemException if a system exception occurred 278 */ 279 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 280 long companyId, long parentOrganizationId) 281 throws com.liferay.portal.kernel.exception.SystemException { 282 return getService().getOrganizations(companyId, parentOrganizationId); 283 } 284 285 /** 286 * Returns a range of all the organizations belonging to the parent 287 * organization. 288 * 289 * <p> 290 * Useful when paginating results. Returns a maximum of <code>end - 291 * start</code> instances. <code>start</code> and <code>end</code> are not 292 * primary keys, they are indexes in the result set. Thus, <code>0</code> 293 * refers to the first result in the set. Setting both <code>start</code> 294 * and <code>end</code> to {@link 295 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 296 * result set. 297 * </p> 298 * 299 * @param companyId the primary key of the organizations' company 300 * @param parentOrganizationId the primary key of the organizations' parent 301 organization 302 * @param start the lower bound of the range of organizations to return 303 * @param end the upper bound of the range of organizations to return (not 304 inclusive) 305 * @return the range of organizations belonging to the parent organization 306 * @throws SystemException if a system exception occurred 307 */ 308 public static java.util.List<com.liferay.portal.model.Organization> getOrganizations( 309 long companyId, long parentOrganizationId, int start, int end) 310 throws com.liferay.portal.kernel.exception.SystemException { 311 return getService() 312 .getOrganizations(companyId, parentOrganizationId, start, end); 313 } 314 315 /** 316 * Returns the number of organizations belonging to the parent organization. 317 * 318 * @param companyId the primary key of the organizations' company 319 * @param parentOrganizationId the primary key of the organizations' parent 320 organization 321 * @return the number of organizations belonging to the parent organization 322 * @throws SystemException if a system exception occurred 323 */ 324 public static int getOrganizationsCount(long companyId, 325 long parentOrganizationId) 326 throws com.liferay.portal.kernel.exception.SystemException { 327 return getService() 328 .getOrganizationsCount(companyId, parentOrganizationId); 329 } 330 331 /** 332 * Returns all the organizations associated with the user. 333 * 334 * @param userId the primary key of the user 335 * @return the organizations associated with the user 336 * @throws PortalException if a user with the primary key could not be found 337 * @throws SystemException if a system exception occurred 338 */ 339 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 340 long userId) 341 throws com.liferay.portal.kernel.exception.PortalException, 342 com.liferay.portal.kernel.exception.SystemException { 343 return getService().getUserOrganizations(userId); 344 } 345 346 /** 347 * Sets the organizations in the group, removing and adding organizations to 348 * the group as necessary. 349 * 350 * @param groupId the primary key of the group 351 * @param organizationIds the primary keys of the organizations 352 * @throws PortalException if a group or organization with the primary key 353 could not be found or if the user did not have permission to 354 assign group members 355 * @throws SystemException if a system exception occurred 356 */ 357 public static void setGroupOrganizations(long groupId, 358 long[] organizationIds) 359 throws com.liferay.portal.kernel.exception.PortalException, 360 com.liferay.portal.kernel.exception.SystemException { 361 getService().setGroupOrganizations(groupId, organizationIds); 362 } 363 364 /** 365 * Removes the organizations from the group. 366 * 367 * @param groupId the primary key of the group 368 * @param organizationIds the primary keys of the organizations 369 * @throws PortalException if a group or organization with the primary key 370 could not be found or if the user did not have permission to 371 assign group members 372 * @throws SystemException if a system exception occurred 373 */ 374 public static void unsetGroupOrganizations(long groupId, 375 long[] organizationIds) 376 throws com.liferay.portal.kernel.exception.PortalException, 377 com.liferay.portal.kernel.exception.SystemException { 378 getService().unsetGroupOrganizations(groupId, organizationIds); 379 } 380 381 /** 382 * Removes the organizations from the password policy. 383 * 384 * @param passwordPolicyId the primary key of the password policy 385 * @param organizationIds the primary keys of the organizations 386 * @throws PortalException if a password policy or organization with the 387 primary key could not be found, or if the user did not have 388 permission to update the password policy 389 * @throws SystemException if a system exception occurred 390 */ 391 public static void unsetPasswordPolicyOrganizations(long passwordPolicyId, 392 long[] organizationIds) 393 throws com.liferay.portal.kernel.exception.PortalException, 394 com.liferay.portal.kernel.exception.SystemException { 395 getService() 396 .unsetPasswordPolicyOrganizations(passwordPolicyId, organizationIds); 397 } 398 399 /** 400 * Updates the organization with additional parameters. 401 * 402 * @param organizationId the primary key of the organization 403 * @param parentOrganizationId the primary key of the organization's parent 404 organization 405 * @param name the organization's name 406 * @param type the organization's type 407 * @param recursable whether the permissions of the organization are to be 408 inherited by its sub-organizations 409 * @param regionId the primary key of the organization's region 410 * @param countryId the primary key of the organization's country 411 * @param statusId the organization's workflow status 412 * @param comments the comments about the organization 413 * @param site whether the organization is to be associated with a main 414 site 415 * @param addresses the organization's addresses 416 * @param emailAddresses the organization's email addresses 417 * @param orgLabors the organization's hours of operation 418 * @param phones the organization's phone numbers 419 * @param websites the organization's websites 420 * @param serviceContext the organization's service context (optionally 421 <code>null</code>). Can set asset category IDs and asset tag 422 names for the organization, and merge expando bridge attributes 423 for the organization. 424 * @return the organization 425 * @throws PortalException if an organization or parent organization with 426 the primary key could not be found, if the user did not have 427 permission to update the organization information, or if the new 428 information was invalid 429 * @throws SystemException if a system exception occurred 430 */ 431 public static com.liferay.portal.model.Organization updateOrganization( 432 long organizationId, long parentOrganizationId, java.lang.String name, 433 java.lang.String type, boolean recursable, long regionId, 434 long countryId, int statusId, java.lang.String comments, boolean site, 435 java.util.List<com.liferay.portal.model.Address> addresses, 436 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 437 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors, 438 java.util.List<com.liferay.portal.model.Phone> phones, 439 java.util.List<com.liferay.portal.model.Website> websites, 440 com.liferay.portal.service.ServiceContext serviceContext) 441 throws com.liferay.portal.kernel.exception.PortalException, 442 com.liferay.portal.kernel.exception.SystemException { 443 return getService() 444 .updateOrganization(organizationId, parentOrganizationId, 445 name, type, recursable, regionId, countryId, statusId, comments, 446 site, addresses, emailAddresses, orgLabors, phones, websites, 447 serviceContext); 448 } 449 450 /** 451 * Updates the organization. 452 * 453 * @param organizationId the primary key of the organization 454 * @param parentOrganizationId the primary key of the organization's parent 455 organization 456 * @param name the organization's name 457 * @param type the organization's type 458 * @param recursable whether permissions of the organization are to be 459 inherited by its sub-organizations 460 * @param regionId the primary key of the organization's region 461 * @param countryId the primary key of the organization's country 462 * @param statusId the organization's workflow status 463 * @param comments the comments about the organization 464 * @param site whether the organization is to be associated with a main 465 site 466 * @param serviceContext the organization's service context (optionally 467 <code>null</code>). Can set asset category IDs and asset tag 468 names for the organization, and merge expando bridge attributes 469 for the organization. 470 * @return the organization 471 * @throws PortalException if an organization or parent organization with 472 the primary key could not be found, if the user did not have 473 permission to update the organization, or if the new information 474 was invalid 475 * @throws SystemException if a system exception occurred 476 */ 477 public static com.liferay.portal.model.Organization updateOrganization( 478 long organizationId, long parentOrganizationId, java.lang.String name, 479 java.lang.String type, boolean recursable, long regionId, 480 long countryId, int statusId, java.lang.String comments, boolean site, 481 com.liferay.portal.service.ServiceContext serviceContext) 482 throws com.liferay.portal.kernel.exception.PortalException, 483 com.liferay.portal.kernel.exception.SystemException { 484 return getService() 485 .updateOrganization(organizationId, parentOrganizationId, 486 name, type, recursable, regionId, countryId, statusId, comments, 487 site, serviceContext); 488 } 489 490 public static OrganizationService getService() { 491 if (_service == null) { 492 _service = (OrganizationService)PortalBeanLocatorUtil.locate(OrganizationService.class.getName()); 493 494 ReferenceRegistry.registerReference(OrganizationServiceUtil.class, 495 "_service"); 496 } 497 498 return _service; 499 } 500 501 /** 502 * @deprecated 503 */ 504 public void setService(OrganizationService service) { 505 } 506 507 private static OrganizationService _service; 508 }