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.CompanyServiceUtil; 022 023 import java.rmi.RemoteException; 024 025 /** 026 * Provides the SOAP utility for the 027 * {@link com.liferay.portal.service.CompanyServiceUtil} 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.CompanySoap}. 036 * If the method in the service utility returns a 037 * {@link com.liferay.portal.model.Company}, that is translated to a 038 * {@link com.liferay.portal.model.CompanySoap}. 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 CompanyServiceHttp 061 * @see com.liferay.portal.model.CompanySoap 062 * @see com.liferay.portal.service.CompanyServiceUtil 063 * @generated 064 */ 065 @ProviderType 066 public class CompanyServiceSoap { 067 /** 068 * Adds a company. 069 * 070 * @param webId the company's web domain 071 * @param virtualHost the company's virtual host name 072 * @param mx the company's mail domain 073 * @param shardName the company's shard 074 * @param system whether the company is the very first company (i.e., the 075 * @param maxUsers the max number of company users (optionally 076 <code>0</code>) 077 * @param active whether the company is active 078 * @return the company 079 * @throws PortalException if the web domain, virtual host name, or mail 080 domain was invalid or if the user was not a universal 081 administrator 082 */ 083 public static com.liferay.portal.model.CompanySoap addCompany( 084 java.lang.String webId, java.lang.String virtualHost, 085 java.lang.String mx, java.lang.String shardName, boolean system, 086 int maxUsers, boolean active) throws RemoteException { 087 try { 088 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.addCompany(webId, 089 virtualHost, mx, shardName, system, maxUsers, active); 090 091 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 092 } 093 catch (Exception e) { 094 _log.error(e, e); 095 096 throw new RemoteException(e.getMessage()); 097 } 098 } 099 100 public static com.liferay.portal.model.CompanySoap deleteCompany( 101 long companyId) throws RemoteException { 102 try { 103 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.deleteCompany(companyId); 104 105 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 106 } 107 catch (Exception e) { 108 _log.error(e, e); 109 110 throw new RemoteException(e.getMessage()); 111 } 112 } 113 114 /** 115 * Deletes the company's logo. 116 * 117 * @param companyId the primary key of the company 118 * @throws PortalException if the company with the primary key could not be 119 found or if the company's logo could not be found or if the user 120 was not an administrator 121 */ 122 public static void deleteLogo(long companyId) throws RemoteException { 123 try { 124 CompanyServiceUtil.deleteLogo(companyId); 125 } 126 catch (Exception e) { 127 _log.error(e, e); 128 129 throw new RemoteException(e.getMessage()); 130 } 131 } 132 133 /** 134 * Returns the company with the primary key. 135 * 136 * @param companyId the primary key of the company 137 * @return Returns the company with the primary key 138 * @throws PortalException if a company with the primary key could not be 139 found 140 */ 141 public static com.liferay.portal.model.CompanySoap getCompanyById( 142 long companyId) throws RemoteException { 143 try { 144 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyById(companyId); 145 146 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 147 } 148 catch (Exception e) { 149 _log.error(e, e); 150 151 throw new RemoteException(e.getMessage()); 152 } 153 } 154 155 /** 156 * Returns the company with the logo. 157 * 158 * @param logoId the ID of the company's logo 159 * @return Returns the company with the logo 160 * @throws PortalException if the company with the logo could not be found 161 */ 162 public static com.liferay.portal.model.CompanySoap getCompanyByLogoId( 163 long logoId) throws RemoteException { 164 try { 165 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByLogoId(logoId); 166 167 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 168 } 169 catch (Exception e) { 170 _log.error(e, e); 171 172 throw new RemoteException(e.getMessage()); 173 } 174 } 175 176 /** 177 * Returns the company with the mail domian. 178 * 179 * @param mx the company's mail domain 180 * @return Returns the company with the mail domain 181 * @throws PortalException if the company with the mail domain could not be 182 found 183 */ 184 public static com.liferay.portal.model.CompanySoap getCompanyByMx( 185 java.lang.String mx) throws RemoteException { 186 try { 187 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByMx(mx); 188 189 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 190 } 191 catch (Exception e) { 192 _log.error(e, e); 193 194 throw new RemoteException(e.getMessage()); 195 } 196 } 197 198 /** 199 * Returns the company with the virtual host name. 200 * 201 * @param virtualHost the company's virtual host name 202 * @return Returns the company with the virtual host name 203 * @throws PortalException if the company with the virtual host name could 204 not be found or if the virtual host was not associated with a 205 company 206 */ 207 public static com.liferay.portal.model.CompanySoap getCompanyByVirtualHost( 208 java.lang.String virtualHost) throws RemoteException { 209 try { 210 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByVirtualHost(virtualHost); 211 212 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 213 } 214 catch (Exception e) { 215 _log.error(e, e); 216 217 throw new RemoteException(e.getMessage()); 218 } 219 } 220 221 /** 222 * Returns the company with the web domain. 223 * 224 * @param webId the company's web domain 225 * @return Returns the company with the web domain 226 * @throws PortalException if the company with the web domain could not be 227 found 228 */ 229 public static com.liferay.portal.model.CompanySoap getCompanyByWebId( 230 java.lang.String webId) throws RemoteException { 231 try { 232 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByWebId(webId); 233 234 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 235 } 236 catch (Exception e) { 237 _log.error(e, e); 238 239 throw new RemoteException(e.getMessage()); 240 } 241 } 242 243 /** 244 * Removes the values that match the keys of the company's preferences. 245 * 246 * This method is called by {@link 247 * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely 248 * through {@link com.liferay.portal.service.CompanyService}. 249 * 250 * @param companyId the primary key of the company 251 * @param keys the company's preferences keys to be remove 252 * @throws PortalException if the user was not an administrator 253 */ 254 public static void removePreferences(long companyId, java.lang.String[] keys) 255 throws RemoteException { 256 try { 257 CompanyServiceUtil.removePreferences(companyId, keys); 258 } 259 catch (Exception e) { 260 _log.error(e, e); 261 262 throw new RemoteException(e.getMessage()); 263 } 264 } 265 266 /** 267 * Updates the company 268 * 269 * @param companyId the primary key of the company 270 * @param virtualHost the company's virtual host name 271 * @param mx the company's mail domain 272 * @param maxUsers the max number of company users (optionally 273 <code>0</code>) 274 * @param active whether the company is active 275 * @return the company with the primary key 276 * @throws PortalException if a company with the primary key could not be 277 found or if the new information was invalid or if the user was 278 not a universal administrator 279 */ 280 public static com.liferay.portal.model.CompanySoap updateCompany( 281 long companyId, java.lang.String virtualHost, java.lang.String mx, 282 int maxUsers, boolean active) throws RemoteException { 283 try { 284 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId, 285 virtualHost, mx, maxUsers, active); 286 287 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 288 } 289 catch (Exception e) { 290 _log.error(e, e); 291 292 throw new RemoteException(e.getMessage()); 293 } 294 } 295 296 /** 297 * Updates the company with additional account information. 298 * 299 * @param companyId the primary key of the company 300 * @param virtualHost the company's virtual host name 301 * @param mx the company's mail domain 302 * @param homeURL the company's home URL (optionally <code>null</code>) 303 * @param logo whether to update the company's logo 304 * @param logoBytes the new logo image data 305 * @param name the company's account name (optionally <code>null</code>) 306 * @param legalName the company's account legal name (optionally 307 <code>null</code>) 308 * @param legalId the company's account legal ID (optionally 309 <code>null</code>) 310 * @param legalType the company's account legal type (optionally 311 <code>null</code>) 312 * @param sicCode the company's account SIC code (optionally 313 <code>null</code>) 314 * @param tickerSymbol the company's account ticker symbol (optionally 315 <code>null</code>) 316 * @param industry the the company's account industry (optionally 317 <code>null</code>) 318 * @param type the company's account type (optionally <code>null</code>) 319 * @param size the company's account size (optionally <code>null</code>) 320 * @return the the company with the primary key 321 * @throws PortalException if a company with the primary key could not be 322 found or if the new information was invalid or if the user was 323 not an administrator 324 */ 325 public static com.liferay.portal.model.CompanySoap updateCompany( 326 long companyId, java.lang.String virtualHost, java.lang.String mx, 327 java.lang.String homeURL, boolean logo, byte[] logoBytes, 328 java.lang.String name, java.lang.String legalName, 329 java.lang.String legalId, java.lang.String legalType, 330 java.lang.String sicCode, java.lang.String tickerSymbol, 331 java.lang.String industry, java.lang.String type, java.lang.String size) 332 throws RemoteException { 333 try { 334 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId, 335 virtualHost, mx, homeURL, logo, logoBytes, name, legalName, 336 legalId, legalType, sicCode, tickerSymbol, industry, type, 337 size); 338 339 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 340 } 341 catch (Exception e) { 342 _log.error(e, e); 343 344 throw new RemoteException(e.getMessage()); 345 } 346 } 347 348 /** 349 * Updates the company with additional account information. 350 * 351 * @param companyId the primary key of the company 352 * @param virtualHost the company's virtual host name 353 * @param mx the company's mail domain 354 * @param homeURL the company's home URL (optionally <code>null</code>) 355 * @param name the company's account name (optionally 356 <code>null</code>) 357 * @param legalName the company's account legal name (optionally 358 <code>null</code>) 359 * @param legalId the company's account legal ID (optionally 360 <code>null</code>) 361 * @param legalType the company's account legal type (optionally 362 <code>null</code>) 363 * @param sicCode the company's account SIC code (optionally 364 <code>null</code>) 365 * @param tickerSymbol the company's account ticker symbol (optionally 366 <code>null</code>) 367 * @param industry the the company's account industry (optionally 368 <code>null</code>) 369 * @param type the company's account type (optionally 370 <code>null</code>) 371 * @param size the company's account size (optionally 372 <code>null</code>) 373 * @return the the company with the primary key 374 * @throws PortalException if a company with the primary key could not 375 be found or if the new information was invalid or if the user 376 was not an administrator 377 * @deprecated As of 7.0.0, replaced by {@link #updateCompany(long, String, 378 String, String, boolean, byte[], String, String, String, 379 String, String, String, String, String, String)} 380 */ 381 @Deprecated 382 public static com.liferay.portal.model.CompanySoap updateCompany( 383 long companyId, java.lang.String virtualHost, java.lang.String mx, 384 java.lang.String homeURL, java.lang.String name, 385 java.lang.String legalName, java.lang.String legalId, 386 java.lang.String legalType, java.lang.String sicCode, 387 java.lang.String tickerSymbol, java.lang.String industry, 388 java.lang.String type, java.lang.String size) throws RemoteException { 389 try { 390 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId, 391 virtualHost, mx, homeURL, name, legalName, legalId, 392 legalType, sicCode, tickerSymbol, industry, type, size); 393 394 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 395 } 396 catch (Exception e) { 397 _log.error(e, e); 398 399 throw new RemoteException(e.getMessage()); 400 } 401 } 402 403 /** 404 * Update the company's display. 405 * 406 * @param companyId the primary key of the company 407 * @param languageId the ID of the company's default user's language 408 * @param timeZoneId the ID of the company's default user's time zone 409 * @throws PortalException if the company's default user could not be found 410 or if the user was not an administrator 411 */ 412 public static void updateDisplay(long companyId, 413 java.lang.String languageId, java.lang.String timeZoneId) 414 throws RemoteException { 415 try { 416 CompanyServiceUtil.updateDisplay(companyId, languageId, timeZoneId); 417 } 418 catch (Exception e) { 419 _log.error(e, e); 420 421 throw new RemoteException(e.getMessage()); 422 } 423 } 424 425 /** 426 * Updates the company's logo. 427 * 428 * @param companyId the primary key of the company 429 * @param bytes the bytes of the company's logo image 430 * @return the company with the primary key 431 * @throws PortalException if the company's logo ID could not be found or if 432 the logo's image was corrupted or if the user was an 433 administrator 434 */ 435 public static com.liferay.portal.model.CompanySoap updateLogo( 436 long companyId, byte[] bytes) throws RemoteException { 437 try { 438 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateLogo(companyId, 439 bytes); 440 441 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 442 } 443 catch (Exception e) { 444 _log.error(e, e); 445 446 throw new RemoteException(e.getMessage()); 447 } 448 } 449 450 /** 451 * Updates the company's security properties. 452 * 453 * @param companyId the primary key of the company 454 * @param authType the company's method of authenticating users 455 * @param autoLogin whether to allow users to select the "remember me" 456 feature 457 * @param sendPassword whether to allow users to ask the company to send 458 their passwords 459 * @param strangers whether to allow strangers to create accounts to 460 register themselves in the company 461 * @param strangersWithMx whether to allow strangers to create accounts 462 with email addresses that match the company mail suffix 463 * @param strangersVerify whether to require strangers who create accounts 464 to be verified via email 465 * @param siteLogo whether to to allow site administrators to use their own 466 logo instead of the enterprise logo 467 * @throws PortalException if the user was not an administrator 468 */ 469 public static void updateSecurity(long companyId, 470 java.lang.String authType, boolean autoLogin, boolean sendPassword, 471 boolean strangers, boolean strangersWithMx, boolean strangersVerify, 472 boolean siteLogo) throws RemoteException { 473 try { 474 CompanyServiceUtil.updateSecurity(companyId, authType, autoLogin, 475 sendPassword, strangers, strangersWithMx, strangersVerify, 476 siteLogo); 477 } 478 catch (Exception e) { 479 _log.error(e, e); 480 481 throw new RemoteException(e.getMessage()); 482 } 483 } 484 485 private static Log _log = LogFactoryUtil.getLog(CompanyServiceSoap.class); 486 }