001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.tasks.service.TasksProposalServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author    Brian Wing Shun Chan
051     * @see       TasksProposalServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.tasks.service.TasksProposalServiceUtil
054     * @generated
055     */
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    }