1
14
15 package com.liferay.portlet.tasks.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.tasks.service.TasksReviewServiceUtil;
25
26
63 public class TasksReviewServiceHttp {
64 public static com.liferay.portlet.tasks.model.TasksReview approveReview(
65 HttpPrincipal httpPrincipal, long proposalId, int stage)
66 throws com.liferay.portal.PortalException,
67 com.liferay.portal.SystemException {
68 try {
69 MethodKey methodKey = new MethodKey(TasksReviewServiceUtil.class.getName(),
70 "approveReview", _approveReviewParameterTypes0);
71
72 MethodHandler methodHandler = new MethodHandler(methodKey,
73 proposalId, stage);
74
75 Object returnObj = null;
76
77 try {
78 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
79 }
80 catch (Exception e) {
81 if (e instanceof com.liferay.portal.PortalException) {
82 throw (com.liferay.portal.PortalException)e;
83 }
84
85 if (e instanceof com.liferay.portal.SystemException) {
86 throw (com.liferay.portal.SystemException)e;
87 }
88
89 throw new com.liferay.portal.SystemException(e);
90 }
91
92 return (com.liferay.portlet.tasks.model.TasksReview)returnObj;
93 }
94 catch (com.liferay.portal.SystemException se) {
95 _log.error(se, se);
96
97 throw se;
98 }
99 }
100
101 public static com.liferay.portlet.tasks.model.TasksReview rejectReview(
102 HttpPrincipal httpPrincipal, long proposalId, int stage)
103 throws com.liferay.portal.PortalException,
104 com.liferay.portal.SystemException {
105 try {
106 MethodKey methodKey = new MethodKey(TasksReviewServiceUtil.class.getName(),
107 "rejectReview", _rejectReviewParameterTypes1);
108
109 MethodHandler methodHandler = new MethodHandler(methodKey,
110 proposalId, stage);
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.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 return (com.liferay.portlet.tasks.model.TasksReview)returnObj;
130 }
131 catch (com.liferay.portal.SystemException se) {
132 _log.error(se, se);
133
134 throw se;
135 }
136 }
137
138 public static void updateReviews(HttpPrincipal httpPrincipal,
139 long proposalId, long[][] userIdsPerStage)
140 throws com.liferay.portal.PortalException,
141 com.liferay.portal.SystemException {
142 try {
143 MethodKey methodKey = new MethodKey(TasksReviewServiceUtil.class.getName(),
144 "updateReviews", _updateReviewsParameterTypes2);
145
146 MethodHandler methodHandler = new MethodHandler(methodKey,
147 proposalId, userIdsPerStage);
148
149 try {
150 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 catch (com.liferay.portal.SystemException se) {
165 _log.error(se, se);
166
167 throw se;
168 }
169 }
170
171 private static Log _log = LogFactoryUtil.getLog(TasksReviewServiceHttp.class);
172 private static final Class<?>[] _approveReviewParameterTypes0 = new Class[] {
173 long.class, int.class
174 };
175 private static final Class<?>[] _rejectReviewParameterTypes1 = new Class[] {
176 long.class, int.class
177 };
178 private static final Class<?>[] _updateReviewsParameterTypes2 = new Class[] {
179 long.class, long[][].class
180 };
181 }