1
14
15 package com.liferay.portlet.shopping.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil;
25
26
63 public class ShoppingCategoryServiceHttp {
64 public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
65 HttpPrincipal httpPrincipal, long parentCategoryId,
66 java.lang.String name, java.lang.String description,
67 com.liferay.portal.service.ServiceContext serviceContext)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 try {
71 MethodKey methodKey = new MethodKey(ShoppingCategoryServiceUtil.class.getName(),
72 "addCategory", _addCategoryParameterTypes0);
73
74 MethodHandler methodHandler = new MethodHandler(methodKey,
75 parentCategoryId, name, description, serviceContext);
76
77 Object returnObj = null;
78
79 try {
80 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
81 }
82 catch (Exception e) {
83 if (e instanceof com.liferay.portal.PortalException) {
84 throw (com.liferay.portal.PortalException)e;
85 }
86
87 if (e instanceof com.liferay.portal.SystemException) {
88 throw (com.liferay.portal.SystemException)e;
89 }
90
91 throw new com.liferay.portal.SystemException(e);
92 }
93
94 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
95 }
96 catch (com.liferay.portal.SystemException se) {
97 _log.error(se, se);
98
99 throw se;
100 }
101 }
102
103 public static void deleteCategory(HttpPrincipal httpPrincipal,
104 long categoryId)
105 throws com.liferay.portal.PortalException,
106 com.liferay.portal.SystemException {
107 try {
108 MethodKey methodKey = new MethodKey(ShoppingCategoryServiceUtil.class.getName(),
109 "deleteCategory", _deleteCategoryParameterTypes1);
110
111 MethodHandler methodHandler = new MethodHandler(methodKey,
112 categoryId);
113
114 try {
115 TunnelUtil.invoke(httpPrincipal, methodHandler);
116 }
117 catch (Exception e) {
118 if (e instanceof com.liferay.portal.PortalException) {
119 throw (com.liferay.portal.PortalException)e;
120 }
121
122 if (e instanceof com.liferay.portal.SystemException) {
123 throw (com.liferay.portal.SystemException)e;
124 }
125
126 throw new com.liferay.portal.SystemException(e);
127 }
128 }
129 catch (com.liferay.portal.SystemException se) {
130 _log.error(se, se);
131
132 throw se;
133 }
134 }
135
136 public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
137 HttpPrincipal httpPrincipal, long categoryId)
138 throws com.liferay.portal.PortalException,
139 com.liferay.portal.SystemException {
140 try {
141 MethodKey methodKey = new MethodKey(ShoppingCategoryServiceUtil.class.getName(),
142 "getCategory", _getCategoryParameterTypes2);
143
144 MethodHandler methodHandler = new MethodHandler(methodKey,
145 categoryId);
146
147 Object returnObj = null;
148
149 try {
150 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
151 }
152 catch (Exception e) {
153 if (e instanceof com.liferay.portal.PortalException) {
154 throw (com.liferay.portal.PortalException)e;
155 }
156
157 if (e instanceof com.liferay.portal.SystemException) {
158 throw (com.liferay.portal.SystemException)e;
159 }
160
161 throw new com.liferay.portal.SystemException(e);
162 }
163
164 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
165 }
166 catch (com.liferay.portal.SystemException se) {
167 _log.error(se, se);
168
169 throw se;
170 }
171 }
172
173 public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
174 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
175 java.lang.String name, java.lang.String description,
176 boolean mergeWithParentCategory,
177 com.liferay.portal.service.ServiceContext serviceContext)
178 throws com.liferay.portal.PortalException,
179 com.liferay.portal.SystemException {
180 try {
181 MethodKey methodKey = new MethodKey(ShoppingCategoryServiceUtil.class.getName(),
182 "updateCategory", _updateCategoryParameterTypes3);
183
184 MethodHandler methodHandler = new MethodHandler(methodKey,
185 categoryId, parentCategoryId, name, description,
186 mergeWithParentCategory, serviceContext);
187
188 Object returnObj = null;
189
190 try {
191 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
192 }
193 catch (Exception e) {
194 if (e instanceof com.liferay.portal.PortalException) {
195 throw (com.liferay.portal.PortalException)e;
196 }
197
198 if (e instanceof com.liferay.portal.SystemException) {
199 throw (com.liferay.portal.SystemException)e;
200 }
201
202 throw new com.liferay.portal.SystemException(e);
203 }
204
205 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
206 }
207 catch (com.liferay.portal.SystemException se) {
208 _log.error(se, se);
209
210 throw se;
211 }
212 }
213
214 private static Log _log = LogFactoryUtil.getLog(ShoppingCategoryServiceHttp.class);
215 private static final Class<?>[] _addCategoryParameterTypes0 = new Class[] {
216 long.class, java.lang.String.class, java.lang.String.class,
217 com.liferay.portal.service.ServiceContext.class
218 };
219 private static final Class<?>[] _deleteCategoryParameterTypes1 = new Class[] {
220 long.class
221 };
222 private static final Class<?>[] _getCategoryParameterTypes2 = new Class[] {
223 long.class
224 };
225 private static final Class<?>[] _updateCategoryParameterTypes3 = new Class[] {
226 long.class, long.class, java.lang.String.class,
227 java.lang.String.class, boolean.class,
228 com.liferay.portal.service.ServiceContext.class
229 };
230 }