001
014
015 package com.liferay.portlet.dynamicdatamapping.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.http.TunnelUtil;
023
024 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkServiceUtil;
025
026
056 public class DDMStructureLinkServiceHttp {
057 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink addStructureLink(
058 HttpPrincipal httpPrincipal, long classNameId, long classPK,
059 long structureId,
060 com.liferay.portal.service.ServiceContext serviceContext)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(DDMStructureLinkServiceUtil.class.getName(),
065 "addStructureLink", _addStructureLinkParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey,
068 classNameId, classPK, structureId, serviceContext);
069
070 Object returnObj = null;
071
072 try {
073 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074 }
075 catch (Exception e) {
076 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077 throw (com.liferay.portal.kernel.exception.PortalException)e;
078 }
079
080 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081 throw (com.liferay.portal.kernel.exception.SystemException)e;
082 }
083
084 throw new com.liferay.portal.kernel.exception.SystemException(e);
085 }
086
087 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink)returnObj;
088 }
089 catch (com.liferay.portal.kernel.exception.SystemException se) {
090 _log.error(se, se);
091
092 throw se;
093 }
094 }
095
096 public static void deleteStructureLink(HttpPrincipal httpPrincipal,
097 long structureLinkId)
098 throws com.liferay.portal.kernel.exception.PortalException,
099 com.liferay.portal.kernel.exception.SystemException {
100 try {
101 MethodKey methodKey = new MethodKey(DDMStructureLinkServiceUtil.class.getName(),
102 "deleteStructureLink", _deleteStructureLinkParameterTypes1);
103
104 MethodHandler methodHandler = new MethodHandler(methodKey,
105 structureLinkId);
106
107 try {
108 TunnelUtil.invoke(httpPrincipal, methodHandler);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112 throw (com.liferay.portal.kernel.exception.PortalException)e;
113 }
114
115 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116 throw (com.liferay.portal.kernel.exception.SystemException)e;
117 }
118
119 throw new com.liferay.portal.kernel.exception.SystemException(e);
120 }
121 }
122 catch (com.liferay.portal.kernel.exception.SystemException se) {
123 _log.error(se, se);
124
125 throw se;
126 }
127 }
128
129 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink getStructureLink(
130 HttpPrincipal httpPrincipal, long structureLinkId)
131 throws com.liferay.portal.kernel.exception.PortalException,
132 com.liferay.portal.kernel.exception.SystemException {
133 try {
134 MethodKey methodKey = new MethodKey(DDMStructureLinkServiceUtil.class.getName(),
135 "getStructureLink", _getStructureLinkParameterTypes2);
136
137 MethodHandler methodHandler = new MethodHandler(methodKey,
138 structureLinkId);
139
140 Object returnObj = null;
141
142 try {
143 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
144 }
145 catch (Exception e) {
146 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
147 throw (com.liferay.portal.kernel.exception.PortalException)e;
148 }
149
150 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
151 throw (com.liferay.portal.kernel.exception.SystemException)e;
152 }
153
154 throw new com.liferay.portal.kernel.exception.SystemException(e);
155 }
156
157 return (com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink)returnObj;
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 com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink updateStructureLink(
167 HttpPrincipal httpPrincipal, long structureLinkId, long classNameId,
168 long classPK, long structureId)
169 throws com.liferay.portal.kernel.exception.PortalException,
170 com.liferay.portal.kernel.exception.SystemException {
171 try {
172 MethodKey methodKey = new MethodKey(DDMStructureLinkServiceUtil.class.getName(),
173 "updateStructureLink", _updateStructureLinkParameterTypes3);
174
175 MethodHandler methodHandler = new MethodHandler(methodKey,
176 structureLinkId, classNameId, classPK, structureId);
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 (com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink)returnObj;
196 }
197 catch (com.liferay.portal.kernel.exception.SystemException se) {
198 _log.error(se, se);
199
200 throw se;
201 }
202 }
203
204 private static Log _log = LogFactoryUtil.getLog(DDMStructureLinkServiceHttp.class);
205 private static final Class<?>[] _addStructureLinkParameterTypes0 = new Class[] {
206 long.class, long.class, long.class,
207 com.liferay.portal.service.ServiceContext.class
208 };
209 private static final Class<?>[] _deleteStructureLinkParameterTypes1 = new Class[] {
210 long.class
211 };
212 private static final Class<?>[] _getStructureLinkParameterTypes2 = new Class[] {
213 long.class
214 };
215 private static final Class<?>[] _updateStructureLinkParameterTypes3 = new Class[] {
216 long.class, long.class, long.class, long.class
217 };
218 }