001
014
015 package com.liferay.portlet.journal.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.journal.service.JournalStructureServiceUtil;
025
026
056 public class JournalStructureServiceHttp {
057 public static com.liferay.portlet.journal.model.JournalStructure addStructure(
058 HttpPrincipal httpPrincipal, long groupId,
059 java.lang.String structureId, boolean autoStructureId,
060 java.lang.String parentStructureId, java.lang.String name,
061 java.lang.String description, java.lang.String xsd,
062 com.liferay.portal.service.ServiceContext serviceContext)
063 throws com.liferay.portal.kernel.exception.PortalException,
064 com.liferay.portal.kernel.exception.SystemException {
065 try {
066 MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
067 "addStructure", long.class, java.lang.String.class,
068 boolean.class, java.lang.String.class,
069 java.lang.String.class, java.lang.String.class,
070 java.lang.String.class,
071 com.liferay.portal.service.ServiceContext.class);
072
073 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
074 structureId, autoStructureId, parentStructureId, name,
075 description, xsd, serviceContext);
076
077 Object returnObj = null;
078
079 try {
080 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
081 }
082 catch (Exception e) {
083 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
084 throw (com.liferay.portal.kernel.exception.PortalException)e;
085 }
086
087 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
088 throw (com.liferay.portal.kernel.exception.SystemException)e;
089 }
090
091 throw new com.liferay.portal.kernel.exception.SystemException(e);
092 }
093
094 return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
095 }
096 catch (com.liferay.portal.kernel.exception.SystemException se) {
097 _log.error(se, se);
098
099 throw se;
100 }
101 }
102
103 public static com.liferay.portlet.journal.model.JournalStructure copyStructure(
104 HttpPrincipal httpPrincipal, long groupId,
105 java.lang.String oldStructureId, java.lang.String newStructureId,
106 boolean autoStructureId)
107 throws com.liferay.portal.kernel.exception.PortalException,
108 com.liferay.portal.kernel.exception.SystemException {
109 try {
110 MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
111 "copyStructure", long.class, java.lang.String.class,
112 java.lang.String.class, boolean.class);
113
114 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
115 oldStructureId, newStructureId, autoStructureId);
116
117 Object returnObj = null;
118
119 try {
120 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
121 }
122 catch (Exception e) {
123 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
124 throw (com.liferay.portal.kernel.exception.PortalException)e;
125 }
126
127 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
128 throw (com.liferay.portal.kernel.exception.SystemException)e;
129 }
130
131 throw new com.liferay.portal.kernel.exception.SystemException(e);
132 }
133
134 return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
135 }
136 catch (com.liferay.portal.kernel.exception.SystemException se) {
137 _log.error(se, se);
138
139 throw se;
140 }
141 }
142
143 public static void deleteStructure(HttpPrincipal httpPrincipal,
144 long groupId, java.lang.String structureId)
145 throws com.liferay.portal.kernel.exception.PortalException,
146 com.liferay.portal.kernel.exception.SystemException {
147 try {
148 MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
149 "deleteStructure", long.class, java.lang.String.class);
150
151 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
152 structureId);
153
154 try {
155 TunnelUtil.invoke(httpPrincipal, methodHandler);
156 }
157 catch (Exception e) {
158 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
159 throw (com.liferay.portal.kernel.exception.PortalException)e;
160 }
161
162 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
163 throw (com.liferay.portal.kernel.exception.SystemException)e;
164 }
165
166 throw new com.liferay.portal.kernel.exception.SystemException(e);
167 }
168 }
169 catch (com.liferay.portal.kernel.exception.SystemException se) {
170 _log.error(se, se);
171
172 throw se;
173 }
174 }
175
176 public static com.liferay.portlet.journal.model.JournalStructure getStructure(
177 HttpPrincipal httpPrincipal, long groupId, java.lang.String structureId)
178 throws com.liferay.portal.kernel.exception.PortalException,
179 com.liferay.portal.kernel.exception.SystemException {
180 try {
181 MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
182 "getStructure", long.class, java.lang.String.class);
183
184 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
185 structureId);
186
187 Object returnObj = null;
188
189 try {
190 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
191 }
192 catch (Exception e) {
193 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
194 throw (com.liferay.portal.kernel.exception.PortalException)e;
195 }
196
197 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
198 throw (com.liferay.portal.kernel.exception.SystemException)e;
199 }
200
201 throw new com.liferay.portal.kernel.exception.SystemException(e);
202 }
203
204 return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
205 }
206 catch (com.liferay.portal.kernel.exception.SystemException se) {
207 _log.error(se, se);
208
209 throw se;
210 }
211 }
212
213 public static com.liferay.portlet.journal.model.JournalStructure updateStructure(
214 HttpPrincipal httpPrincipal, long groupId,
215 java.lang.String structureId, java.lang.String parentStructureId,
216 java.lang.String name, java.lang.String description,
217 java.lang.String xsd,
218 com.liferay.portal.service.ServiceContext serviceContext)
219 throws com.liferay.portal.kernel.exception.PortalException,
220 com.liferay.portal.kernel.exception.SystemException {
221 try {
222 MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
223 "updateStructure", long.class, java.lang.String.class,
224 java.lang.String.class, java.lang.String.class,
225 java.lang.String.class, java.lang.String.class,
226 com.liferay.portal.service.ServiceContext.class);
227
228 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
229 structureId, parentStructureId, name, description, xsd,
230 serviceContext);
231
232 Object returnObj = null;
233
234 try {
235 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
236 }
237 catch (Exception e) {
238 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
239 throw (com.liferay.portal.kernel.exception.PortalException)e;
240 }
241
242 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
243 throw (com.liferay.portal.kernel.exception.SystemException)e;
244 }
245
246 throw new com.liferay.portal.kernel.exception.SystemException(e);
247 }
248
249 return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
250 }
251 catch (com.liferay.portal.kernel.exception.SystemException se) {
252 _log.error(se, se);
253
254 throw se;
255 }
256 }
257
258 private static Log _log = LogFactoryUtil.getLog(JournalStructureServiceHttp.class);
259 }