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