Author: rsmeral
Date: 2012-04-24 11:50:50 -0400 (Tue, 24 Apr 2012)
New Revision: 14635
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/pom.xml
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF/
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/pom.xml
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Category.java
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Task.java
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/User.java
branches/community/Seam_2_3/examples-ee6/tasks/tasks-tests/src/test/java/org/jboss/seam/example/tasks/test/TaskResourceTest.java
Log:
tasks example using Jackson
Modified: branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/pom.xml 2012-04-24 08:41:21
UTC (rev 14634)
+++ branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/pom.xml 2012-04-24 15:50:50
UTC (rev 14635)
@@ -30,14 +30,6 @@
<type>ejb</type>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-atom-provider</artifactId>
- </dependency>
</dependencies>
@@ -72,7 +64,7 @@
<artifactId>jboss-seam</artifactId>
<bundleFileName>jboss-seam.jar</bundleFileName>
</ejbModule>
- <jarModule>
+<!-- <jarModule>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<bundleDir>lib</bundleDir>
@@ -81,7 +73,7 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-atom-provider</artifactId>
<bundleDir>lib</bundleDir>
- </jarModule>
+ </jarModule>-->
</modules>
</configuration>
Property changes on:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF
___________________________________________________________________
Added: svn:ignore
+ .jboss-deployment-structure.xml
.jboss-deployment-structure.xml.bak
.jboss-deployment-structure.xml.kate-swp
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
---
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-24
08:41:21 UTC (rev 14634)
+++
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-24
15:50:50 UTC (rev 14635)
@@ -5,18 +5,5 @@
<module name="org.apache.commons.collections"
export="true"/>
<module name="javax.faces.api" export="true"/>
</dependencies>
- <exclusions>
- <module name="org.jboss.resteasy.resteasy-jaxrs"
slot="main"/>
- <module name="org.jboss.resteasy.resteasy-jettison-provider"
slot="main"/>
- <module name="org.jboss.resteasy.resteasy-jaxb-provider"
slot="main"/>
- </exclusions>
</deployment>
- <sub-deployment name="tasks-web.war">
- <exclusions>
- <module name="org.jboss.resteasy.resteasy-jaxrs"
slot="main"/>
- <module name="org.jboss.resteasy.resteasy-jettison-provider"
slot="main"/>
- <module name="org.jboss.resteasy.resteasy-jaxb-provider"
slot="main"/>
- <module name="org.jboss.resteasy.resteasy-yaml-provider"
slot="main"/>
- </exclusions>
- </sub-deployment>
</jboss-deployment-structure>
Modified: branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/pom.xml 2012-04-24 08:41:21
UTC (rev 14634)
+++ branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/pom.xml 2012-04-24 15:50:50
UTC (rev 14635)
@@ -53,13 +53,45 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<scope>provided</scope>
+ <version>2.3.2.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-atom-provider</artifactId>
<scope>provided</scope>
+ <version>2.3.2.Final</version>
</dependency>
<dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson-provider</artifactId>
+ <version>2.3.2.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ <version>2.3.2.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-jaxrs</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-xc</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-resteasy</artifactId>
<exclusions>
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Category.java
===================================================================
---
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Category.java 2012-04-24
08:41:21 UTC (rev 14634)
+++
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Category.java 2012-04-24
15:50:50 UTC (rev 14635)
@@ -37,6 +37,9 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.validation.constraints.NotNull;
+import org.codehaus.jackson.annotate.JsonBackReference;
+import org.codehaus.jackson.annotate.JsonManagedReference;
+import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes;
/**
*
@@ -92,6 +95,7 @@
@OneToMany(mappedBy = "category", cascade = CascadeType.REMOVE)
@XmlTransient
+ @JsonManagedReference("category-task")
public List<Task> getTasks()
{
return tasks;
@@ -104,6 +108,7 @@
@ManyToOne
@XmlTransient
+ @JsonBackReference("category-owner")
public User getOwner()
{
return owner;
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Task.java
===================================================================
---
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Task.java 2012-04-24
08:41:21 UTC (rev 14634)
+++
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/Task.java 2012-04-24
15:50:50 UTC (rev 14635)
@@ -29,6 +29,7 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.validation.constraints.NotNull;
+import org.codehaus.jackson.annotate.JsonBackReference;
/**
*
@@ -108,6 +109,7 @@
@ManyToOne
@XmlTransient
@NotNull
+ @JsonBackReference("category-task")
public Category getCategory()
{
return category;
@@ -126,6 +128,7 @@
}
@Transient
+ @JsonBackReference("task-owner")
public User getOwner() {
return category.getOwner();
}
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/User.java
===================================================================
---
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/User.java 2012-04-24
08:41:21 UTC (rev 14634)
+++
branches/community/Seam_2_3/examples-ee6/tasks/tasks-ejb/src/main/java/org/jboss/seam/example/tasks/entity/User.java 2012-04-24
15:50:50 UTC (rev 14635)
@@ -30,6 +30,7 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.validation.constraints.NotNull;
+import org.codehaus.jackson.annotate.JsonManagedReference;
/**
*
@@ -69,6 +70,7 @@
@OneToMany(mappedBy = "owner")
@XmlTransient
+ @JsonManagedReference("category-owner")
public List<Category> getCategories()
{
return categories;
Modified:
branches/community/Seam_2_3/examples-ee6/tasks/tasks-tests/src/test/java/org/jboss/seam/example/tasks/test/TaskResourceTest.java
===================================================================
---
branches/community/Seam_2_3/examples-ee6/tasks/tasks-tests/src/test/java/org/jboss/seam/example/tasks/test/TaskResourceTest.java 2012-04-24
08:41:21 UTC (rev 14634)
+++
branches/community/Seam_2_3/examples-ee6/tasks/tasks-tests/src/test/java/org/jboss/seam/example/tasks/test/TaskResourceTest.java 2012-04-24
15:50:50 UTC (rev 14635)
@@ -61,7 +61,7 @@
public void createTaskTest() throws Exception
{
final String mimeType = "application/json";
- final String representation =
"{\"task\":{\"name\":\"Test task\"}}";
+ final String representation = "{\"name\":\"Test
task\"}";
new ResourceRequest(new ResourceRequestEnvironment(this), Method.POST,
"/v1/auth/category/School/unresolved")
{
Show replies by date