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     * <p>
030     * This class provides a SOAP utility for the
031     * {@link com.liferay.portlet.journal.service.JournalTemplateServiceUtil} 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.JournalTemplateSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.journal.model.JournalTemplate}, that is translated to a
043     * {@link com.liferay.portlet.journal.model.JournalTemplateSoap}. 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       JournalTemplateServiceHttp
066     * @see       com.liferay.portlet.journal.model.JournalTemplateSoap
067     * @see       com.liferay.portlet.journal.service.JournalTemplateServiceUtil
068     * @generated
069     */
070    public class JournalTemplateServiceSoap {
071            public static com.liferay.portlet.journal.model.JournalTemplateSoap addTemplate(
072                    long groupId, java.lang.String templateId, boolean autoTemplateId,
073                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
074                    java.lang.String[] nameMapValues,
075                    java.lang.String[] descriptionMapLanguageIds,
076                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
077                    boolean formatXsl, java.lang.String langType, boolean cacheable,
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.JournalTemplate returnValue = JournalTemplateServiceUtil.addTemplate(groupId,
087                                            templateId, autoTemplateId, structureId, nameMap,
088                                            descriptionMap, xsl, formatXsl, langType, cacheable,
089                                            serviceContext);
090    
091                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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.JournalTemplateSoap copyTemplate(
101                    long groupId, java.lang.String oldTemplateId,
102                    java.lang.String newTemplateId, boolean autoTemplateId)
103                    throws RemoteException {
104                    try {
105                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.copyTemplate(groupId,
106                                            oldTemplateId, newTemplateId, autoTemplateId);
107    
108                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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 deleteTemplate(long groupId, java.lang.String templateId)
118                    throws RemoteException {
119                    try {
120                            JournalTemplateServiceUtil.deleteTemplate(groupId, templateId);
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.JournalTemplateSoap[] getStructureTemplates(
130                    long groupId, java.lang.String structureId) throws RemoteException {
131                    try {
132                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
133                                    JournalTemplateServiceUtil.getStructureTemplates(groupId,
134                                            structureId);
135    
136                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
137                    }
138                    catch (Exception e) {
139                            _log.error(e, e);
140    
141                            throw new RemoteException(e.getMessage());
142                    }
143            }
144    
145            public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
146                    long groupId, java.lang.String templateId) throws RemoteException {
147                    try {
148                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
149                                            templateId);
150    
151                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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.JournalTemplateSoap getTemplate(
161                    long groupId, java.lang.String templateId,
162                    boolean includeGlobalTemplates) throws RemoteException {
163                    try {
164                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
165                                            templateId, includeGlobalTemplates);
166    
167                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
168                    }
169                    catch (Exception e) {
170                            _log.error(e, e);
171    
172                            throw new RemoteException(e.getMessage());
173                    }
174            }
175    
176            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
177                    long companyId, long[] groupIds, java.lang.String keywords,
178                    java.lang.String structureId, java.lang.String structureIdComparator,
179                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
180                    throws RemoteException {
181                    try {
182                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
183                                    JournalTemplateServiceUtil.search(companyId, groupIds,
184                                            keywords, structureId, structureIdComparator, start, end,
185                                            obc);
186    
187                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
188                    }
189                    catch (Exception e) {
190                            _log.error(e, e);
191    
192                            throw new RemoteException(e.getMessage());
193                    }
194            }
195    
196            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
197                    long companyId, long[] groupIds, java.lang.String templateId,
198                    java.lang.String structureId, java.lang.String structureIdComparator,
199                    java.lang.String name, java.lang.String description,
200                    boolean andOperator, int start, int end,
201                    com.liferay.portal.kernel.util.OrderByComparator obc)
202                    throws RemoteException {
203                    try {
204                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
205                                    JournalTemplateServiceUtil.search(companyId, groupIds,
206                                            templateId, structureId, structureIdComparator, name,
207                                            description, andOperator, start, end, obc);
208    
209                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
210                    }
211                    catch (Exception e) {
212                            _log.error(e, e);
213    
214                            throw new RemoteException(e.getMessage());
215                    }
216            }
217    
218            public static int searchCount(long companyId, long[] groupIds,
219                    java.lang.String keywords, java.lang.String structureId,
220                    java.lang.String structureIdComparator) throws RemoteException {
221                    try {
222                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
223                                            groupIds, keywords, structureId, structureIdComparator);
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 templateId, java.lang.String structureId,
236                    java.lang.String structureIdComparator, java.lang.String name,
237                    java.lang.String description, boolean andOperator)
238                    throws RemoteException {
239                    try {
240                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
241                                            groupIds, templateId, structureId, structureIdComparator,
242                                            name, description, andOperator);
243    
244                            return returnValue;
245                    }
246                    catch (Exception e) {
247                            _log.error(e, e);
248    
249                            throw new RemoteException(e.getMessage());
250                    }
251            }
252    
253            public static com.liferay.portlet.journal.model.JournalTemplateSoap updateTemplate(
254                    long groupId, java.lang.String templateId,
255                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
256                    java.lang.String[] nameMapValues,
257                    java.lang.String[] descriptionMapLanguageIds,
258                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
259                    boolean formatXsl, java.lang.String langType, boolean cacheable,
260                    com.liferay.portal.service.ServiceContext serviceContext)
261                    throws RemoteException {
262                    try {
263                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
264                                            nameMapValues);
265                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
266                                            descriptionMapValues);
267    
268                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.updateTemplate(groupId,
269                                            templateId, structureId, nameMap, descriptionMap, xsl,
270                                            formatXsl, langType, cacheable, serviceContext);
271    
272                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
273                    }
274                    catch (Exception e) {
275                            _log.error(e, e);
276    
277                            throw new RemoteException(e.getMessage());
278                    }
279            }
280    
281            private static Log _log = LogFactoryUtil.getLog(JournalTemplateServiceSoap.class);
282    }