001
014
015 package com.liferay.portal.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.IntegerWrapper;
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.ListTypeServiceUtil;
025
026
056 public class ListTypeServiceHttp {
057 public static com.liferay.portal.model.ListType getListType(
058 HttpPrincipal httpPrincipal, int listTypeId)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 try {
062 Object paramObj0 = new IntegerWrapper(listTypeId);
063
064 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
065 "getListType", new Object[] { paramObj0 });
066
067 Object returnObj = null;
068
069 try {
070 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
071 }
072 catch (Exception e) {
073 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074 throw (com.liferay.portal.kernel.exception.PortalException)e;
075 }
076
077 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
078 throw (com.liferay.portal.kernel.exception.SystemException)e;
079 }
080
081 throw new com.liferay.portal.kernel.exception.SystemException(e);
082 }
083
084 return (com.liferay.portal.model.ListType)returnObj;
085 }
086 catch (com.liferay.portal.kernel.exception.SystemException se) {
087 _log.error(se, se);
088
089 throw se;
090 }
091 }
092
093 public static java.util.List<com.liferay.portal.model.ListType> getListTypes(
094 HttpPrincipal httpPrincipal, java.lang.String type)
095 throws com.liferay.portal.kernel.exception.SystemException {
096 try {
097 Object paramObj0 = type;
098
099 if (type == null) {
100 paramObj0 = new NullWrapper("java.lang.String");
101 }
102
103 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
104 "getListTypes", new Object[] { paramObj0 });
105
106 Object returnObj = null;
107
108 try {
109 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
110 }
111 catch (Exception e) {
112 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
113 throw (com.liferay.portal.kernel.exception.SystemException)e;
114 }
115
116 throw new com.liferay.portal.kernel.exception.SystemException(e);
117 }
118
119 return (java.util.List<com.liferay.portal.model.ListType>)returnObj;
120 }
121 catch (com.liferay.portal.kernel.exception.SystemException se) {
122 _log.error(se, se);
123
124 throw se;
125 }
126 }
127
128 public static void validate(HttpPrincipal httpPrincipal, int listTypeId,
129 java.lang.String type)
130 throws com.liferay.portal.kernel.exception.PortalException,
131 com.liferay.portal.kernel.exception.SystemException {
132 try {
133 Object paramObj0 = new IntegerWrapper(listTypeId);
134
135 Object paramObj1 = type;
136
137 if (type == null) {
138 paramObj1 = new NullWrapper("java.lang.String");
139 }
140
141 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
142 "validate", new Object[] { paramObj0, paramObj1 });
143
144 try {
145 TunnelUtil.invoke(httpPrincipal, methodWrapper);
146 }
147 catch (Exception e) {
148 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
149 throw (com.liferay.portal.kernel.exception.PortalException)e;
150 }
151
152 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
153 throw (com.liferay.portal.kernel.exception.SystemException)e;
154 }
155
156 throw new com.liferay.portal.kernel.exception.SystemException(e);
157 }
158 }
159 catch (com.liferay.portal.kernel.exception.SystemException se) {
160 _log.error(se, se);
161
162 throw se;
163 }
164 }
165
166 public static void validate(HttpPrincipal httpPrincipal, int listTypeId,
167 long classNameId, java.lang.String type)
168 throws com.liferay.portal.kernel.exception.PortalException,
169 com.liferay.portal.kernel.exception.SystemException {
170 try {
171 Object paramObj0 = new IntegerWrapper(listTypeId);
172
173 Object paramObj1 = new LongWrapper(classNameId);
174
175 Object paramObj2 = type;
176
177 if (type == null) {
178 paramObj2 = new NullWrapper("java.lang.String");
179 }
180
181 MethodWrapper methodWrapper = new MethodWrapper(ListTypeServiceUtil.class.getName(),
182 "validate", new Object[] { paramObj0, paramObj1, paramObj2 });
183
184 try {
185 TunnelUtil.invoke(httpPrincipal, methodWrapper);
186 }
187 catch (Exception e) {
188 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189 throw (com.liferay.portal.kernel.exception.PortalException)e;
190 }
191
192 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193 throw (com.liferay.portal.kernel.exception.SystemException)e;
194 }
195
196 throw new com.liferay.portal.kernel.exception.SystemException(e);
197 }
198 }
199 catch (com.liferay.portal.kernel.exception.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 private static Log _log = LogFactoryUtil.getLog(ListTypeServiceHttp.class);
207 }