001/*
002 *  Copyright 2010 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.newsletter.category;
017
018import org.ametys.plugins.repository.AmetysRepositoryException;
019import org.ametys.runtime.i18n.I18nizableText;
020
021/**
022 * This class represent a category of newsletter
023 */
024public class Category
025{
026    private String _id;
027    private String _name;
028    private I18nizableText _title;
029    private I18nizableText _description;
030    private String _parentId;
031    private String _template;
032    private String _siteName;
033    private String _lang;
034    
035    /**
036     * Constructor
037     * @param id The id of the tag. The id must be unique.
038     */
039    public Category (String id)
040    {
041        _id = id;
042    }
043    
044    /**
045     * Constructor
046     * @param id The id of the category. The id must be unique.
047     * @param name The name of the category. The name must be unique. The name is the same as the id except for JCR category.
048     * @param parentId The parent category id
049     * @param title the category title
050     * @param description the category description
051     * @param template the template
052     * @param siteName the category site name
053     * @param lang the category language
054     */
055    public Category(String id, String name, String parentId, I18nizableText title, I18nizableText description, String template, String siteName, String lang)
056    {
057        _id = id;
058        _name = name;
059        _parentId = parentId;
060        _title = title;
061        _description = description;
062        _template = template;
063        _siteName = siteName;
064        _lang = lang;
065    }
066    
067    
068    /**
069     * Get the category unique id. 
070     * @return The unique id
071     */
072    public String getId ()
073    {
074        return _id;
075    }
076    
077    /**
078     * Get the category unique id. 
079     * @return The unique id
080     */
081    public String getName ()
082    {
083        return _name;
084    }
085    
086    /**
087     * Get the parent id. 
088     * @return The parent id. 
089     */
090    public String getParentId ()
091    {
092        return _parentId;
093    }
094    
095    /**
096     * Retrieves the title.
097     * @return the title.
098     * @throws AmetysRepositoryException if an error occurs.
099     */
100    public I18nizableText getTitle()
101    {
102        return _title;
103    }
104    
105    /**
106     * Set the title.
107     * @param title the title to set.
108     */
109    public void setTitle(I18nizableText title)
110    {
111        _title = title;
112    }
113    
114    /**
115     * Retrieves the description.
116     * @return the description.
117     */
118    public I18nizableText getDescription()
119    {
120        return _description;
121    }
122    
123    /**
124     * Set the description.
125     * @param description the description to set.
126     */
127    public void setDescription(I18nizableText description)
128    {
129        _description = description;
130    }
131    
132    /**
133     * Get the template name
134     * @return the template name
135     */
136    public String getTemplate ()
137    {
138        return _template;
139    }
140    
141    /**
142     * Set the template 
143     * @param templateName the template
144     */
145    public void setTemplate (String templateName)
146    {
147        _template = templateName;
148    }
149    
150    /**
151     * Get the the site name 
152     * @return the the site name 
153     */
154    public String getSiteName ()
155    {
156        return _siteName;
157    }
158    
159    /**
160     * Set the site name 
161     * @param siteName the site name to set
162     */
163    public void setSiteName (String siteName)
164    {
165        _siteName = siteName;
166    }
167    
168    /**
169     * Get the language
170     * @return the language
171     */
172    public String getLang ()
173    {
174        return _lang;
175    }
176    
177    /**
178     * Set the language 
179     * @param lang the language
180     */
181    public void setLang (String lang)
182    {
183        _lang = lang;
184    }
185}