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