001
014
015 package com.liferay.portlet.expando.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.IntegerWrapper;
020 import com.liferay.portal.kernel.util.LongWrapper;
021 import com.liferay.portal.kernel.util.MethodWrapper;
022 import com.liferay.portal.kernel.util.NullWrapper;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.http.TunnelUtil;
025
026 import com.liferay.portlet.expando.service.ExpandoColumnServiceUtil;
027
028
058 public class ExpandoColumnServiceHttp {
059 public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
060 HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
061 int type)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 try {
065 Object paramObj0 = new LongWrapper(tableId);
066
067 Object paramObj1 = name;
068
069 if (name == null) {
070 paramObj1 = new NullWrapper("java.lang.String");
071 }
072
073 Object paramObj2 = new IntegerWrapper(type);
074
075 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
076 "addColumn",
077 new Object[] { paramObj0, paramObj1, paramObj2 });
078
079 Object returnObj = null;
080
081 try {
082 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
083 }
084 catch (Exception e) {
085 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
086 throw (com.liferay.portal.kernel.exception.PortalException)e;
087 }
088
089 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
090 throw (com.liferay.portal.kernel.exception.SystemException)e;
091 }
092
093 throw new com.liferay.portal.kernel.exception.SystemException(e);
094 }
095
096 return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
097 }
098 catch (com.liferay.portal.kernel.exception.SystemException se) {
099 _log.error(se, se);
100
101 throw se;
102 }
103 }
104
105 public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
106 HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
107 int type, java.lang.Object defaultData)
108 throws com.liferay.portal.kernel.exception.PortalException,
109 com.liferay.portal.kernel.exception.SystemException {
110 try {
111 Object paramObj0 = new LongWrapper(tableId);
112
113 Object paramObj1 = name;
114
115 if (name == null) {
116 paramObj1 = new NullWrapper("java.lang.String");
117 }
118
119 Object paramObj2 = new IntegerWrapper(type);
120
121 Object paramObj3 = defaultData;
122
123 if (defaultData == null) {
124 paramObj3 = new NullWrapper("java.lang.Object");
125 }
126
127 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
128 "addColumn",
129 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
130
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138 throw (com.liferay.portal.kernel.exception.PortalException)e;
139 }
140
141 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
142 throw (com.liferay.portal.kernel.exception.SystemException)e;
143 }
144
145 throw new com.liferay.portal.kernel.exception.SystemException(e);
146 }
147
148 return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
149 }
150 catch (com.liferay.portal.kernel.exception.SystemException se) {
151 _log.error(se, se);
152
153 throw se;
154 }
155 }
156
157 public static void deleteColumn(HttpPrincipal httpPrincipal, long columnId)
158 throws com.liferay.portal.kernel.exception.PortalException,
159 com.liferay.portal.kernel.exception.SystemException {
160 try {
161 Object paramObj0 = new LongWrapper(columnId);
162
163 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
164 "deleteColumn", new Object[] { paramObj0 });
165
166 try {
167 TunnelUtil.invoke(httpPrincipal, methodWrapper);
168 }
169 catch (Exception e) {
170 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
171 throw (com.liferay.portal.kernel.exception.PortalException)e;
172 }
173
174 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
175 throw (com.liferay.portal.kernel.exception.SystemException)e;
176 }
177
178 throw new com.liferay.portal.kernel.exception.SystemException(e);
179 }
180 }
181 catch (com.liferay.portal.kernel.exception.SystemException se) {
182 _log.error(se, se);
183
184 throw se;
185 }
186 }
187
188 public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
189 HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
190 int type)
191 throws com.liferay.portal.kernel.exception.PortalException,
192 com.liferay.portal.kernel.exception.SystemException {
193 try {
194 Object paramObj0 = new LongWrapper(columnId);
195
196 Object paramObj1 = name;
197
198 if (name == null) {
199 paramObj1 = new NullWrapper("java.lang.String");
200 }
201
202 Object paramObj2 = new IntegerWrapper(type);
203
204 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
205 "updateColumn",
206 new Object[] { paramObj0, paramObj1, paramObj2 });
207
208 Object returnObj = null;
209
210 try {
211 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
212 }
213 catch (Exception e) {
214 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
215 throw (com.liferay.portal.kernel.exception.PortalException)e;
216 }
217
218 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
219 throw (com.liferay.portal.kernel.exception.SystemException)e;
220 }
221
222 throw new com.liferay.portal.kernel.exception.SystemException(e);
223 }
224
225 return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
226 }
227 catch (com.liferay.portal.kernel.exception.SystemException se) {
228 _log.error(se, se);
229
230 throw se;
231 }
232 }
233
234 public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
235 HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
236 int type, java.lang.Object defaultData)
237 throws com.liferay.portal.kernel.exception.PortalException,
238 com.liferay.portal.kernel.exception.SystemException {
239 try {
240 Object paramObj0 = new LongWrapper(columnId);
241
242 Object paramObj1 = name;
243
244 if (name == null) {
245 paramObj1 = new NullWrapper("java.lang.String");
246 }
247
248 Object paramObj2 = new IntegerWrapper(type);
249
250 Object paramObj3 = defaultData;
251
252 if (defaultData == null) {
253 paramObj3 = new NullWrapper("java.lang.Object");
254 }
255
256 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
257 "updateColumn",
258 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
259
260 Object returnObj = null;
261
262 try {
263 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
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.expando.model.ExpandoColumn)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.expando.model.ExpandoColumn updateTypeSettings(
287 HttpPrincipal httpPrincipal, long columnId,
288 java.lang.String typeSettings)
289 throws com.liferay.portal.kernel.exception.PortalException,
290 com.liferay.portal.kernel.exception.SystemException {
291 try {
292 Object paramObj0 = new LongWrapper(columnId);
293
294 Object paramObj1 = typeSettings;
295
296 if (typeSettings == null) {
297 paramObj1 = new NullWrapper("java.lang.String");
298 }
299
300 MethodWrapper methodWrapper = new MethodWrapper(ExpandoColumnServiceUtil.class.getName(),
301 "updateTypeSettings", new Object[] { paramObj0, paramObj1 });
302
303 Object returnObj = null;
304
305 try {
306 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
307 }
308 catch (Exception e) {
309 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
310 throw (com.liferay.portal.kernel.exception.PortalException)e;
311 }
312
313 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
314 throw (com.liferay.portal.kernel.exception.SystemException)e;
315 }
316
317 throw new com.liferay.portal.kernel.exception.SystemException(e);
318 }
319
320 return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
321 }
322 catch (com.liferay.portal.kernel.exception.SystemException se) {
323 _log.error(se, se);
324
325 throw se;
326 }
327 }
328
329 private static Log _log = LogFactoryUtil.getLog(ExpandoColumnServiceHttp.class);
330 }