1
14
15 package com.liferay.portlet.ratings.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.ratings.service.RatingsEntryServiceUtil;
25
26
63 public class RatingsEntryServiceHttp {
64 public static void deleteEntry(HttpPrincipal httpPrincipal,
65 java.lang.String className, long classPK)
66 throws com.liferay.portal.PortalException,
67 com.liferay.portal.SystemException {
68 try {
69 MethodKey methodKey = new MethodKey(RatingsEntryServiceUtil.class.getName(),
70 "deleteEntry", _deleteEntryParameterTypes0);
71
72 MethodHandler methodHandler = new MethodHandler(methodKey,
73 className, classPK);
74
75 try {
76 TunnelUtil.invoke(httpPrincipal, methodHandler);
77 }
78 catch (Exception e) {
79 if (e instanceof com.liferay.portal.PortalException) {
80 throw (com.liferay.portal.PortalException)e;
81 }
82
83 if (e instanceof com.liferay.portal.SystemException) {
84 throw (com.liferay.portal.SystemException)e;
85 }
86
87 throw new com.liferay.portal.SystemException(e);
88 }
89 }
90 catch (com.liferay.portal.SystemException se) {
91 _log.error(se, se);
92
93 throw se;
94 }
95 }
96
97 public static com.liferay.portlet.ratings.model.RatingsEntry updateEntry(
98 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
99 double score)
100 throws com.liferay.portal.PortalException,
101 com.liferay.portal.SystemException {
102 try {
103 MethodKey methodKey = new MethodKey(RatingsEntryServiceUtil.class.getName(),
104 "updateEntry", _updateEntryParameterTypes1);
105
106 MethodHandler methodHandler = new MethodHandler(methodKey,
107 className, classPK, score);
108
109 Object returnObj = null;
110
111 try {
112 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
113 }
114 catch (Exception e) {
115 if (e instanceof com.liferay.portal.PortalException) {
116 throw (com.liferay.portal.PortalException)e;
117 }
118
119 if (e instanceof com.liferay.portal.SystemException) {
120 throw (com.liferay.portal.SystemException)e;
121 }
122
123 throw new com.liferay.portal.SystemException(e);
124 }
125
126 return (com.liferay.portlet.ratings.model.RatingsEntry)returnObj;
127 }
128 catch (com.liferay.portal.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 private static Log _log = LogFactoryUtil.getLog(RatingsEntryServiceHttp.class);
136 private static final Class<?>[] _deleteEntryParameterTypes0 = new Class[] {
137 java.lang.String.class, long.class
138 };
139 private static final Class<?>[] _updateEntryParameterTypes1 = new Class[] {
140 java.lang.String.class, long.class, double.class
141 };
142 }