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