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.JournalTemplateServiceUtil;
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.JournalTemplateServiceUtil} 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 JournalTemplateServiceHttp
056     * @see com.liferay.portlet.journal.service.JournalTemplateServiceUtil
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 JournalTemplateServiceSoap {
063            public static com.liferay.portlet.journal.model.JournalTemplateSoap addTemplate(
064                    long groupId, java.lang.String templateId, boolean autoTemplateId,
065                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
066                    java.lang.String[] nameMapValues,
067                    java.lang.String[] descriptionMapLanguageIds,
068                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
069                    boolean formatXsl, java.lang.String langType, boolean cacheable,
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.JournalTemplate returnValue = JournalTemplateServiceUtil.addTemplate(groupId,
079                                            templateId, autoTemplateId, structureId, nameMap,
080                                            descriptionMap, xsl, formatXsl, langType, cacheable,
081                                            serviceContext);
082    
083                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static com.liferay.portlet.journal.model.JournalTemplateSoap copyTemplate(
093                    long groupId, java.lang.String oldTemplateId,
094                    java.lang.String newTemplateId, boolean autoTemplateId)
095                    throws RemoteException {
096                    try {
097                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.copyTemplate(groupId,
098                                            oldTemplateId, newTemplateId, autoTemplateId);
099    
100                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
101                    }
102                    catch (Exception e) {
103                            _log.error(e, e);
104    
105                            throw new RemoteException(e.getMessage());
106                    }
107            }
108    
109            public static void deleteTemplate(long groupId, java.lang.String templateId)
110                    throws RemoteException {
111                    try {
112                            JournalTemplateServiceUtil.deleteTemplate(groupId, templateId);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] getStructureTemplates(
122                    long groupId, java.lang.String structureId) throws RemoteException {
123                    try {
124                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
125                                    JournalTemplateServiceUtil.getStructureTemplates(groupId,
126                                            structureId);
127    
128                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
129                    }
130                    catch (Exception e) {
131                            _log.error(e, e);
132    
133                            throw new RemoteException(e.getMessage());
134                    }
135            }
136    
137            public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
138                    long groupId, java.lang.String templateId) throws RemoteException {
139                    try {
140                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
141                                            templateId);
142    
143                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
144                    }
145                    catch (Exception e) {
146                            _log.error(e, e);
147    
148                            throw new RemoteException(e.getMessage());
149                    }
150            }
151    
152            public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
153                    long groupId, java.lang.String templateId,
154                    boolean includeGlobalTemplates) throws RemoteException {
155                    try {
156                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
157                                            templateId, includeGlobalTemplates);
158    
159                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
160                    }
161                    catch (Exception e) {
162                            _log.error(e, e);
163    
164                            throw new RemoteException(e.getMessage());
165                    }
166            }
167    
168            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
169                    long companyId, long[] groupIds, java.lang.String keywords,
170                    java.lang.String structureId, java.lang.String structureIdComparator,
171                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
172                    throws RemoteException {
173                    try {
174                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
175                                    JournalTemplateServiceUtil.search(companyId, groupIds,
176                                            keywords, structureId, structureIdComparator, start, end,
177                                            obc);
178    
179                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
180                    }
181                    catch (Exception e) {
182                            _log.error(e, e);
183    
184                            throw new RemoteException(e.getMessage());
185                    }
186            }
187    
188            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
189                    long companyId, long[] groupIds, java.lang.String templateId,
190                    java.lang.String structureId, java.lang.String structureIdComparator,
191                    java.lang.String name, java.lang.String description,
192                    boolean andOperator, int start, int end,
193                    com.liferay.portal.kernel.util.OrderByComparator obc)
194                    throws RemoteException {
195                    try {
196                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
197                                    JournalTemplateServiceUtil.search(companyId, groupIds,
198                                            templateId, structureId, structureIdComparator, name,
199                                            description, andOperator, start, end, obc);
200    
201                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
202                    }
203                    catch (Exception e) {
204                            _log.error(e, e);
205    
206                            throw new RemoteException(e.getMessage());
207                    }
208            }
209    
210            public static int searchCount(long companyId, long[] groupIds,
211                    java.lang.String keywords, java.lang.String structureId,
212                    java.lang.String structureIdComparator) throws RemoteException {
213                    try {
214                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
215                                            groupIds, keywords, structureId, structureIdComparator);
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 templateId, java.lang.String structureId,
228                    java.lang.String structureIdComparator, java.lang.String name,
229                    java.lang.String description, boolean andOperator)
230                    throws RemoteException {
231                    try {
232                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
233                                            groupIds, templateId, structureId, structureIdComparator,
234                                            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.JournalTemplateSoap updateTemplate(
246                    long groupId, java.lang.String templateId,
247                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
248                    java.lang.String[] nameMapValues,
249                    java.lang.String[] descriptionMapLanguageIds,
250                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
251                    boolean formatXsl, java.lang.String langType, boolean cacheable,
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.JournalTemplate returnValue = JournalTemplateServiceUtil.updateTemplate(groupId,
261                                            templateId, structureId, nameMap, descriptionMap, xsl,
262                                            formatXsl, langType, cacheable, serviceContext);
263    
264                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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(JournalTemplateServiceSoap.class);
274    }