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.JournalStructureServiceUtil;
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.JournalStructureServiceUtil} 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.JournalStructureSoap}.
041     * If the method in the service utility returns a
042     * {@link com.liferay.portlet.journal.model.JournalStructure}, that is translated to a
043     * {@link com.liferay.portlet.journal.model.JournalStructureSoap}. 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       JournalStructureServiceHttp
067     * @see       com.liferay.portlet.journal.model.JournalStructureSoap
068     * @see       com.liferay.portlet.journal.service.JournalStructureServiceUtil
069     * @generated
070     */
071    public class JournalStructureServiceSoap {
072            public static com.liferay.portlet.journal.model.JournalStructureSoap addStructure(
073                    long groupId, java.lang.String structureId, boolean autoStructureId,
074                    java.lang.String parentStructureId,
075                    java.lang.String[] nameMapLanguageIds,
076                    java.lang.String[] nameMapValues,
077                    java.lang.String[] descriptionMapLanguageIds,
078                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
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.JournalStructure returnValue = JournalStructureServiceUtil.addStructure(groupId,
088                                            structureId, autoStructureId, parentStructureId, nameMap,
089                                            descriptionMap, xsd, serviceContext);
090    
091                            return com.liferay.portlet.journal.model.JournalStructureSoap.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.JournalStructureSoap copyStructure(
101                    long groupId, java.lang.String oldStructureId,
102                    java.lang.String newStructureId, boolean autoStructureId)
103                    throws RemoteException {
104                    try {
105                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.copyStructure(groupId,
106                                            oldStructureId, newStructureId, autoStructureId);
107    
108                            return com.liferay.portlet.journal.model.JournalStructureSoap.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 deleteStructure(long groupId,
118                    java.lang.String structureId) throws RemoteException {
119                    try {
120                            JournalStructureServiceUtil.deleteStructure(groupId, structureId);
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.JournalStructureSoap getStructure(
130                    long groupId, java.lang.String structureId) throws RemoteException {
131                    try {
132                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.getStructure(groupId,
133                                            structureId);
134    
135                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
136                    }
137                    catch (Exception e) {
138                            _log.error(e, e);
139    
140                            throw new RemoteException(e.getMessage());
141                    }
142            }
143    
144            public static com.liferay.portlet.journal.model.JournalStructureSoap[] getStructures(
145                    long groupId) throws RemoteException {
146                    try {
147                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
148                                    JournalStructureServiceUtil.getStructures(groupId);
149    
150                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static com.liferay.portlet.journal.model.JournalStructureSoap[] search(
160                    long companyId, long[] groupIds, java.lang.String keywords, int start,
161                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
162                    throws RemoteException {
163                    try {
164                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
165                                    JournalStructureServiceUtil.search(companyId, groupIds,
166                                            keywords, start, end, obc);
167    
168                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModels(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.JournalStructureSoap[] search(
178                    long companyId, long[] groupIds, java.lang.String structureId,
179                    java.lang.String name, java.lang.String description,
180                    boolean andOperator, int start, int end,
181                    com.liferay.portal.kernel.util.OrderByComparator obc)
182                    throws RemoteException {
183                    try {
184                            java.util.List<com.liferay.portlet.journal.model.JournalStructure> returnValue =
185                                    JournalStructureServiceUtil.search(companyId, groupIds,
186                                            structureId, name, description, andOperator, start, end, obc);
187    
188                            return com.liferay.portlet.journal.model.JournalStructureSoap.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 int searchCount(long companyId, long[] groupIds,
198                    java.lang.String keywords) throws RemoteException {
199                    try {
200                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
201                                            groupIds, keywords);
202    
203                            return returnValue;
204                    }
205                    catch (Exception e) {
206                            _log.error(e, e);
207    
208                            throw new RemoteException(e.getMessage());
209                    }
210            }
211    
212            public static int searchCount(long companyId, long[] groupIds,
213                    java.lang.String structureId, java.lang.String name,
214                    java.lang.String description, boolean andOperator)
215                    throws RemoteException {
216                    try {
217                            int returnValue = JournalStructureServiceUtil.searchCount(companyId,
218                                            groupIds, structureId, name, description, andOperator);
219    
220                            return returnValue;
221                    }
222                    catch (Exception e) {
223                            _log.error(e, e);
224    
225                            throw new RemoteException(e.getMessage());
226                    }
227            }
228    
229            public static com.liferay.portlet.journal.model.JournalStructureSoap updateStructure(
230                    long groupId, java.lang.String structureId,
231                    java.lang.String parentStructureId,
232                    java.lang.String[] nameMapLanguageIds,
233                    java.lang.String[] nameMapValues,
234                    java.lang.String[] descriptionMapLanguageIds,
235                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
236                    com.liferay.portal.service.ServiceContext serviceContext)
237                    throws RemoteException {
238                    try {
239                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
240                                            nameMapValues);
241                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
242                                            descriptionMapValues);
243    
244                            com.liferay.portlet.journal.model.JournalStructure returnValue = JournalStructureServiceUtil.updateStructure(groupId,
245                                            structureId, parentStructureId, nameMap, descriptionMap,
246                                            xsd, serviceContext);
247    
248                            return com.liferay.portlet.journal.model.JournalStructureSoap.toSoapModel(returnValue);
249                    }
250                    catch (Exception e) {
251                            _log.error(e, e);
252    
253                            throw new RemoteException(e.getMessage());
254                    }
255            }
256    
257            private static Log _log = LogFactoryUtil.getLog(JournalStructureServiceSoap.class);
258    }