001 /** 002 * Copyright (c) 2000-2013 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 suborganizations 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 suborganizations 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 PortalException if the user did not have permission to view the 333 organization 334 * @throws SystemException if a system exception occurred 335 */ 336 public static long getOrganizationId(long companyId, java.lang.String name) 337 throws RemoteException { 338 try { 339 long returnValue = OrganizationServiceUtil.getOrganizationId(companyId, 340 name); 341 342 return returnValue; 343 } 344 catch (Exception e) { 345 _log.error(e, e); 346 347 throw new RemoteException(e.getMessage()); 348 } 349 } 350 351 /** 352 * Returns all the organizations belonging to the parent organization. 353 * 354 * @param companyId the primary key of the organizations' company 355 * @param parentOrganizationId the primary key of the organizations' parent 356 organization 357 * @return the organizations belonging to the parent organization 358 * @throws SystemException if a system exception occurred 359 */ 360 public static com.liferay.portal.model.OrganizationSoap[] getOrganizations( 361 long companyId, long parentOrganizationId) throws RemoteException { 362 try { 363 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId, 364 parentOrganizationId); 365 366 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 367 } 368 catch (Exception e) { 369 _log.error(e, e); 370 371 throw new RemoteException(e.getMessage()); 372 } 373 } 374 375 /** 376 * Returns a range of all the organizations belonging to the parent 377 * organization. 378 * 379 * <p> 380 * Useful when paginating results. Returns a maximum of <code>end - 381 * start</code> instances. <code>start</code> and <code>end</code> are not 382 * primary keys, they are indexes in the result set. Thus, <code>0</code> 383 * refers to the first result in the set. Setting both <code>start</code> 384 * and <code>end</code> to {@link 385 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 386 * result set. 387 * </p> 388 * 389 * @param companyId the primary key of the organizations' company 390 * @param parentOrganizationId the primary key of the organizations' parent 391 organization 392 * @param start the lower bound of the range of organizations to return 393 * @param end the upper bound of the range of organizations to return (not 394 inclusive) 395 * @return the range of organizations belonging to the parent organization 396 * @throws SystemException if a system exception occurred 397 */ 398 public static com.liferay.portal.model.OrganizationSoap[] getOrganizations( 399 long companyId, long parentOrganizationId, int start, int end) 400 throws RemoteException { 401 try { 402 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getOrganizations(companyId, 403 parentOrganizationId, start, end); 404 405 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 406 } 407 catch (Exception e) { 408 _log.error(e, e); 409 410 throw new RemoteException(e.getMessage()); 411 } 412 } 413 414 /** 415 * Returns the number of organizations belonging to the parent organization. 416 * 417 * @param companyId the primary key of the organizations' company 418 * @param parentOrganizationId the primary key of the organizations' parent 419 organization 420 * @return the number of organizations belonging to the parent organization 421 * @throws SystemException if a system exception occurred 422 */ 423 public static int getOrganizationsCount(long companyId, 424 long parentOrganizationId) throws RemoteException { 425 try { 426 int returnValue = OrganizationServiceUtil.getOrganizationsCount(companyId, 427 parentOrganizationId); 428 429 return returnValue; 430 } 431 catch (Exception e) { 432 _log.error(e, e); 433 434 throw new RemoteException(e.getMessage()); 435 } 436 } 437 438 /** 439 * Returns all the organizations associated with the user. 440 * 441 * @param userId the primary key of the user 442 * @return the organizations associated with the user 443 * @throws PortalException if a user with the primary key could not be found 444 * @throws SystemException if a system exception occurred 445 */ 446 public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations( 447 long userId) throws RemoteException { 448 try { 449 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId); 450 451 return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue); 452 } 453 catch (Exception e) { 454 _log.error(e, e); 455 456 throw new RemoteException(e.getMessage()); 457 } 458 } 459 460 /** 461 * Sets the organizations in the group, removing and adding organizations to 462 * the group as necessary. 463 * 464 * @param groupId the primary key of the group 465 * @param organizationIds the primary keys of the organizations 466 * @throws PortalException if a group or organization with the primary key 467 could not be found or if the user did not have permission to 468 assign group members 469 * @throws SystemException if a system exception occurred 470 */ 471 public static void setGroupOrganizations(long groupId, 472 long[] organizationIds) throws RemoteException { 473 try { 474 OrganizationServiceUtil.setGroupOrganizations(groupId, 475 organizationIds); 476 } 477 catch (Exception e) { 478 _log.error(e, e); 479 480 throw new RemoteException(e.getMessage()); 481 } 482 } 483 484 /** 485 * Removes the organizations from the group. 486 * 487 * @param groupId the primary key of the group 488 * @param organizationIds the primary keys of the organizations 489 * @throws PortalException if a group or organization with the primary key 490 could not be found or if the user did not have permission to 491 assign group members 492 * @throws SystemException if a system exception occurred 493 */ 494 public static void unsetGroupOrganizations(long groupId, 495 long[] organizationIds) throws RemoteException { 496 try { 497 OrganizationServiceUtil.unsetGroupOrganizations(groupId, 498 organizationIds); 499 } 500 catch (Exception e) { 501 _log.error(e, e); 502 503 throw new RemoteException(e.getMessage()); 504 } 505 } 506 507 /** 508 * Removes the organizations from the password policy. 509 * 510 * @param passwordPolicyId the primary key of the password policy 511 * @param organizationIds the primary keys of the organizations 512 * @throws PortalException if a password policy or organization with the 513 primary key could not be found, or if the user did not have 514 permission to update the password policy 515 * @throws SystemException if a system exception occurred 516 */ 517 public static void unsetPasswordPolicyOrganizations(long passwordPolicyId, 518 long[] organizationIds) throws RemoteException { 519 try { 520 OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId, 521 organizationIds); 522 } 523 catch (Exception e) { 524 _log.error(e, e); 525 526 throw new RemoteException(e.getMessage()); 527 } 528 } 529 530 /** 531 * Updates the organization with additional parameters. 532 * 533 * @param organizationId the primary key of the organization 534 * @param parentOrganizationId the primary key of the organization's parent 535 organization 536 * @param name the organization's name 537 * @param type the organization's type 538 * @param recursable whether the permissions of the organization are to be 539 inherited by its suborganizations 540 * @param regionId the primary key of the organization's region 541 * @param countryId the primary key of the organization's country 542 * @param statusId the organization's workflow status 543 * @param comments the comments about the organization 544 * @param site whether the organization is to be associated with a main 545 site 546 * @param addresses the organization's addresses 547 * @param emailAddresses the organization's email addresses 548 * @param orgLabors the organization's hours of operation 549 * @param phones the organization's phone numbers 550 * @param websites the organization's websites 551 * @param serviceContext the organization's service context (optionally 552 <code>null</code>). Can set asset category IDs and asset tag 553 names for the organization, and merge expando bridge attributes 554 for the organization. 555 * @return the organization 556 * @throws PortalException if an organization or parent organization with 557 the primary key could not be found, if the user did not have 558 permission to update the organization information, or if the new 559 information was invalid 560 * @throws SystemException if a system exception occurred 561 */ 562 public static com.liferay.portal.model.OrganizationSoap updateOrganization( 563 long organizationId, long parentOrganizationId, java.lang.String name, 564 java.lang.String type, boolean recursable, long regionId, 565 long countryId, int statusId, java.lang.String comments, boolean site, 566 com.liferay.portal.model.AddressSoap[] addresses, 567 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 568 com.liferay.portal.model.OrgLaborSoap[] orgLabors, 569 com.liferay.portal.model.PhoneSoap[] phones, 570 com.liferay.portal.model.WebsiteSoap[] websites, 571 com.liferay.portal.service.ServiceContext serviceContext) 572 throws RemoteException { 573 try { 574 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId, 575 parentOrganizationId, name, type, recursable, regionId, 576 countryId, statusId, comments, site, 577 com.liferay.portal.model.impl.AddressModelImpl.toModels( 578 addresses), 579 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 580 emailAddresses), 581 com.liferay.portal.model.impl.OrgLaborModelImpl.toModels( 582 orgLabors), 583 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 584 phones), 585 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 586 websites), serviceContext); 587 588 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 589 } 590 catch (Exception e) { 591 _log.error(e, e); 592 593 throw new RemoteException(e.getMessage()); 594 } 595 } 596 597 /** 598 * Updates the organization. 599 * 600 * @param organizationId the primary key of the organization 601 * @param parentOrganizationId the primary key of the organization's parent 602 organization 603 * @param name the organization's name 604 * @param type the organization's type 605 * @param recursable whether permissions of the organization are to be 606 inherited by its suborganizations 607 * @param regionId the primary key of the organization's region 608 * @param countryId the primary key of the organization's country 609 * @param statusId the organization's workflow status 610 * @param comments the comments about the organization 611 * @param site whether the organization is to be associated with a main 612 site 613 * @param serviceContext the organization's service context (optionally 614 <code>null</code>). Can set asset category IDs and asset tag 615 names for the organization, and merge expando bridge attributes 616 for the organization. 617 * @return the organization 618 * @throws PortalException if an organization or parent organization with 619 the primary key could not be found, if the user did not have 620 permission to update the organization, or if the new information 621 was invalid 622 * @throws SystemException if a system exception occurred 623 */ 624 public static com.liferay.portal.model.OrganizationSoap updateOrganization( 625 long organizationId, long parentOrganizationId, java.lang.String name, 626 java.lang.String type, boolean recursable, long regionId, 627 long countryId, int statusId, java.lang.String comments, boolean site, 628 com.liferay.portal.service.ServiceContext serviceContext) 629 throws RemoteException { 630 try { 631 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId, 632 parentOrganizationId, name, type, recursable, regionId, 633 countryId, statusId, comments, site, serviceContext); 634 635 return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue); 636 } 637 catch (Exception e) { 638 _log.error(e, e); 639 640 throw new RemoteException(e.getMessage()); 641 } 642 } 643 644 private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class); 645 }