1
22
23 package com.liferay.portal.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.IntegerWrapper;
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.ListTypeServiceUtil;
33 import com.liferay.portal.service.http.TunnelUtil;
34
35
72 public class ListTypeServiceHttp {
73 public static com.liferay.portal.model.ListType getListType(
74 HttpPrincipal httpPrincipal, int listTypeId)
75 throws com.liferay.portal.SystemException,
76 com.liferay.portal.PortalException {
77 try {
78 Object paramObj0 = new IntegerWrapper(listTypeId);
79 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
80 "getListType", new Object[] { paramObj0 });
81 Object returnObj = null;
82
83 try {
84 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
85 }
86 catch (Exception e) {
87 if (e instanceof com.liferay.portal.SystemException) {
88 throw (com.liferay.portal.SystemException)e;
89 }
90
91 if (e instanceof com.liferay.portal.PortalException) {
92 throw (com.liferay.portal.PortalException)e;
93 }
94
95 throw new com.liferay.portal.SystemException(e);
96 }
97
98 return (com.liferay.portal.model.ListType)returnObj;
99 }
100 catch (com.liferay.portal.SystemException se) {
101 _log.error(se, se);
102 throw se;
103 }
104 }
105
106 public static java.util.List getListTypes(HttpPrincipal httpPrincipal,
107 java.lang.String type) throws com.liferay.portal.SystemException {
108 try {
109 Object paramObj0 = type;
110
111 if (type == null) {
112 paramObj0 = new NullWrapper("java.lang.String");
113 }
114
115 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
116 "getListTypes", new Object[] { paramObj0 });
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.SystemException) {
124 throw (com.liferay.portal.SystemException)e;
125 }
126
127 throw new com.liferay.portal.SystemException(e);
128 }
129
130 return (java.util.List)returnObj;
131 }
132 catch (com.liferay.portal.SystemException se) {
133 _log.error(se, se);
134 throw se;
135 }
136 }
137
138 public static void validate(HttpPrincipal httpPrincipal, int listTypeId,
139 java.lang.String type)
140 throws com.liferay.portal.SystemException,
141 com.liferay.portal.PortalException {
142 try {
143 Object paramObj0 = new IntegerWrapper(listTypeId);
144 Object paramObj1 = type;
145
146 if (type == null) {
147 paramObj1 = new NullWrapper("java.lang.String");
148 }
149
150 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
151 "validate", new Object[] { paramObj0, paramObj1 });
152
153 try {
154 TunnelUtil.invoke(httpPrincipal, methodWrapper);
155 }
156 catch (Exception e) {
157 if (e instanceof com.liferay.portal.SystemException) {
158 throw (com.liferay.portal.SystemException)e;
159 }
160
161 if (e instanceof com.liferay.portal.PortalException) {
162 throw (com.liferay.portal.PortalException)e;
163 }
164
165 throw new com.liferay.portal.SystemException(e);
166 }
167 }
168 catch (com.liferay.portal.SystemException se) {
169 _log.error(se, se);
170 throw se;
171 }
172 }
173
174 public static void validate(HttpPrincipal httpPrincipal, int listTypeId,
175 long classNameId, java.lang.String type)
176 throws com.liferay.portal.SystemException,
177 com.liferay.portal.PortalException {
178 try {
179 Object paramObj0 = new IntegerWrapper(listTypeId);
180 Object paramObj1 = new LongWrapper(classNameId);
181 Object paramObj2 = type;
182
183 if (type == null) {
184 paramObj2 = new NullWrapper("java.lang.String");
185 }
186
187 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
188 "validate", new Object[] { paramObj0, paramObj1, paramObj2 });
189
190 try {
191 TunnelUtil.invoke(httpPrincipal, methodWrapper);
192 }
193 catch (Exception e) {
194 if (e instanceof com.liferay.portal.SystemException) {
195 throw (com.liferay.portal.SystemException)e;
196 }
197
198 if (e instanceof com.liferay.portal.PortalException) {
199 throw (com.liferay.portal.PortalException)e;
200 }
201
202 throw new com.liferay.portal.SystemException(e);
203 }
204 }
205 catch (com.liferay.portal.SystemException se) {
206 _log.error(se, se);
207 throw se;
208 }
209 }
210
211 private static Log _log = LogFactoryUtil.getLog(ListTypeServiceHttp.class);
212 }