001
014
015 package com.liferay.portlet.tasks.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.tasks.service.TasksProposalServiceUtil;
025
026
056 public class TasksProposalServiceHttp {
057 public static com.liferay.portlet.tasks.model.TasksProposal addProposal(
058 HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
059 java.lang.String classPK, java.lang.String name,
060 java.lang.String description, long reviewUserId,
061 boolean addCommunityPermissions, boolean addGuestPermissions)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 try {
065 MethodKey methodKey = new MethodKey(TasksProposalServiceUtil.class.getName(),
066 "addProposal", _addProposalParameterTypes0);
067
068 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069 className, classPK, name, description, reviewUserId,
070 addCommunityPermissions, addGuestPermissions);
071
072 Object returnObj = null;
073
074 try {
075 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076 }
077 catch (Exception e) {
078 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079 throw (com.liferay.portal.kernel.exception.PortalException)e;
080 }
081
082 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083 throw (com.liferay.portal.kernel.exception.SystemException)e;
084 }
085
086 throw new com.liferay.portal.kernel.exception.SystemException(e);
087 }
088
089 return (com.liferay.portlet.tasks.model.TasksProposal)returnObj;
090 }
091 catch (com.liferay.portal.kernel.exception.SystemException se) {
092 _log.error(se, se);
093
094 throw se;
095 }
096 }
097
098 public static com.liferay.portlet.tasks.model.TasksProposal addProposal(
099 HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
100 java.lang.String classPK, java.lang.String name,
101 java.lang.String description, long reviewUserId,
102 java.lang.String[] communityPermissions,
103 java.lang.String[] guestPermissions)
104 throws com.liferay.portal.kernel.exception.PortalException,
105 com.liferay.portal.kernel.exception.SystemException {
106 try {
107 MethodKey methodKey = new MethodKey(TasksProposalServiceUtil.class.getName(),
108 "addProposal", _addProposalParameterTypes1);
109
110 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
111 className, classPK, name, description, reviewUserId,
112 communityPermissions, guestPermissions);
113
114 Object returnObj = null;
115
116 try {
117 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
118 }
119 catch (Exception e) {
120 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
121 throw (com.liferay.portal.kernel.exception.PortalException)e;
122 }
123
124 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
125 throw (com.liferay.portal.kernel.exception.SystemException)e;
126 }
127
128 throw new com.liferay.portal.kernel.exception.SystemException(e);
129 }
130
131 return (com.liferay.portlet.tasks.model.TasksProposal)returnObj;
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 void deleteProposal(HttpPrincipal httpPrincipal,
141 long proposalId)
142 throws com.liferay.portal.kernel.exception.PortalException,
143 com.liferay.portal.kernel.exception.SystemException {
144 try {
145 MethodKey methodKey = new MethodKey(TasksProposalServiceUtil.class.getName(),
146 "deleteProposal", _deleteProposalParameterTypes2);
147
148 MethodHandler methodHandler = new MethodHandler(methodKey,
149 proposalId);
150
151 try {
152 TunnelUtil.invoke(httpPrincipal, methodHandler);
153 }
154 catch (Exception e) {
155 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
156 throw (com.liferay.portal.kernel.exception.PortalException)e;
157 }
158
159 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
160 throw (com.liferay.portal.kernel.exception.SystemException)e;
161 }
162
163 throw new com.liferay.portal.kernel.exception.SystemException(e);
164 }
165 }
166 catch (com.liferay.portal.kernel.exception.SystemException se) {
167 _log.error(se, se);
168
169 throw se;
170 }
171 }
172
173 public static com.liferay.portlet.tasks.model.TasksProposal updateProposal(
174 HttpPrincipal httpPrincipal, long proposalId,
175 java.lang.String description, int dueDateMonth, int dueDateDay,
176 int dueDateYear, int dueDateHour, int dueDateMinute)
177 throws com.liferay.portal.kernel.exception.PortalException,
178 com.liferay.portal.kernel.exception.SystemException {
179 try {
180 MethodKey methodKey = new MethodKey(TasksProposalServiceUtil.class.getName(),
181 "updateProposal", _updateProposalParameterTypes3);
182
183 MethodHandler methodHandler = new MethodHandler(methodKey,
184 proposalId, description, dueDateMonth, dueDateDay,
185 dueDateYear, dueDateHour, dueDateMinute);
186
187 Object returnObj = null;
188
189 try {
190 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
191 }
192 catch (Exception e) {
193 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
194 throw (com.liferay.portal.kernel.exception.PortalException)e;
195 }
196
197 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
198 throw (com.liferay.portal.kernel.exception.SystemException)e;
199 }
200
201 throw new com.liferay.portal.kernel.exception.SystemException(e);
202 }
203
204 return (com.liferay.portlet.tasks.model.TasksProposal)returnObj;
205 }
206 catch (com.liferay.portal.kernel.exception.SystemException se) {
207 _log.error(se, se);
208
209 throw se;
210 }
211 }
212
213 private static Log _log = LogFactoryUtil.getLog(TasksProposalServiceHttp.class);
214 private static final Class<?>[] _addProposalParameterTypes0 = new Class[] {
215 long.class, java.lang.String.class, java.lang.String.class,
216 java.lang.String.class, java.lang.String.class, long.class,
217 boolean.class, boolean.class
218 };
219 private static final Class<?>[] _addProposalParameterTypes1 = new Class[] {
220 long.class, java.lang.String.class, java.lang.String.class,
221 java.lang.String.class, java.lang.String.class, long.class,
222 java.lang.String[].class, java.lang.String[].class
223 };
224 private static final Class<?>[] _deleteProposalParameterTypes2 = new Class[] {
225 long.class
226 };
227 private static final Class<?>[] _updateProposalParameterTypes3 = new Class[] {
228 long.class, java.lang.String.class, int.class, int.class, int.class,
229 int.class, int.class
230 };
231 }