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