View Javadoc
1   /*
2    * Copyright (C) 2003-2019 eXo Platform SAS.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU Affero General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU Affero General Public License for more details.
13   *
14   * You should have received a copy of the GNU Affero General Public License
15   * along with this program. If not, see <http://www.gnu.org/licenses/>.
16   */
17  
18  package org.exoplatform.calendar.ws.bean;
19  
20  import org.exoplatform.calendar.ws.common.Resource;
21  import org.exoplatform.social.core.identity.model.Identity;
22  import org.exoplatform.social.core.service.LinkProvider;
23  
24  public class ParticipantResource extends Resource {
25  
26      private String name;
27  
28      private String email;
29  
30      private String avatar;
31  
32      public ParticipantResource() {
33          super(null);
34      }
35  
36      public ParticipantResource(Identity data) {
37          super(data.getRemoteId());
38          this.name = data.getProfile().getFullName();
39          this.email = data.getProfile().getEmail();
40          this.avatar = LinkProvider.buildAvatarURL(data.getProviderId(), data.getRemoteId());
41      }
42  
43      public String getName() {
44          return name;
45      }
46  
47      public void setName(String name) {
48          this.name = name;
49      }
50  
51      public String getEmail() {
52          return email;
53      }
54  
55      public void setEmail(String email) {
56          this.email = email;
57      }
58  
59      public String getAvatar() { return avatar; }
60  
61      public void setAvatar(String avatar) { this.avatar = avatar; }
62  }