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.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.asset.service.AssetCategoryPropertyServiceUtil;
025
026
056 public class AssetCategoryPropertyServiceHttp {
057 public static com.liferay.portlet.asset.model.AssetCategoryProperty addCategoryProperty(
058 HttpPrincipal httpPrincipal, long entryId, java.lang.String key,
059 java.lang.String value)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 try {
063 MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
064 "addCategoryProperty", long.class, java.lang.String.class,
065 java.lang.String.class);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
068 key, value);
069
070 Object returnObj = null;
071
072 try {
073 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074 }
075 catch (Exception e) {
076 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077 throw (com.liferay.portal.kernel.exception.PortalException)e;
078 }
079
080 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081 throw (com.liferay.portal.kernel.exception.SystemException)e;
082 }
083
084 throw new com.liferay.portal.kernel.exception.SystemException(e);
085 }
086
087 return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
088 }
089 catch (com.liferay.portal.kernel.exception.SystemException se) {
090 _log.error(se, se);
091
092 throw se;
093 }
094 }
095
096 public static void deleteCategoryProperty(HttpPrincipal httpPrincipal,
097 long categoryPropertyId)
098 throws com.liferay.portal.kernel.exception.PortalException,
099 com.liferay.portal.kernel.exception.SystemException {
100 try {
101 MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
102 "deleteCategoryProperty", long.class);
103
104 MethodHandler methodHandler = new MethodHandler(methodKey,
105 categoryPropertyId);
106
107 try {
108 TunnelUtil.invoke(httpPrincipal, methodHandler);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112 throw (com.liferay.portal.kernel.exception.PortalException)e;
113 }
114
115 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116 throw (com.liferay.portal.kernel.exception.SystemException)e;
117 }
118
119 throw new com.liferay.portal.kernel.exception.SystemException(e);
120 }
121 }
122 catch (com.liferay.portal.kernel.exception.SystemException se) {
123 _log.error(se, se);
124
125 throw se;
126 }
127 }
128
129 public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryProperties(
130 HttpPrincipal httpPrincipal, long entryId)
131 throws com.liferay.portal.kernel.exception.SystemException {
132 try {
133 MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
134 "getCategoryProperties", long.class);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
137
138 Object returnObj = null;
139
140 try {
141 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142 }
143 catch (Exception e) {
144 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
145 throw (com.liferay.portal.kernel.exception.SystemException)e;
146 }
147
148 throw new com.liferay.portal.kernel.exception.SystemException(e);
149 }
150
151 return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
152 }
153 catch (com.liferay.portal.kernel.exception.SystemException se) {
154 _log.error(se, se);
155
156 throw se;
157 }
158 }
159
160 public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryPropertyValues(
161 HttpPrincipal httpPrincipal, long companyId, java.lang.String key)
162 throws com.liferay.portal.kernel.exception.SystemException {
163 try {
164 MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
165 "getCategoryPropertyValues", long.class,
166 java.lang.String.class);
167
168 MethodHandler methodHandler = new MethodHandler(methodKey,
169 companyId, key);
170
171 Object returnObj = null;
172
173 try {
174 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
175 }
176 catch (Exception e) {
177 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
178 throw (com.liferay.portal.kernel.exception.SystemException)e;
179 }
180
181 throw new com.liferay.portal.kernel.exception.SystemException(e);
182 }
183
184 return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
185 }
186 catch (com.liferay.portal.kernel.exception.SystemException se) {
187 _log.error(se, se);
188
189 throw se;
190 }
191 }
192
193 public static com.liferay.portlet.asset.model.AssetCategoryProperty updateCategoryProperty(
194 HttpPrincipal httpPrincipal, long categoryPropertyId,
195 java.lang.String key, java.lang.String value)
196 throws com.liferay.portal.kernel.exception.PortalException,
197 com.liferay.portal.kernel.exception.SystemException {
198 try {
199 MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
200 "updateCategoryProperty", long.class,
201 java.lang.String.class, java.lang.String.class);
202
203 MethodHandler methodHandler = new MethodHandler(methodKey,
204 categoryPropertyId, key, value);
205
206 Object returnObj = null;
207
208 try {
209 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
210 }
211 catch (Exception e) {
212 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
213 throw (com.liferay.portal.kernel.exception.PortalException)e;
214 }
215
216 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
217 throw (com.liferay.portal.kernel.exception.SystemException)e;
218 }
219
220 throw new com.liferay.portal.kernel.exception.SystemException(e);
221 }
222
223 return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
224 }
225 catch (com.liferay.portal.kernel.exception.SystemException se) {
226 _log.error(se, se);
227
228 throw se;
229 }
230 }
231
232 private static Log _log = LogFactoryUtil.getLog(AssetCategoryPropertyServiceHttp.class);
233 }