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