001
014
015 package com.liferay.portlet.dynamicdatamapping.service.http;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.util.MethodHandler;
022 import com.liferay.portal.kernel.util.MethodKey;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.http.TunnelUtil;
025
026 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureVersionServiceUtil;
027
028
056 @ProviderType
057 public class DDMStructureVersionServiceHttp {
058 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion getLatestStructureVersion(
059 HttpPrincipal httpPrincipal, long structureId)
060 throws com.liferay.portal.kernel.exception.PortalException {
061 try {
062 MethodKey methodKey = new MethodKey(DDMStructureVersionServiceUtil.class,
063 "getLatestStructureVersion",
064 _getLatestStructureVersionParameterTypes0);
065
066 MethodHandler methodHandler = new MethodHandler(methodKey,
067 structureId);
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 throw new com.liferay.portal.kernel.exception.SystemException(e);
080 }
081
082 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion)returnObj;
083 }
084 catch (com.liferay.portal.kernel.exception.SystemException se) {
085 _log.error(se, se);
086
087 throw se;
088 }
089 }
090
091 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion getStructureVersion(
092 HttpPrincipal httpPrincipal, long structureVersionId)
093 throws com.liferay.portal.kernel.exception.PortalException {
094 try {
095 MethodKey methodKey = new MethodKey(DDMStructureVersionServiceUtil.class,
096 "getStructureVersion", _getStructureVersionParameterTypes1);
097
098 MethodHandler methodHandler = new MethodHandler(methodKey,
099 structureVersionId);
100
101 Object returnObj = null;
102
103 try {
104 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
105 }
106 catch (Exception e) {
107 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108 throw (com.liferay.portal.kernel.exception.PortalException)e;
109 }
110
111 throw new com.liferay.portal.kernel.exception.SystemException(e);
112 }
113
114 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion)returnObj;
115 }
116 catch (com.liferay.portal.kernel.exception.SystemException se) {
117 _log.error(se, se);
118
119 throw se;
120 }
121 }
122
123 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion> getStructureVersions(
124 HttpPrincipal httpPrincipal, long structureId, int start, int end,
125 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion> orderByComparator)
126 throws com.liferay.portal.kernel.exception.PortalException {
127 try {
128 MethodKey methodKey = new MethodKey(DDMStructureVersionServiceUtil.class,
129 "getStructureVersions", _getStructureVersionsParameterTypes2);
130
131 MethodHandler methodHandler = new MethodHandler(methodKey,
132 structureId, start, end, orderByComparator);
133
134 Object returnObj = null;
135
136 try {
137 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
138 }
139 catch (Exception e) {
140 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
141 throw (com.liferay.portal.kernel.exception.PortalException)e;
142 }
143
144 throw new com.liferay.portal.kernel.exception.SystemException(e);
145 }
146
147 return (java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructureVersion>)returnObj;
148 }
149 catch (com.liferay.portal.kernel.exception.SystemException se) {
150 _log.error(se, se);
151
152 throw se;
153 }
154 }
155
156 public static int getStructureVersionsCount(HttpPrincipal httpPrincipal,
157 long structureId)
158 throws com.liferay.portal.kernel.exception.PortalException {
159 try {
160 MethodKey methodKey = new MethodKey(DDMStructureVersionServiceUtil.class,
161 "getStructureVersionsCount",
162 _getStructureVersionsCountParameterTypes3);
163
164 MethodHandler methodHandler = new MethodHandler(methodKey,
165 structureId);
166
167 Object returnObj = null;
168
169 try {
170 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
171 }
172 catch (Exception e) {
173 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
174 throw (com.liferay.portal.kernel.exception.PortalException)e;
175 }
176
177 throw new com.liferay.portal.kernel.exception.SystemException(e);
178 }
179
180 return ((Integer)returnObj).intValue();
181 }
182 catch (com.liferay.portal.kernel.exception.SystemException se) {
183 _log.error(se, se);
184
185 throw se;
186 }
187 }
188
189 private static Log _log = LogFactoryUtil.getLog(DDMStructureVersionServiceHttp.class);
190 private static final Class<?>[] _getLatestStructureVersionParameterTypes0 = new Class[] {
191 long.class
192 };
193 private static final Class<?>[] _getStructureVersionParameterTypes1 = new Class[] {
194 long.class
195 };
196 private static final Class<?>[] _getStructureVersionsParameterTypes2 = new Class[] {
197 long.class, int.class, int.class,
198 com.liferay.portal.kernel.util.OrderByComparator.class
199 };
200 private static final Class<?>[] _getStructureVersionsCountParameterTypes3 = new Class[] {
201 long.class
202 };
203 }