001 /** 002 * Copyright (c) 2000-2012 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.http; 016 017 import com.liferay.portal.kernel.log.Log; 018 import com.liferay.portal.kernel.log.LogFactoryUtil; 019 import com.liferay.portal.service.OrganizationServiceUtil; 020 021 import java.rmi.RemoteException; 022 023 /** 024 * <p> 025 * This class provides a SOAP utility for the 026 * {@link com.liferay.portal.service.OrganizationServiceUtil} service utility. The 027 * static methods of this class calls the same methods of the service utility. 028 * However, the signatures are different because it is difficult for SOAP to 029 * support certain types. 030 * </p> 031 * 032 * <p> 033 * ServiceBuilder follows certain rules in translating the methods. For example, 034 * if the method in the service utility returns a {@link java.util.List}, that 035 * is translated to an array of {@link com.liferay.portal.model.OrganizationSoap}. 036 * If the method in the service utility returns a 037 * {@link com.liferay.portal.model.Organization}, that is translated to a 038 * {@link com.liferay.portal.model.OrganizationSoap}. Methods that SOAP cannot 039 * safely wire are skipped. 040 * </p> 041 * 042 * <p> 043 * The benefits of using the SOAP utility is that it is cross platform 044 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 045 * even Perl, to call the generated services. One drawback of SOAP is that it is 046 * slow because it needs to serialize all calls into a text format (XML). 047 * </p> 048 * 049 * <p> 050 * You can see a list of services at 051 * http://localhost:8080/api/secure/axis. Set the property 052 * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 053 * security. 054 * </p> 055 * 056 * <p> 057 * The SOAP utility is only generated for remote services. 058 * </p> 059 * 060 * @author Brian Wing Shun Chan 061 * @see OrganizationServiceHttp 062 * @see com.liferay.portal.model.OrganizationSoap 063 * @see com.liferay.portal.service.OrganizationServiceUtil 064 * @generated 065 */ 066 public class OrganizationServiceSoap { 067 /** 068 * Adds the organizations to the group. 069 * 070 * @param groupId the primary key of the group 071 * @param organizationIds the primary keys of the organizations 072 * @throws PortalException if a group or organization with the primary key 073 could not be found or if the user did not have permission to 074 assign group members 075 * @throws SystemException if a system exception occurred 076 */ 077 public static void addGroupOrganizations(long groupId, 078 long[] organizationIds) throws RemoteException { 079 try { 080 OrganizationServiceUtil.addGroupOrganizations(groupId, 081 organizationIds); 082 } 083 catch (Exception e) { 084 _log.error(e, e); 085 086 throw new RemoteException(e.getMessage()); 087 } 088 } 089 090 /** 091 * Adds an organization with additional parameters. 092 * 093 * <p> 094 * This method handles the creation and bookkeeping of the organization 095 * including its resources, metadata, and internal data structures. 096 * </p> 097 * 098 * @param parentOrganizationId the primary key of the organization's parent 099 organization 100 * @param name the organization's name 101 * @param type the organization's type 102 * @param recursable whether the permissions of the organization are to be 103 inherited by its sub-organizations 104 * @param regionId the primary key of the organization's region 105 * @param countryId the primary key of the organization's country 106 * @param statusId the organization's workflow status 107 * @param comments the comments about the organization 108 * @param site whether the organization is to be associated with a main 109 site 110 * @param addresses the organization's addresses 111 * @param emailAddresses the organization's email addresses 112 * @param orgLabors the organization's hours of operation 113 * @param phones the organization's phone numbers 114 * @param websites the organization's websites 115 * @param serviceContext the organization's service context (optionally 116 <code>null</code>). Can set asset category IDs, asset tag names, 117 and expando bridge attributes for the organization. 118 * @return the organization 119 * @throws PortalException if a parent organization with the primary key 120 could not be found, if the organization's information was 121 invalid, or if the user did not have permission to add the 122 organization 123 * @throws SystemException if a system exception occurred 124 */ 125 public static com.liferay.portal.model.OrganizationSoap addOrganization( 126 long parentOrganizationId, java.lang.String name, 127 java.lang.String type, boolean recursable, long regionId, 128 long countryId, int statusId, java.lang.String comments, boolean site, 129 com.liferay.portal.model.AddressSoap[] addresses, 130 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 131 com.liferay.portal.model.OrgLaborSoap[] orgLabors, 132 com.liferay.portal.model.PhoneSoap[] phones, 133 com.liferay.portal.model.WebsiteSoap[] websites, 134 com.liferay.portal.service.ServiceContext serviceContext) 135 throws RemoteException { 136 try { 137 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId, 138 name, type, recursable, regionId, countryId, statusId, 139 comments, site, 140 com.liferay.portal.model.impl.AddressModelImpl.toModels( 141 addresses), 142 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 143 emailAddresses), 144 com.liferay.portal.model.impl.OrgLaborModelImpl.toModels( 145 orgLabors), 146 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 147 phones), 148 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 149 websites), serviceContext); 150 151 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 152 } 153 catch (Exception e) { 154 _log.error(e, e); 155 156 throw new RemoteException(e.getMessage()); 157 } 158 } 159 160 /** 161 * Adds an organization. 162 * 163 * <p> 164 * This method handles the creation and bookkeeping of the organization 165 * including its resources, metadata, and internal data structures. 166 * </p> 167 * 168 * @param parentOrganizationId the primary key of the organization's parent 169 organization 170 * @param name the organization's name 171 * @param type the organization's type 172 * @param recursable whether the permissions of the organization are to be 173 inherited by its sub-organizations 174 * @param regionId the primary key of the organization's region 175 * @param countryId the primary key of the organization's country 176 * @param statusId the organization's workflow status 177 * @param comments the comments about the organization 178 * @param site whether the organization is to be associated with a main 179 site 180 * @param serviceContext the organization's service context (optionally 181 <code>null</code>). Can set asset category IDs, asset tag names, 182 and expando bridge attributes for the organization. 183 * @return the organization 184 * @throws PortalException if the parent organization with the primary key 185 could not be found, if the organization information was invalid, 186 or if the user did not have permission to add the organization 187 * @throws SystemException if a system exception occurred 188 */ 189 public static com.liferay.portal.model.OrganizationSoap addOrganization( 190 long parentOrganizationId, java.lang.String name, 191 java.lang.String type, boolean recursable, long regionId, 192 long countryId, int statusId, java.lang.String comments, boolean site, 193 com.liferay.portal.service.ServiceContext serviceContext) 194 throws RemoteException { 195 try { 196 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId, 197 name, type, recursable, regionId, countryId, statusId, 198 comments, site, serviceContext); 199 200 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 201 } 202 catch (Exception e) { 203 _log.error(e, e); 204 205 throw new RemoteException(e.getMessage()); 206 } 207 } 208 209 /** 210 * Assigns the password policy to the organizations, removing any other 211 * currently assigned password policies. 212 * 213 * @param passwordPolicyId the primary key of the password policy 214 * @param organizationIds the primary keys of the organizations 215 * @throws PortalException if the user did not have permission to update the 216 password policy 217 * @throws SystemException if a system exception occurred 218 */ 219 public static void addPasswordPolicyOrganizations(long passwordPolicyId, 220 long[] organizationIds) throws RemoteException { 221 try { 222 OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId, 223 organizationIds); 224 } 225 catch (Exception e) { 226 _log.error(e, e); 227 228 throw new RemoteException(e.getMessage()); 229 } 230 } 231 232 /** 233 * Deletes the logo of the organization. 234 * 235 * @param organizationId the primary key of the organization 236 * @throws PortalException if an organization with the primary key could not 237 be found, if the organization's logo could not be found, or if 238 the user did not have permission to update the organization 239 * @throws SystemException if a system exception occurred 240 */ 241 public static void deleteLogo(long organizationId) 242 throws RemoteException { 243 try { 244 OrganizationServiceUtil.deleteLogo(organizationId); 245 } 246 catch (Exception e) { 247 _log.error(e, e); 248 249 throw new RemoteException(e.getMessage()); 250 } 251 } 252 253 /** 254 * Deletes the organization. The organization's associated resources and 255 * assets are also deleted. 256 * 257 * @param organizationId the primary key of the organization 258 * @throws PortalException if an organization with the primary key could not 259 be found, if the user did not have permission to delete the 260 organization, if the organization had a workflow in approved 261 status, or if the organization was a parent organization 262 * @throws SystemException if a system exception occurred 263 */ 264 public static void deleteOrganization(long organizationId) 265 throws RemoteException { 266 try { 267 OrganizationServiceUtil.deleteOrganization(organizationId); 268 } 269 catch (Exception e) { 270 _log.error(e, e); 271 272 throw new RemoteException(e.getMessage()); 273 } 274 } 275 276 /** 277 * Returns all the organizations which the user has permission to manage. 278 * 279 * @param actionId the permitted action 280 * @param max the maximum number of the organizations to be considered 281 * @return the organizations which the user has permission to manage 282 * @throws PortalException if a portal exception occurred 283 * @throws SystemException if a system exception occurred 284 * @deprecated Replaced by {@link #getOrganizations(long, long, int, int)} 285 */ 286 public static com.liferay.portal.model.OrganizationSoap[] getManageableOrganizations( 287 java.lang.String actionId, int max) throws RemoteException { 288 try { 289 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getManageableOrganizations(actionId, 290 max); 291 292 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 293 } 294 catch (Exception e) { 295 _log.error(e, e); 296 297 throw new RemoteException(e.getMessage()); 298 } 299 } 300 301 /** 302 * Returns the organization with the primary key. 303 * 304 * @param organizationId the primary key of the organization 305 * @return the organization with the primary key 306 * @throws PortalException if an organization with the primary key could not 307 be found or if the user did not have permission to view the 308 organization 309 * @throws SystemException if a system exception occurred 310 */ 311 public static com.liferay.portal.model.OrganizationSoap getOrganization( 312 long organizationId) throws RemoteException { 313 try { 314 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId); 315 316 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 317 } 318 catch (Exception e) { 319 _log.error(e, e); 320 321 throw new RemoteException(e.getMessage()); 322 } 323 } 324 325 /** 326 * Returns the primary key of the organization with the name. 327 * 328 * @param companyId the primary key of the organization's company 329 * @param name the organization's name 330 * @return the primary key of the organization with the name, or 331 <code>0</code> if the organization could not be found 332 * @throws SystemException if a system exception occurred 333 */ 334 public static long getOrganizationId(long companyId, java.lang.String name) 335 throws RemoteException { 336 try { 337 long returnValue = OrganizationServiceUtil.getOrganizationId(companyId, 338 name); 339 340 return returnValue; 341 } 342 catch (Exception e) { 343 _log.error(e, e); 344 345 throw new RemoteException(e.getMessage()); 346 } 347 } 348 349 /** 350 * Returns all the organizations belonging to the parent organization. 351 * 352 * @param companyId the primary key of the organizations' company 353 * @param parentOrganizationId the primary key of the organizations' parent 354 organization 355 * @return the organizations belonging to the parent organization 356 * @throws SystemException if a system exception occurred 357 */ 358 public static com.liferay.portal.model.OrganizationSoap[] getOrganizations( 359 long companyId, long parentOrganizationId) throws RemoteException { 360 try { 361 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId, 362 parentOrganizationId); 363 364 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 365 } 366 catch (Exception e) { 367 _log.error(e, e); 368 369 throw new RemoteException(e.getMessage()); 370 } 371 } 372 373 /** 374 * Returns a range of all the organizations belonging to the parent 375 * organization. 376 * 377 * <p> 378 * Useful when paginating results. Returns a maximum of <code>end - 379 * start</code> instances. <code>start</code> and <code>end</code> are not 380 * primary keys, they are indexes in the result set. Thus, <code>0</code> 381 * refers to the first result in the set. Setting both <code>start</code> 382 * and <code>end</code> to {@link 383 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 384 * result set. 385 * </p> 386 * 387 * @param companyId the primary key of the organizations' company 388 * @param parentOrganizationId the primary key of the organizations' parent 389 organization 390 * @param start the lower bound of the range of organizations to return 391 * @param end the upper bound of the range of organizations to return (not 392 inclusive) 393 * @return the range of organizations belonging to the parent organization 394 * @throws SystemException if a system exception occurred 395 */ 396 public static com.liferay.portal.model.OrganizationSoap[] getOrganizations( 397 long companyId, long parentOrganizationId, int start, int end) 398 throws RemoteException { 399 try { 400 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId, 401 parentOrganizationId, start, end); 402 403 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 404 } 405 catch (Exception e) { 406 _log.error(e, e); 407 408 throw new RemoteException(e.getMessage()); 409 } 410 } 411 412 /** 413 * Returns the number of organizations belonging to the parent organization. 414 * 415 * @param companyId the primary key of the organizations' company 416 * @param parentOrganizationId the primary key of the organizations' parent 417 organization 418 * @return the number of organizations belonging to the parent organization 419 * @throws SystemException if a system exception occurred 420 */ 421 public static int getOrganizationsCount(long companyId, 422 long parentOrganizationId) throws RemoteException { 423 try { 424 int returnValue = OrganizationServiceUtil.getOrganizationsCount(companyId, 425 parentOrganizationId); 426 427 return returnValue; 428 } 429 catch (Exception e) { 430 _log.error(e, e); 431 432 throw new RemoteException(e.getMessage()); 433 } 434 } 435 436 /** 437 * Returns all the organizations associated with the user. 438 * 439 * @param userId the primary key of the user 440 * @return the organizations associated with the user 441 * @throws PortalException if a user with the primary key could not be found 442 * @throws SystemException if a system exception occurred 443 */ 444 public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations( 445 long userId) throws RemoteException { 446 try { 447 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId); 448 449 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 450 } 451 catch (Exception e) { 452 _log.error(e, e); 453 454 throw new RemoteException(e.getMessage()); 455 } 456 } 457 458 /** 459 * Sets the organizations in the group, removing and adding organizations to 460 * the group as necessary. 461 * 462 * @param groupId the primary key of the group 463 * @param organizationIds the primary keys of the organizations 464 * @throws PortalException if a group or organization with the primary key 465 could not be found or if the user did not have permission to 466 assign group members 467 * @throws SystemException if a system exception occurred 468 */ 469 public static void setGroupOrganizations(long groupId, 470 long[] organizationIds) throws RemoteException { 471 try { 472 OrganizationServiceUtil.setGroupOrganizations(groupId, 473 organizationIds); 474 } 475 catch (Exception e) { 476 _log.error(e, e); 477 478 throw new RemoteException(e.getMessage()); 479 } 480 } 481 482 /** 483 * Removes the organizations from the group. 484 * 485 * @param groupId the primary key of the group 486 * @param organizationIds the primary keys of the organizations 487 * @throws PortalException if a group or organization with the primary key 488 could not be found or if the user did not have permission to 489 assign group members 490 * @throws SystemException if a system exception occurred 491 */ 492 public static void unsetGroupOrganizations(long groupId, 493 long[] organizationIds) throws RemoteException { 494 try { 495 OrganizationServiceUtil.unsetGroupOrganizations(groupId, 496 organizationIds); 497 } 498 catch (Exception e) { 499 _log.error(e, e); 500 501 throw new RemoteException(e.getMessage()); 502 } 503 } 504 505 /** 506 * Removes the organizations from the password policy. 507 * 508 * @param passwordPolicyId the primary key of the password policy 509 * @param organizationIds the primary keys of the organizations 510 * @throws PortalException if a password policy or organization with the 511 primary key could not be found, or if the user did not have 512 permission to update the password policy 513 * @throws SystemException if a system exception occurred 514 */ 515 public static void unsetPasswordPolicyOrganizations(long passwordPolicyId, 516 long[] organizationIds) throws RemoteException { 517 try { 518 OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId, 519 organizationIds); 520 } 521 catch (Exception e) { 522 _log.error(e, e); 523 524 throw new RemoteException(e.getMessage()); 525 } 526 } 527 528 /** 529 * Updates the organization with additional parameters. 530 * 531 * @param organizationId the primary key of the organization 532 * @param parentOrganizationId the primary key of the organization's parent 533 organization 534 * @param name the organization's name 535 * @param type the organization's type 536 * @param recursable whether the permissions of the organization are to be 537 inherited by its sub-organizations 538 * @param regionId the primary key of the organization's region 539 * @param countryId the primary key of the organization's country 540 * @param statusId the organization's workflow status 541 * @param comments the comments about the organization 542 * @param site whether the organization is to be associated with a main 543 site 544 * @param addresses the organization's addresses 545 * @param emailAddresses the organization's email addresses 546 * @param orgLabors the organization's hours of operation 547 * @param phones the organization's phone numbers 548 * @param websites the organization's websites 549 * @param serviceContext the organization's service context (optionally 550 <code>null</code>). Can set asset category IDs and asset tag 551 names for the organization, and merge expando bridge attributes 552 for the organization. 553 * @return the organization 554 * @throws PortalException if an organization or parent organization with 555 the primary key could not be found, if the user did not have 556 permission to update the organization information, or if the new 557 information was invalid 558 * @throws SystemException if a system exception occurred 559 */ 560 public static com.liferay.portal.model.OrganizationSoap updateOrganization( 561 long organizationId, long parentOrganizationId, java.lang.String name, 562 java.lang.String type, boolean recursable, long regionId, 563 long countryId, int statusId, java.lang.String comments, boolean site, 564 com.liferay.portal.model.AddressSoap[] addresses, 565 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 566 com.liferay.portal.model.OrgLaborSoap[] orgLabors, 567 com.liferay.portal.model.PhoneSoap[] phones, 568 com.liferay.portal.model.WebsiteSoap[] websites, 569 com.liferay.portal.service.ServiceContext serviceContext) 570 throws RemoteException { 571 try { 572 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId, 573 parentOrganizationId, name, type, recursable, regionId, 574 countryId, statusId, comments, site, 575 com.liferay.portal.model.impl.AddressModelImpl.toModels( 576 addresses), 577 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 578 emailAddresses), 579 com.liferay.portal.model.impl.OrgLaborModelImpl.toModels( 580 orgLabors), 581 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 582 phones), 583 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 584 websites), serviceContext); 585 586 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 587 } 588 catch (Exception e) { 589 _log.error(e, e); 590 591 throw new RemoteException(e.getMessage()); 592 } 593 } 594 595 /** 596 * Updates the organization. 597 * 598 * @param organizationId the primary key of the organization 599 * @param parentOrganizationId the primary key of the organization's parent 600 organization 601 * @param name the organization's name 602 * @param type the organization's type 603 * @param recursable whether permissions of the organization are to be 604 inherited by its sub-organizations 605 * @param regionId the primary key of the organization's region 606 * @param countryId the primary key of the organization's country 607 * @param statusId the organization's workflow status 608 * @param comments the comments about the organization 609 * @param site whether the organization is to be associated with a main 610 site 611 * @param serviceContext the organization's service context (optionally 612 <code>null</code>). Can set asset category IDs and asset tag 613 names for the organization, and merge expando bridge attributes 614 for the organization. 615 * @return the organization 616 * @throws PortalException if an organization or parent organization with 617 the primary key could not be found, if the user did not have 618 permission to update the organization, or if the new information 619 was invalid 620 * @throws SystemException if a system exception occurred 621 */ 622 public static com.liferay.portal.model.OrganizationSoap updateOrganization( 623 long organizationId, long parentOrganizationId, java.lang.String name, 624 java.lang.String type, boolean recursable, long regionId, 625 long countryId, int statusId, java.lang.String comments, boolean site, 626 com.liferay.portal.service.ServiceContext serviceContext) 627 throws RemoteException { 628 try { 629 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId, 630 parentOrganizationId, name, type, recursable, regionId, 631 countryId, statusId, comments, site, serviceContext); 632 633 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 634 } 635 catch (Exception e) { 636 _log.error(e, e); 637 638 throw new RemoteException(e.getMessage()); 639 } 640 } 641 642 private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class); 643 }