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