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