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.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
056     * http://localhost:8080/api/secure/axis. Set the property
057     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
058     * security.
059     * </p>
060     *
061     * <p>
062     * The SOAP utility is only generated for remote services.
063     * </p>
064     *
065     * @author    Brian Wing Shun Chan
066     * @see       JournalStructureServiceHttp
067     * @see       com.liferay.portlet.journal.model.JournalStructureSoap
068     * @see       com.liferay.portlet.journal.service.JournalStructureServiceUtil
069     * @generated
070     */
071    public class JournalStructureServiceSoap {
072            public static com.liferay.portlet.journal.model.JournalStructureSoap addStructure(
073                    long groupId, java.lang.String structureId, boolean autoStructureId,
074                    java.lang.String parentStructureId,
075                    java.lang.String[] nameMapLanguageIds,
076                    java.lang.String[] nameMapValues,
077                    java.lang.String[] descriptionMapLanguageIds,
078                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
079                    com.liferay.portal.service.ServiceContext serviceContext)
080                    throws RemoteException {
081                    try {
082                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
083                                            nameMapValues);
084                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
085                                            descriptionMapValues);
086    
087                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.addStructure(groupId,
088                                            structureId, autoStructureId, parentStructureId, nameMap,
089                                            descriptionMap, xsd, serviceContext);
090    
091                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
092                    }
093                    catch (Exception e) {
094                            _log.error(e, e);
095    
096                            throw new RemoteException(e.getMessage());
097                    }
098            }
099    
100            public static com.liferay.portlet.journal.model.JournalStructureSoap copyStructure(
101                    long groupId, java.lang.String oldStructureId,
102                    java.lang.String newStructureId, boolean autoStructureId)
103                    throws RemoteException {
104                    try {
105                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.copyStructure(groupId,
106                                            oldStructureId, newStructureId, autoStructureId);
107    
108                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
109                    }
110                    catch (Exception e) {
111                            _log.error(e, e);
112    
113                            throw new RemoteException(e.getMessage());
114                    }
115            }
116    
117            public static void deleteStructure(long groupId,
118                    java.lang.String structureId) throws RemoteException {
119                    try {
120                            JournalStructureServiceUtil.deleteStructure(groupId, structureId);
121                    }
122                    catch (Exception e) {
123                            _log.error(e, e);
124    
125                            throw new RemoteException(e.getMessage());
126                    }
127            }
128    
129            public static com.liferay.portlet.journal.model.JournalStructureSoap getStructure(
130                    long groupId, java.lang.String structureId) throws RemoteException {
131                    try {
132                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.getStructure(groupId,
133                                            structureId);
134    
135                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
136                    }
137                    catch (Exception e) {
138                            _log.error(e, e);
139    
140                            throw new RemoteException(e.getMessage());
141                    }
142            }
143    
144            public static com.liferay.portlet.journal.model.JournalStructureSoap getStructure(
145                    long groupId, java.lang.String structureId,
146                    boolean includeGlobalStructures) throws RemoteException {
147                    try {
148                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.getStructure(groupId,
149                                            structureId, includeGlobalStructures);
150    
151                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static com.liferay.portlet.journal.model.JournalStructureSoap[] getStructures(
161                    long groupId) throws RemoteException {
162                    try {
163                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
164                                    JournalStructureServiceUtil.getStructures(groupId);
165    
166                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
167                    }
168                    catch (Exception e) {
169                            _log.error(e, e);
170    
171                            throw new RemoteException(e.getMessage());
172                    }
173            }
174    
175            public static com.liferay.portlet.journal.model.JournalStructureSoap[] search(
176                    long companyId, long[] groupIds, java.lang.String keywords, int start,
177                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
178                    throws RemoteException {
179                    try {
180                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
181                                    JournalStructureServiceUtil.search(companyId, groupIds,
182                                            keywords, start, end, obc);
183    
184                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
185                    }
186                    catch (Exception e) {
187                            _log.error(e, e);
188    
189                            throw new RemoteException(e.getMessage());
190                    }
191            }
192    
193            public static com.liferay.portlet.journal.model.JournalStructureSoap[] search(
194                    long companyId, long[] groupIds, java.lang.String structureId,
195                    java.lang.String name, java.lang.String description,
196                    boolean andOperator, int start, int end,
197                    com.liferay.portal.kernel.util.OrderByComparator obc)
198                    throws RemoteException {
199                    try {
200                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
201                                    JournalStructureServiceUtil.search(companyId, groupIds,
202                                            structureId, name, description, andOperator, start, end, obc);
203    
204                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
205                    }
206                    catch (Exception e) {
207                            _log.error(e, e);
208    
209                            throw new RemoteException(e.getMessage());
210                    }
211            }
212    
213            public static int searchCount(long companyId, long[] groupIds,
214                    java.lang.String keywords) throws RemoteException {
215                    try {
216                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
217                                            groupIds, keywords);
218    
219                            return returnValue;
220                    }
221                    catch (Exception e) {
222                            _log.error(e, e);
223    
224                            throw new RemoteException(e.getMessage());
225                    }
226            }
227    
228            public static int searchCount(long companyId, long[] groupIds,
229                    java.lang.String structureId, java.lang.String name,
230                    java.lang.String description, boolean andOperator)
231                    throws RemoteException {
232                    try {
233                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
234                                            groupIds, structureId, name, description, andOperator);
235    
236                            return returnValue;
237                    }
238                    catch (Exception e) {
239                            _log.error(e, e);
240    
241                            throw new RemoteException(e.getMessage());
242                    }
243            }
244    
245            public static com.liferay.portlet.journal.model.JournalStructureSoap updateStructure(
246                    long groupId, java.lang.String structureId,
247                    java.lang.String parentStructureId,
248                    java.lang.String[] nameMapLanguageIds,
249                    java.lang.String[] nameMapValues,
250                    java.lang.String[] descriptionMapLanguageIds,
251                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
252                    com.liferay.portal.service.ServiceContext serviceContext)
253                    throws RemoteException {
254                    try {
255                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
256                                            nameMapValues);
257                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
258                                            descriptionMapValues);
259    
260                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.updateStructure(groupId,
261                                            structureId, parentStructureId, nameMap, descriptionMap,
262                                            xsd, serviceContext);
263    
264                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
265                    }
266                    catch (Exception e) {
267                            _log.error(e, e);
268    
269                            throw new RemoteException(e.getMessage());
270                    }
271            }
272    
273            private static Log _log = LogFactoryUtil.getLog(JournalStructureServiceSoap.class);
274    }