001
014
015 package com.liferay.portlet.asset.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.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.http.TunnelUtil;
024
025 import com.liferay.portlet.asset.service.AssetCategoryPropertyServiceUtil;
026
027
057 public class AssetCategoryPropertyServiceHttp {
058 public static com.liferay.portlet.asset.model.AssetCategoryProperty addCategoryProperty(
059 HttpPrincipal httpPrincipal, long entryId, java.lang.String key,
060 java.lang.String value)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 Object paramObj0 = new LongWrapper(entryId);
065
066 Object paramObj1 = key;
067
068 if (key == null) {
069 paramObj1 = new NullWrapper("java.lang.String");
070 }
071
072 Object paramObj2 = value;
073
074 if (value == null) {
075 paramObj2 = new NullWrapper("java.lang.String");
076 }
077
078 MethodWrapper methodWrapper = new MethodWrapper(AssetCategoryPropertyServiceUtil.class.getName(),
079 "addCategoryProperty",
080 new Object[] { paramObj0, paramObj1, paramObj2 });
081
082 Object returnObj = null;
083
084 try {
085 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
086 }
087 catch (Exception e) {
088 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
089 throw (com.liferay.portal.kernel.exception.PortalException)e;
090 }
091
092 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
093 throw (com.liferay.portal.kernel.exception.SystemException)e;
094 }
095
096 throw new com.liferay.portal.kernel.exception.SystemException(e);
097 }
098
099 return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
100 }
101 catch (com.liferay.portal.kernel.exception.SystemException se) {
102 _log.error(se, se);
103
104 throw se;
105 }
106 }
107
108 public static void deleteCategoryProperty(HttpPrincipal httpPrincipal,
109 long categoryPropertyId)
110 throws com.liferay.portal.kernel.exception.PortalException,
111 com.liferay.portal.kernel.exception.SystemException {
112 try {
113 Object paramObj0 = new LongWrapper(categoryPropertyId);
114
115 MethodWrapper methodWrapper = new MethodWrapper(AssetCategoryPropertyServiceUtil.class.getName(),
116 "deleteCategoryProperty", new Object[] { paramObj0 });
117
118 try {
119 TunnelUtil.invoke(httpPrincipal, methodWrapper);
120 }
121 catch (Exception e) {
122 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
123 throw (com.liferay.portal.kernel.exception.PortalException)e;
124 }
125
126 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
127 throw (com.liferay.portal.kernel.exception.SystemException)e;
128 }
129
130 throw new com.liferay.portal.kernel.exception.SystemException(e);
131 }
132 }
133 catch (com.liferay.portal.kernel.exception.SystemException se) {
134 _log.error(se, se);
135
136 throw se;
137 }
138 }
139
140 public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryProperties(
141 HttpPrincipal httpPrincipal, long entryId)
142 throws com.liferay.portal.kernel.exception.SystemException {
143 try {
144 Object paramObj0 = new LongWrapper(entryId);
145
146 MethodWrapper methodWrapper = new MethodWrapper(AssetCategoryPropertyServiceUtil.class.getName(),
147 "getCategoryProperties", new Object[] { paramObj0 });
148
149 Object returnObj = null;
150
151 try {
152 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
153 }
154 catch (Exception e) {
155 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156 throw (com.liferay.portal.kernel.exception.SystemException)e;
157 }
158
159 throw new com.liferay.portal.kernel.exception.SystemException(e);
160 }
161
162 return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
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 java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryPropertyValues(
172 HttpPrincipal httpPrincipal, long companyId, java.lang.String key)
173 throws com.liferay.portal.kernel.exception.SystemException {
174 try {
175 Object paramObj0 = new LongWrapper(companyId);
176
177 Object paramObj1 = key;
178
179 if (key == null) {
180 paramObj1 = new NullWrapper("java.lang.String");
181 }
182
183 MethodWrapper methodWrapper = new MethodWrapper(AssetCategoryPropertyServiceUtil.class.getName(),
184 "getCategoryPropertyValues",
185 new Object[] { paramObj0, paramObj1 });
186
187 Object returnObj = null;
188
189 try {
190 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
191 }
192 catch (Exception e) {
193 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
194 throw (com.liferay.portal.kernel.exception.SystemException)e;
195 }
196
197 throw new com.liferay.portal.kernel.exception.SystemException(e);
198 }
199
200 return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
201 }
202 catch (com.liferay.portal.kernel.exception.SystemException se) {
203 _log.error(se, se);
204
205 throw se;
206 }
207 }
208
209 public static com.liferay.portlet.asset.model.AssetCategoryProperty updateCategoryProperty(
210 HttpPrincipal httpPrincipal, long categoryPropertyId,
211 java.lang.String key, java.lang.String value)
212 throws com.liferay.portal.kernel.exception.PortalException,
213 com.liferay.portal.kernel.exception.SystemException {
214 try {
215 Object paramObj0 = new LongWrapper(categoryPropertyId);
216
217 Object paramObj1 = key;
218
219 if (key == null) {
220 paramObj1 = new NullWrapper("java.lang.String");
221 }
222
223 Object paramObj2 = value;
224
225 if (value == null) {
226 paramObj2 = new NullWrapper("java.lang.String");
227 }
228
229 MethodWrapper methodWrapper = new MethodWrapper(AssetCategoryPropertyServiceUtil.class.getName(),
230 "updateCategoryProperty",
231 new Object[] { paramObj0, paramObj1, paramObj2 });
232
233 Object returnObj = null;
234
235 try {
236 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
237 }
238 catch (Exception e) {
239 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
240 throw (com.liferay.portal.kernel.exception.PortalException)e;
241 }
242
243 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
244 throw (com.liferay.portal.kernel.exception.SystemException)e;
245 }
246
247 throw new com.liferay.portal.kernel.exception.SystemException(e);
248 }
249
250 return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
251 }
252 catch (com.liferay.portal.kernel.exception.SystemException se) {
253 _log.error(se, se);
254
255 throw se;
256 }
257 }
258
259 private static Log _log = LogFactoryUtil.getLog(AssetCategoryPropertyServiceHttp.class);
260 }