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