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