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