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 com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.service.CompanyServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * <p>
025     * This class provides a SOAP utility for the
026     * {@link com.liferay.portal.service.CompanyServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it is difficult for SOAP to
029     * support certain types.
030     * </p>
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
051     * http://localhost:8080/api/secure/axis. Set the property
052     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
053     * security.
054     * </p>
055     *
056     * <p>
057     * The SOAP utility is only generated for remote services.
058     * </p>
059     *
060     * @author    Brian Wing Shun Chan
061     * @see       CompanyServiceHttp
062     * @see       com.liferay.portal.model.CompanySoap
063     * @see       com.liferay.portal.service.CompanyServiceUtil
064     * @generated
065     */
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            /**
102            * Deletes the company's logo.
103            *
104            * @param companyId the primary key of the company
105            * @throws PortalException if the company with the primary key could not be
106            found or if the company's logo could not be found or if the user
107            was not an administrator
108            * @throws SystemException if a system exception occurred
109            */
110            public static void deleteLogo(long companyId) throws RemoteException {
111                    try {
112                            CompanyServiceUtil.deleteLogo(companyId);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            /**
122            * Returns the company with the primary key.
123            *
124            * @param companyId the primary key of the company
125            * @return Returns the company with the primary key
126            * @throws PortalException if a company with the primary key could not be
127            found
128            * @throws SystemException if a system exception occurred
129            */
130            public static com.liferay.portal.model.CompanySoap getCompanyById(
131                    long companyId) throws RemoteException {
132                    try {
133                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyById(companyId);
134    
135                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
136                    }
137                    catch (Exception e) {
138                            _log.error(e, e);
139    
140                            throw new RemoteException(e.getMessage());
141                    }
142            }
143    
144            /**
145            * Returns the company with the logo.
146            *
147            * @param logoId the ID of the company's logo
148            * @return Returns the company with the logo
149            * @throws PortalException if the company with the logo could not be found
150            * @throws SystemException if a system exception occurred
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            * @throws PortalException if the company with the mail domain could not be
172            found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.CompanySoap getCompanyByMx(
176                    java.lang.String mx) throws RemoteException {
177                    try {
178                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByMx(mx);
179    
180                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
181                    }
182                    catch (Exception e) {
183                            _log.error(e, e);
184    
185                            throw new RemoteException(e.getMessage());
186                    }
187            }
188    
189            /**
190            * Returns the company with the virtual host name.
191            *
192            * @param virtualHost the company's virtual host name
193            * @return Returns the company with the virtual host name
194            * @throws PortalException if the company with the virtual host name could
195            not be found or if the virtual host was not associated with a
196            company
197            * @throws SystemException if a system exception occurred
198            */
199            public static com.liferay.portal.model.CompanySoap getCompanyByVirtualHost(
200                    java.lang.String virtualHost) throws RemoteException {
201                    try {
202                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByVirtualHost(virtualHost);
203    
204                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
205                    }
206                    catch (Exception e) {
207                            _log.error(e, e);
208    
209                            throw new RemoteException(e.getMessage());
210                    }
211            }
212    
213            /**
214            * Returns the company with the web domain.
215            *
216            * @param webId the company's web domain
217            * @return Returns the company with the web domain
218            * @throws PortalException if the company with the web domain could not be
219            found
220            * @throws SystemException if a system exception occurred
221            */
222            public static com.liferay.portal.model.CompanySoap getCompanyByWebId(
223                    java.lang.String webId) throws RemoteException {
224                    try {
225                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.getCompanyByWebId(webId);
226    
227                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
228                    }
229                    catch (Exception e) {
230                            _log.error(e, e);
231    
232                            throw new RemoteException(e.getMessage());
233                    }
234            }
235    
236            /**
237            * Removes the values that match the keys of the company's preferences.
238            *
239            * This method is called by {@link
240            * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely
241            * through {@link com.liferay.portal.service.CompanyService}.
242            *
243            * @param companyId the primary key of the company
244            * @param keys the company's preferences keys to be remove
245            * @throws PortalException if the user was not an administrator
246            * @throws SystemException if a system exception occurred
247            */
248            public static void removePreferences(long companyId, java.lang.String[] keys)
249                    throws RemoteException {
250                    try {
251                            CompanyServiceUtil.removePreferences(companyId, keys);
252                    }
253                    catch (Exception e) {
254                            _log.error(e, e);
255    
256                            throw new RemoteException(e.getMessage());
257                    }
258            }
259    
260            /**
261            * Updates the company
262            *
263            * @param companyId the primary key of the company
264            * @param virtualHost the company's virtual host name
265            * @param mx the company's mail domain
266            * @param maxUsers the max number of company users (optionally
267            <code>0</code>)
268            * @param active whether the company is active
269            * @return the company with the primary key
270            * @throws PortalException if a company with the primary key could not be
271            found or if the new information was invalid or if the user was
272            not a universal administrator
273            * @throws SystemException if a system exception occurred
274            */
275            public static com.liferay.portal.model.CompanySoap updateCompany(
276                    long companyId, java.lang.String virtualHost, java.lang.String mx,
277                    int maxUsers, boolean active) throws RemoteException {
278                    try {
279                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId,
280                                            virtualHost, mx, maxUsers, active);
281    
282                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
283                    }
284                    catch (Exception e) {
285                            _log.error(e, e);
286    
287                            throw new RemoteException(e.getMessage());
288                    }
289            }
290    
291            /**
292            * Updates the company with additional account information.
293            *
294            * @param companyId the primary key of the company
295            * @param virtualHost the company's virtual host name
296            * @param mx the company's mail domain
297            * @param homeURL the company's home URL (optionally <code>null</code>)
298            * @param name the company's account name (optionally <code>null</code>)
299            * @param legalName the company's account legal name (optionally
300            <code>null</code>)
301            * @param legalId the company's account legal ID (optionally
302            <code>null</code>)
303            * @param legalType the company's account legal type (optionally
304            <code>null</code>)
305            * @param sicCode the company's account SIC code (optionally
306            <code>null</code>)
307            * @param tickerSymbol the company's account ticker symbol (optionally
308            <code>null</code>)
309            * @param industry the the company's account industry (optionally
310            <code>null</code>)
311            * @param type the company's account type (optionally <code>null</code>)
312            * @param size the company's account size (optionally <code>null</code>)
313            * @return the the company with the primary key
314            * @throws PortalException if a company with the primary key could not be
315            found or if the new information was invalid or if the user was
316            not an administrator
317            * @throws SystemException if a system exception occurred
318            */
319            public static com.liferay.portal.model.CompanySoap updateCompany(
320                    long companyId, java.lang.String virtualHost, java.lang.String mx,
321                    java.lang.String homeURL, java.lang.String name,
322                    java.lang.String legalName, java.lang.String legalId,
323                    java.lang.String legalType, java.lang.String sicCode,
324                    java.lang.String tickerSymbol, java.lang.String industry,
325                    java.lang.String type, java.lang.String size) throws RemoteException {
326                    try {
327                            com.liferay.portal.model.Company returnValue = CompanyServiceUtil.updateCompany(companyId,
328                                            virtualHost, mx, homeURL, name, legalName, legalId,
329                                            legalType, sicCode, tickerSymbol, industry, type, size);
330    
331                            return com.liferay.portal.model.CompanySoap.toSoapModel(returnValue);
332                    }
333                    catch (Exception e) {
334                            _log.error(e, e);
335    
336                            throw new RemoteException(e.getMessage());
337                    }
338            }
339    
340            /**
341            * Update the company's display.
342            *
343            * @param companyId the primary key of the company
344            * @param languageId the ID of the company's default user's language
345            * @param timeZoneId the ID of the company's default user's time zone
346            * @throws PortalException if the company's default user could not be found
347            or if the user was not an administrator
348            * @throws SystemException if a system exception occurred
349            */
350            public static void updateDisplay(long companyId,
351                    java.lang.String languageId, java.lang.String timeZoneId)
352                    throws RemoteException {
353                    try {
354                            CompanyServiceUtil.updateDisplay(companyId, languageId, timeZoneId);
355                    }
356                    catch (Exception e) {
357                            _log.error(e, e);
358    
359                            throw new RemoteException(e.getMessage());
360                    }
361            }
362    
363            /**
364            * Updates the company's security properties.
365            *
366            * @param companyId the primary key of the company
367            * @param authType the company's method of authenticating users
368            * @param autoLogin whether to allow users to select the "remember me"
369            feature
370            * @param sendPassword whether to allow users to ask the company to send
371            their passwords
372            * @param strangers whether to allow strangers to create accounts to
373            register themselves in the company
374            * @param strangersWithMx whether to allow strangers to create accounts
375            with email addresses that match the company mail suffix
376            * @param strangersVerify whether to require strangers who create accounts
377            to be verified via email
378            * @param siteLogo whether to to allow site administrators to use their own
379            logo instead of the enterprise logo
380            * @throws PortalException if the user was not an administrator
381            * @throws SystemException if a system exception occurred
382            */
383            public static void updateSecurity(long companyId,
384                    java.lang.String authType, boolean autoLogin, boolean sendPassword,
385                    boolean strangers, boolean strangersWithMx, boolean strangersVerify,
386                    boolean siteLogo) throws RemoteException {
387                    try {
388                            CompanyServiceUtil.updateSecurity(companyId, authType, autoLogin,
389                                    sendPassword, strangers, strangersWithMx, strangersVerify,
390                                    siteLogo);
391                    }
392                    catch (Exception e) {
393                            _log.error(e, e);
394    
395                            throw new RemoteException(e.getMessage());
396                    }
397            }
398    
399            private static Log _log = LogFactoryUtil.getLog(CompanyServiceSoap.class);
400    }