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