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
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       JournalTemplateServiceHttp
067     * @see       com.liferay.portlet.journal.model.JournalTemplateSoap
068     * @see       com.liferay.portlet.journal.service.JournalTemplateServiceUtil
069     * @generated
070     */
071    public class JournalTemplateServiceSoap {
072            public static com.liferay.portlet.journal.model.JournalTemplateSoap addTemplate(
073                    long groupId, java.lang.String templateId, boolean autoTemplateId,
074                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
075                    java.lang.String[] nameMapValues,
076                    java.lang.String[] descriptionMapLanguageIds,
077                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
078                    boolean formatXsl, java.lang.String langType, boolean cacheable,
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.JournalTemplate returnValue = JournalTemplateServiceUtil.addTemplate(groupId,
088                                            templateId, autoTemplateId, structureId, nameMap,
089                                            descriptionMap, xsl, formatXsl, langType, cacheable,
090                                            serviceContext);
091    
092                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
093                    }
094                    catch (Exception e) {
095                            _log.error(e, e);
096    
097                            throw new RemoteException(e.getMessage());
098                    }
099            }
100    
101            public static com.liferay.portlet.journal.model.JournalTemplateSoap copyTemplate(
102                    long groupId, java.lang.String oldTemplateId,
103                    java.lang.String newTemplateId, boolean autoTemplateId)
104                    throws RemoteException {
105                    try {
106                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.copyTemplate(groupId,
107                                            oldTemplateId, newTemplateId, autoTemplateId);
108    
109                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
110                    }
111                    catch (Exception e) {
112                            _log.error(e, e);
113    
114                            throw new RemoteException(e.getMessage());
115                    }
116            }
117    
118            public static void deleteTemplate(long groupId, java.lang.String templateId)
119                    throws RemoteException {
120                    try {
121                            JournalTemplateServiceUtil.deleteTemplate(groupId, templateId);
122                    }
123                    catch (Exception e) {
124                            _log.error(e, e);
125    
126                            throw new RemoteException(e.getMessage());
127                    }
128            }
129    
130            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] getStructureTemplates(
131                    long groupId, java.lang.String structureId) throws RemoteException {
132                    try {
133                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
134                                    JournalTemplateServiceUtil.getStructureTemplates(groupId,
135                                            structureId);
136    
137                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
138                    }
139                    catch (Exception e) {
140                            _log.error(e, e);
141    
142                            throw new RemoteException(e.getMessage());
143                    }
144            }
145    
146            public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
147                    long groupId, java.lang.String templateId) throws RemoteException {
148                    try {
149                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
150                                            templateId);
151    
152                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
153                    }
154                    catch (Exception e) {
155                            _log.error(e, e);
156    
157                            throw new RemoteException(e.getMessage());
158                    }
159            }
160    
161            public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
162                    long groupId, java.lang.String templateId,
163                    boolean includeGlobalTemplates) throws RemoteException {
164                    try {
165                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.getTemplate(groupId,
166                                            templateId, includeGlobalTemplates);
167    
168                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
169                    }
170                    catch (Exception e) {
171                            _log.error(e, e);
172    
173                            throw new RemoteException(e.getMessage());
174                    }
175            }
176    
177            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
178                    long companyId, long[] groupIds, java.lang.String keywords,
179                    java.lang.String structureId, java.lang.String structureIdComparator,
180                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
181                    throws RemoteException {
182                    try {
183                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
184                                    JournalTemplateServiceUtil.search(companyId, groupIds,
185                                            keywords, structureId, structureIdComparator, start, end,
186                                            obc);
187    
188                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
189                    }
190                    catch (Exception e) {
191                            _log.error(e, e);
192    
193                            throw new RemoteException(e.getMessage());
194                    }
195            }
196    
197            public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
198                    long companyId, long[] groupIds, java.lang.String templateId,
199                    java.lang.String structureId, java.lang.String structureIdComparator,
200                    java.lang.String name, java.lang.String description,
201                    boolean andOperator, int start, int end,
202                    com.liferay.portal.kernel.util.OrderByComparator obc)
203                    throws RemoteException {
204                    try {
205                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
206                                    JournalTemplateServiceUtil.search(companyId, groupIds,
207                                            templateId, structureId, structureIdComparator, name,
208                                            description, andOperator, start, end, obc);
209    
210                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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, java.lang.String structureId,
221                    java.lang.String structureIdComparator) throws RemoteException {
222                    try {
223                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
224                                            groupIds, keywords, structureId, structureIdComparator);
225    
226                            return returnValue;
227                    }
228                    catch (Exception e) {
229                            _log.error(e, e);
230    
231                            throw new RemoteException(e.getMessage());
232                    }
233            }
234    
235            public static int searchCount(long companyId, long[] groupIds,
236                    java.lang.String templateId, java.lang.String structureId,
237                    java.lang.String structureIdComparator, java.lang.String name,
238                    java.lang.String description, boolean andOperator)
239                    throws RemoteException {
240                    try {
241                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
242                                            groupIds, templateId, structureId, structureIdComparator,
243                                            name, description, andOperator);
244    
245                            return returnValue;
246                    }
247                    catch (Exception e) {
248                            _log.error(e, e);
249    
250                            throw new RemoteException(e.getMessage());
251                    }
252            }
253    
254            public static com.liferay.portlet.journal.model.JournalTemplateSoap updateTemplate(
255                    long groupId, java.lang.String templateId,
256                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
257                    java.lang.String[] nameMapValues,
258                    java.lang.String[] descriptionMapLanguageIds,
259                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
260                    boolean formatXsl, java.lang.String langType, boolean cacheable,
261                    com.liferay.portal.service.ServiceContext serviceContext)
262                    throws RemoteException {
263                    try {
264                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
265                                            nameMapValues);
266                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
267                                            descriptionMapValues);
268    
269                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.updateTemplate(groupId,
270                                            templateId, structureId, nameMap, descriptionMap, xsl,
271                                            formatXsl, langType, cacheable, serviceContext);
272    
273                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
274                    }
275                    catch (Exception e) {
276                            _log.error(e, e);
277    
278                            throw new RemoteException(e.getMessage());
279                    }
280            }
281    
282            private static Log _log = LogFactoryUtil.getLog(JournalTemplateServiceSoap.class);
283    }