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