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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil;
025
026
056 public class DDMStructureServiceHttp {
057 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
058 HttpPrincipal httpPrincipal, long groupId, long classNameId,
059 java.lang.String structureKey,
060 java.util.Map<java.util.Locale, java.lang.String> nameMap,
061 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
062 java.lang.String xsd, java.lang.String storageType, int type,
063 com.liferay.portal.service.ServiceContext serviceContext)
064 throws com.liferay.portal.kernel.exception.PortalException,
065 com.liferay.portal.kernel.exception.SystemException {
066 try {
067 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
068 "addStructure", _addStructureParameterTypes0);
069
070 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
071 classNameId, structureKey, nameMap, descriptionMap, xsd,
072 storageType, type, serviceContext);
073
074 Object returnObj = null;
075
076 try {
077 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
078 }
079 catch (Exception e) {
080 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081 throw (com.liferay.portal.kernel.exception.PortalException)e;
082 }
083
084 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085 throw (com.liferay.portal.kernel.exception.SystemException)e;
086 }
087
088 throw new com.liferay.portal.kernel.exception.SystemException(e);
089 }
090
091 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
092 }
093 catch (com.liferay.portal.kernel.exception.SystemException se) {
094 _log.error(se, se);
095
096 throw se;
097 }
098 }
099
100 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure(
101 HttpPrincipal httpPrincipal, long structureId,
102 com.liferay.portal.service.ServiceContext serviceContext)
103 throws com.liferay.portal.kernel.exception.PortalException,
104 com.liferay.portal.kernel.exception.SystemException {
105 try {
106 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
107 "copyStructure", _copyStructureParameterTypes1);
108
109 MethodHandler methodHandler = new MethodHandler(methodKey,
110 structureId, serviceContext);
111
112 Object returnObj = null;
113
114 try {
115 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
116 }
117 catch (Exception e) {
118 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
119 throw (com.liferay.portal.kernel.exception.PortalException)e;
120 }
121
122 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
123 throw (com.liferay.portal.kernel.exception.SystemException)e;
124 }
125
126 throw new com.liferay.portal.kernel.exception.SystemException(e);
127 }
128
129 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
130 }
131 catch (com.liferay.portal.kernel.exception.SystemException se) {
132 _log.error(se, se);
133
134 throw se;
135 }
136 }
137
138 public static void deleteStructure(HttpPrincipal httpPrincipal,
139 long structureId)
140 throws com.liferay.portal.kernel.exception.PortalException,
141 com.liferay.portal.kernel.exception.SystemException {
142 try {
143 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
144 "deleteStructure", _deleteStructureParameterTypes2);
145
146 MethodHandler methodHandler = new MethodHandler(methodKey,
147 structureId);
148
149 try {
150 TunnelUtil.invoke(httpPrincipal, methodHandler);
151 }
152 catch (Exception e) {
153 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
154 throw (com.liferay.portal.kernel.exception.PortalException)e;
155 }
156
157 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158 throw (com.liferay.portal.kernel.exception.SystemException)e;
159 }
160
161 throw new com.liferay.portal.kernel.exception.SystemException(e);
162 }
163 }
164 catch (com.liferay.portal.kernel.exception.SystemException se) {
165 _log.error(se, se);
166
167 throw se;
168 }
169 }
170
171 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure(
172 HttpPrincipal httpPrincipal, long groupId, java.lang.String structureKey)
173 throws com.liferay.portal.kernel.exception.PortalException,
174 com.liferay.portal.kernel.exception.SystemException {
175 try {
176 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
177 "fetchStructure", _fetchStructureParameterTypes3);
178
179 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
180 structureKey);
181
182 Object returnObj = null;
183
184 try {
185 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186 }
187 catch (Exception e) {
188 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189 throw (com.liferay.portal.kernel.exception.PortalException)e;
190 }
191
192 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193 throw (com.liferay.portal.kernel.exception.SystemException)e;
194 }
195
196 throw new com.liferay.portal.kernel.exception.SystemException(e);
197 }
198
199 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
200 }
201 catch (com.liferay.portal.kernel.exception.SystemException se) {
202 _log.error(se, se);
203
204 throw se;
205 }
206 }
207
208 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
209 HttpPrincipal httpPrincipal, long structureId)
210 throws com.liferay.portal.kernel.exception.PortalException,
211 com.liferay.portal.kernel.exception.SystemException {
212 try {
213 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
214 "getStructure", _getStructureParameterTypes4);
215
216 MethodHandler methodHandler = new MethodHandler(methodKey,
217 structureId);
218
219 Object returnObj = null;
220
221 try {
222 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
223 }
224 catch (Exception e) {
225 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
226 throw (com.liferay.portal.kernel.exception.PortalException)e;
227 }
228
229 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
230 throw (com.liferay.portal.kernel.exception.SystemException)e;
231 }
232
233 throw new com.liferay.portal.kernel.exception.SystemException(e);
234 }
235
236 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
237 }
238 catch (com.liferay.portal.kernel.exception.SystemException se) {
239 _log.error(se, se);
240
241 throw se;
242 }
243 }
244
245 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
246 HttpPrincipal httpPrincipal, long structureId,
247 java.util.Map<java.util.Locale, java.lang.String> nameMap,
248 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
249 java.lang.String xsd,
250 com.liferay.portal.service.ServiceContext serviceContext)
251 throws com.liferay.portal.kernel.exception.PortalException,
252 com.liferay.portal.kernel.exception.SystemException {
253 try {
254 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
255 "updateStructure", _updateStructureParameterTypes5);
256
257 MethodHandler methodHandler = new MethodHandler(methodKey,
258 structureId, nameMap, descriptionMap, xsd, serviceContext);
259
260 Object returnObj = null;
261
262 try {
263 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
264 }
265 catch (Exception e) {
266 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
267 throw (com.liferay.portal.kernel.exception.PortalException)e;
268 }
269
270 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
271 throw (com.liferay.portal.kernel.exception.SystemException)e;
272 }
273
274 throw new com.liferay.portal.kernel.exception.SystemException(e);
275 }
276
277 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
278 }
279 catch (com.liferay.portal.kernel.exception.SystemException se) {
280 _log.error(se, se);
281
282 throw se;
283 }
284 }
285
286 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
287 HttpPrincipal httpPrincipal, long groupId,
288 java.lang.String structureKey,
289 java.util.Map<java.util.Locale, java.lang.String> nameMap,
290 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
291 java.lang.String xsd,
292 com.liferay.portal.service.ServiceContext serviceContext)
293 throws com.liferay.portal.kernel.exception.PortalException,
294 com.liferay.portal.kernel.exception.SystemException {
295 try {
296 MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
297 "updateStructure", _updateStructureParameterTypes6);
298
299 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
300 structureKey, nameMap, descriptionMap, xsd, serviceContext);
301
302 Object returnObj = null;
303
304 try {
305 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
306 }
307 catch (Exception e) {
308 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
309 throw (com.liferay.portal.kernel.exception.PortalException)e;
310 }
311
312 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
313 throw (com.liferay.portal.kernel.exception.SystemException)e;
314 }
315
316 throw new com.liferay.portal.kernel.exception.SystemException(e);
317 }
318
319 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
320 }
321 catch (com.liferay.portal.kernel.exception.SystemException se) {
322 _log.error(se, se);
323
324 throw se;
325 }
326 }
327
328 private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceHttp.class);
329 private static final Class<?>[] _addStructureParameterTypes0 = new Class[] {
330 long.class, long.class, java.lang.String.class, java.util.Map.class,
331 java.util.Map.class, java.lang.String.class, java.lang.String.class,
332 int.class, com.liferay.portal.service.ServiceContext.class
333 };
334 private static final Class<?>[] _copyStructureParameterTypes1 = new Class[] {
335 long.class, com.liferay.portal.service.ServiceContext.class
336 };
337 private static final Class<?>[] _deleteStructureParameterTypes2 = new Class[] {
338 long.class
339 };
340 private static final Class<?>[] _fetchStructureParameterTypes3 = new Class[] {
341 long.class, java.lang.String.class
342 };
343 private static final Class<?>[] _getStructureParameterTypes4 = new Class[] {
344 long.class
345 };
346 private static final Class<?>[] _updateStructureParameterTypes5 = new Class[] {
347 long.class, java.util.Map.class, java.util.Map.class,
348 java.lang.String.class,
349 com.liferay.portal.service.ServiceContext.class
350 };
351 private static final Class<?>[] _updateStructureParameterTypes6 = new Class[] {
352 long.class, java.lang.String.class, java.util.Map.class,
353 java.util.Map.class, java.lang.String.class,
354 com.liferay.portal.service.ServiceContext.class
355 };
356 }