View Javadoc
1   /*
2    * Copyright (C) 2003-2014 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 static org.exoplatform.calendar.ws.CalendarRestApi.CATEGORY_URI;
21  
22  import org.exoplatform.calendar.service.EventCategory;
23  import org.exoplatform.calendar.ws.common.Resource;
24  
25  public class CategoryResource extends Resource {
26    private static final long serialVersionUID = 6940106249883390857L;
27    private String name;
28    
29    public CategoryResource() {
30      super(null);
31    }
32    
33  	public CategoryResource(EventCategory data, String basePath) {
34  	  super(data.getId());
35  	  StringBuilder path = new StringBuilder(basePath);
36  	  path.append(CATEGORY_URI).append(getId());
37  	  setHref(path.toString());
38  	  name = data.getName();
39  	}
40    public String getName() {
41      return name;
42    }
43  
44    public void setName(String name) {
45      this.name = name;
46    }
47  
48  }