001
014
015 package com.liferay.portal.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.security.auth.HttpPrincipal;
022 import com.liferay.portal.kernel.service.LayoutBranchServiceUtil;
023 import com.liferay.portal.kernel.service.http.TunnelUtil;
024 import com.liferay.portal.kernel.util.MethodHandler;
025 import com.liferay.portal.kernel.util.MethodKey;
026
027
055 @ProviderType
056 public class LayoutBranchServiceHttp {
057 public static com.liferay.portal.kernel.model.LayoutBranch addLayoutBranch(
058 HttpPrincipal httpPrincipal, long layoutRevisionId,
059 java.lang.String name, java.lang.String description, boolean master,
060 com.liferay.portal.kernel.service.ServiceContext serviceContext)
061 throws com.liferay.portal.kernel.exception.PortalException {
062 try {
063 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
064 "addLayoutBranch", _addLayoutBranchParameterTypes0);
065
066 MethodHandler methodHandler = new MethodHandler(methodKey,
067 layoutRevisionId, name, description, master, serviceContext);
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.portal.kernel.model.LayoutBranch)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 void deleteLayoutBranch(HttpPrincipal httpPrincipal,
092 long layoutBranchId)
093 throws com.liferay.portal.kernel.exception.PortalException {
094 try {
095 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
096 "deleteLayoutBranch", _deleteLayoutBranchParameterTypes1);
097
098 MethodHandler methodHandler = new MethodHandler(methodKey,
099 layoutBranchId);
100
101 try {
102 TunnelUtil.invoke(httpPrincipal, methodHandler);
103 }
104 catch (Exception e) {
105 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
106 throw (com.liferay.portal.kernel.exception.PortalException)e;
107 }
108
109 throw new com.liferay.portal.kernel.exception.SystemException(e);
110 }
111 }
112 catch (com.liferay.portal.kernel.exception.SystemException se) {
113 _log.error(se, se);
114
115 throw se;
116 }
117 }
118
119 public static com.liferay.portal.kernel.model.LayoutBranch updateLayoutBranch(
120 HttpPrincipal httpPrincipal, long layoutBranchId,
121 java.lang.String name, java.lang.String description,
122 com.liferay.portal.kernel.service.ServiceContext serviceContext)
123 throws com.liferay.portal.kernel.exception.PortalException {
124 try {
125 MethodKey methodKey = new MethodKey(LayoutBranchServiceUtil.class,
126 "updateLayoutBranch", _updateLayoutBranchParameterTypes2);
127
128 MethodHandler methodHandler = new MethodHandler(methodKey,
129 layoutBranchId, name, description, serviceContext);
130
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138 throw (com.liferay.portal.kernel.exception.PortalException)e;
139 }
140
141 throw new com.liferay.portal.kernel.exception.SystemException(e);
142 }
143
144 return (com.liferay.portal.kernel.model.LayoutBranch)returnObj;
145 }
146 catch (com.liferay.portal.kernel.exception.SystemException se) {
147 _log.error(se, se);
148
149 throw se;
150 }
151 }
152
153 private static Log _log = LogFactoryUtil.getLog(LayoutBranchServiceHttp.class);
154 private static final Class<?>[] _addLayoutBranchParameterTypes0 = new Class[] {
155 long.class, java.lang.String.class, java.lang.String.class,
156 boolean.class,
157 com.liferay.portal.kernel.service.ServiceContext.class
158 };
159 private static final Class<?>[] _deleteLayoutBranchParameterTypes1 = new Class[] {
160 long.class
161 };
162 private static final Class<?>[] _updateLayoutBranchParameterTypes2 = new Class[] {
163 long.class, java.lang.String.class, java.lang.String.class,
164 com.liferay.portal.kernel.service.ServiceContext.class
165 };
166 }