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