001    /**
002     * Copyright (c) 2000-2012 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.portlet.journal.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.LocalizationUtil;
020    
021    import com.liferay.portlet.journal.service.JournalStructureServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    import java.util.Locale;
026    import java.util.Map;
027    
028    /**
029     * <p>
030     * This class provides a SOAP utility for the
031     * {@link com.liferay.portlet.journal.service.JournalStructureServiceUtil} service utility. The
032     * static methods of this class calls the same methods of the service utility.
033     * However, the signatures are different because it is difficult for SOAP to
034     * support certain types.
035     * </p>
036     *
037     * <p>
038     * ServiceBuilder follows certain rules in translating the methods. For example,
039     * if the method in the service utility returns a {@link java.util.List}, that
040     * is translated to an array of {@link com.liferay.portlet.journal.model.JournalStructureSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.journal.model.JournalStructure}, that is translated to a
043     * {@link com.liferay.portlet.journal.model.JournalStructureSoap}. Methods that SOAP cannot
044     * safely wire are skipped.
045     * </p>
046     *
047     * <p>
048     * The benefits of using the SOAP utility is that it is cross platform
049     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
050     * even Perl, to call the generated services. One drawback of SOAP is that it is
051     * slow because it needs to serialize all calls into a text format (XML).
052     * </p>
053     *
054     * <p>
055     * You can see a list of services at http://localhost:8080/api/axis. Set the
056     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
057     * security.
058     * </p>
059     *
060     * <p>
061     * The SOAP utility is only generated for remote services.
062     * </p>
063     *
064     * @author    Brian Wing Shun Chan
065     * @see       JournalStructureServiceHttp
066     * @see       com.liferay.portlet.journal.model.JournalStructureSoap
067     * @see       com.liferay.portlet.journal.service.JournalStructureServiceUtil
068     * @generated
069     */
070    public class JournalStructureServiceSoap {
071            public static com.liferay.portlet.journal.model.JournalStructureSoap addStructure(
072                    long groupId, java.lang.String structureId, boolean autoStructureId,
073                    java.lang.String parentStructureId,
074                    java.lang.String[] nameMapLanguageIds,
075                    java.lang.String[] nameMapValues,
076                    java.lang.String[] descriptionMapLanguageIds,
077                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
078                    com.liferay.portal.service.ServiceContext serviceContext)
079                    throws RemoteException {
080                    try {
081                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
082                                            nameMapValues);
083                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
084                                            descriptionMapValues);
085    
086                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.addStructure(groupId,
087                                            structureId, autoStructureId, parentStructureId, nameMap,
088                                            descriptionMap, xsd, serviceContext);
089    
090                            return com.liferay.portlet.journal.model.JournalStructureSoap.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.portlet.journal.model.JournalStructureSoap copyStructure(
100                    long groupId, java.lang.String oldStructureId,
101                    java.lang.String newStructureId, boolean autoStructureId)
102                    throws RemoteException {
103                    try {
104                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.copyStructure(groupId,
105                                            oldStructureId, newStructureId, autoStructureId);
106    
107                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
108                    }
109                    catch (Exception e) {
110                            _log.error(e, e);
111    
112                            throw new RemoteException(e.getMessage());
113                    }
114            }
115    
116            public static void deleteStructure(long groupId,
117                    java.lang.String structureId) throws RemoteException {
118                    try {
119                            JournalStructureServiceUtil.deleteStructure(groupId, structureId);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            public static com.liferay.portlet.journal.model.JournalStructureSoap getStructure(
129                    long groupId, java.lang.String structureId) throws RemoteException {
130                    try {
131                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.getStructure(groupId,
132                                            structureId);
133    
134                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
135                    }
136                    catch (Exception e) {
137                            _log.error(e, e);
138    
139                            throw new RemoteException(e.getMessage());
140                    }
141            }
142    
143            public static com.liferay.portlet.journal.model.JournalStructureSoap[] getStructures(
144                    long groupId) throws RemoteException {
145                    try {
146                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
147                                    JournalStructureServiceUtil.getStructures(groupId);
148    
149                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            public static com.liferay.portlet.journal.model.JournalStructureSoap[] getStructures(
159                    long[] groupIds) throws RemoteException {
160                    try {
161                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
162                                    JournalStructureServiceUtil.getStructures(groupIds);
163    
164                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
165                    }
166                    catch (Exception e) {
167                            _log.error(e, e);
168    
169                            throw new RemoteException(e.getMessage());
170                    }
171            }
172    
173            public static com.liferay.portlet.journal.model.JournalStructureSoap[] search(
174                    long companyId, long[] groupIds, java.lang.String keywords, int start,
175                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
176                    throws RemoteException {
177                    try {
178                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
179                                    JournalStructureServiceUtil.search(companyId, groupIds,
180                                            keywords, start, end, obc);
181    
182                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
183                    }
184                    catch (Exception e) {
185                            _log.error(e, e);
186    
187                            throw new RemoteException(e.getMessage());
188                    }
189            }
190    
191            public static com.liferay.portlet.journal.model.JournalStructureSoap[] search(
192                    long companyId, long[] groupIds, java.lang.String structureId,
193                    java.lang.String name, java.lang.String description,
194                    boolean andOperator, int start, int end,
195                    com.liferay.portal.kernel.util.OrderByComparator obc)
196                    throws RemoteException {
197                    try {
198                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
199                                    JournalStructureServiceUtil.search(companyId, groupIds,
200                                            structureId, name, description, andOperator, start, end, obc);
201    
202                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
203                    }
204                    catch (Exception e) {
205                            _log.error(e, e);
206    
207                            throw new RemoteException(e.getMessage());
208                    }
209            }
210    
211            public static int searchCount(long companyId, long[] groupIds,
212                    java.lang.String keywords) throws RemoteException {
213                    try {
214                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
215                                            groupIds, keywords);
216    
217                            return returnValue;
218                    }
219                    catch (Exception e) {
220                            _log.error(e, e);
221    
222                            throw new RemoteException(e.getMessage());
223                    }
224            }
225    
226            public static int searchCount(long companyId, long[] groupIds,
227                    java.lang.String structureId, java.lang.String name,
228                    java.lang.String description, boolean andOperator)
229                    throws RemoteException {
230                    try {
231                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
232                                            groupIds, structureId, name, description, andOperator);
233    
234                            return returnValue;
235                    }
236                    catch (Exception e) {
237                            _log.error(e, e);
238    
239                            throw new RemoteException(e.getMessage());
240                    }
241            }
242    
243            public static com.liferay.portlet.journal.model.JournalStructureSoap updateStructure(
244                    long groupId, java.lang.String structureId,
245                    java.lang.String parentStructureId,
246                    java.lang.String[] nameMapLanguageIds,
247                    java.lang.String[] nameMapValues,
248                    java.lang.String[] descriptionMapLanguageIds,
249                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
250                    com.liferay.portal.service.ServiceContext serviceContext)
251                    throws RemoteException {
252                    try {
253                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
254                                            nameMapValues);
255                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
256                                            descriptionMapValues);
257    
258                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.updateStructure(groupId,
259                                            structureId, parentStructureId, nameMap, descriptionMap,
260                                            xsd, serviceContext);
261    
262                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
263                    }
264                    catch (Exception e) {
265                            _log.error(e, e);
266    
267                            throw new RemoteException(e.getMessage());
268                    }
269            }
270    
271            private static Log _log = LogFactoryUtil.getLog(JournalStructureServiceSoap.class);
272    }