Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
7,606 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<project basedir="." name="PasteCode Example Build" default="restart"> | ||
|
||
<property name="example.name" value="weld-pastecode" /> | ||
<property name="type" value="ear" /> | ||
|
||
<import file="../../build.xml" /> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-ear</artifactId> | ||
<packaging>ear</packaging> | ||
<name>Weld Examples: PasteCode (ear)</name> | ||
|
||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>codehaus snapshot repository</id> | ||
<url>http://snapshots.repository.codehaus.org/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-ejb</artifactId> | ||
<type>ejb</type> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-war</artifactId> | ||
<type>war</type> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<scope>test</scope> | ||
<classifier>jdk15</classifier> | ||
</dependency> | ||
<!-- <dependency> | ||
<groupId>org.jboss.el</groupId> | ||
<artifactId>jboss-el</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>javax.el</groupId> | ||
<artifactId>el-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency>--> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>weld-pastecode</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-ear-plugin</artifactId> | ||
<configuration> | ||
<generateApplicationXml>true</generateApplicationXml> | ||
<applicationXml>${project.build.directory}/application.xml</applicationXml> | ||
<modules> | ||
<webModule> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-war</artifactId> | ||
<bundleFileName>weld-pastecode.war</bundleFileName> | ||
<contextRoot>/weld-pastecode</contextRoot> | ||
</webModule> | ||
<ejbModule> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-ejb</artifactId> | ||
<bundleFileName>weld-pastecode.jar</bundleFileName> | ||
</ejbModule> | ||
</modules> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.jboss.weld.examples.jsf.pastecode</groupId> | ||
<artifactId>weld-jsf-pastecode-ejb</artifactId> | ||
<packaging>ejb</packaging> | ||
<name>Weld Examples: PasteCode (ejb)</name> | ||
|
||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>codehaus snapshot repository</id> | ||
<url>http://snapshots.repository.codehaus.org/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<scope>test</scope> | ||
<classifier>jdk15</classifier> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.enterprise</groupId> | ||
<artifactId>cdi-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.ejb3</groupId> | ||
<artifactId>jboss-ejb3-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.persistence</groupId> | ||
<artifactId>persistence-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.faces</groupId> | ||
<artifactId>jsf-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<finalName>weld-pastecode</finalName> | ||
</build> | ||
|
||
</project> | ||
|
136 changes: 136 additions & 0 deletions
136
jsf/pastecode/ejb/src/main/java/org/jboss/weld/examples/pastecode/model/Code.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package org.jboss.weld.examples.pastecode.model; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.*; | ||
import java.util.Date; | ||
|
||
/** | ||
* The persistent class for the code database table. | ||
* | ||
*/ | ||
@Entity | ||
@Table(name = "code") | ||
public class Code implements Serializable, Cloneable | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
private int id; | ||
private Date datetime; | ||
private String language; | ||
private String note; | ||
private String text; | ||
private String user; | ||
private String hash; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
public int getId() | ||
{ | ||
return id; | ||
} | ||
|
||
public void setId(int id) | ||
{ | ||
this.id = id; | ||
} | ||
|
||
@Column(name = "hash") | ||
public String getHash() | ||
{ | ||
return hash; | ||
} | ||
|
||
public void setHash(String hash) | ||
{ | ||
this.hash = hash; | ||
} | ||
|
||
public Code() | ||
{ | ||
this.language = ""; | ||
this.note = ""; | ||
this.text = ""; | ||
this.user = ""; | ||
this.hash = null; | ||
} | ||
|
||
@Temporal(TemporalType.TIMESTAMP) | ||
@Column(name = "datetime") | ||
public Date getDatetime() | ||
{ | ||
return this.datetime; | ||
} | ||
|
||
public void setDatetime(Date datetime) | ||
{ | ||
this.datetime = datetime; | ||
} | ||
|
||
@Column(name = "language") | ||
public String getLanguage() | ||
{ | ||
return this.language; | ||
} | ||
|
||
public void setLanguage(String language) | ||
{ | ||
this.language = language; | ||
} | ||
|
||
@Lob() | ||
@Column(name = "note") | ||
public String getNote() | ||
{ | ||
return this.note; | ||
} | ||
|
||
public void setNote(String note) | ||
{ | ||
this.note = note; | ||
} | ||
|
||
@Lob() | ||
@Column(name = "text") | ||
public String getText() | ||
{ | ||
return this.text; | ||
} | ||
|
||
public void setText(String text) | ||
{ | ||
this.text = text; | ||
} | ||
|
||
@Column(name = "user") | ||
public String getUser() | ||
{ | ||
return this.user; | ||
} | ||
|
||
public void setUser(String user) | ||
{ | ||
this.user = user; | ||
} | ||
|
||
// public Object clone() | ||
// { | ||
// Code c = null; | ||
// try | ||
// { | ||
// c = (Code) super.clone(); | ||
// c.setDatetime(this.datetime); | ||
// c.setHash(this.hash); | ||
// c.setId(this.id); | ||
// c.setLanguage(this.language); | ||
// c.setNote(this.note); | ||
// c.setText(this.text); | ||
// c.setUser(this.user); | ||
// } | ||
// catch (CloneNotSupportedException e) | ||
// { | ||
// e.printStackTrace(); | ||
// } | ||
// return c; | ||
// } | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
jsf/pastecode/ejb/src/main/java/org/jboss/weld/examples/pastecode/session/CodeEAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jboss.weld.examples.pastecode.session; | ||
|
||
import javax.ejb.Local; | ||
import java.util.List; | ||
import org.jboss.weld.examples.pastecode.model.Code; | ||
|
||
@Local | ||
public interface CodeEAO | ||
{ | ||
public String addCode(Code code, boolean secured); | ||
|
||
public Code getCode(String id); | ||
|
||
public List<Code> allCodes(); | ||
|
||
public List<Code> recentCodes(); | ||
|
||
public List<Code> searchCodes(Code code, int page, QueryInfo info); | ||
} |
Oops, something went wrong.