001
014
015 package com.liferay.portlet.dynamicdatamapping.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.dynamicdatamapping.service.DDMTemplateServiceUtil;
022
023 import java.rmi.RemoteException;
024
025 import java.util.Locale;
026 import java.util.Map;
027
028
071 public class DDMTemplateServiceSoap {
072 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap addTemplate(
073 long groupId, long structureId, java.lang.String[] nameMapLanguageIds,
074 java.lang.String[] nameMapValues,
075 java.lang.String[] descriptionMapLanguageIds,
076 java.lang.String[] descriptionMapValues, java.lang.String type,
077 java.lang.String mode, java.lang.String language,
078 java.lang.String script,
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.dynamicdatamapping.model.DDMTemplate returnValue =
088 DDMTemplateServiceUtil.addTemplate(groupId, structureId,
089 nameMap, descriptionMap, type, mode, language, script,
090 serviceContext);
091
092 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.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.dynamicdatamapping.model.DDMTemplateSoap[] copyTemplates(
102 long structureId, long newStructureId, java.lang.String type,
103 com.liferay.portal.service.ServiceContext serviceContext)
104 throws RemoteException {
105 try {
106 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
107 DDMTemplateServiceUtil.copyTemplates(structureId,
108 newStructureId, type, serviceContext);
109
110 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
111 }
112 catch (Exception e) {
113 _log.error(e, e);
114
115 throw new RemoteException(e.getMessage());
116 }
117 }
118
119 public static void deleteTemplate(long templateId)
120 throws RemoteException {
121 try {
122 DDMTemplateServiceUtil.deleteTemplate(templateId);
123 }
124 catch (Exception e) {
125 _log.error(e, e);
126
127 throw new RemoteException(e.getMessage());
128 }
129 }
130
131 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate(
132 long templateId) throws RemoteException {
133 try {
134 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
135 DDMTemplateServiceUtil.getTemplate(templateId);
136
137 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(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.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates(
147 long structureId, java.lang.String type, java.lang.String mode)
148 throws RemoteException {
149 try {
150 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
151 DDMTemplateServiceUtil.getTemplates(structureId, type, mode);
152
153 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
154 }
155 catch (Exception e) {
156 _log.error(e, e);
157
158 throw new RemoteException(e.getMessage());
159 }
160 }
161
162 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search(
163 long companyId, long groupId, long structureId,
164 java.lang.String keywords, java.lang.String type,
165 java.lang.String mode, int start, int end,
166 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
167 throws RemoteException {
168 try {
169 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
170 DDMTemplateServiceUtil.search(companyId, groupId, structureId,
171 keywords, type, mode, start, end, orderByComparator);
172
173 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
174 }
175 catch (Exception e) {
176 _log.error(e, e);
177
178 throw new RemoteException(e.getMessage());
179 }
180 }
181
182 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search(
183 long companyId, long groupId, long structureId, java.lang.String name,
184 java.lang.String description, java.lang.String type,
185 java.lang.String mode, java.lang.String language, boolean andOperator,
186 int start, int end,
187 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
188 throws RemoteException {
189 try {
190 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue =
191 DDMTemplateServiceUtil.search(companyId, groupId, structureId,
192 name, description, type, mode, language, andOperator,
193 start, end, orderByComparator);
194
195 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue);
196 }
197 catch (Exception e) {
198 _log.error(e, e);
199
200 throw new RemoteException(e.getMessage());
201 }
202 }
203
204 public static int searchCount(long companyId, long groupId,
205 long structureId, java.lang.String keywords, java.lang.String type,
206 java.lang.String mode) throws RemoteException {
207 try {
208 int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
209 groupId, structureId, keywords, type, mode);
210
211 return returnValue;
212 }
213 catch (Exception e) {
214 _log.error(e, e);
215
216 throw new RemoteException(e.getMessage());
217 }
218 }
219
220 public static int searchCount(long companyId, long groupId,
221 long structureId, java.lang.String name, java.lang.String description,
222 java.lang.String type, java.lang.String mode,
223 java.lang.String language, boolean andOperator)
224 throws RemoteException {
225 try {
226 int returnValue = DDMTemplateServiceUtil.searchCount(companyId,
227 groupId, structureId, name, description, type, mode,
228 language, andOperator);
229
230 return returnValue;
231 }
232 catch (Exception e) {
233 _log.error(e, e);
234
235 throw new RemoteException(e.getMessage());
236 }
237 }
238
239 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap updateTemplate(
240 long templateId, java.lang.String[] nameMapLanguageIds,
241 java.lang.String[] nameMapValues,
242 java.lang.String[] descriptionMapLanguageIds,
243 java.lang.String[] descriptionMapValues, java.lang.String type,
244 java.lang.String mode, java.lang.String language,
245 java.lang.String script,
246 com.liferay.portal.service.ServiceContext serviceContext)
247 throws RemoteException {
248 try {
249 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
250 nameMapValues);
251 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
252 descriptionMapValues);
253
254 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue =
255 DDMTemplateServiceUtil.updateTemplate(templateId, nameMap,
256 descriptionMap, type, mode, language, script, serviceContext);
257
258 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue);
259 }
260 catch (Exception e) {
261 _log.error(e, e);
262
263 throw new RemoteException(e.getMessage());
264 }
265 }
266
267 private static Log _log = LogFactoryUtil.getLog(DDMTemplateServiceSoap.class);
268 }