[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model ...
Christian Bauer
christian at hibernate.org
Sun Apr 8 11:10:36 EDT 2007
User: cbauer
Date: 07/04/08 11:10:36
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/model
Node.java User.java Directory.java
Added: examples/wiki/src/main/org/jboss/seam/wiki/core/model
Feed.java FeedEntry.java
Log:
Implemented Atom feeds for site and directories
Revision Changes Path
1.8 +0 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Node.java
(In the diff below, changes in quantity of whitespace are not shown.)
1.5 +4 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: User.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- User.java 5 Apr 2007 14:38:26 -0000 1.4
+++ User.java 8 Apr 2007 15:10:36 -0000 1.5
@@ -91,6 +91,10 @@
public String getFirstname() { return firstname; }
public void setFirstname(String firstname) { this.firstname = firstname; }
+ public String getFullname() {
+ return getFirstname() + " " + getLastname();
+ }
+
public String getLastname() { return lastname; }
public void setLastname(String lastname) { this.lastname = lastname; }
1.4 +11 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Directory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Directory.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Directory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Directory.java 19 Mar 2007 04:53:53 -0000 1.3
+++ Directory.java 8 Apr 2007 15:10:36 -0000 1.4
@@ -10,6 +10,9 @@
@JoinColumn(name = "DEFAULT_DOCUMENT_ID", nullable = true)
private Document defaultDocument;
+ @OneToOne(mappedBy = "directory", cascade = CascadeType.PERSIST)
+ private Feed feed;
+
public Directory() { super("New Directory"); }
public Directory(String name) {
@@ -40,4 +43,12 @@
public Directory getParent() {
return (Directory)super.getParent();
}
+
+ public Feed getFeed() {
+ return feed;
+ }
+
+ public void setFeed(Feed feed) {
+ this.feed = feed;
+ }
}
1.1 date: 2007/04/08 15:10:36; author: cbauer; state: Exp;jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java
Index: Feed.java
===================================================================
package org.jboss.seam.wiki.core.model;
import javax.persistence.*;
import java.util.Date;
import java.io.Serializable;
@Entity
@Table(name = "FEED")
public class Feed implements Serializable {
@Id
@GeneratedValue
@Column(name = "FEED_ID")
private Long id;
@Version
@Column(name = "OBJ_VERSION")
protected Integer version;
@Column(name = "TITLE", nullable = false)
private String title;
@Column(name = "DESCRIPTION", nullable = true)
private String description;
@Column(name = "AUTHOR", nullable = true)
private String author;
@Column(name = "COPYRIGHT", nullable = true)
private String copyright;
@Column(name = "PUBLISHED_ON", nullable = false, updatable = false)
private Date publishedDate = new Date();
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "DIRECTORY_ID", nullable = false, updatable = false)
private Directory directory;
public Feed() { }
// Immutable properties
public Long getId() { return id; }
public Integer getVersion() { return version; }
// Mutable properties
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getCopyright() {
return copyright;
}
public void setCopyright(String copyright) {
this.copyright = copyright;
}
public Date getPublishedDate() {
return publishedDate;
}
public void setPublishedDate(Date publishedDate) {
this.publishedDate = publishedDate;
}
public Directory getDirectory() {
return directory;
}
public void setDirectory(Directory directory) {
this.directory = directory;
}
public String toString() {
return "Feed: " + getId();
}
}
1.1 date: 2007/04/08 15:10:36; author: cbauer; state: Exp;jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java
Index: FeedEntry.java
===================================================================
package org.jboss.seam.wiki.core.model;
import org.hibernate.validator.Length;
import javax.persistence.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "FEEDENTRY")
public class FeedEntry {
@Id
@GeneratedValue
@Column(name = "FEEDENTRY_ID")
private Long id;
@Version
@Column(name = "OBJ_VERSION")
protected Integer version;
@Column(name = "LINK", nullable = false)
@Length(min = 3, max = 1024)
private String link;
@Column(name = "TITLE", nullable = false)
@Length(min = 3, max = 255)
private String title;
@Column(name = "AUTHOR", nullable = false)
@Length(min = 3, max = 255)
private String author;
@Column(name = "PUBLISHED_ON", nullable = false)
private Date publishedDate = new Date();
@Column(name = "UPDATED_ON", nullable = true)
private Date updatedDate;
@Column(name = "DESCRIPTION_TYPE", nullable = false)
@Length(min = 3, max = 255)
private String descriptionType;
@Column(name = "DESCRIPTION_VALUE", nullable = false)
@Length(min = 1, max = 32768)
private String descriptionValue;
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
@JoinColumn(name = "DOCUMENT_ID", nullable = false, updatable = false)
private Document document;
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(
name = "FEED_FEEDENTRY",
joinColumns = @JoinColumn(name = "FEEDENTRY_ID", nullable = false, updatable = false),
inverseJoinColumns= @JoinColumn(name = "FEED_ID", nullable = false, updatable = false)
)
private Set<Feed> feeds = new HashSet<Feed>();
public FeedEntry() {}
// Immutable properties
public Long getId() { return id; }
public Integer getVersion() { return version; }
// Mutable properties
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public Date getPublishedDate() {
return publishedDate;
}
public void setPublishedDate(Date publishedDate) {
this.publishedDate = publishedDate;
}
public Date getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
public String getDescriptionType() {
return descriptionType;
}
public void setDescriptionType(String descriptionType) {
this.descriptionType = descriptionType;
}
public String getDescriptionValue() {
return descriptionValue;
}
public void setDescriptionValue(String descriptionValue) {
this.descriptionValue = descriptionValue;
}
public Document getDocument() {
return document;
}
public void setDocument(Document document) {
this.document = document;
}
public Set<Feed> getFeeds() {
return feeds;
}
public void setFeeds(Set<Feed> feeds) {
this.feeds = feeds;
}
public String toString() {
return "FeedEntry: " + getId();
}
}
More information about the jboss-cvs-commits
mailing list