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.LayoutBranchServiceUtil;
023
024
052 public class LayoutBranchServiceHttp {
053 public static com.liferay.portal.model.LayoutBranch addLayoutBranch(
054 HttpPrincipal httpPrincipal, long layoutRevisionId,
055 java.lang.String name, java.lang.String description, boolean master,
056 com.liferay.portal.service.ServiceContext serviceContext)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 try {
060 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
061 "addLayoutBranch", _addLayoutBranchParameterTypes0);
062
063 MethodHandler methodHandler = new MethodHandler(methodKey,
064 layoutRevisionId, name, description, master, serviceContext);
065
066 Object returnObj = null;
067
068 try {
069 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
070 }
071 catch (Exception e) {
072 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
073 throw (com.liferay.portal.kernel.exception.PortalException)e;
074 }
075
076 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
077 throw (com.liferay.portal.kernel.exception.SystemException)e;
078 }
079
080 throw new com.liferay.portal.kernel.exception.SystemException(e);
081 }
082
083 return (com.liferay.portal.model.LayoutBranch)returnObj;
084 }
085 catch (com.liferay.portal.kernel.exception.SystemException se) {
086 _log.error(se, se);
087
088 throw se;
089 }
090 }
091
092 public static void deleteLayoutBranch(HttpPrincipal httpPrincipal,
093 long layoutBranchId)
094 throws com.liferay.portal.kernel.exception.PortalException,
095 com.liferay.portal.kernel.exception.SystemException {
096 try {
097 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
098 "deleteLayoutBranch", _deleteLayoutBranchParameterTypes1);
099
100 MethodHandler methodHandler = new MethodHandler(methodKey,
101 layoutBranchId);
102
103 try {
104 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 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
112 throw (com.liferay.portal.kernel.exception.SystemException)e;
113 }
114
115 throw new com.liferay.portal.kernel.exception.SystemException(e);
116 }
117 }
118 catch (com.liferay.portal.kernel.exception.SystemException se) {
119 _log.error(se, se);
120
121 throw se;
122 }
123 }
124
125 public static com.liferay.portal.model.LayoutBranch updateLayoutBranch(
126 HttpPrincipal httpPrincipal, long layoutBranchId,
127 java.lang.String name, java.lang.String description,
128 com.liferay.portal.service.ServiceContext serviceContext)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
133 "updateLayoutBranch", _updateLayoutBranchParameterTypes2);
134
135 MethodHandler methodHandler = new MethodHandler(methodKey,
136 layoutBranchId, name, description, serviceContext);
137
138 Object returnObj = null;
139
140 try {
141 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142 }
143 catch (Exception e) {
144 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145 throw (com.liferay.portal.kernel.exception.PortalException)e;
146 }
147
148 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149 throw (com.liferay.portal.kernel.exception.SystemException)e;
150 }
151
152 throw new com.liferay.portal.kernel.exception.SystemException(e);
153 }
154
155 return (com.liferay.portal.model.LayoutBranch)returnObj;
156 }
157 catch (com.liferay.portal.kernel.exception.SystemException se) {
158 _log.error(se, se);
159
160 throw se;
161 }
162 }
163
164 private static Log _log = LogFactoryUtil.getLog(LayoutBranchServiceHttp.class);
165 private static final Class<?>[] _addLayoutBranchParameterTypes0 = new Class[] {
166 long.class, java.lang.String.class, java.lang.String.class,
167 boolean.class, com.liferay.portal.service.ServiceContext.class
168 };
169 private static final Class<?>[] _deleteLayoutBranchParameterTypes1 = new Class[] {
170 long.class
171 };
172 private static final Class<?>[] _updateLayoutBranchParameterTypes2 = new Class[] {
173 long.class, java.lang.String.class, java.lang.String.class,
174 com.liferay.portal.service.ServiceContext.class
175 };
176 }