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.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.service.CompanyServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * Provides the SOAP utility for the
027     * {@link com.liferay.portal.service.CompanyServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.CompanySoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Company}, that is translated to a
038     * {@link com.liferay.portal.model.CompanySoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see CompanyServiceHttp
061     * @see com.liferay.portal.model.CompanySoap
062     * @see com.liferay.portal.service.CompanyServiceUtil
063     * @generated
064     */
065    @ProviderType
066    public class CompanyServiceSoap {
067            /**
068            * Adds a company.
069            *
070            * @param webId the company's web domain
071            * @param virtualHost the company's virtual host name
072            * @param mx the company's mail domain
073            * @param shardName the company's shard
074            * @param system whether the company is the very first company (i.e., the
075            * @param maxUsers the max number of company users (optionally
076            <code>0</code>)
077            * @param active whether the company is active
078            * @return the company
079            * @throws PortalException if the web domain, virtual host name, or mail
080            domain was invalid or if the user was not a universal
081            administrator
082            * @throws SystemException if a system exception occurred
083            */
084            public static com.liferay.portal.model.CompanySoap addCompany(
085                    java.lang.String webId, java.lang.String virtualHost,
086                    java.lang.String mx, java.lang.String shardName, boolean system,
087                    int maxUsers, boolean active) throws RemoteException {
088                    try {
089                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.addCompany(webId,
090                                            virtualHost, mx, shardName, system, maxUsers, active);
091    
092                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
093                    }
094                    catch (Exception e) {
095                            _log.error(e, e);
096    
097                            throw new RemoteException(e.getMessage());
098                    }
099            }
100    
101            public static com.liferay.portal.model.CompanySoap deleteCompany(
102                    long companyId) throws RemoteException {
103                    try {
104                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.deleteCompany(companyId);
105    
106                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
107                    }
108                    catch (Exception e) {
109                            _log.error(e, e);
110    
111                            throw new RemoteException(e.getMessage());
112                    }
113            }
114    
115            /**
116            * Deletes the company's logo.
117            *
118            * @param companyId the primary key of the company
119            * @throws PortalException if the company with the primary key could not be
120            found or if the company's logo could not be found or if the user
121            was not an administrator
122            * @throws SystemException if a system exception occurred
123            */
124            public static void deleteLogo(long companyId) throws RemoteException {
125                    try {
126                            CompanyServiceUtil.deleteLogo(companyId);
127                    }
128                    catch (Exception e) {
129                            _log.error(e, e);
130    
131                            throw new RemoteException(e.getMessage());
132                    }
133            }
134    
135            /**
136            * Returns the company with the primary key.
137            *
138            * @param companyId the primary key of the company
139            * @return Returns the company with the primary key
140            * @throws PortalException if a company with the primary key could not be
141            found
142            * @throws SystemException if a system exception occurred
143            */
144            public static com.liferay.portal.model.CompanySoap getCompanyById(
145                    long companyId) throws RemoteException {
146                    try {
147                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyById(companyId);
148    
149                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            /**
159            * Returns the company with the logo.
160            *
161            * @param logoId the ID of the company's logo
162            * @return Returns the company with the logo
163            * @throws PortalException if the company with the logo could not be found
164            * @throws SystemException if a system exception occurred
165            */
166            public static com.liferay.portal.model.CompanySoap getCompanyByLogoId(
167                    long logoId) throws RemoteException {
168                    try {
169                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByLogoId(logoId);
170    
171                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
172                    }
173                    catch (Exception e) {
174                            _log.error(e, e);
175    
176                            throw new RemoteException(e.getMessage());
177                    }
178            }
179    
180            /**
181            * Returns the company with the mail domian.
182            *
183            * @param mx the company's mail domain
184            * @return Returns the company with the mail domain
185            * @throws PortalException if the company with the mail domain could not be
186            found
187            * @throws SystemException if a system exception occurred
188            */
189            public static com.liferay.portal.model.CompanySoap getCompanyByMx(
190                    java.lang.String mx) throws RemoteException {
191                    try {
192                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByMx(mx);
193    
194                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            /**
204            * Returns the company with the virtual host name.
205            *
206            * @param virtualHost the company's virtual host name
207            * @return Returns the company with the virtual host name
208            * @throws PortalException if the company with the virtual host name could
209            not be found or if the virtual host was not associated with a
210            company
211            * @throws SystemException if a system exception occurred
212            */
213            public static com.liferay.portal.model.CompanySoap getCompanyByVirtualHost(
214                    java.lang.String virtualHost) throws RemoteException {
215                    try {
216                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByVirtualHost(virtualHost);
217    
218                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
219                    }
220                    catch (Exception e) {
221                            _log.error(e, e);
222    
223                            throw new RemoteException(e.getMessage());
224                    }
225            }
226    
227            /**
228            * Returns the company with the web domain.
229            *
230            * @param webId the company's web domain
231            * @return Returns the company with the web domain
232            * @throws PortalException if the company with the web domain could not be
233            found
234            * @throws SystemException if a system exception occurred
235            */
236            public static com.liferay.portal.model.CompanySoap getCompanyByWebId(
237                    java.lang.String webId) throws RemoteException {
238                    try {
239                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByWebId(webId);
240    
241                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
242                    }
243                    catch (Exception e) {
244                            _log.error(e, e);
245    
246                            throw new RemoteException(e.getMessage());
247                    }
248            }
249    
250            /**
251            * Removes the values that match the keys of the company's preferences.
252            *
253            * This method is called by {@link
254            * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely
255            * through {@link com.liferay.portal.service.CompanyService}.
256            *
257            * @param companyId the primary key of the company
258            * @param keys the company's preferences keys to be remove
259            * @throws PortalException if the user was not an administrator
260            * @throws SystemException if a system exception occurred
261            */
262            public static void removePreferences(long companyId, java.lang.String[] keys)
263                    throws RemoteException {
264                    try {
265                            CompanyServiceUtil.removePreferences(companyId, keys);
266                    }
267                    catch (Exception e) {
268                            _log.error(e, e);
269    
270                            throw new RemoteException(e.getMessage());
271                    }
272            }
273    
274            /**
275            * Updates the company
276            *
277            * @param companyId the primary key of the company
278            * @param virtualHost the company's virtual host name
279            * @param mx the company's mail domain
280            * @param maxUsers the max number of company users (optionally
281            <code>0</code>)
282            * @param active whether the company is active
283            * @return the company with the primary key
284            * @throws PortalException if a company with the primary key could not be
285            found or if the new information was invalid or if the user was
286            not a universal administrator
287            * @throws SystemException if a system exception occurred
288            */
289            public static com.liferay.portal.model.CompanySoap updateCompany(
290                    long companyId, java.lang.String virtualHost, java.lang.String mx,
291                    int maxUsers, boolean active) throws RemoteException {
292                    try {
293                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId,
294                                            virtualHost, mx, maxUsers, active);
295    
296                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
297                    }
298                    catch (Exception e) {
299                            _log.error(e, e);
300    
301                            throw new RemoteException(e.getMessage());
302                    }
303            }
304    
305            /**
306            * Updates the company with additional account information.
307            *
308            * @param companyId the primary key of the company
309            * @param virtualHost the company's virtual host name
310            * @param mx the company's mail domain
311            * @param homeURL the company's home URL (optionally <code>null</code>)
312            * @param name the company's account name (optionally <code>null</code>)
313            * @param legalName the company's account legal name (optionally
314            <code>null</code>)
315            * @param legalId the company's account legal ID (optionally
316            <code>null</code>)
317            * @param legalType the company's account legal type (optionally
318            <code>null</code>)
319            * @param sicCode the company's account SIC code (optionally
320            <code>null</code>)
321            * @param tickerSymbol the company's account ticker symbol (optionally
322            <code>null</code>)
323            * @param industry the the company's account industry (optionally
324            <code>null</code>)
325            * @param type the company's account type (optionally <code>null</code>)
326            * @param size the company's account size (optionally <code>null</code>)
327            * @return the the company with the primary key
328            * @throws PortalException if a company with the primary key could not be
329            found or if the new information was invalid or if the user was
330            not an administrator
331            * @throws SystemException if a system exception occurred
332            */
333            public static com.liferay.portal.model.CompanySoap updateCompany(
334                    long companyId, java.lang.String virtualHost, java.lang.String mx,
335                    java.lang.String homeURL, java.lang.String name,
336                    java.lang.String legalName, java.lang.String legalId,
337                    java.lang.String legalType, java.lang.String sicCode,
338                    java.lang.String tickerSymbol, java.lang.String industry,
339                    java.lang.String type, java.lang.String size) throws RemoteException {
340                    try {
341                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId,
342                                            virtualHost, mx, homeURL, name, legalName, legalId,
343                                            legalType, sicCode, tickerSymbol, industry, type, size);
344    
345                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
346                    }
347                    catch (Exception e) {
348                            _log.error(e, e);
349    
350                            throw new RemoteException(e.getMessage());
351                    }
352            }
353    
354            /**
355            * Update the company's display.
356            *
357            * @param companyId the primary key of the company
358            * @param languageId the ID of the company's default user's language
359            * @param timeZoneId the ID of the company's default user's time zone
360            * @throws PortalException if the company's default user could not be found
361            or if the user was not an administrator
362            * @throws SystemException if a system exception occurred
363            */
364            public static void updateDisplay(long companyId,
365                    java.lang.String languageId, java.lang.String timeZoneId)
366                    throws RemoteException {
367                    try {
368                            CompanyServiceUtil.updateDisplay(companyId, languageId, timeZoneId);
369                    }
370                    catch (Exception e) {
371                            _log.error(e, e);
372    
373                            throw new RemoteException(e.getMessage());
374                    }
375            }
376    
377            /**
378            * Updates the company's logo.
379            *
380            * @param companyId the primary key of the company
381            * @param bytes the bytes of the company's logo image
382            * @return the company with the primary key
383            * @throws PortalException if the company's logo ID could not be found or if
384            the logo's image was corrupted or if the user was an
385            administrator
386            * @throws SystemException if a system exception occurred
387            */
388            public static com.liferay.portal.model.CompanySoap updateLogo(
389                    long companyId, byte[] bytes) throws RemoteException {
390                    try {
391                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateLogo(companyId,
392                                            bytes);
393    
394                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
395                    }
396                    catch (Exception e) {
397                            _log.error(e, e);
398    
399                            throw new RemoteException(e.getMessage());
400                    }
401            }
402    
403            /**
404            * Updates the company's security properties.
405            *
406            * @param companyId the primary key of the company
407            * @param authType the company's method of authenticating users
408            * @param autoLogin whether to allow users to select the "remember me"
409            feature
410            * @param sendPassword whether to allow users to ask the company to send
411            their passwords
412            * @param strangers whether to allow strangers to create accounts to
413            register themselves in the company
414            * @param strangersWithMx whether to allow strangers to create accounts
415            with email addresses that match the company mail suffix
416            * @param strangersVerify whether to require strangers who create accounts
417            to be verified via email
418            * @param siteLogo whether to to allow site administrators to use their own
419            logo instead of the enterprise logo
420            * @throws PortalException if the user was not an administrator
421            * @throws SystemException if a system exception occurred
422            */
423            public static void updateSecurity(long companyId,
424                    java.lang.String authType, boolean autoLogin, boolean sendPassword,
425                    boolean strangers, boolean strangersWithMx, boolean strangersVerify,
426                    boolean siteLogo) throws RemoteException {
427                    try {
428                            CompanyServiceUtil.updateSecurity(companyId, authType, autoLogin,
429                                    sendPassword, strangers, strangersWithMx, strangersVerify,
430                                    siteLogo);
431                    }
432                    catch (Exception e) {
433                            _log.error(e, e);
434    
435                            throw new RemoteException(e.getMessage());
436                    }
437            }
438    
439            private static Log _log = LogFactoryUtil.getLog(CompanyServiceSoap.class);
440    }