001
014
015 package com.liferay.portlet.ratings.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.DoubleWrapper;
020 import com.liferay.portal.kernel.util.LongWrapper;
021 import com.liferay.portal.kernel.util.MethodWrapper;
022 import com.liferay.portal.kernel.util.NullWrapper;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.http.TunnelUtil;
025
026 import com.liferay.portlet.ratings.service.RatingsEntryServiceUtil;
027
028
058 public class RatingsEntryServiceHttp {
059 public static void deleteEntry(HttpPrincipal httpPrincipal,
060 java.lang.String className, long classPK)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 Object paramObj0 = className;
065
066 if (className == null) {
067 paramObj0 = new NullWrapper("java.lang.String");
068 }
069
070 Object paramObj1 = new LongWrapper(classPK);
071
072 MethodWrapper methodWrapper = new MethodWrapper(RatingsEntryServiceUtil.class.getName(),
073 "deleteEntry", new Object[] { paramObj0, paramObj1 });
074
075 try {
076 TunnelUtil.invoke(httpPrincipal, methodWrapper);
077 }
078 catch (Exception e) {
079 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080 throw (com.liferay.portal.kernel.exception.PortalException)e;
081 }
082
083 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084 throw (com.liferay.portal.kernel.exception.SystemException)e;
085 }
086
087 throw new com.liferay.portal.kernel.exception.SystemException(e);
088 }
089 }
090 catch (com.liferay.portal.kernel.exception.SystemException se) {
091 _log.error(se, se);
092
093 throw se;
094 }
095 }
096
097 public static com.liferay.portlet.ratings.model.RatingsEntry updateEntry(
098 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
099 double score)
100 throws com.liferay.portal.kernel.exception.PortalException,
101 com.liferay.portal.kernel.exception.SystemException {
102 try {
103 Object paramObj0 = className;
104
105 if (className == null) {
106 paramObj0 = new NullWrapper("java.lang.String");
107 }
108
109 Object paramObj1 = new LongWrapper(classPK);
110
111 Object paramObj2 = new DoubleWrapper(score);
112
113 MethodWrapper methodWrapper = new MethodWrapper(RatingsEntryServiceUtil.class.getName(),
114 "updateEntry",
115 new Object[] { paramObj0, paramObj1, paramObj2 });
116
117 Object returnObj = null;
118
119 try {
120 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
121 }
122 catch (Exception e) {
123 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
124 throw (com.liferay.portal.kernel.exception.PortalException)e;
125 }
126
127 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
128 throw (com.liferay.portal.kernel.exception.SystemException)e;
129 }
130
131 throw new com.liferay.portal.kernel.exception.SystemException(e);
132 }
133
134 return (com.liferay.portlet.ratings.model.RatingsEntry)returnObj;
135 }
136 catch (com.liferay.portal.kernel.exception.SystemException se) {
137 _log.error(se, se);
138
139 throw se;
140 }
141 }
142
143 private static Log _log = LogFactoryUtil.getLog(RatingsEntryServiceHttp.class);
144 }