Skip to content

Commit cb551f5

Browse files
committed
Multi-domain showcase now deploys
1 parent b7831d6 commit cb551f5

2 files changed

Lines changed: 110 additions & 102 deletions

File tree

‎showcase/multi-domain/pom.xml‎

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
44
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
55
<modelVersion>4.0.0</modelVersion>
6-
<parent>
7-
<artifactId>rewrite-showcase</artifactId>
8-
<groupId>com.ocpsoft.rewrite.showcase</groupId>
9-
<version>1.0.0-SNAPSHOT</version>
10-
<relativePath>../</relativePath>
11-
</parent>
6+
7+
<groupId>com.ocpsoft.rewrite.showcase</groupId>
8+
<version>1.0.0-SNAPSHOT</version>
129
<artifactId>rewrite-showcase-multi-domain</artifactId>
10+
1311
<packaging>war</packaging>
1412
<dependencies>
1513
<dependency>
@@ -20,43 +18,19 @@
2018
<scope>provided</scope>
2119
</dependency>
2220
<dependency>
23-
<groupId>com.ocpsoft.rewrite</groupId>
24-
<artifactId>rewrite-impl-servlet</artifactId>
25-
<scope>compile</scope>
26-
</dependency>
27-
<dependency>
28-
<groupId>com.ocpsoft.rewrite</groupId>
29-
<artifactId>rewrite-integration-cdi</artifactId>
30-
<scope>compile</scope>
31-
</dependency>
32-
<dependency>
33-
<groupId>org.metawidget.forge</groupId>
34-
<artifactId>metawidget-forge-scaffold</artifactId>
21+
<groupId>org.jboss.forge</groupId>
22+
<artifactId>forge-scaffold-metawidget-lib</artifactId>
3523
<version>1.0.0-SNAPSHOT</version>
36-
<exclusions>
37-
<exclusion>
38-
<groupId>com.ocpsoft.rewrite</groupId>
39-
<artifactId>rewrite-servlet-impl</artifactId>
40-
</exclusion>
41-
<exclusion>
42-
<groupId>com.ocpsoft.rewrite</groupId>
43-
<artifactId>rewrite-integration-cdi</artifactId>
44-
</exclusion>
45-
<exclusion>
46-
<groupId>com.ocpsoft.rewrite</groupId>
47-
<artifactId>rewrite-integration-faces</artifactId>
48-
</exclusion>
49-
</exclusions>
5024
</dependency>
5125
</dependencies>
52-
53-
<repositories>
54-
<repository>
55-
<id>ocpsoft</id>
56-
<url>http://ocpsoft.com/repository/</url>
57-
</repository>
58-
</repositories>
59-
26+
27+
<repositories>
28+
<repository>
29+
<id>ocpsoft</id>
30+
<url>http://ocpsoft.com/repository/</url>
31+
</repository>
32+
</repositories>
33+
6034
<build>
6135
<finalName>multi-domain</finalName>
6236
<plugins>
Lines changed: 96 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,104 @@
11
package com.ocpsoft.rewrite.showcase.view;
2-
import java.util.List;
2+
33
import java.util.ArrayList;
4+
import java.util.List;
5+
46
import javax.ejb.Stateful;
57
import javax.enterprise.context.RequestScoped;
68
import javax.inject.Named;
9+
10+
import org.jboss.forge.scaffold.metawidget.persistence.PaginationHelper;
11+
import org.jboss.forge.scaffold.metawidget.persistence.PersistenceUtil;
12+
713
import com.ocpsoft.rewrite.showcase.domain.DomainEntity;
8-
import org.metawidget.forge.persistence.PaginationHelper;
9-
import org.metawidget.forge.persistence.PersistenceUtil;
10-
import org.jboss.seam.transaction.Transactional;
11-
@Transactional @Named @Stateful @RequestScoped public class DomainBean extends PersistenceUtil {
12-
private static final long serialVersionUID=1L;
13-
private List<DomainEntity> list=null;
14-
private DomainEntity domain=new DomainEntity();
15-
private long id=0;
16-
private PaginationHelper<DomainEntity> pagination;
17-
public void load(){
18-
domain=findById(DomainEntity.class,id);
19-
}
20-
public String create(){
21-
create(domain);
22-
return "view?faces-redirect=true&id=" + domain.getId();
23-
}
24-
public String delete(){
25-
delete(domain);
26-
return "list?faces-redirect=true";
27-
}
28-
public String save(){
29-
save(domain);
30-
return "view?faces-redirect=true&id=" + domain.getId();
31-
}
32-
public long getId(){
33-
return id;
34-
}
35-
public void setId( long id){
36-
this.id=id;
37-
if (id > 0) {
38-
load();
39-
}
40-
}
41-
public DomainEntity getDomain(){
42-
return domain;
43-
}
44-
public void setDomain( DomainEntity domain){
45-
this.domain=domain;
46-
}
47-
public List<DomainEntity> getList(){
48-
if (list == null) {
49-
list=getPagination().createPageDataModel();
50-
}
51-
return list;
52-
}
53-
public void setList( List<DomainEntity> list){
54-
this.list=list;
55-
}
56-
public PaginationHelper<DomainEntity> getPagination(){
57-
if (pagination == null) {
58-
pagination=new PaginationHelper<DomainEntity>(10){
59-
@Override public int getItemsCount(){
60-
return count(DomainEntity.class);
61-
}
62-
@Override public List<DomainEntity> createPageDataModel(){
63-
return new ArrayList<DomainEntity>(findAll(DomainEntity.class,getPageFirstItem(),getPageSize()));
64-
}
14+
15+
@Named
16+
@Stateful
17+
@RequestScoped
18+
public class DomainBean extends PersistenceUtil
19+
{
20+
private static final long serialVersionUID = 1L;
21+
private List<DomainEntity> list = null;
22+
private DomainEntity domain = new DomainEntity();
23+
private long id = 0;
24+
private PaginationHelper<DomainEntity> pagination;
25+
26+
public void load()
27+
{
28+
domain = findById(DomainEntity.class, id);
29+
}
30+
31+
public String create()
32+
{
33+
create(domain);
34+
return "view?faces-redirect=true&id=" + domain.getId();
35+
}
36+
37+
public String delete()
38+
{
39+
delete(domain);
40+
return "list?faces-redirect=true";
41+
}
42+
43+
public String save()
44+
{
45+
save(domain);
46+
return "view?faces-redirect=true&id=" + domain.getId();
47+
}
48+
49+
public long getId()
50+
{
51+
return id;
52+
}
53+
54+
public void setId(final long id)
55+
{
56+
this.id = id;
57+
if (id > 0) {
58+
load();
59+
}
60+
}
61+
62+
public DomainEntity getDomain()
63+
{
64+
return domain;
65+
}
66+
67+
public void setDomain(final DomainEntity domain)
68+
{
69+
this.domain = domain;
70+
}
71+
72+
public List<DomainEntity> getList()
73+
{
74+
if (list == null) {
75+
list = getPagination().createPageDataModel();
76+
}
77+
return list;
78+
}
79+
80+
public void setList(final List<DomainEntity> list)
81+
{
82+
this.list = list;
83+
}
84+
85+
public PaginationHelper<DomainEntity> getPagination()
86+
{
87+
if (pagination == null) {
88+
pagination = new PaginationHelper<DomainEntity>(10) {
89+
@Override
90+
public int getItemsCount()
91+
{
92+
return count(DomainEntity.class);
93+
}
94+
95+
@Override
96+
public List<DomainEntity> createPageDataModel()
97+
{
98+
return new ArrayList<DomainEntity>(findAll(DomainEntity.class, getPageFirstItem(), getPageSize()));
99+
}
100+
};
65101
}
66-
;
67-
}
68-
return pagination;
69-
}
102+
return pagination;
103+
}
70104
}

0 commit comments

Comments
 (0)