Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit b5334b2

Browse files
dfcoffinclaude
andcommitted
Add modern Thymeleaf frontend to replace legacy JSP
- Add Thymeleaf and Spring Security dependencies to pom.xml - Create responsive Thymeleaf templates with Bootstrap 5 - Convert JSP pages to modern HTML templates: * Base layout with fragments for header, footer, navigation * Home page with modern hero section and cards * Customer portal with dashboard and usage points * Custodian portal with management interface * Login page with OAuth2 integration support * Error pages (400, 403, general error) - Add modern CSS with Green Button branding - Add JavaScript utilities for form validation and UX - Configure Thymeleaf in application.yml - Include static resources (CSS, JS, favicon) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4b11edd commit b5334b2

27 files changed

+3072
-0
lines changed

OpenESPI-GreenButton-Workspace/OpenESPI-DataCustodian-java/pom.xml

Lines changed: 596 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Development MySQL Profile Configuration
2+
spring:
3+
datasource:
4+
url: jdbc:mysql://localhost:3306/datacustodian?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
5+
username: espi
6+
password: espi123
7+
driver-class-name: com.mysql.cj.jdbc.Driver
8+
hikari:
9+
maximum-pool-size: 20
10+
minimum-idle: 5
11+
idle-timeout: 300000
12+
pool-name: DataCustodianHikariCP
13+
auto-commit: false
14+
connection-test-query: SELECT 1
15+
16+
jpa:
17+
show-sql: true
18+
properties:
19+
hibernate:
20+
dialect: org.hibernate.dialect.MySQLDialect
21+
generate_statistics: true
22+
23+
flyway:
24+
locations: classpath:db/migration/mysql
25+
url: ${spring.datasource.url}
26+
user: ${spring.datasource.username}
27+
password: ${spring.datasource.password}
28+
29+
# Development-specific logging
30+
logging:
31+
level:
32+
org.greenbuttonalliance.espi: DEBUG
33+
org.springframework.security: DEBUG
34+
org.hibernate.SQL: DEBUG
35+
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
36+
37+
server:
38+
port: 8081
39+
40+
espi:
41+
datacustodian:
42+
base-url: http://localhost:8081/DataCustodian
43+
authorization-server:
44+
issuer-uri: http://localhost:8080
45+
jwk-set-uri: http://localhost:8080/.well-known/jwks.json
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Development PostgreSQL Profile Configuration
2+
spring:
3+
datasource:
4+
url: jdbc:postgresql://localhost:5432/datacustodian?createDatabaseIfNotExist=true
5+
username: espi
6+
password: espi123
7+
driver-class-name: org.postgresql.Driver
8+
hikari:
9+
maximum-pool-size: 20
10+
minimum-idle: 5
11+
idle-timeout: 300000
12+
pool-name: DataCustodianHikariCP
13+
auto-commit: false
14+
connection-test-query: SELECT 1
15+
16+
jpa:
17+
show-sql: true
18+
properties:
19+
hibernate:
20+
dialect: org.hibernate.dialect.PostgreSQLDialect
21+
generate_statistics: true
22+
23+
flyway:
24+
locations: classpath:db/migration/postgresql
25+
url: ${spring.datasource.url}
26+
user: ${spring.datasource.username}
27+
password: ${spring.datasource.password}
28+
29+
# Development-specific logging
30+
logging:
31+
level:
32+
org.greenbuttonalliance.espi: DEBUG
33+
org.springframework.security: DEBUG
34+
org.hibernate.SQL: DEBUG
35+
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
36+
37+
server:
38+
port: 8081
39+
40+
espi:
41+
datacustodian:
42+
base-url: http://localhost:8081/DataCustodian
43+
authorization-server:
44+
issuer-uri: http://localhost:8080
45+
jwk-set-uri: http://localhost:8080/.well-known/jwks.json
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Local Development H2 Profile Configuration
2+
spring:
3+
datasource:
4+
url: jdbc:h2:mem:datacustodian;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
5+
username: sa
6+
password:
7+
driver-class-name: org.h2.Driver
8+
hikari:
9+
maximum-pool-size: 10
10+
minimum-idle: 2
11+
pool-name: DataCustodianHikariCP
12+
auto-commit: false
13+
14+
h2:
15+
console:
16+
enabled: true
17+
path: /h2-console
18+
settings:
19+
web-allow-others: true
20+
21+
jpa:
22+
show-sql: true
23+
hibernate:
24+
ddl-auto: create-drop
25+
properties:
26+
hibernate:
27+
dialect: org.hibernate.dialect.H2Dialect
28+
generate_statistics: true
29+
30+
flyway:
31+
enabled: false # Disable Flyway for H2 development
32+
33+
# Development-specific logging
34+
logging:
35+
level:
36+
org.greenbuttonalliance.espi: DEBUG
37+
org.springframework.security: DEBUG
38+
org.hibernate.SQL: DEBUG
39+
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
40+
41+
server:
42+
port: 8081
43+
44+
espi:
45+
datacustodian:
46+
base-url: http://localhost:8081/DataCustodian
47+
authorization-server:
48+
issuer-uri: http://localhost:8080
49+
jwk-set-uri: http://localhost:8080/.well-known/jwks.json
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# OpenESPI Data Custodian Resource Server Configuration
2+
# Spring Boot 3.5 configuration with multi-environment support
3+
4+
spring:
5+
application:
6+
name: OpenESPI-DataCustodian
7+
8+
profiles:
9+
active: ${SPRING_PROFILES_ACTIVE:dev-mysql}
10+
11+
# JPA Configuration
12+
jpa:
13+
open-in-view: false
14+
show-sql: false
15+
hibernate:
16+
ddl-auto: none
17+
properties:
18+
hibernate:
19+
dialect: org.hibernate.dialect.MySQLDialect
20+
format_sql: true
21+
jdbc:
22+
batch_size: 20
23+
order_inserts: true
24+
order_updates: true
25+
generate_statistics: false
26+
cache:
27+
use_second_level_cache: false
28+
use_query_cache: false
29+
30+
# Flyway Database Migration
31+
flyway:
32+
enabled: true
33+
baseline-on-migrate: true
34+
locations: classpath:db/migration/mysql
35+
table: flyway_schema_history
36+
37+
# Jackson JSON Configuration
38+
jackson:
39+
serialization:
40+
write-dates-as-timestamps: false
41+
indent-output: true
42+
deserialization:
43+
fail-on-unknown-properties: false
44+
default-property-inclusion: NON_NULL
45+
time-zone: UTC
46+
date-format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX
47+
48+
# Cache Configuration
49+
cache:
50+
type: simple
51+
cache-names:
52+
- espi-resources
53+
- espi-usage-points
54+
- espi-authorizations
55+
56+
# Thymeleaf Configuration
57+
thymeleaf:
58+
cache: false # Set to true in production
59+
check-template: true
60+
check-template-location: true
61+
encoding: UTF-8
62+
mode: HTML
63+
prefix: classpath:/templates/
64+
suffix: .html
65+
servlet:
66+
content-type: text/html
67+
produce-partial-output-while-processing: true
68+
69+
# Web Configuration
70+
web:
71+
resources:
72+
add-mappings: true
73+
static-locations: classpath:/static/
74+
cache:
75+
period: 3600s
76+
77+
# MVC Configuration
78+
mvc:
79+
view:
80+
prefix: classpath:/templates/
81+
suffix: .html
82+
static-path-pattern: /**
83+
84+
# Security Configuration
85+
security:
86+
oauth2:
87+
resourceserver:
88+
jwt:
89+
issuer-uri: ${espi.authorization-server.issuer-uri:http://localhost:8080}
90+
jwk-set-uri: ${espi.authorization-server.jwk-set-uri:http://localhost:8080/.well-known/jwks.json}
91+
92+
# Server Configuration
93+
server:
94+
port: 8081
95+
servlet:
96+
context-path: /DataCustodian
97+
encoding:
98+
charset: UTF-8
99+
enabled: true
100+
force: true
101+
compression:
102+
enabled: true
103+
mime-types: application/json,application/xml,text/html,text/xml,text/plain,application/atom+xml
104+
error:
105+
include-stacktrace: never
106+
include-message: always
107+
108+
# Actuator Configuration
109+
management:
110+
endpoints:
111+
web:
112+
exposure:
113+
include: health,info,metrics,prometheus
114+
base-path: /actuator
115+
endpoint:
116+
health:
117+
show-details: when-authorized
118+
metrics:
119+
enabled: true
120+
metrics:
121+
export:
122+
prometheus:
123+
enabled: true
124+
tags:
125+
application: ${spring.application.name}
126+
127+
# ESPI Data Custodian Configuration
128+
espi:
129+
datacustodian:
130+
base-url: ${DATACUSTODIAN_BASE_URL:http://localhost:8081/DataCustodian}
131+
name: "Green Button Alliance Data Custodian"
132+
description: "NAESB ESPI 1.0 Data Custodian Implementation"
133+
contact:
134+
name: "Green Button Alliance"
135+
url: "https://www.greenbuttonalliance.org"
136+
137+
138+
authorization-server:
139+
issuer-uri: ${AUTHORIZATION_SERVER_ISSUER_URI:http://localhost:8080}
140+
jwk-set-uri: ${AUTHORIZATION_SERVER_JWK_SET_URI:http://localhost:8080/.well-known/jwks.json}
141+
token-endpoint: ${AUTHORIZATION_SERVER_TOKEN_ENDPOINT:http://localhost:8080/oauth/token}
142+
introspection-endpoint: ${AUTHORIZATION_SERVER_INTROSPECTION_ENDPOINT:http://localhost:8080/oauth/introspect}
143+
144+
# ESPI Resource Configuration
145+
resources:
146+
base-uri: ${espi.datacustodian.base-url}/espi/1_1/resource
147+
page-size: 50
148+
max-page-size: 200
149+
150+
# XML Processing Configuration
151+
xml:
152+
pretty-print: true
153+
include-namespaces: true
154+
155+
# Logging Configuration
156+
logging:
157+
level:
158+
org.greenbuttonalliance.espi: INFO
159+
org.springframework.security: INFO
160+
org.springframework.web: INFO
161+
org.hibernate.SQL: WARN
162+
org.hibernate.type: WARN
163+
org.flywaydb: INFO
164+
pattern:
165+
console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
166+
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
167+
168+
# SpringDoc OpenAPI Configuration
169+
springdoc:
170+
api-docs:
171+
path: /api-docs
172+
enabled: true
173+
swagger-ui:
174+
path: /swagger-ui.html
175+
enabled: true
176+
operations-sorter: alpha
177+
tags-sorter: alpha
178+
show-actuator: true
179+
default-consumes-media-type: application/json
180+
default-produces-media-type: application/json
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
#
3+
# Copyright (c) 2018-2021 Green Button Alliance, Inc.
4+
#
5+
# Portions (c) 2013-2018 EnergyOS.org
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
#
20+
21+
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
22+
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
#
3+
# Copyright (c) 2018-2021 Green Button Alliance, Inc.
4+
#
5+
# Portions (c) 2013-2018 EnergyOS.org
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
#
20+
21+
# Set root logger level to DEBUG and its only appender to A1.
22+
#log4j.rootLogger=TRACE, file, A1
23+
log4j.rootLogger=FATAL, A1
24+
#log4j.rootLogger=DEBUG,A1
25+
#log4j.rootLogger=TRACE,A1
26+
27+
# A1 is set to be a ConsoleAppender.
28+
log4j.appender.A1=org.apache.log4j.ConsoleAppender
29+
30+
# A1 uses PatternLayout.
31+
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
32+
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
33+
34+
# Direct log messages to a log file
35+
log4j.appender.file=org.apache.log4j.RollingFileAppender
36+
log4j.appender.file.File=dcloging.log
37+
log4j.appender.file.MaxFileSize=10MB
38+
log4j.appender.file.MaxBackupIndex=1
39+
log4j.appender.file.layout=org.apache.log4j.PatternLayout
40+
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

0 commit comments

Comments
 (0)