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; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the remote service utility for Company. This utility wraps 024 * {@link com.liferay.portal.service.impl.CompanyServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on a remote server. Methods of this service are expected to have security 027 * checks based on the propagated JAAS credentials because this service can be 028 * accessed remotely. 029 * 030 * @author Brian Wing Shun Chan 031 * @see CompanyService 032 * @see com.liferay.portal.service.base.CompanyServiceBaseImpl 033 * @see com.liferay.portal.service.impl.CompanyServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class CompanyServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.CompanyServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Returns the Spring bean ID for this bean. 046 * 047 * @return the Spring bean ID for this bean 048 */ 049 public static java.lang.String getBeanIdentifier() { 050 return getService().getBeanIdentifier(); 051 } 052 053 /** 054 * Sets the Spring bean ID for this bean. 055 * 056 * @param beanIdentifier the Spring bean ID for this bean 057 */ 058 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 059 getService().setBeanIdentifier(beanIdentifier); 060 } 061 062 /** 063 * Adds a company. 064 * 065 * @param webId the company's web domain 066 * @param virtualHost the company's virtual host name 067 * @param mx the company's mail domain 068 * @param shardName the company's shard 069 * @param system whether the company is the very first company (i.e., the 070 * @param maxUsers the max number of company users (optionally 071 <code>0</code>) 072 * @param active whether the company is active 073 * @return the company 074 * @throws PortalException if the web domain, virtual host name, or mail 075 domain was invalid or if the user was not a universal 076 administrator 077 * @throws SystemException if a system exception occurred 078 */ 079 public static com.liferay.portal.model.Company addCompany( 080 java.lang.String webId, java.lang.String virtualHost, 081 java.lang.String mx, java.lang.String shardName, boolean system, 082 int maxUsers, boolean active) 083 throws com.liferay.portal.kernel.exception.PortalException, 084 com.liferay.portal.kernel.exception.SystemException { 085 return getService() 086 .addCompany(webId, virtualHost, mx, shardName, system, 087 maxUsers, active); 088 } 089 090 public static com.liferay.portal.model.Company deleteCompany(long companyId) 091 throws com.liferay.portal.kernel.exception.PortalException, 092 com.liferay.portal.kernel.exception.SystemException { 093 return getService().deleteCompany(companyId); 094 } 095 096 /** 097 * Deletes the company's logo. 098 * 099 * @param companyId the primary key of the company 100 * @throws PortalException if the company with the primary key could not be 101 found or if the company's logo could not be found or if the user 102 was not an administrator 103 * @throws SystemException if a system exception occurred 104 */ 105 public static void deleteLogo(long companyId) 106 throws com.liferay.portal.kernel.exception.PortalException, 107 com.liferay.portal.kernel.exception.SystemException { 108 getService().deleteLogo(companyId); 109 } 110 111 /** 112 * Returns the company with the primary key. 113 * 114 * @param companyId the primary key of the company 115 * @return Returns the company with the primary key 116 * @throws PortalException if a company with the primary key could not be 117 found 118 * @throws SystemException if a system exception occurred 119 */ 120 public static com.liferay.portal.model.Company getCompanyById( 121 long companyId) 122 throws com.liferay.portal.kernel.exception.PortalException, 123 com.liferay.portal.kernel.exception.SystemException { 124 return getService().getCompanyById(companyId); 125 } 126 127 /** 128 * Returns the company with the logo. 129 * 130 * @param logoId the ID of the company's logo 131 * @return Returns the company with the logo 132 * @throws PortalException if the company with the logo could not be found 133 * @throws SystemException if a system exception occurred 134 */ 135 public static com.liferay.portal.model.Company getCompanyByLogoId( 136 long logoId) 137 throws com.liferay.portal.kernel.exception.PortalException, 138 com.liferay.portal.kernel.exception.SystemException { 139 return getService().getCompanyByLogoId(logoId); 140 } 141 142 /** 143 * Returns the company with the mail domian. 144 * 145 * @param mx the company's mail domain 146 * @return Returns the company with the mail domain 147 * @throws PortalException if the company with the mail domain could not be 148 found 149 * @throws SystemException if a system exception occurred 150 */ 151 public static com.liferay.portal.model.Company getCompanyByMx( 152 java.lang.String mx) 153 throws com.liferay.portal.kernel.exception.PortalException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getService().getCompanyByMx(mx); 156 } 157 158 /** 159 * Returns the company with the virtual host name. 160 * 161 * @param virtualHost the company's virtual host name 162 * @return Returns the company with the virtual host name 163 * @throws PortalException if the company with the virtual host name could 164 not be found or if the virtual host was not associated with a 165 company 166 * @throws SystemException if a system exception occurred 167 */ 168 public static com.liferay.portal.model.Company getCompanyByVirtualHost( 169 java.lang.String virtualHost) 170 throws com.liferay.portal.kernel.exception.PortalException, 171 com.liferay.portal.kernel.exception.SystemException { 172 return getService().getCompanyByVirtualHost(virtualHost); 173 } 174 175 /** 176 * Returns the company with the web domain. 177 * 178 * @param webId the company's web domain 179 * @return Returns the company with the web domain 180 * @throws PortalException if the company with the web domain could not be 181 found 182 * @throws SystemException if a system exception occurred 183 */ 184 public static com.liferay.portal.model.Company getCompanyByWebId( 185 java.lang.String webId) 186 throws com.liferay.portal.kernel.exception.PortalException, 187 com.liferay.portal.kernel.exception.SystemException { 188 return getService().getCompanyByWebId(webId); 189 } 190 191 /** 192 * Removes the values that match the keys of the company's preferences. 193 * 194 * This method is called by {@link 195 * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely 196 * through {@link com.liferay.portal.service.CompanyService}. 197 * 198 * @param companyId the primary key of the company 199 * @param keys the company's preferences keys to be remove 200 * @throws PortalException if the user was not an administrator 201 * @throws SystemException if a system exception occurred 202 */ 203 public static void removePreferences(long companyId, java.lang.String[] keys) 204 throws com.liferay.portal.kernel.exception.PortalException, 205 com.liferay.portal.kernel.exception.SystemException { 206 getService().removePreferences(companyId, keys); 207 } 208 209 /** 210 * Updates the company 211 * 212 * @param companyId the primary key of the company 213 * @param virtualHost the company's virtual host name 214 * @param mx the company's mail domain 215 * @param maxUsers the max number of company users (optionally 216 <code>0</code>) 217 * @param active whether the company is active 218 * @return the company with the primary key 219 * @throws PortalException if a company with the primary key could not be 220 found or if the new information was invalid or if the user was 221 not a universal administrator 222 * @throws SystemException if a system exception occurred 223 */ 224 public static com.liferay.portal.model.Company updateCompany( 225 long companyId, java.lang.String virtualHost, java.lang.String mx, 226 int maxUsers, boolean active) 227 throws com.liferay.portal.kernel.exception.PortalException, 228 com.liferay.portal.kernel.exception.SystemException { 229 return getService() 230 .updateCompany(companyId, virtualHost, mx, maxUsers, active); 231 } 232 233 /** 234 * Updates the company with additional account information. 235 * 236 * @param companyId the primary key of the company 237 * @param virtualHost the company's virtual host name 238 * @param mx the company's mail domain 239 * @param homeURL the company's home URL (optionally <code>null</code>) 240 * @param name the company's account name (optionally <code>null</code>) 241 * @param legalName the company's account legal name (optionally 242 <code>null</code>) 243 * @param legalId the company's account legal ID (optionally 244 <code>null</code>) 245 * @param legalType the company's account legal type (optionally 246 <code>null</code>) 247 * @param sicCode the company's account SIC code (optionally 248 <code>null</code>) 249 * @param tickerSymbol the company's account ticker symbol (optionally 250 <code>null</code>) 251 * @param industry the the company's account industry (optionally 252 <code>null</code>) 253 * @param type the company's account type (optionally <code>null</code>) 254 * @param size the company's account size (optionally <code>null</code>) 255 * @return the the company with the primary key 256 * @throws PortalException if a company with the primary key could not be 257 found or if the new information was invalid or if the user was 258 not an administrator 259 * @throws SystemException if a system exception occurred 260 */ 261 public static com.liferay.portal.model.Company updateCompany( 262 long companyId, java.lang.String virtualHost, java.lang.String mx, 263 java.lang.String homeURL, java.lang.String name, 264 java.lang.String legalName, java.lang.String legalId, 265 java.lang.String legalType, java.lang.String sicCode, 266 java.lang.String tickerSymbol, java.lang.String industry, 267 java.lang.String type, java.lang.String size) 268 throws com.liferay.portal.kernel.exception.PortalException, 269 com.liferay.portal.kernel.exception.SystemException { 270 return getService() 271 .updateCompany(companyId, virtualHost, mx, homeURL, name, 272 legalName, legalId, legalType, sicCode, tickerSymbol, industry, 273 type, size); 274 } 275 276 /** 277 * Updates the company with addition information. 278 * 279 * @param companyId the primary key of the company 280 * @param virtualHost the company's virtual host name 281 * @param mx the company's mail domain 282 * @param homeURL the company's home URL (optionally <code>null</code>) 283 * @param name the company's account name (optionally <code>null</code>) 284 * @param legalName the company's account legal name (optionally 285 <code>null</code>) 286 * @param legalId the company's accout legal ID (optionally 287 <code>null</code>) 288 * @param legalType the company's account legal type (optionally 289 <code>null</code>) 290 * @param sicCode the company's account SIC code (optionally 291 <code>null</code>) 292 * @param tickerSymbol the company's account ticker symbol (optionally 293 <code>null</code>) 294 * @param industry the the company's account industry (optionally 295 <code>null</code>) 296 * @param type the company's account type (optionally <code>null</code>) 297 * @param size the company's account size (optionally <code>null</code>) 298 * @param languageId the ID of the company's default user's language 299 * @param timeZoneId the ID of the company's default user's time zone 300 * @param addresses the company's addresses 301 * @param emailAddresses the company's email addresses 302 * @param phones the company's phone numbers 303 * @param websites the company's websites 304 * @param properties the company's properties 305 * @return the company with the primary key 306 * @throws PortalException the company with the primary key could not be 307 found or if the new information was invalid or if the user was 308 not an administrator 309 * @throws SystemException if a system exception occurred 310 */ 311 public static com.liferay.portal.model.Company updateCompany( 312 long companyId, java.lang.String virtualHost, java.lang.String mx, 313 java.lang.String homeURL, java.lang.String name, 314 java.lang.String legalName, java.lang.String legalId, 315 java.lang.String legalType, java.lang.String sicCode, 316 java.lang.String tickerSymbol, java.lang.String industry, 317 java.lang.String type, java.lang.String size, 318 java.lang.String languageId, java.lang.String timeZoneId, 319 java.util.List<com.liferay.portal.model.Address> addresses, 320 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 321 java.util.List<com.liferay.portal.model.Phone> phones, 322 java.util.List<com.liferay.portal.model.Website> websites, 323 com.liferay.portal.kernel.util.UnicodeProperties properties) 324 throws com.liferay.portal.kernel.exception.PortalException, 325 com.liferay.portal.kernel.exception.SystemException { 326 return getService() 327 .updateCompany(companyId, virtualHost, mx, homeURL, name, 328 legalName, legalId, legalType, sicCode, tickerSymbol, industry, 329 type, size, languageId, timeZoneId, addresses, emailAddresses, 330 phones, websites, properties); 331 } 332 333 /** 334 * Update the company's display. 335 * 336 * @param companyId the primary key of the company 337 * @param languageId the ID of the company's default user's language 338 * @param timeZoneId the ID of the company's default user's time zone 339 * @throws PortalException if the company's default user could not be found 340 or if the user was not an administrator 341 * @throws SystemException if a system exception occurred 342 */ 343 public static void updateDisplay(long companyId, 344 java.lang.String languageId, java.lang.String timeZoneId) 345 throws com.liferay.portal.kernel.exception.PortalException, 346 com.liferay.portal.kernel.exception.SystemException { 347 getService().updateDisplay(companyId, languageId, timeZoneId); 348 } 349 350 /** 351 * Updates the company's logo. 352 * 353 * @param companyId the primary key of the company 354 * @param bytes the bytes of the company's logo image 355 * @return the company with the primary key 356 * @throws PortalException if the company's logo ID could not be found or if 357 the logo's image was corrupted or if the user was an 358 administrator 359 * @throws SystemException if a system exception occurred 360 */ 361 public static com.liferay.portal.model.Company updateLogo(long companyId, 362 byte[] bytes) 363 throws com.liferay.portal.kernel.exception.PortalException, 364 com.liferay.portal.kernel.exception.SystemException { 365 return getService().updateLogo(companyId, bytes); 366 } 367 368 /** 369 * Updates the company's logo. 370 * 371 * @param companyId the primary key of the company 372 * @param inputStream the input stream of the company's logo image 373 * @return the company with the primary key 374 * @throws PortalException if the company's logo ID could not be found or if 375 the logo's image was corrupted or if the user was an 376 administrator 377 * @throws SystemException if a system exception occurred 378 */ 379 public static com.liferay.portal.model.Company updateLogo(long companyId, 380 java.io.InputStream inputStream) 381 throws com.liferay.portal.kernel.exception.PortalException, 382 com.liferay.portal.kernel.exception.SystemException { 383 return getService().updateLogo(companyId, inputStream); 384 } 385 386 /** 387 * Updates the company's preferences. The company's default properties are 388 * found in portal.properties. 389 * 390 * @param companyId the primary key of the company 391 * @param properties the company's properties. See {@link 392 com.liferay.portal.kernel.util.UnicodeProperties} 393 * @throws PortalException if the user was not an administrator 394 * @throws SystemException if a system exception occurred 395 */ 396 public static void updatePreferences(long companyId, 397 com.liferay.portal.kernel.util.UnicodeProperties properties) 398 throws com.liferay.portal.kernel.exception.PortalException, 399 com.liferay.portal.kernel.exception.SystemException { 400 getService().updatePreferences(companyId, properties); 401 } 402 403 /** 404 * Updates the company's security properties. 405 * 406 * @param companyId the primary key of the company 407 * @param authType the company's method of authenticating users 408 * @param autoLogin whether to allow users to select the "remember me" 409 feature 410 * @param sendPassword whether to allow users to ask the company to send 411 their passwords 412 * @param strangers whether to allow strangers to create accounts to 413 register themselves in the company 414 * @param strangersWithMx whether to allow strangers to create accounts 415 with email addresses that match the company mail suffix 416 * @param strangersVerify whether to require strangers who create accounts 417 to be verified via email 418 * @param siteLogo whether to to allow site administrators to use their own 419 logo instead of the enterprise logo 420 * @throws PortalException if the user was not an administrator 421 * @throws SystemException if a system exception occurred 422 */ 423 public static void updateSecurity(long companyId, 424 java.lang.String authType, boolean autoLogin, boolean sendPassword, 425 boolean strangers, boolean strangersWithMx, boolean strangersVerify, 426 boolean siteLogo) 427 throws com.liferay.portal.kernel.exception.PortalException, 428 com.liferay.portal.kernel.exception.SystemException { 429 getService() 430 .updateSecurity(companyId, authType, autoLogin, sendPassword, 431 strangers, strangersWithMx, strangersVerify, siteLogo); 432 } 433 434 public static CompanyService getService() { 435 if (_service == null) { 436 _service = (CompanyService)PortalBeanLocatorUtil.locate(CompanyService.class.getName()); 437 438 ReferenceRegistry.registerReference(CompanyServiceUtil.class, 439 "_service"); 440 } 441 442 return _service; 443 } 444 445 /** 446 * @deprecated As of 6.2.0 447 */ 448 public void setService(CompanyService service) { 449 } 450 451 private static CompanyService _service; 452 }