001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/web/tags/sakai_2-4-1/news-impl/impl/src/java/org/sakaiproject/news/impl/BasicNewsItem.java $
003: * $Id: BasicNewsItem.java 18368 2006-11-22 04:36:12Z joshua.ryan@asu.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.news.impl;
021:
022: import java.util.List;
023:
024: import org.sakaiproject.news.api.NewsItem;
025:
026: /***********************************************************************************
027: * NewsItem implementation
028: **********************************************************************************/
029:
030: public class BasicNewsItem implements NewsItem {
031: /** The title of this NewsItem. */
032: protected String m_title = null;
033:
034: /** The URL for the complete story. */
035: protected String m_link = null;
036:
037: /** The publication date of the NewsItem. */
038: protected String m_pubdate = null;
039:
040: /** The description (or body) of the news item */
041: protected String m_description = null;
042:
043: /** The list of NewsItemEnclosures for this item. */
044: protected List m_enclosures = null;
045:
046: /**
047: * Construct.
048: *
049: * @param title
050: * The headline of the item
051: * @param description
052: * The body of the item
053: * @param link
054: * The URL for a longer version of the item
055: * @param pubdate
056: * The date/time at which the item was published
057: * @param enclosure
058: * The list of NewsItemEnclosures for this item
059: */
060: public BasicNewsItem(String title, String description, String link,
061: String pubdate, List enclosures) {
062: m_title = title;
063: m_description = description;
064: m_link = link;
065: m_pubdate = pubdate;
066: m_enclosures = enclosures;
067:
068: } // BasicNewsItem
069:
070: /**
071: * Construct.
072: *
073: * @param title
074: * The headline of the item
075: * @param description
076: * The body of the item
077: * @param link
078: * The URL for a longer version of the item
079: * @param pubdate
080: * The date/time at which the item was published
081: */
082: public BasicNewsItem(String title, String description, String link,
083: String pubdate) {
084: m_title = title;
085: m_description = description;
086: m_link = link;
087: m_pubdate = pubdate;
088:
089: } // BasicNewsItem
090:
091: /**
092: * Access the title of the NewsItem.
093: *
094: * @return The title of the NewsItem.
095: */
096: public String getTitle() {
097: return m_title;
098:
099: } // getTitle
100:
101: /**
102: * Access the time when the NewsItem was updated.
103: *
104: * @return The time when the NewsItem was updated.
105: */
106: public String getPubdate() {
107: return m_pubdate;
108:
109: } // getPubdate
110:
111: /**
112: * Access the URL where the complete story can be found.
113: *
114: * @return The URL where the complete story can be found.
115: */
116: public String getLink() {
117: return m_link;
118:
119: } // getLink
120:
121: /**
122: * Access the List of Enclosures for the item
123: *
124: * @return the List of Enclosures for the item
125: */
126: public List getEnclosures() {
127: return m_enclosures;
128: } // getEnclosures
129:
130: /**
131: * Access the description (or body) of the NewsItem.
132: *
133: * @return The description (or body) of the NewsItem.
134: */
135: public String getDescription() {
136: return m_description;
137: }
138:
139: /**
140: * Set the title of the NewsItem.
141: *
142: * @param title
143: * The title of the NewsItem.
144: */
145: public void setTitle(String title) {
146: m_title = title;
147:
148: } // setTitle
149:
150: /**
151: * Set the time when the NewsItem was updated.
152: *
153: * @param pubdate
154: * The time when the NewsItem was updated.
155: */
156: public void setPubdate(String pubdate) {
157: m_pubdate = pubdate;
158:
159: } // setPubdate
160:
161: /**
162: * Set the URL where the complete story can be found.
163: *
164: * @param link
165: * The URL where the complete story can be found.
166: */
167: public void setLink(String link) {
168: m_link = link;
169:
170: } // setLink
171:
172: /**
173: * Set the description (or body) of the NewsItem.
174: *
175: * @param description
176: * The description (or body) of the NewsItem.
177: */
178: public void setDescription(String description) {
179: m_description = description;
180: }
181:
182: } // class BasicNewsItem
|