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