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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.LayoutPrototypeServiceUtil;
023
024
054 public class LayoutPrototypeServiceHttp {
055 public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype(
056 HttpPrincipal httpPrincipal,
057 java.util.Map<java.util.Locale, java.lang.String> nameMap,
058 java.lang.String description, boolean active)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 try {
062 MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class.getName(),
063 "addLayoutPrototype", java.util.Map.class,
064 java.lang.String.class, boolean.class);
065
066 MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
067 description, active);
068
069 Object returnObj = null;
070
071 try {
072 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
073 }
074 catch (Exception e) {
075 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
076 throw (com.liferay.portal.kernel.exception.PortalException)e;
077 }
078
079 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
080 throw (com.liferay.portal.kernel.exception.SystemException)e;
081 }
082
083 throw new com.liferay.portal.kernel.exception.SystemException(e);
084 }
085
086 return (com.liferay.portal.model.LayoutPrototype)returnObj;
087 }
088 catch (com.liferay.portal.kernel.exception.SystemException se) {
089 _log.error(se, se);
090
091 throw se;
092 }
093 }
094
095 public static void deleteLayoutPrototype(HttpPrincipal httpPrincipal,
096 long layoutPrototypeId)
097 throws com.liferay.portal.kernel.exception.PortalException,
098 com.liferay.portal.kernel.exception.SystemException {
099 try {
100 MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class.getName(),
101 "deleteLayoutPrototype", long.class);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey,
104 layoutPrototypeId);
105
106 try {
107 TunnelUtil.invoke(httpPrincipal, methodHandler);
108 }
109 catch (Exception e) {
110 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
111 throw (com.liferay.portal.kernel.exception.PortalException)e;
112 }
113
114 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
115 throw (com.liferay.portal.kernel.exception.SystemException)e;
116 }
117
118 throw new com.liferay.portal.kernel.exception.SystemException(e);
119 }
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 com.liferay.portal.model.LayoutPrototype getLayoutPrototype(
129 HttpPrincipal httpPrincipal, long layoutPrototypeId)
130 throws com.liferay.portal.kernel.exception.PortalException,
131 com.liferay.portal.kernel.exception.SystemException {
132 try {
133 MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class.getName(),
134 "getLayoutPrototype", long.class);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey,
137 layoutPrototypeId);
138
139 Object returnObj = null;
140
141 try {
142 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
143 }
144 catch (Exception e) {
145 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
146 throw (com.liferay.portal.kernel.exception.PortalException)e;
147 }
148
149 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
150 throw (com.liferay.portal.kernel.exception.SystemException)e;
151 }
152
153 throw new com.liferay.portal.kernel.exception.SystemException(e);
154 }
155
156 return (com.liferay.portal.model.LayoutPrototype)returnObj;
157 }
158 catch (com.liferay.portal.kernel.exception.SystemException se) {
159 _log.error(se, se);
160
161 throw se;
162 }
163 }
164
165 public static java.util.List<com.liferay.portal.model.LayoutPrototype> search(
166 HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
167 com.liferay.portal.kernel.util.OrderByComparator obc)
168 throws com.liferay.portal.kernel.exception.PortalException,
169 com.liferay.portal.kernel.exception.SystemException {
170 try {
171 MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class.getName(),
172 "search", long.class, java.lang.Boolean.class,
173 com.liferay.portal.kernel.util.OrderByComparator.class);
174
175 MethodHandler methodHandler = new MethodHandler(methodKey,
176 companyId, active, obc);
177
178 Object returnObj = null;
179
180 try {
181 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
182 }
183 catch (Exception e) {
184 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
185 throw (com.liferay.portal.kernel.exception.PortalException)e;
186 }
187
188 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
189 throw (com.liferay.portal.kernel.exception.SystemException)e;
190 }
191
192 throw new com.liferay.portal.kernel.exception.SystemException(e);
193 }
194
195 return (java.util.List<com.liferay.portal.model.LayoutPrototype>)returnObj;
196 }
197 catch (com.liferay.portal.kernel.exception.SystemException se) {
198 _log.error(se, se);
199
200 throw se;
201 }
202 }
203
204 public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
205 HttpPrincipal httpPrincipal, long layoutPrototypeId,
206 java.util.Map<java.util.Locale, java.lang.String> nameMap,
207 java.lang.String description, boolean active)
208 throws com.liferay.portal.kernel.exception.PortalException,
209 com.liferay.portal.kernel.exception.SystemException {
210 try {
211 MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class.getName(),
212 "updateLayoutPrototype", long.class, java.util.Map.class,
213 java.lang.String.class, boolean.class);
214
215 MethodHandler methodHandler = new MethodHandler(methodKey,
216 layoutPrototypeId, nameMap, description, active);
217
218 Object returnObj = null;
219
220 try {
221 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
222 }
223 catch (Exception e) {
224 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
225 throw (com.liferay.portal.kernel.exception.PortalException)e;
226 }
227
228 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
229 throw (com.liferay.portal.kernel.exception.SystemException)e;
230 }
231
232 throw new com.liferay.portal.kernel.exception.SystemException(e);
233 }
234
235 return (com.liferay.portal.model.LayoutPrototype)returnObj;
236 }
237 catch (com.liferay.portal.kernel.exception.SystemException se) {
238 _log.error(se, se);
239
240 throw se;
241 }
242 }
243
244 private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceHttp.class);
245 }