[jboss-cvs] jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace ...
Shane Bryzak
Shane_Bryzak at symantec.com
Fri Jan 12 08:24:32 EST 2007
User: sbryzak2
Date: 07/01/12 08:24:32
Modified: examples/seamspace/src/org/jboss/seam/example/seamspace
BlogAction.java CommentAction.java
CommentLocal.java
Log:
initial support for adding blog comments, some security stuff
Revision Changes Path
1.4 +0 -3 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BlogAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- BlogAction.java 11 Jan 2007 02:23:16 -0000 1.3
+++ BlogAction.java 12 Jan 2007 13:24:32 -0000 1.4
@@ -7,18 +7,15 @@
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
-import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.RequestParameter;
-import org.jboss.seam.annotations.Scope;
@Stateful
@Name("blog")
- at Scope(ScopeType.EVENT)
public class BlogAction implements BlogLocal
{
@RequestParameter
1.2 +28 -4 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/CommentAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CommentAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/CommentAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- CommentAction.java 11 Jan 2007 02:23:16 -0000 1.1
+++ CommentAction.java 12 Jan 2007 13:24:32 -0000 1.2
@@ -2,14 +2,38 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
- at Name("commentAction")
@Stateful
+ at Name("commentAction")
public class CommentAction implements CommentLocal
{
+ @Out
+ private BlogComment comment;
+
+ @In
+ private EntityManager entityManager;
+
+ @Begin @Restrict
+ public void create(MemberBlog blog)
+ {
+ comment = new BlogComment();
+ comment.setBlog(blog);
+ }
+
+ @End
+ public void save()
+ {
+ entityManager.persist(comment);
+ }
@Remove @Destroy
public void destroy() { }
1.2 +3 -1 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/CommentLocal.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CommentLocal.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/CommentLocal.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- CommentLocal.java 11 Jan 2007 02:23:16 -0000 1.1
+++ CommentLocal.java 12 Jan 2007 13:24:32 -0000 1.2
@@ -5,5 +5,7 @@
@Local
public interface CommentLocal
{
+ void create(MemberBlog blog);
+ void save();
void destroy();
}
More information about the jboss-cvs-commits
mailing list