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