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