Skip to content

Commit 64e4bc2

Browse files
authored
Merge pull request #1 from michaelranaldo/Add-Josh-Juneaus-Playground
Added Josh Juneau's AcmePools application
2 parents dd9d460 + 2d3984e commit 64e4bc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+5562
-0
lines changed

AcmePools/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# JavaEE8-Playground
2+
Test project for playing with Java EE 8 APIs. Includes support for all Java EE 8 specifications, utilizing the official Java EE 8 maven coordinates.
3+
4+
This project has been tested and verified to work on Payara-5 branch.
5+
6+
I will update the project occasionally to add new demos. Stay tuned. Please send feedback to my twitter handle at @javajuneau.
7+
8+
Thanks

AcmePools/faces-config.NavData

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scene Scope="Project" version="2">
3+
<Scope Scope="Faces Configuration Only"/>
4+
<Scope Scope="Project"/>
5+
<Scope Scope="All Faces Configurations"/>
6+
</Scene>

AcmePools/nb-configuration.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-shared-configuration>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
17+
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
18+
<org-netbeans-modules-projectapi.jsf_2e_present>true</org-netbeans-modules-projectapi.jsf_2e_present>
19+
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
20+
<org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
21+
</properties>
22+
</project-shared-configuration>

AcmePools/pom.xml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>org.javaee8recipes</groupId>
6+
<artifactId>AcmePools</artifactId>
7+
<version>2.0</version>
8+
<packaging>war</packaging>
9+
10+
<name>AcmePools</name>
11+
12+
<properties>
13+
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
<dependencies>
17+
18+
19+
<dependency>
20+
<groupId>org.primefaces</groupId>
21+
<artifactId>primefaces</artifactId>
22+
<version>6.0</version>
23+
</dependency>
24+
<!-- Java EE 8 -->
25+
<dependency>
26+
<groupId>javax</groupId>
27+
<artifactId>javaee-api</artifactId>
28+
<version>8.0</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
32+
<!-- Lombok -->
33+
<dependency>
34+
<groupId>org.projectlombok</groupId>
35+
<artifactId>lombok</artifactId>
36+
<version>1.16.8</version>
37+
</dependency>
38+
39+
<!-- Apache POI -->
40+
<dependency>
41+
<groupId>org.apache.poi</groupId>
42+
<artifactId>poi</artifactId>
43+
<version>3.15</version>
44+
</dependency>
45+
</dependencies>
46+
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-compiler-plugin</artifactId>
53+
<version>3.1</version>
54+
<configuration>
55+
<source>1.8</source>
56+
<target>1.8</target>
57+
<compilerArguments>
58+
<endorseddirs>${endorsed.dir}</endorseddirs>
59+
</compilerArguments>
60+
</configuration>
61+
</plugin>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-war-plugin</artifactId>
65+
<version>2.3</version>
66+
<configuration>
67+
<failOnMissingWebXml>false</failOnMissingWebXml>
68+
</configuration>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-dependency-plugin</artifactId>
73+
<version>2.6</version>
74+
<executions>
75+
<execution>
76+
<phase>validate</phase>
77+
<goals>
78+
<goal>copy</goal>
79+
</goals>
80+
<configuration>
81+
<outputDirectory>${endorsed.dir}</outputDirectory>
82+
<silent>true</silent>
83+
<artifactItems>
84+
<artifactItem>
85+
<groupId>javax</groupId>
86+
<artifactId>javaee-endorsed-api</artifactId>
87+
<version>7.0</version>
88+
<type>jar</type>
89+
</artifactItem>
90+
</artifactItems>
91+
</configuration>
92+
</execution>
93+
</executions>
94+
</plugin>
95+
</plugins>
96+
</build>
97+
98+
99+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
-- *****************************************************
2+
-- * Simple database model for AcmePools application.
3+
-- *
4+
-- * Author: J. Juneau
5+
-- * Description: Ready for summer! Run this SQL in
6+
-- * your favorite Apache derby schema if you are
7+
-- * not using the NetBeans sample database
8+
-- *****************************************************
9+
10+
CREATE TABLE CUSTOMER (
11+
CUSTOMER_ID INTEGER NOT NULL,
12+
DISCOUNT_CODE CHAR(1) NOT NULL,
13+
ZIP VARCHAR(10) NOT NULL,
14+
"NAME" VARCHAR(30),
15+
ADDRESSLINE1 VARCHAR(30),
16+
ADDRESSLINE2 VARCHAR(30),
17+
CITY VARCHAR(25),
18+
"STATE" CHAR(2),
19+
PHONE CHAR(12),
20+
FAX CHAR(12),
21+
EMAIL VARCHAR(40),
22+
CREDIT_LIMIT INTEGER,
23+
PRIMARY KEY (CUSTOMER_ID));
24+
25+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
26+
VALUES (1, 'N', '95117', 'Jumbo Eagle Corp', '111 E. Las Olivas Blvd', 'Suite 51', 'Fort Lauderdale', 'FL', '305-555-0188', '305-555-0189', 'jumboeagle@example.com', 100000);
27+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
28+
VALUES (2, 'M', '95035', 'New Enterprises', '9754 Main Street USA', 'P.O. Box 567', 'Miami', 'FL', '305-555-0148', '305-555-0149', 'www.new.example.com', 50000);
29+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
30+
VALUES (25, 'M', '85638', 'Wren Computers', '8989 Red Albatross Drive', 'Suite 9897', 'Houston', 'TX', '214-555-0133', '214-555-0134', 'www.wrencomp.example.com', 25000);
31+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
32+
VALUES (3, 'L', '12347', 'Small Bill Company', '8585 South Upper Murray Drive', 'P.O. Box 456', 'Alanta', 'GA', '555-555-0175', '555-555-0176', 'www.smallbill.example.com', 90000);
33+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
34+
VALUES (36, 'H', '94401', 'Bob Hosting Corp.', '65653 Lake Road', 'Suite 2323', 'San Mateo', 'CA', '650-555-0160', '650-555-0161', 'www.bobhostcorp.example.com', 65000);
35+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
36+
VALUES (106, 'L', '95035', 'Early CentralComp', '829 E Flex Drive', 'Suite 853', 'San Jose', 'CA', '408-555-0157', '408-555-0150', 'www.centralcomp.example.com', 26500);
37+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
38+
VALUES (149, 'L', '95117', 'John Valley Computers', '4381 Kelly Valley Ave', 'Suite 77', 'Santa Clara', 'CA', '408-555-0169', '408-555-0167', 'www.johnvalley.example.com', 70000);
39+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
40+
VALUES (863, 'N', '94401', 'Big Network Systems', '456 444th Street', 'Suite 45', 'Redwood City', 'CA', '650-555-0181', '650-555-0180', 'www.bignet.example.com', 25000);
41+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
42+
VALUES (777, 'L', '48128', 'West Valley Inc.', '88 Northsouth Drive', 'Building C', 'Dearborn', 'MI', '313-555-0172', '313-555-0171', 'www.westv.example.com', 100000);
43+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
44+
VALUES (753, 'H', '48128', 'Zed Motor Co', '2267 NE Michigan Ave', 'Building 21', 'Dearborn', 'MI', '313-555-0151', '313-555-0152', 'www.parts@ford.example.com', 5000000);
45+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
46+
VALUES (722, 'N', '48124', 'Big Car Parts', '52963 Notouter Dr', 'Suite 35', 'Detroit', 'MI', '313-555-0144', '313-555-0145', 'www.bparts.example.com', 50000);
47+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
48+
VALUES (409, 'L', '10095', 'Old Media Productions', '4400 527th Street', 'Suite 562', 'New York', 'NY', '212-555-0110', '212-555-0111', 'www.oldmedia.example.com', 10000);
49+
INSERT INTO CUSTOMER (CUSTOMER_ID, DISCOUNT_CODE, ZIP, "NAME", ADDRESSLINE1, ADDRESSLINE2, CITY, "STATE", PHONE, FAX, EMAIL, CREDIT_LIMIT)
50+
VALUES (410, 'M', '10096', 'Yankee Computer Repair Ltd', '9653 211th Ave', 'Floor 4', 'New York', 'NY', '212-555-0191', '212-555-0197', 'www.nycompltd@repair.example.com', 25000);
51+
52+
CREATE TABLE DISCOUNT_CODE (DISCOUNT_CODE CHAR(1) NOT NULL, RATE DECIMAL(4, 2), PRIMARY KEY (DISCOUNT_CODE));
53+
54+
INSERT INTO DISCOUNT_CODE (DISCOUNT_CODE, RATE)
55+
VALUES ('H', 16.00);
56+
INSERT INTO DISCOUNT_CODE (DISCOUNT_CODE, RATE)
57+
VALUES ('L', 7.00);
58+
INSERT INTO DISCOUNT_CODE (DISCOUNT_CODE, RATE)
59+
VALUES ('M', 11.00);
60+
INSERT INTO DISCOUNT_CODE (DISCOUNT_CODE, RATE)
61+
VALUES ('N', 0.00);
62+
63+
CREATE TABLE MICRO_MARKET (ZIP_CODE VARCHAR(10) NOT NULL, RADIUS DOUBLE, AREA_LENGTH DOUBLE, AREA_WIDTH DOUBLE, PRIMARY KEY (ZIP_CODE));
64+
65+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
66+
VALUES ('95051', 255.59, 689.856, 478.479);
67+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
68+
VALUES ('94043', 157.869, 385.821, 147.538);
69+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
70+
VALUES ('85638', 758.648, 328.963, 482.164);
71+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
72+
VALUES ('12347', 475.965, 385.849, 146.937);
73+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
74+
VALUES ('94401', 368.386, 285.848, 173.794);
75+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
76+
VALUES ('95035', 683.396, 472.859, 379.757);
77+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
78+
VALUES ('95117', 755.778, 547.967, 468.858);
79+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
80+
VALUES ('48128', 684.675, 475.854, 408.074);
81+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
82+
VALUES ('48124', 753.765, 487.664, 456.632);
83+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
84+
VALUES ('10095', 1987.854, 975.875, 865.681);
85+
INSERT INTO MICRO_MARKET (ZIP_CODE, RADIUS, AREA_LENGTH, AREA_WIDTH)
86+
VALUES ('10096', 1876.766, 955.666, 923.556);
87+
88+
89+
create table pool_customer(
90+
id int primary key,
91+
pool_id int,
92+
customer_id int);
93+
94+
create table job (
95+
id int primary key,
96+
customer_id int,
97+
description clob,
98+
est_hours float,
99+
cost numeric);
100+
101+
102+
103+
create table pool (
104+
id int primary key,
105+
style varchar(10),
106+
shape varchar(10),
107+
length float,
108+
width float,
109+
radius float,
110+
gallons float);
111+
112+
alter table pool_customer
113+
add constraint pool_customer_fk
114+
foreign key (pool_id) references pool(id);
115+
116+
alter table pool_customer
117+
add constraint pool_customer_fk2
118+
foreign key (customer_id) references customer(customer_id);
119+
120+
alter table job
121+
add constraint job_fk
122+
foreign key (customer_id) references pool_customer(id);
123+
124+
insert into pool values(
125+
1,
126+
'ABOVE',
127+
'ROUND',
128+
0,
129+
0,
130+
24,
131+
61072.56);
132+
133+
insert into pool values(
134+
2,
135+
'INGROUND',
136+
'ROUND',
137+
32,
138+
16,
139+
0,
140+
23040);
141+
142+
insert into pool_customer values(
143+
1,
144+
1,
145+
1);
146+
147+
insert into pool_customer values(
148+
2,
149+
2,
150+
2);
151+
152+
-- Add support for data export
153+
create table column_model(
154+
id int primary key,
155+
column_name varchar(30),
156+
column_label varchar(150));
157+
158+
159+
insert into column_model values(
160+
1,
161+
'addressline1',
162+
'Address Line 1');
163+
164+
insert into column_model values(
165+
2,
166+
'addressline2',
167+
'Address Line 2');
168+
169+
insert into column_model values(
170+
3,
171+
'city',
172+
'City');
173+
174+
insert into column_model values(
175+
4,
176+
'creditLimit',
177+
'Credit Limit');
178+
179+
insert into column_model values(
180+
5,
181+
'customerId',
182+
'Customer Id');
183+
184+
insert into column_model values(
185+
6,
186+
'discountCode',
187+
'Discount Code');
188+
189+
insert into column_model values(
190+
7,
191+
'email',
192+
'Email');
193+
194+
insert into column_model values(
195+
8,
196+
'fax',
197+
'Fax');
198+
199+
insert into column_model values(
200+
9,
201+
'name',
202+
'Name');
203+
204+
insert into column_model values(
205+
10,
206+
'phone',
207+
'Phone');
208+
209+
insert into column_model values(
210+
11,
211+
'state',
212+
'State');
213+
214+
insert into column_model values(
215+
12,
216+
'zip',
217+
'Zip');
218+
219+
-- Uncomment the following to create sequences if using Apache Derby 10.6+
220+
-- create sequence column_model_s
221+
-- start with 100;
222+
--
223+
-- create sequence pool_s
224+
-- start with 100;
225+
--
226+
-- create sequence job_s
227+
-- start with 100;
228+
--
229+
-- create sequence pool_cust_s
230+
-- start with 100;

0 commit comments

Comments
 (0)