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; 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 * Adds a company. 046 * 047 * @param webId the company's web domain 048 * @param virtualHost the company's virtual host name 049 * @param mx the company's mail domain 050 * @param system whether the company is the very first company (i.e., the 051 * @param maxUsers the max number of company users (optionally 052 <code>0</code>) 053 * @param active whether the company is active 054 * @return the company 055 * @throws PortalException if the web domain, virtual host name, or mail 056 domain was invalid or if the user was not a universal 057 administrator 058 */ 059 public static com.liferay.portal.model.Company addCompany( 060 java.lang.String webId, java.lang.String virtualHost, 061 java.lang.String mx, boolean system, int maxUsers, boolean active) 062 throws com.liferay.portal.kernel.exception.PortalException { 063 return getService() 064 .addCompany(webId, virtualHost, mx, system, maxUsers, active); 065 } 066 067 public static com.liferay.portal.model.Company deleteCompany(long companyId) 068 throws com.liferay.portal.kernel.exception.PortalException { 069 return getService().deleteCompany(companyId); 070 } 071 072 /** 073 * Deletes the company's logo. 074 * 075 * @param companyId the primary key of the company 076 * @throws PortalException if the company with the primary key could not be 077 found or if the company's logo could not be found or if the user 078 was not an administrator 079 */ 080 public static void deleteLogo(long companyId) 081 throws com.liferay.portal.kernel.exception.PortalException { 082 getService().deleteLogo(companyId); 083 } 084 085 /** 086 * Returns the Spring bean ID for this bean. 087 * 088 * @return the Spring bean ID for this bean 089 */ 090 public static java.lang.String getBeanIdentifier() { 091 return getService().getBeanIdentifier(); 092 } 093 094 /** 095 * Returns the company with the primary key. 096 * 097 * @param companyId the primary key of the company 098 * @return Returns the company with the primary key 099 * @throws PortalException if a company with the primary key could not be 100 found 101 */ 102 public static com.liferay.portal.model.Company getCompanyById( 103 long companyId) 104 throws com.liferay.portal.kernel.exception.PortalException { 105 return getService().getCompanyById(companyId); 106 } 107 108 /** 109 * Returns the company with the logo. 110 * 111 * @param logoId the ID of the company's logo 112 * @return Returns the company with the logo 113 * @throws PortalException if the company with the logo could not be found 114 */ 115 public static com.liferay.portal.model.Company getCompanyByLogoId( 116 long logoId) throws com.liferay.portal.kernel.exception.PortalException { 117 return getService().getCompanyByLogoId(logoId); 118 } 119 120 /** 121 * Returns the company with the mail domian. 122 * 123 * @param mx the company's mail domain 124 * @return Returns the company with the mail domain 125 * @throws PortalException if the company with the mail domain could not be 126 found 127 */ 128 public static com.liferay.portal.model.Company getCompanyByMx( 129 java.lang.String mx) 130 throws com.liferay.portal.kernel.exception.PortalException { 131 return getService().getCompanyByMx(mx); 132 } 133 134 /** 135 * Returns the company with the virtual host name. 136 * 137 * @param virtualHost the company's virtual host name 138 * @return Returns the company with the virtual host name 139 * @throws PortalException if the company with the virtual host name could 140 not be found or if the virtual host was not associated with a 141 company 142 */ 143 public static com.liferay.portal.model.Company getCompanyByVirtualHost( 144 java.lang.String virtualHost) 145 throws com.liferay.portal.kernel.exception.PortalException { 146 return getService().getCompanyByVirtualHost(virtualHost); 147 } 148 149 /** 150 * Returns the company with the web domain. 151 * 152 * @param webId the company's web domain 153 * @return Returns the company with the web domain 154 * @throws PortalException if the company with the web domain could not be 155 found 156 */ 157 public static com.liferay.portal.model.Company getCompanyByWebId( 158 java.lang.String webId) 159 throws com.liferay.portal.kernel.exception.PortalException { 160 return getService().getCompanyByWebId(webId); 161 } 162 163 /** 164 * Removes the values that match the keys of the company's preferences. 165 * 166 * This method is called by {@link 167 * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely 168 * through {@link com.liferay.portal.service.CompanyService}. 169 * 170 * @param companyId the primary key of the company 171 * @param keys the company's preferences keys to be remove 172 * @throws PortalException if the user was not an administrator 173 */ 174 public static void removePreferences(long companyId, java.lang.String[] keys) 175 throws com.liferay.portal.kernel.exception.PortalException { 176 getService().removePreferences(companyId, keys); 177 } 178 179 /** 180 * Sets the Spring bean ID for this bean. 181 * 182 * @param beanIdentifier the Spring bean ID for this bean 183 */ 184 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 185 getService().setBeanIdentifier(beanIdentifier); 186 } 187 188 /** 189 * Updates the company with additional account information. 190 * 191 * @param companyId the primary key of the company 192 * @param virtualHost the company's virtual host name 193 * @param mx the company's mail domain 194 * @param homeURL the company's home URL (optionally <code>null</code>) 195 * @param logo whether to update the company's logo 196 * @param logoBytes the new logo image data 197 * @param name the company's account name (optionally <code>null</code>) 198 * @param legalName the company's account legal name (optionally 199 <code>null</code>) 200 * @param legalId the company's account legal ID (optionally 201 <code>null</code>) 202 * @param legalType the company's account legal type (optionally 203 <code>null</code>) 204 * @param sicCode the company's account SIC code (optionally 205 <code>null</code>) 206 * @param tickerSymbol the company's account ticker symbol (optionally 207 <code>null</code>) 208 * @param industry the the company's account industry (optionally 209 <code>null</code>) 210 * @param type the company's account type (optionally <code>null</code>) 211 * @param size the company's account size (optionally <code>null</code>) 212 * @return the the company with the primary key 213 * @throws PortalException if a company with the primary key could not be 214 found or if the new information was invalid or if the user was 215 not an administrator 216 */ 217 public static com.liferay.portal.model.Company updateCompany( 218 long companyId, java.lang.String virtualHost, java.lang.String mx, 219 java.lang.String homeURL, boolean logo, byte[] logoBytes, 220 java.lang.String name, java.lang.String legalName, 221 java.lang.String legalId, java.lang.String legalType, 222 java.lang.String sicCode, java.lang.String tickerSymbol, 223 java.lang.String industry, java.lang.String type, java.lang.String size) 224 throws com.liferay.portal.kernel.exception.PortalException { 225 return getService() 226 .updateCompany(companyId, virtualHost, mx, homeURL, logo, 227 logoBytes, name, legalName, legalId, legalType, sicCode, 228 tickerSymbol, industry, type, size); 229 } 230 231 /** 232 * Updates the company with addition information. 233 * 234 * @param companyId the primary key of the company 235 * @param virtualHost the company's virtual host name 236 * @param mx the company's mail domain 237 * @param homeURL the company's home URL (optionally <code>null</code>) 238 * @param logo if the company has a custom logo 239 * @param logoBytes the new logo image data 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 accout 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 * @param languageId the ID of the company's default user's language 256 * @param timeZoneId the ID of the company's default user's time zone 257 * @param addresses the company's addresses 258 * @param emailAddresses the company's email addresses 259 * @param phones the company's phone numbers 260 * @param websites the company's websites 261 * @param properties the company's properties 262 * @return the company with the primary key 263 * @throws PortalException the company with the primary key could not be 264 found or if the new information was invalid or if the user was 265 not an administrator 266 */ 267 public static com.liferay.portal.model.Company updateCompany( 268 long companyId, java.lang.String virtualHost, java.lang.String mx, 269 java.lang.String homeURL, boolean logo, byte[] logoBytes, 270 java.lang.String name, java.lang.String legalName, 271 java.lang.String legalId, java.lang.String legalType, 272 java.lang.String sicCode, java.lang.String tickerSymbol, 273 java.lang.String industry, java.lang.String type, 274 java.lang.String size, java.lang.String languageId, 275 java.lang.String timeZoneId, 276 java.util.List<com.liferay.portal.model.Address> addresses, 277 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 278 java.util.List<com.liferay.portal.model.Phone> phones, 279 java.util.List<com.liferay.portal.model.Website> websites, 280 com.liferay.portal.kernel.util.UnicodeProperties properties) 281 throws com.liferay.portal.kernel.exception.PortalException { 282 return getService() 283 .updateCompany(companyId, virtualHost, mx, homeURL, logo, 284 logoBytes, name, legalName, legalId, legalType, sicCode, 285 tickerSymbol, industry, type, size, languageId, timeZoneId, 286 addresses, emailAddresses, phones, websites, properties); 287 } 288 289 /** 290 * Updates the company with additional account information. 291 * 292 * @param companyId the primary key of the company 293 * @param virtualHost the company's virtual host name 294 * @param mx the company's mail domain 295 * @param homeURL the company's home URL (optionally <code>null</code>) 296 * @param name the company's account name (optionally 297 <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 311 <code>null</code>) 312 * @param size the company's account size (optionally 313 <code>null</code>) 314 * @return the the company with the primary key 315 * @throws PortalException if a company with the primary key could not 316 be found or if the new information was invalid or if the user 317 was not an administrator 318 * @deprecated As of 7.0.0, replaced by {@link #updateCompany(long, String, 319 String, String, boolean, byte[], String, String, String, 320 String, String, String, String, String, String)} 321 */ 322 @Deprecated 323 public static com.liferay.portal.model.Company updateCompany( 324 long companyId, java.lang.String virtualHost, java.lang.String mx, 325 java.lang.String homeURL, java.lang.String name, 326 java.lang.String legalName, java.lang.String legalId, 327 java.lang.String legalType, java.lang.String sicCode, 328 java.lang.String tickerSymbol, java.lang.String industry, 329 java.lang.String type, java.lang.String size) 330 throws com.liferay.portal.kernel.exception.PortalException { 331 return getService() 332 .updateCompany(companyId, virtualHost, mx, homeURL, name, 333 legalName, legalId, legalType, sicCode, tickerSymbol, industry, 334 type, size); 335 } 336 337 /** 338 * Updates the company with addition information. 339 * 340 * @param companyId the primary key of the company 341 * @param virtualHost the company's virtual host name 342 * @param mx the company's mail domain 343 * @param homeURL the company's home URL (optionally <code>null</code>) 344 * @param name the company's account name (optionally 345 <code>null</code>) 346 * @param legalName the company's account legal name (optionally 347 <code>null</code>) 348 * @param legalId the company's accout legal ID (optionally 349 <code>null</code>) 350 * @param legalType the company's account legal type (optionally 351 <code>null</code>) 352 * @param sicCode the company's account SIC code (optionally 353 <code>null</code>) 354 * @param tickerSymbol the company's account ticker symbol (optionally 355 <code>null</code>) 356 * @param industry the the company's account industry (optionally 357 <code>null</code>) 358 * @param type the company's account type (optionally 359 <code>null</code>) 360 * @param size the company's account size (optionally 361 <code>null</code>) 362 * @param languageId the ID of the company's default user's language 363 * @param timeZoneId the ID of the company's default user's time zone 364 * @param addresses the company's addresses 365 * @param emailAddresses the company's email addresses 366 * @param phones the company's phone numbers 367 * @param websites the company's websites 368 * @param properties the company's properties 369 * @return the company with the primary key 370 * @throws PortalException the company with the primary key could not be 371 found or if the new information was invalid or if the user 372 was not an administrator 373 * @deprecated As of 7.0.0, replaced by {@link #updateCompany(long, String, 374 String, String, boolean, byte[], String, String, String, 375 String, String, String, String, String, String, String, 376 String, List, List, List, List, UnicodeProperties)} 377 */ 378 @Deprecated 379 public static com.liferay.portal.model.Company updateCompany( 380 long companyId, java.lang.String virtualHost, java.lang.String mx, 381 java.lang.String homeURL, java.lang.String name, 382 java.lang.String legalName, java.lang.String legalId, 383 java.lang.String legalType, java.lang.String sicCode, 384 java.lang.String tickerSymbol, java.lang.String industry, 385 java.lang.String type, java.lang.String size, 386 java.lang.String languageId, java.lang.String timeZoneId, 387 java.util.List<com.liferay.portal.model.Address> addresses, 388 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 389 java.util.List<com.liferay.portal.model.Phone> phones, 390 java.util.List<com.liferay.portal.model.Website> websites, 391 com.liferay.portal.kernel.util.UnicodeProperties properties) 392 throws com.liferay.portal.kernel.exception.PortalException { 393 return getService() 394 .updateCompany(companyId, virtualHost, mx, homeURL, name, 395 legalName, legalId, legalType, sicCode, tickerSymbol, industry, 396 type, size, languageId, timeZoneId, addresses, emailAddresses, 397 phones, websites, properties); 398 } 399 400 /** 401 * Updates the company 402 * 403 * @param companyId the primary key of the company 404 * @param virtualHost the company's virtual host name 405 * @param mx the company's mail domain 406 * @param maxUsers the max number of company users (optionally 407 <code>0</code>) 408 * @param active whether the company is active 409 * @return the company with the primary key 410 * @throws PortalException if a company with the primary key could not be 411 found or if the new information was invalid or if the user was 412 not a universal administrator 413 */ 414 public static com.liferay.portal.model.Company updateCompany( 415 long companyId, java.lang.String virtualHost, java.lang.String mx, 416 int maxUsers, boolean active) 417 throws com.liferay.portal.kernel.exception.PortalException { 418 return getService() 419 .updateCompany(companyId, virtualHost, mx, maxUsers, active); 420 } 421 422 /** 423 * Update the company's display. 424 * 425 * @param companyId the primary key of the company 426 * @param languageId the ID of the company's default user's language 427 * @param timeZoneId the ID of the company's default user's time zone 428 * @throws PortalException if the company's default user could not be found 429 or if the user was not an administrator 430 */ 431 public static void updateDisplay(long companyId, 432 java.lang.String languageId, java.lang.String timeZoneId) 433 throws com.liferay.portal.kernel.exception.PortalException { 434 getService().updateDisplay(companyId, languageId, timeZoneId); 435 } 436 437 /** 438 * Updates the company's logo. 439 * 440 * @param companyId the primary key of the company 441 * @param bytes the bytes of the company's logo image 442 * @return the company with the primary key 443 * @throws PortalException if the company's logo ID could not be found or if 444 the logo's image was corrupted or if the user was an 445 administrator 446 */ 447 public static com.liferay.portal.model.Company updateLogo(long companyId, 448 byte[] bytes) 449 throws com.liferay.portal.kernel.exception.PortalException { 450 return getService().updateLogo(companyId, bytes); 451 } 452 453 /** 454 * Updates the company's logo. 455 * 456 * @param companyId the primary key of the company 457 * @param inputStream the input stream of the company's logo image 458 * @return the company with the primary key 459 * @throws PortalException if the company's logo ID could not be found or if 460 the logo's image was corrupted or if the user was an 461 administrator 462 */ 463 public static com.liferay.portal.model.Company updateLogo(long companyId, 464 java.io.InputStream inputStream) 465 throws com.liferay.portal.kernel.exception.PortalException { 466 return getService().updateLogo(companyId, inputStream); 467 } 468 469 /** 470 * Updates the company's preferences. The company's default properties are 471 * found in portal.properties. 472 * 473 * @param companyId the primary key of the company 474 * @param properties the company's properties. See {@link 475 UnicodeProperties} 476 * @throws PortalException if the user was not an administrator 477 */ 478 public static void updatePreferences(long companyId, 479 com.liferay.portal.kernel.util.UnicodeProperties properties) 480 throws com.liferay.portal.kernel.exception.PortalException { 481 getService().updatePreferences(companyId, properties); 482 } 483 484 /** 485 * Updates the company's security properties. 486 * 487 * @param companyId the primary key of the company 488 * @param authType the company's method of authenticating users 489 * @param autoLogin whether to allow users to select the "remember me" 490 feature 491 * @param sendPassword whether to allow users to ask the company to send 492 their passwords 493 * @param strangers whether to allow strangers to create accounts to 494 register themselves in the company 495 * @param strangersWithMx whether to allow strangers to create accounts 496 with email addresses that match the company mail suffix 497 * @param strangersVerify whether to require strangers who create accounts 498 to be verified via email 499 * @param siteLogo whether to to allow site administrators to use their own 500 logo instead of the enterprise logo 501 * @throws PortalException if the user was not an administrator 502 */ 503 public static void updateSecurity(long companyId, 504 java.lang.String authType, boolean autoLogin, boolean sendPassword, 505 boolean strangers, boolean strangersWithMx, boolean strangersVerify, 506 boolean siteLogo) 507 throws com.liferay.portal.kernel.exception.PortalException { 508 getService() 509 .updateSecurity(companyId, authType, autoLogin, sendPassword, 510 strangers, strangersWithMx, strangersVerify, siteLogo); 511 } 512 513 public static CompanyService getService() { 514 if (_service == null) { 515 _service = (CompanyService)PortalBeanLocatorUtil.locate(CompanyService.class.getName()); 516 517 ReferenceRegistry.registerReference(CompanyServiceUtil.class, 518 "_service"); 519 } 520 521 return _service; 522 } 523 524 /** 525 * @deprecated As of 6.2.0 526 */ 527 @Deprecated 528 public void setService(CompanyService service) { 529 } 530 531 private static CompanyService _service; 532 }