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.CompanyServiceUtil; 020 021 import java.rmi.RemoteException; 022 023 /** 024 * Provides the SOAP utility for the 025 * {@link com.liferay.portal.service.CompanyServiceUtil} service utility. The 026 * static methods of this class calls the same methods of the service utility. 027 * However, the signatures are different because it is difficult for SOAP to 028 * support certain types. 029 * 030 * <p> 031 * ServiceBuilder follows certain rules in translating the methods. For example, 032 * if the method in the service utility returns a {@link java.util.List}, that 033 * is translated to an array of {@link com.liferay.portal.model.CompanySoap}. 034 * If the method in the service utility returns a 035 * {@link com.liferay.portal.model.Company}, that is translated to a 036 * {@link com.liferay.portal.model.CompanySoap}. Methods that SOAP cannot 037 * safely wire are skipped. 038 * </p> 039 * 040 * <p> 041 * The benefits of using the SOAP utility is that it is cross platform 042 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 043 * even Perl, to call the generated services. One drawback of SOAP is that it is 044 * slow because it needs to serialize all calls into a text format (XML). 045 * </p> 046 * 047 * <p> 048 * You can see a list of services at http://localhost:8080/api/axis. Set the 049 * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 050 * security. 051 * </p> 052 * 053 * <p> 054 * The SOAP utility is only generated for remote services. 055 * </p> 056 * 057 * @author Brian Wing Shun Chan 058 * @see CompanyServiceHttp 059 * @see com.liferay.portal.model.CompanySoap 060 * @see com.liferay.portal.service.CompanyServiceUtil 061 * @generated 062 */ 063 public class CompanyServiceSoap { 064 /** 065 * Adds a company. 066 * 067 * @param webId the company's web domain 068 * @param virtualHost the company's virtual host name 069 * @param mx the company's mail domain 070 * @param shardName the company's shard 071 * @param system whether the company is the very first company (i.e., the 072 * @param maxUsers the max number of company users (optionally 073 <code>0</code>) 074 * @param active whether the company is active 075 * @return the company 076 * @throws PortalException if the web domain, virtual host name, or mail 077 domain was invalid or if the user was not a universal 078 administrator 079 * @throws SystemException if a system exception occurred 080 */ 081 public static com.liferay.portal.model.CompanySoap addCompany( 082 java.lang.String webId, java.lang.String virtualHost, 083 java.lang.String mx, java.lang.String shardName, boolean system, 084 int maxUsers, boolean active) throws RemoteException { 085 try { 086 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.addCompany(webId, 087 virtualHost, mx, shardName, system, maxUsers, active); 088 089 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 090 } 091 catch (Exception e) { 092 _log.error(e, e); 093 094 throw new RemoteException(e.getMessage()); 095 } 096 } 097 098 public static com.liferay.portal.model.CompanySoap deleteCompany( 099 long companyId) throws RemoteException { 100 try { 101 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.deleteCompany(companyId); 102 103 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 104 } 105 catch (Exception e) { 106 _log.error(e, e); 107 108 throw new RemoteException(e.getMessage()); 109 } 110 } 111 112 /** 113 * Deletes the company's logo. 114 * 115 * @param companyId the primary key of the company 116 * @throws PortalException if the company with the primary key could not be 117 found or if the company's logo could not be found or if the user 118 was not an administrator 119 * @throws SystemException if a system exception occurred 120 */ 121 public static void deleteLogo(long companyId) throws RemoteException { 122 try { 123 CompanyServiceUtil.deleteLogo(companyId); 124 } 125 catch (Exception e) { 126 _log.error(e, e); 127 128 throw new RemoteException(e.getMessage()); 129 } 130 } 131 132 /** 133 * Returns the company with the primary key. 134 * 135 * @param companyId the primary key of the company 136 * @return Returns the company with the primary key 137 * @throws PortalException if a company with the primary key could not be 138 found 139 * @throws SystemException if a system exception occurred 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 * @throws SystemException if a system exception occurred 162 */ 163 public static com.liferay.portal.model.CompanySoap getCompanyByLogoId( 164 long logoId) throws RemoteException { 165 try { 166 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByLogoId(logoId); 167 168 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 169 } 170 catch (Exception e) { 171 _log.error(e, e); 172 173 throw new RemoteException(e.getMessage()); 174 } 175 } 176 177 /** 178 * Returns the company with the mail domian. 179 * 180 * @param mx the company's mail domain 181 * @return Returns the company with the mail domain 182 * @throws PortalException if the company with the mail domain could not be 183 found 184 * @throws SystemException if a system exception occurred 185 */ 186 public static com.liferay.portal.model.CompanySoap getCompanyByMx( 187 java.lang.String mx) throws RemoteException { 188 try { 189 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByMx(mx); 190 191 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 192 } 193 catch (Exception e) { 194 _log.error(e, e); 195 196 throw new RemoteException(e.getMessage()); 197 } 198 } 199 200 /** 201 * Returns the company with the virtual host name. 202 * 203 * @param virtualHost the company's virtual host name 204 * @return Returns the company with the virtual host name 205 * @throws PortalException if the company with the virtual host name could 206 not be found or if the virtual host was not associated with a 207 company 208 * @throws SystemException if a system exception occurred 209 */ 210 public static com.liferay.portal.model.CompanySoap getCompanyByVirtualHost( 211 java.lang.String virtualHost) throws RemoteException { 212 try { 213 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByVirtualHost(virtualHost); 214 215 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 216 } 217 catch (Exception e) { 218 _log.error(e, e); 219 220 throw new RemoteException(e.getMessage()); 221 } 222 } 223 224 /** 225 * Returns the company with the web domain. 226 * 227 * @param webId the company's web domain 228 * @return Returns the company with the web domain 229 * @throws PortalException if the company with the web domain could not be 230 found 231 * @throws SystemException if a system exception occurred 232 */ 233 public static com.liferay.portal.model.CompanySoap getCompanyByWebId( 234 java.lang.String webId) throws RemoteException { 235 try { 236 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByWebId(webId); 237 238 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 239 } 240 catch (Exception e) { 241 _log.error(e, e); 242 243 throw new RemoteException(e.getMessage()); 244 } 245 } 246 247 /** 248 * Removes the values that match the keys of the company's preferences. 249 * 250 * This method is called by {@link 251 * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely 252 * through {@link com.liferay.portal.service.CompanyService}. 253 * 254 * @param companyId the primary key of the company 255 * @param keys the company's preferences keys to be remove 256 * @throws PortalException if the user was not an administrator 257 * @throws SystemException if a system exception occurred 258 */ 259 public static void removePreferences(long companyId, java.lang.String[] keys) 260 throws RemoteException { 261 try { 262 CompanyServiceUtil.removePreferences(companyId, keys); 263 } 264 catch (Exception e) { 265 _log.error(e, e); 266 267 throw new RemoteException(e.getMessage()); 268 } 269 } 270 271 /** 272 * Updates the company 273 * 274 * @param companyId the primary key of the company 275 * @param virtualHost the company's virtual host name 276 * @param mx the company's mail domain 277 * @param maxUsers the max number of company users (optionally 278 <code>0</code>) 279 * @param active whether the company is active 280 * @return the company with the primary key 281 * @throws PortalException if a company with the primary key could not be 282 found or if the new information was invalid or if the user was 283 not a universal administrator 284 * @throws SystemException if a system exception occurred 285 */ 286 public static com.liferay.portal.model.CompanySoap updateCompany( 287 long companyId, java.lang.String virtualHost, java.lang.String mx, 288 int maxUsers, boolean active) throws RemoteException { 289 try { 290 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId, 291 virtualHost, mx, maxUsers, active); 292 293 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 294 } 295 catch (Exception e) { 296 _log.error(e, e); 297 298 throw new RemoteException(e.getMessage()); 299 } 300 } 301 302 /** 303 * Updates the company with additional account information. 304 * 305 * @param companyId the primary key of the company 306 * @param virtualHost the company's virtual host name 307 * @param mx the company's mail domain 308 * @param homeURL the company's home URL (optionally <code>null</code>) 309 * @param name the company's account name (optionally <code>null</code>) 310 * @param legalName the company's account legal name (optionally 311 <code>null</code>) 312 * @param legalId the company's account legal ID (optionally 313 <code>null</code>) 314 * @param legalType the company's account legal type (optionally 315 <code>null</code>) 316 * @param sicCode the company's account SIC code (optionally 317 <code>null</code>) 318 * @param tickerSymbol the company's account ticker symbol (optionally 319 <code>null</code>) 320 * @param industry the the company's account industry (optionally 321 <code>null</code>) 322 * @param type the company's account type (optionally <code>null</code>) 323 * @param size the company's account size (optionally <code>null</code>) 324 * @return the the company with the primary key 325 * @throws PortalException if a company with the primary key could not be 326 found or if the new information was invalid or if the user was 327 not an administrator 328 * @throws SystemException if a system exception occurred 329 */ 330 public static com.liferay.portal.model.CompanySoap updateCompany( 331 long companyId, java.lang.String virtualHost, java.lang.String mx, 332 java.lang.String homeURL, java.lang.String name, 333 java.lang.String legalName, java.lang.String legalId, 334 java.lang.String legalType, java.lang.String sicCode, 335 java.lang.String tickerSymbol, java.lang.String industry, 336 java.lang.String type, java.lang.String size) throws RemoteException { 337 try { 338 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId, 339 virtualHost, mx, homeURL, name, legalName, legalId, 340 legalType, sicCode, tickerSymbol, industry, type, size); 341 342 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 343 } 344 catch (Exception e) { 345 _log.error(e, e); 346 347 throw new RemoteException(e.getMessage()); 348 } 349 } 350 351 /** 352 * Update the company's display. 353 * 354 * @param companyId the primary key of the company 355 * @param languageId the ID of the company's default user's language 356 * @param timeZoneId the ID of the company's default user's time zone 357 * @throws PortalException if the company's default user could not be found 358 or if the user was not an administrator 359 * @throws SystemException if a system exception occurred 360 */ 361 public static void updateDisplay(long companyId, 362 java.lang.String languageId, java.lang.String timeZoneId) 363 throws RemoteException { 364 try { 365 CompanyServiceUtil.updateDisplay(companyId, languageId, timeZoneId); 366 } 367 catch (Exception e) { 368 _log.error(e, e); 369 370 throw new RemoteException(e.getMessage()); 371 } 372 } 373 374 /** 375 * Updates the company's logo. 376 * 377 * @param companyId the primary key of the company 378 * @param bytes the bytes of the company's logo image 379 * @return the company with the primary key 380 * @throws PortalException if the company's logo ID could not be found or if 381 the logo's image was corrupted or if the user was an 382 administrator 383 * @throws SystemException if a system exception occurred 384 */ 385 public static com.liferay.portal.model.CompanySoap updateLogo( 386 long companyId, byte[] bytes) throws RemoteException { 387 try { 388 com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateLogo(companyId, 389 bytes); 390 391 return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue); 392 } 393 catch (Exception e) { 394 _log.error(e, e); 395 396 throw new RemoteException(e.getMessage()); 397 } 398 } 399 400 /** 401 * Updates the company's security properties. 402 * 403 * @param companyId the primary key of the company 404 * @param authType the company's method of authenticating users 405 * @param autoLogin whether to allow users to select the "remember me" 406 feature 407 * @param sendPassword whether to allow users to ask the company to send 408 their passwords 409 * @param strangers whether to allow strangers to create accounts to 410 register themselves in the company 411 * @param strangersWithMx whether to allow strangers to create accounts 412 with email addresses that match the company mail suffix 413 * @param strangersVerify whether to require strangers who create accounts 414 to be verified via email 415 * @param siteLogo whether to to allow site administrators to use their own 416 logo instead of the enterprise logo 417 * @throws PortalException if the user was not an administrator 418 * @throws SystemException if a system exception occurred 419 */ 420 public static void updateSecurity(long companyId, 421 java.lang.String authType, boolean autoLogin, boolean sendPassword, 422 boolean strangers, boolean strangersWithMx, boolean strangersVerify, 423 boolean siteLogo) throws RemoteException { 424 try { 425 CompanyServiceUtil.updateSecurity(companyId, authType, autoLogin, 426 sendPassword, strangers, strangersWithMx, strangersVerify, 427 siteLogo); 428 } 429 catch (Exception e) { 430 _log.error(e, e); 431 432 throw new RemoteException(e.getMessage()); 433 } 434 } 435 436 private static Log _log = LogFactoryUtil.getLog(CompanyServiceSoap.class); 437 }