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