1
22
23 package com.liferay.portlet.ratings.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.DoubleWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.ratings.service.RatingsEntryServiceUtil;
35
36
73 public class RatingsEntryServiceHttp {
74 public static void deleteEntry(HttpPrincipal httpPrincipal,
75 java.lang.String className, long classPK)
76 throws com.liferay.portal.PortalException,
77 com.liferay.portal.SystemException {
78 try {
79 Object paramObj0 = className;
80
81 if (className == null) {
82 paramObj0 = new NullWrapper("java.lang.String");
83 }
84
85 Object paramObj1 = new LongWrapper(classPK);
86
87 MethodWrapper methodWrapper = new MethodWrapper(RatingsEntryServiceUtil.class.getName(),
88 "deleteEntry", new Object[] { paramObj0, paramObj1 });
89
90 try {
91 TunnelUtil.invoke(httpPrincipal, methodWrapper);
92 }
93 catch (Exception e) {
94 if (e instanceof com.liferay.portal.PortalException) {
95 throw (com.liferay.portal.PortalException)e;
96 }
97
98 if (e instanceof com.liferay.portal.SystemException) {
99 throw (com.liferay.portal.SystemException)e;
100 }
101
102 throw new com.liferay.portal.SystemException(e);
103 }
104 }
105 catch (com.liferay.portal.SystemException se) {
106 _log.error(se, se);
107
108 throw se;
109 }
110 }
111
112 public static com.liferay.portlet.ratings.model.RatingsEntry updateEntry(
113 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
114 double score)
115 throws com.liferay.portal.PortalException,
116 com.liferay.portal.SystemException {
117 try {
118 Object paramObj0 = className;
119
120 if (className == null) {
121 paramObj0 = new NullWrapper("java.lang.String");
122 }
123
124 Object paramObj1 = new LongWrapper(classPK);
125
126 Object paramObj2 = new DoubleWrapper(score);
127
128 MethodWrapper methodWrapper = new MethodWrapper(RatingsEntryServiceUtil.class.getName(),
129 "updateEntry",
130 new Object[] { paramObj0, paramObj1, paramObj2 });
131
132 Object returnObj = null;
133
134 try {
135 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
136 }
137 catch (Exception e) {
138 if (e instanceof com.liferay.portal.PortalException) {
139 throw (com.liferay.portal.PortalException)e;
140 }
141
142 if (e instanceof com.liferay.portal.SystemException) {
143 throw (com.liferay.portal.SystemException)e;
144 }
145
146 throw new com.liferay.portal.SystemException(e);
147 }
148
149 return (com.liferay.portlet.ratings.model.RatingsEntry)returnObj;
150 }
151 catch (com.liferay.portal.SystemException se) {
152 _log.error(se, se);
153
154 throw se;
155 }
156 }
157
158 private static Log _log = LogFactoryUtil.getLog(RatingsEntryServiceHttp.class);
159 }