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