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