001    /**
002     * Copyright (c) 2000-2012 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[] search(
162                    long companyId, long[] groupIds, java.lang.String keywords,
163                    java.lang.String structureId, java.lang.String structureIdComparator,
164                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
165                    throws RemoteException {
166                    try {
167                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
168                                    JournalTemplateServiceUtil.search(companyId, groupIds,
169                                            keywords, structureId, structureIdComparator, start, end,
170                                            obc);
171    
172                            return com.liferay.portlet.journal.model.JournalTemplateSoap.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.JournalTemplateSoap[] search(
182                    long companyId, long[] groupIds, java.lang.String templateId,
183                    java.lang.String structureId, java.lang.String structureIdComparator,
184                    java.lang.String name, java.lang.String description,
185                    boolean andOperator, int start, int end,
186                    com.liferay.portal.kernel.util.OrderByComparator obc)
187                    throws RemoteException {
188                    try {
189                            java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
190                                    JournalTemplateServiceUtil.search(companyId, groupIds,
191                                            templateId, structureId, structureIdComparator, name,
192                                            description, andOperator, start, end, obc);
193    
194                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            public static int searchCount(long companyId, long[] groupIds,
204                    java.lang.String keywords, java.lang.String structureId,
205                    java.lang.String structureIdComparator) throws RemoteException {
206                    try {
207                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
208                                            groupIds, keywords, structureId, structureIdComparator);
209    
210                            return 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 templateId, java.lang.String structureId,
221                    java.lang.String structureIdComparator, java.lang.String name,
222                    java.lang.String description, boolean andOperator)
223                    throws RemoteException {
224                    try {
225                            int returnValue = JournalTemplateServiceUtil.searchCount(companyId,
226                                            groupIds, templateId, structureId, structureIdComparator,
227                                            name, description, andOperator);
228    
229                            return returnValue;
230                    }
231                    catch (Exception e) {
232                            _log.error(e, e);
233    
234                            throw new RemoteException(e.getMessage());
235                    }
236            }
237    
238            public static com.liferay.portlet.journal.model.JournalTemplateSoap updateTemplate(
239                    long groupId, java.lang.String templateId,
240                    java.lang.String structureId, java.lang.String[] nameMapLanguageIds,
241                    java.lang.String[] nameMapValues,
242                    java.lang.String[] descriptionMapLanguageIds,
243                    java.lang.String[] descriptionMapValues, java.lang.String xsl,
244                    boolean formatXsl, java.lang.String langType, boolean cacheable,
245                    com.liferay.portal.service.ServiceContext serviceContext)
246                    throws RemoteException {
247                    try {
248                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
249                                            nameMapValues);
250                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
251                                            descriptionMapValues);
252    
253                            com.liferay.portlet.journal.model.JournalTemplate returnValue = JournalTemplateServiceUtil.updateTemplate(groupId,
254                                            templateId, structureId, nameMap, descriptionMap, xsl,
255                                            formatXsl, langType, cacheable, serviceContext);
256    
257                            return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
258                    }
259                    catch (Exception e) {
260                            _log.error(e, e);
261    
262                            throw new RemoteException(e.getMessage());
263                    }
264            }
265    
266            private static Log _log = LogFactoryUtil.getLog(JournalTemplateServiceSoap.class);
267    }