1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.TeamServiceUtil;
24
25
62 public class TeamServiceHttp {
63 public static com.liferay.portal.model.Team addTeam(
64 HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
65 java.lang.String description)
66 throws com.liferay.portal.kernel.exception.PortalException,
67 com.liferay.portal.kernel.exception.SystemException {
68 try {
69 Object paramObj0 = new LongWrapper(groupId);
70
71 Object paramObj1 = name;
72
73 if (name == null) {
74 paramObj1 = new NullWrapper("java.lang.String");
75 }
76
77 Object paramObj2 = description;
78
79 if (description == null) {
80 paramObj2 = new NullWrapper("java.lang.String");
81 }
82
83 MethodWrapper methodWrapper = new MethodWrapper(TeamServiceUtil.class.getName(),
84 "addTeam", new Object[] { paramObj0, paramObj1, paramObj2 });
85
86 Object returnObj = null;
87
88 try {
89 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
90 }
91 catch (Exception e) {
92 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
93 throw (com.liferay.portal.kernel.exception.PortalException)e;
94 }
95
96 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
97 throw (com.liferay.portal.kernel.exception.SystemException)e;
98 }
99
100 throw new com.liferay.portal.kernel.exception.SystemException(e);
101 }
102
103 return (com.liferay.portal.model.Team)returnObj;
104 }
105 catch (com.liferay.portal.kernel.exception.SystemException se) {
106 _log.error(se, se);
107
108 throw se;
109 }
110 }
111
112 public static void deleteTeam(HttpPrincipal httpPrincipal, long teamId)
113 throws com.liferay.portal.kernel.exception.PortalException,
114 com.liferay.portal.kernel.exception.SystemException {
115 try {
116 Object paramObj0 = new LongWrapper(teamId);
117
118 MethodWrapper methodWrapper = new MethodWrapper(TeamServiceUtil.class.getName(),
119 "deleteTeam", new Object[] { paramObj0 });
120
121 try {
122 TunnelUtil.invoke(httpPrincipal, methodWrapper);
123 }
124 catch (Exception e) {
125 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
126 throw (com.liferay.portal.kernel.exception.PortalException)e;
127 }
128
129 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
130 throw (com.liferay.portal.kernel.exception.SystemException)e;
131 }
132
133 throw new com.liferay.portal.kernel.exception.SystemException(e);
134 }
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 com.liferay.portal.model.Team updateTeam(
144 HttpPrincipal httpPrincipal, long teamId, java.lang.String name,
145 java.lang.String description)
146 throws com.liferay.portal.kernel.exception.PortalException,
147 com.liferay.portal.kernel.exception.SystemException {
148 try {
149 Object paramObj0 = new LongWrapper(teamId);
150
151 Object paramObj1 = name;
152
153 if (name == null) {
154 paramObj1 = new NullWrapper("java.lang.String");
155 }
156
157 Object paramObj2 = description;
158
159 if (description == null) {
160 paramObj2 = new NullWrapper("java.lang.String");
161 }
162
163 MethodWrapper methodWrapper = new MethodWrapper(TeamServiceUtil.class.getName(),
164 "updateTeam",
165 new Object[] { paramObj0, paramObj1, paramObj2 });
166
167 Object returnObj = null;
168
169 try {
170 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
171 }
172 catch (Exception e) {
173 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
174 throw (com.liferay.portal.kernel.exception.PortalException)e;
175 }
176
177 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
178 throw (com.liferay.portal.kernel.exception.SystemException)e;
179 }
180
181 throw new com.liferay.portal.kernel.exception.SystemException(e);
182 }
183
184 return (com.liferay.portal.model.Team)returnObj;
185 }
186 catch (com.liferay.portal.kernel.exception.SystemException se) {
187 _log.error(se, se);
188
189 throw se;
190 }
191 }
192
193 private static Log _log = LogFactoryUtil.getLog(TeamServiceHttp.class);
194 }