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