Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bae3f5e
Delete support in preperation for submodule
iTerminate Dec 2, 2026
54c5a1c
Add support submodule
iTerminate Dec 2, 2026
fe4f307
Rename sbin/init.d scripts to bely_, use LOGR_* variables only, remov…
iTerminate Dec 2, 2026
b3792be
Create a self contained crpt password in preperation for python servi…
iTerminate Dec 2, 2026
2a3964a
Remove python service plugins
iTerminate Dec 2, 2026
50412f1
Remove bin scripts that interact with the service
iTerminate Dec 2, 2026
7c4a087
Update scripts for removal of the python service
iTerminate Dec 2, 2026
2cc6701
Remove web serivce docs
iTerminate Dec 2, 2026
2a0627f
Remove the python service
iTerminate Dec 2, 2026
b04b002
Update to use the updated shared support submodlue in support scripts
iTerminate Dec 2, 2026
e2675a7
add documentation for recent changes
iTerminate Dec 2, 2026
169ef95
Update imports to use jakarta
iTerminate Dec 2, 2026
bf6fd44
Use new tree node children
iTerminate Dec 2, 2026
1f3085e
Update libs to support new dependencies
iTerminate Dec 2, 2026
2b498cd
Update configurations to support updated deps
iTerminate Dec 2, 2026
0a17a5d
Remove watermark
iTerminate Dec 2, 2026
c840fb2
Replace filteroptions with a new filter facet
iTerminate Dec 2, 2026
a560d4d
Add a generic function to process filter options similarly as before
iTerminate Dec 2, 2026
62b6294
slection box option replaces slectionmode
iTerminate Dec 2, 2026
2301ec0
Resolve the new options for file validations on file upload
iTerminate Dec 2, 2026
bf92ff5
Refacotr the handling of dialog styling in the new primefaces
iTerminate Dec 2, 2026
7955793
The new panelgrid requres a layout type. To mimic the same behavior u…
iTerminate Dec 2, 2026
c858984
Add a paginator position option that is now required for new primefaces
iTerminate Dec 2, 2026
a32fca7
Apply misc fixes that were found and applied during CDB migration.
iTerminate Dec 2, 2026
1321adb
Clean up unused plugins
iTerminate Dec 2, 2026
d3aa04a
Update mqtt configuration
iTerminate Dec 2, 2026
9f4967c
init build in netbeans
iTerminate Dec 2, 2026
ab57bef
Add a configuration for mqtt service
iTerminate Dec 2, 2026
f348de8
resolve misc errors reporterd by netbeans
iTerminate Dec 2, 2026
6c125a1
add a dev option for mqtt confuration
iTerminate Dec 2, 2026
148109a
Update the github workflow
iTerminate Dec 2, 2026
ed7b936
Modernize loading dialog
iTerminate Dec 2, 2026
421afc3
resolve unit test
iTerminate Dec 2, 2026
b8972b8
resolve selenium tests
iTerminate Dec 2, 2026
16a41d2
add explicit lazy flag
iTerminate Dec 2, 2026
7b976ee
clean up misc warinings in output
iTerminate Dec 2, 2026
1def67e
Resolve the file upload multipart warnings
iTerminate Dec 2, 2026
0204b6c
Update to jakarta references.
iTerminate Dec 2, 2026
60be0ad
Update documentation to reflect depencency changes
iTerminate Dec 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .github/workflows/test-belyportal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Java 11 until the Payara 7 / JDK 25 upgrade.
- name: Set up JDK 11 and Maven cache
- name: Set up JDK 25 and Maven cache
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'
java-version: '25'
cache: maven
cache-dependency-path: tools/developer_tools/code_testing/BelyPortalTest/pom.xml

Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.idea
.vscode
.DS_Store
src/python/.loglogin
.loglogin

# Compiled files
Expand Down Expand Up @@ -46,19 +45,15 @@ src/java/LogrPortal/setup/glassfish-resources.xml

# Plugin directories, autogenerated files
src/java/LogrPortal/web/views/plugins/
src/python/cdb/cdb_web_service/plugins/
src/java/LogrPortal/src/java/gov/anl/aps/logr/portal/plugins/support/

# Python docs
docs/python/_build/
/src/java/LogrPortal/nbproject/private/
/src/java/LogrPortal/build/
/src/java/LogrPortal/dist/
/src/java/LogrPortal/nbproject/private/

# Python REST Api Dist
/src/python/cdb_api.egg-info
/src/python/dist

# Temporary testing csv files
.env
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "support"]
path = support
url = https://github.com/AdvancedPhotonSource/cdb-bely-support.git
44 changes: 17 additions & 27 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
BELY (Best Electronic Logbook Yet) is a Java EE web application for electronic logbook management. It is deployed on Payara Server (GlassFish fork) and uses MySQL/MariaDB as its database. The project includes:

- **LogrPortal**: Main Java EE web application (JSF/PrimeFaces frontend + REST API)
- **Python web service**: Python-based web service components
- **MQTT integration**: Python framework for handling MQTT events and notifications
- **CLI utilities**: Command-line tools for searching and querying the system

Expand All @@ -23,9 +22,10 @@ source setup.sh
This sets up critical environment variables:
- `LOGR_ROOT_DIR`: Root directory of the repository
- `LOGR_SUPPORT_DIR`: Support software directory (Payara, Java, MySQL, etc.)
- `CDB_BELY_SUPPORT_GLASSFISH_ADMIN_PASSWORD_FILE`: Payara admin password file used by `make`/`sbin` `asadmin` calls
- `LOGR_INSTALL_DIR`: Installation directory
- `LOGR_DATA_DIR`: Data directory
- `PYTHONPATH`: Includes `src/python` and Python client paths
- `PYTHONPATH`: Includes the generated Python API client

### Initial Setup

Expand Down Expand Up @@ -80,16 +80,11 @@ ant dist
# Deploy to Payara (from project root)
make deploy-web-portal

# Deploy web service
make deploy-web-service

# Undeploy
make undeploy-web-portal
make undeploy-web-service

# Development deployment variants
make deploy-web-portal-dev
make deploy-web-service-dev
```

### Running Tests
Expand All @@ -114,15 +109,6 @@ pytest tests/ -n auto --dist loadfile --reruns 1 -m "not mqtt"
make test-mqtt
```

### Python Web Service Development

```bash
# Start the Python web service
./sbin/cdbWebService.sh
```

Python code is in `src/python/cdb/`.

## Architecture

### Java Package Structure
Expand Down Expand Up @@ -163,23 +149,25 @@ Location: `src/java/LogrPortal/web/`

### Technology Stack

- **Framework**: Java EE 8 (JSF 2.3, EJB 3.2, JPA 2.2, JAX-RS 2.1)
- **UI**: PrimeFaces 11 + PrimeFaces Extensions, OmniFaces 3
- **App Server**: Payara 5.2022.5 (GlassFish fork)
- **Framework**: Jakarta EE 11 (`jakarta.*`; Faces 4.1/Mojarra, EJB 4, JPA 3.2, JAX-RS 4/Jersey), Java 25 (Temurin)
- **UI**: PrimeFaces 16.0.2 + PrimeFaces Extensions 16.0.2, OmniFaces 5.5.7
- **App Server**: Payara 7.2026.11 (GlassFish fork)
- **Database**: MySQL/MariaDB (driver: mariadb-java-client-3.1.0.jar)
- **ORM**: EclipseLink (JPA implementation)
- **Build**: Apache Ant + NetBeans project
- **API Docs**: Swagger/OpenAPI 2.1.5
- **PDF Generation**: iText 5.5.13.1
- **ORM**: EclipseLink 5 (JPA implementation)
- **Build**: Apache Ant 1.10.18 + NetBeans 32 project
- **API Docs**: Swagger/OpenAPI (`swagger-*-jakarta` 2.2.52)
- **PDF Generation**: openhtmltopdf 1.0.10 via flexmark-pdf-converter; iText 5.5.13.1
- **Markdown**: Flexmark 0.64.8
- **Logging**: Log4j 2.17.0
- **Logging**: Log4j 2.26.0 (`src/java/log4j2.xml`)
- **XHTML namespaces**: use jakarta URNs (`jakarta.faces.html`, `jakarta.faces.core`, `jakarta.faces.facelets`, `jakarta.tags.core`); `plans/taglib_check.py` checks tags/attributes against the PrimeFaces taglibs

### MQTT Integration

The MQTT notification framework is a pluggable Python system for handling MQTT events:
- Location: `tools/developer_tools/bely-mqtt-message-broker/`
- Features: Type-safe Pydantic models, topic matching with wildcards, notification handlers (email, Slack, Discord)
- See `tools/developer_tools/bely-mqtt-message-broker/README.md` for details
- Payara side: `mqtt-rar-1.0.0.rar` connector (`src/lib/`), JNDI `bely/MQTT/resource`; `make mqtt-configuration` then `make configure-mqtt` (or `make configure-mqtt-dev` for the NetBeans Payara)

### Plugins System

Expand All @@ -194,13 +182,14 @@ BELY supports custom plugins for extending functionality:
1. Open NetBeans: `netbeans &`
2. File > Open Project > Select `src/java/LogrPortal`
3. Resolve missing server: Right-click project > "Resolve Missing Server Problem"
4. Add Payara Server pointing to `$LOGR_SUPPORT_DIR/netbeans/payara`
4. Add Payara Server pointing to `$LOGR_SUPPORT_DIR/netbeans/payara` (Payara 7, default JDK 25)
5. Copy MariaDB driver to Payara:
```bash
cp src/java/LogrPortal/lib/mariadb-java-client-3.1.0.jar \
$LOGR_SUPPORT_DIR/netbeans/payara/glassfish/domains/domain1/lib/
```
6. Run project from NetBeans
6. Raise the domain heap to `-Xmx4g` (see README) and run project from NetBeans
7. After files change outside the IDE (patches, `git pull`), use Clean and Build: copy-on-save misses them

### Adding New Entities

Expand Down Expand Up @@ -231,7 +220,8 @@ Version updates go in `db/sql/updates/updateToYYYY.X.sql` (e.g., `updateTo2025.3

- `Makefile`: Top-level make targets for building, deploying, testing
- `setup.sh`: Environment variable setup (must be sourced)
- `sbin/`: Deployment and utility scripts
- `sbin/`: Deployment and utility scripts (`bely_*.sh`; `bely_asadmin_env.sh` authenticates `asadmin` with the admin password file)
- `support/`: git submodule [cdb-bely-support](https://github.com/AdvancedPhotonSource/cdb-bely-support) (runtime installers shared with ComponentDB), pinned to `etc/support.version`; `make support` copies it to `$LOGR_SUPPORT_DIR`
- `src/java/LogrPortal/build.xml`: Ant build file
- `src/java/LogrPortal/nbproject/project.properties`: NetBeans project configuration
- `db/sql/create_logr_tables.sql`: Main database schema
Expand Down
75 changes: 37 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ SUBDIRS = src

.PHONY: help
.PHONY: support support-mysql dev-config
.PHONY: db backup db-dev deploy-web-portal undeploy-web-portal deploy-web-service undeploy-web-service
.PHONY: db-dev backup-dev deploy-web-portal-dev undeploy-web-portal-dev deploy-web-service-dev undeploy-web-service-dev
.PHONY: db backup db-dev deploy-web-portal undeploy-web-portal
.PHONY: db-dev backup-dev deploy-web-portal-dev undeploy-web-portal-dev
.PHONY: prepare-release release-python-client
.PHONY: mqtt-configuration configure-mqtt configure-mqtt-dev

default:

Expand All @@ -36,12 +37,12 @@ help:
@echo ""
@echo "Build & Deploy:"
@echo " configure-web-portal Configure the web portal"
@echo " mqtt-configuration Create the MQTT configuration file (etc/mqtt.conf)"
@echo " configure-mqtt Deploy the MQTT connector (mqtt-rar) and connection pool"
@echo " deploy-web-portal Deploy the web portal"
@echo " deploy-web-service Deploy the web service"
@echo " deploy-cdb-plugin Deploy a BELY plugin"
@echo " unconfigure-web-portal Unconfigure the web portal"
@echo " undeploy-web-portal Undeploy the web portal"
@echo " undeploy-web-service Undeploy the web service"
@echo ""
@echo "Testing:"
@echo " test Run the full test suite (backs up DB, deploys test DB,"
Expand Down Expand Up @@ -69,28 +70,28 @@ release-python-client:
prepare-dev-env: support db dev-config

dev-config:
$(TOP)/sbin/cdb_prepare_dev_config.sh
$(TOP)/sbin/bely_prepare_dev_config.sh

configuration:
$(TOP)/sbin/cdb_create_configuration.sh
$(TOP)/sbin/bely_create_configuration.sh

support:
$(TOP)/sbin/cdb_install_support.sh
$(TOP)/sbin/bely_install_support.sh

support-portal:
$(TOP)/sbin/cdb_install_support_portal.sh
$(TOP)/sbin/bely_install_support_portal.sh

support-mysql:
$(TOP)/sbin/cdb_install_support_mysql.sh && $(TOP)/sbin/cdb_deploy_mysqld.sh
$(TOP)/sbin/bely_install_support_mysql.sh && $(TOP)/sbin/bely_deploy_mysqld.sh

support-netbeans:
$(TOP)/sbin/cdb_install_support_netbeans.sh
$(TOP)/sbin/bely_install_support_netbeans.sh

clean-db:
$(TOP)/sbin/cdb_create_db.sh logr $(TOP)/db/sql/clean
$(TOP)/sbin/bely_create_db.sh logr $(TOP)/db/sql/clean

test-db:
$(TOP)/sbin/cdb_create_db.sh logr $(TOP)/db/sql/test
$(TOP)/sbin/bely_create_db.sh logr $(TOP)/db/sql/test

test:
$(TOP)/sbin/bely_test.sh
Expand All @@ -107,63 +108,61 @@ test-plugins:
cd $(TOP)/tools/developer_tools/logr_plugins && python -m pytest test/ -v

db:
$(TOP)/sbin/cdb_create_db.sh
$(TOP)/sbin/bely_create_db.sh

backup:
$(TOP)/sbin/cdb_backup_all.sh logr
$(TOP)/sbin/bely_backup_all.sh logr

configure-web-portal: dist
$(TOP)/sbin/cdb_configure_web_portal.sh
$(TOP)/sbin/bely_configure_web_portal.sh

mqtt-configuration:
$(TOP)/sbin/bely_create_mqtt_configuration.sh

configure-mqtt:
$(TOP)/sbin/bely_configure_mqtt_service.sh

# NetBeans development Payara ($LOGR_SUPPORT_DIR/netbeans/payara, domain1).
configure-mqtt-dev:
$(TOP)/sbin/bely_configure_mqtt_service.sh --dev

deploy-cdb-plugin:
$(TOP)/tools/developer_tools/logr_plugins/deploy_plugin.py bely

deploy-web-portal: dist
$(TOP)/sbin/cdb_deploy_web_portal.sh

deploy-web-service:
$(TOP)/sbin/cdb_deploy_web_service.sh
$(TOP)/sbin/bely_deploy_web_portal.sh

unconfigure-web-portal:
$(TOP)/sbin/cdb_unconfigure_web_portal.sh
$(TOP)/sbin/bely_unconfigure_web_portal.sh

undeploy-web-portal:
$(TOP)/sbin/cdb_undeploy_web_portal.sh

undeploy-web-service:
$(TOP)/sbin/cdb_undeploy_web_service.sh
$(TOP)/sbin/bely_undeploy_web_portal.sh

configuration-dev:
$(TOP)/sbin/cdb_create_configuration.sh cdb_dev
$(TOP)/sbin/bely_create_configuration.sh cdb_dev

db-dev:
$(TOP)/sbin/cdb_create_db.sh logr_dev
$(TOP)/sbin/bely_create_db.sh logr_dev

clean-db-dev:
$(TOP)/sbin/cdb_create_db.sh logr_dev $(TOP)/db/sql/clean
$(TOP)/sbin/bely_create_db.sh logr_dev $(TOP)/db/sql/clean

backup-dev:
$(TOP)/sbin/cdb_backup_all.sh logr_dev
$(TOP)/sbin/bely_backup_all.sh logr_dev

deploy-cdb-plugin-dev:
$(TOP)/tools/developer_tools/logr_plugins/deploy_plugin.py cdb_dev

deploy-web-portal-dev: dist
$(TOP)/sbin/cdb_deploy_web_portal.sh cdb_dev Dev
$(TOP)/sbin/bely_deploy_web_portal.sh cdb_dev Dev

configure-web-portal-dev: dist
$(TOP)/sbin/cdb_configure_web_portal.sh cdb_dev

deploy-web-service-dev:
$(TOP)/sbin/cdb_deploy_web_service.sh cdb_dev
$(TOP)/sbin/bely_configure_web_portal.sh cdb_dev

unconfigure-web-portal-dev:
$(TOP)/sbin/cdb_unconfigure_web_portal.sh cdb_dev
$(TOP)/sbin/bely_unconfigure_web_portal.sh cdb_dev

undeploy-web-portal-dev:
$(TOP)/sbin/cdb_undeploy_web_portal.sh cdb_dev

undeploy-web-service-dev:
$(TOP)/sbin/cdb_undeploy_web_service.sh cdb_dev
$(TOP)/sbin/bely_undeploy_web_portal.sh cdb_dev

include $(TOP)/tools/make/RULES_CDB
Loading
Loading