1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.businessobjects.reporting;
16
17 import org.figure8.join.core.EntityObject;
18 import org.figure8.join.businessobjects.commons.Release;
19
20 import java.util.Date;
21 /**
22 * This is an entity representing a Message. Such messages can be created
23 * by administrators or automatically created during workflow transitions.
24 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
25 * @version $Revision: 1.1 $
26 *
27 * @hibernate.class table="join_messages"
28 * @hibernate.cache usage="read-write"
29 *
30 * @hibernate.query name="join.message_findByDate"
31 * query="from Message msg where msg.publicationDate <= :endDate and msg.expiryDate >= :startDate"
32 * @hibernate.query name="join.message_findByDateAndRelease"
33 * query="from Message msg where msg.publicationDate <= :endDate and msg.expiryDate >= :startDate and msg.release = :release"
34 */
35 public class Message extends EntityObject{
36
37
38
39 /** The title of this message. */
40 private String title;
41 /** The content of this message. */
42 private String content;
43 /** A link to reference from this message. */
44 private String link;
45 /** The date of first publication of this message. */
46 private Date publicationDate;
47 /** Expiration date (ie. end of publication) for this message. */
48 private Date expiryDate;
49
50 /** The release this message is attached to. */
51 private Release release = null;
52
53
54
55
56 /** Creates a new instance of Message */
57 public Message(){
58 }
59
60 /**
61 * Creates a new instance of Message with mandatory attributes.
62 * @param title This message title
63 * @param content This message content
64 * @param publicationDate The date of publication of this message
65 * @param expiryDate The date of publication end for this message
66 */
67 public Message(String title, String content, Date publicationDate, Date expiryDate){
68 this.title = title;
69 this.content = content;
70 this.publicationDate = publicationDate;
71 this.expiryDate = expiryDate;
72 }
73
74
75
76
77 /**
78 * @hibernate.property column="s_title"
79 * not-null="true" length="255"
80 * @return This message title
81 */
82 public String getTitle(){
83 return title;
84 }
85 /** @param title This message title */
86 public void setTitle(String title){
87 this.title = title;
88 }
89
90 /**
91 * @hibernate.property column="s_content"
92 * not-null="true" type="text"
93 * @return This message content
94 */
95 public String getContent(){
96 return content;
97 }
98 /** @param content This message content */
99 public void setContent(String content){
100 this.content = content;
101 }
102
103 /**
104 * @hibernate.property column="s_link" length="255"
105 * @return A link to reference from message.
106 */
107 public String getLink(){
108 return link;
109 }
110 /** @param link The link to reference from message. */
111 public void setLink(String link){
112 this.link = link;
113 }
114
115 /**
116 * @hibernate.property column="d_publication"
117 * not-null="true"
118 * @return This message publication date
119 */
120 public Date getPublicationDate(){
121 return publicationDate;
122 }
123 /** @param publicationDate This message publication date */
124 public void setPublicationDate(Date publicationDate){
125 this.publicationDate = publicationDate;
126 }
127
128 /**
129 * @hibernate.property column="d_expiry"
130 * not-null="true"
131 * @return This message expiry date
132 */
133 public Date getExpiryDate(){
134 return expiryDate;
135 }
136 /** @param expiryDate This message expiry date */
137 public void setExpiryDate(Date expiryDate){
138 this.expiryDate = expiryDate;
139 }
140
141 /**
142 * @hibernate.many-to-one column="n_release_fk"
143 * @return The project release this message is dedicated to
144 */
145 public Release getRelease(){
146 return release;
147 }
148 /** @param release The project release this message is dedicated to */
149 public void setRelease(Release release){
150 this.release = release;
151 }
152 }