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