Compare commits

..
20 Commits
Author SHA1 Message Date
james.maes d646c35903 Merge pull request 'ci: pin shared workflow to v1' (#20) from ci/pin-v1-main into main
QRun-IO/ci-policy: ci / fork-guard (push) Skipped
QRun-IO/ci-policy: native / fork-deny (push) Skipped
QRun-IO/ci-policy: native / dotnet-0 (push) Skipped
QRun-IO/ci-policy: ci / Scoped workflow [workflow 1e25bb5a243dfdcd95d4b9a4f780200ff8c8778a] (push) Successful in 16s
QRun-IO/ci-policy: native / native-result (push) Successful in 12s
QRun-IO/ci-policy: ci / head-profile (push) Skipped
QRun-IO/ci-policy: ci / repository-policy (push) Skipped
QRun-IO/ci-policy: ci / application-template-0 (push) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (push) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (push) Skipped
QRun-IO/ci-policy: ci / node-8 (push) Skipped
QRun-IO/ci-policy: ci / node-9 (push) Skipped
QRun-IO/ci-policy: ci / node-10 (push) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (push) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (push) Skipped
QRun-IO/ci-policy: ci / source-config-13 (push) Skipped
QRun-IO/ci-policy: ci / source-config-14 (push) Skipped
QRun-IO/ci-policy: ci / original-business (push) Skipped
QRun-IO/ci-policy: ci / original-voyage (push) Skipped
QRun-IO/ci-policy: ci / original-cli (push) Skipped
QRun-IO/ci-policy: ci / shared-pipeline (push) Skipped
QRun-IO/ci-policy: ci / ci-result (push) Successful in 14s
build / maven (push) Successful in 2m58s
QRun-IO/ci-policy: ci / gradle-1 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (push) Skipped
QRun-IO/ci-policy: ci / android-0 (push) Skipped
QRun-IO/ci-policy: ci / original-mcp (push) Skipped
QRun-IO/ci-policy: ci / not-enrolled (push) Skipped
maven / build (push) Successful in 2m58s
2026-11-06 16:05:36 +00:00
james.maesandClaude Opus 5.5 a773770e0b ci: pin shared workflow to v1
build / maven (push) Successful in 2m38s
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / Scoped workflow [workflow 1e25bb5a243dfdcd95d4b9a4f780200ff8c8778a] (pull_request) Successful in 8s
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 7s
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-business (pull_request) Skipped
QRun-IO/ci-policy: ci / android-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-mcp (pull_request) Skipped
QRun-IO/ci-policy: ci / original-voyage (pull_request) Skipped
QRun-IO/ci-policy: ci / original-cli (pull_request) Skipped
QRun-IO/ci-policy: ci / shared-pipeline (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: ci / ci-result (pull_request) Successful in 8s
maven / build (push) Successful in 2m38s
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:07:29 +00:00
james.maes 4dda6a31f9 Merge pull request 'ci: use shared ci-workflows Maven workflow' (#18) from ci/ci-workflows into main
QRun-IO/ci-policy: ci / fork-guard (push) Skipped
QRun-IO/ci-policy: native / fork-deny (push) Skipped
QRun-IO/ci-policy: native / dotnet-0 (push) Skipped
QRun-IO/ci-policy: ci / head-profile (push) Skipped
QRun-IO/ci-policy: ci / repository-policy (push) Skipped
QRun-IO/ci-policy: ci / application-template-0 (push) Skipped
QRun-IO/ci-policy: ci / gradle-1 (push) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (push) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (push) Skipped
QRun-IO/ci-policy: native / native-result (push) Successful in 11s
QRun-IO/ci-policy: ci / java-maven-7-head (push) Skipped
QRun-IO/ci-policy: ci / node-8 (push) Skipped
QRun-IO/ci-policy: ci / node-9 (push) Skipped
QRun-IO/ci-policy: ci / node-10 (push) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (push) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (push) Skipped
QRun-IO/ci-policy: ci / source-config-13 (push) Skipped
QRun-IO/ci-policy: ci / source-config-14 (push) Skipped
QRun-IO/ci-policy: ci / original-business (push) Skipped
QRun-IO/ci-policy: ci / original-voyage (push) Skipped
QRun-IO/ci-policy: ci / original-cli (push) Skipped
QRun-IO/ci-policy: ci / shared-pipeline (push) Skipped
QRun-IO/ci-policy: ci / ci-result (push) Successful in 5s
build / maven (push) Successful in 1m21s
QRun-IO/ci-policy: ci / Scoped workflow [workflow d20a578c7d818bc7ca32a2ac2c675da4e4f27385] (push) Successful in 8s
QRun-IO/ci-policy: ci / java-docker-3-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (push) Skipped
QRun-IO/ci-policy: ci / android-0 (push) Skipped
QRun-IO/ci-policy: ci / original-mcp (push) Skipped
QRun-IO/ci-policy: ci / not-enrolled (push) Skipped
maven / build (push) Successful in 1m21s
2026-11-05 23:15:51 +00:00
james.maesandClaude Opus 5.5 7dc0340f93 ci: use shared ci-workflows Maven workflow
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / Scoped workflow [workflow 1b3648d9421543350067e95e54959dfb471b26d5] (pull_request) Successful in 5s
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 4s
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / android-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-business (pull_request) Skipped
QRun-IO/ci-policy: ci / original-mcp (pull_request) Skipped
QRun-IO/ci-policy: ci / original-voyage (pull_request) Skipped
QRun-IO/ci-policy: ci / original-cli (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: ci / shared-pipeline (pull_request) Skipped
build / maven (push) Successful in 1m26s
QRun-IO/ci-policy: Shared Java Maven CI / verify (pull_request) Successful in 1m25s
QRun-IO/ci-policy: Shared Java Maven CI / secrets (pull_request) Failing after 1s
QRun-IO/ci-policy: Shared Java Maven CI / gate (pull_request) Failing after 1s
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Failing after 16m8s
QRun-IO/ci-policy: ci / ci-result (pull_request) Failing after 2s
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Skipped
maven / build (push) Successful in 1m26s
Replace the platform-ci release callers with one caller of
KofTwentyTwo/ci-workflows maven.yaml (qqq-orb port).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:03:47 +00:00
forge-recovery 901fdb701a ci: enroll shared Gitea lifecycle
QRun-IO/ci-policy: ci / ci-result (push) Successful in 7s
QRun-IO/ci-policy: ci / fork-guard (push) Skipped
QRun-IO/ci-policy: ci / head-profile (push) Skipped
QRun-IO/ci-policy: ci / application-template-0 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (push) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (push) Skipped
QRun-IO/ci-policy: ci / node-8 (push) Skipped
QRun-IO/ci-policy: ci / node-9 (push) Skipped
QRun-IO/ci-policy: ci / node-10 (push) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (push) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (push) Skipped
QRun-IO/ci-policy: ci / source-config-13 (push) Skipped
QRun-IO/ci-policy: ci / source-config-14 (push) Skipped
QRun-IO/ci-policy: native / fork-deny (push) Skipped
QRun-IO/ci-policy: native / dotnet-0 (push) Skipped
Shared Java Maven CI / secrets (push) Successful in 24s
QRun-IO/ci-policy: native / native-result (push) Successful in 6s
QRun-IO/ci-policy: Shared Java Maven CI / secrets (push) Successful in 21s
QRun-IO/ci-policy: ci / repository-policy (push) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (push) Skipped
QRun-IO/ci-policy: Shared Java Maven CI / verify (push) Successful in 58s
Shared Java Maven CI / verify (push) Successful in 1m2s
QRun-IO/ci-policy: ci / java-maven-6 (push) Successful in 24m16s
Shared Java Maven CI / gate (push) Successful in 18s
qrun-release / release (push) Successful in 24m33s
qrun-release / postpublish (push) Skipped
QRun-IO/ci-policy: ci / gradle-1 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (push) Skipped
QRun-IO/ci-policy: ci / android-0 (push) Skipped
QRun-IO/ci-policy: ci / original-mcp (push) Skipped
QRun-IO/ci-policy: ci / not-enrolled (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (push) Skipped
QRun-IO/ci-policy: Shared Java Maven CI / gate (push) Successful in 16s
2026-11-02 22:13:22 +00:00
94f321032a ci: add the isolated postpublish job to the QRun release caller
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
Shared Java Maven CI / secrets (push) Successful in 16s
QRun-IO/ci-policy: Shared Java Maven CI / secrets (pull_request) Successful in 16s
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 5s
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
Shared Java Maven CI / gate (push) Canceled after 0s
Shared Java Maven CI / verify (push) Canceled after 0s
qrun-release / release (push) Canceled after 2h38m57s
qrun-release / postpublish (push) Canceled after 0s
QRun-IO/ci-policy: Shared Java Maven CI / verify (pull_request) Successful in 59s
QRun-IO/ci-policy: Shared Java Maven CI / gate (pull_request) Successful in 9s
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Successful in 2h44m52s
QRun-IO/ci-policy: ci / ci-result (pull_request) Successful in 5s
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 15:48:23 +00:00
abf66bf27b ci: move the QRun release caller to the thin v2 contract
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-2 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / ci-result (pull_request) Failing after 5s
Shared Java Maven CI / secrets (push) Successful in 14s
QRun-IO/ci-policy: Shared Java Maven CI / secrets (pull_request) Successful in 14s
QRun-IO/ci-policy: Shared Java Maven CI / verify (pull_request) Failing after 1m19s
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 5s
QRun-IO/ci-policy: Shared Java Maven CI / gate (pull_request) Canceled after 0s
qrun-release / release (push) Canceled after 1h11m50s
Shared Java Maven CI / gate (push) Canceled after 0s
Shared Java Maven CI / verify (push) Canceled after 0s
QRun-IO/ci-policy: ci / node-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-4 (pull_request) Canceled after 1h11m35s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 06:17:27 +00:00
forge-recoveryandCodex 9c0510a98c ci: add the identical QRun release caller
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-2 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: Shared Java Maven CI / verify (pull_request) Failing after 1m35s
QRun-IO/ci-policy: Shared Java Maven CI / secrets (pull_request) Successful in 21s
QRun-IO/ci-policy: Shared Java Maven CI / gate (pull_request) Failing after 0s
QRun-IO/ci-policy: ci / ci-result (pull_request) Failing after 5s
QRun-IO/ci-policy: ci / source-config-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-4 (pull_request) Failing after 15m33s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 04:09:33 +00:00
james.maes e22adf9d36 ci: use shared advanced CodeQL scanning
Approved scanner-only rollout. Preserve Java scanning and add workflow scanning using the immutable shared worker.
2026-10-29 16:19:19 -05:00
james.maesandCodex b2c4e02856 ci: adopt managed orb 0.8 patch track (#11)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 16:35:04 -05:00
james.maesandCodex d1b58efdaa ci: adopt central orb 0.7.12 and stable gates (#10)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 08:49:42 -05:00
james.maesandCodex 11c87dfb7e ci: adopt shared orb 0.7.11 (#9)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 00:53:18 -05:00
james.maes 5969a17b01 Merge pull request #8 from QRun-IO/feature/central-ci
ci: adopt orb 0.7.4 and buildable QQQ dependencies
2026-10-20 19:37:19 -05:00
james.maesandCodex 5dd9b4b241 ci: adopt shared orb with published Custom Apps dependencies
Co-Authored-By: Codex <noreply@openai.com>
2026-10-20 19:33:00 -05:00
james.maes af8618ec0f Merge pull request #4 from QRun-IO/feature/release-rc-automation
ci: hotfix/* pushes no longer publish
2026-10-13 15:03:12 -05:00
james.maesandClaude Opus 5.5 e708c61a1d ci: keep apt unattended (configure-package-install pre-step)
Every job hung in "Install Java 21" on the needrestart dialog until the
10m no-output timeout. Adds the standard's configure-package-install
command (QRUN-QBIT-REPO-STANDARD C1) as a pre-step to each orb job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:59:56 -05:00
james.maesandClaude Opus 5.5 97b764640f ci: hotfix/* pushes no longer publish
Removes publish_hotfix_release: a hotfix/* branch push published a GA
release to Maven Central with no tag or review (QRun-IO/qbit-cdn#12,
QRun-IO/qqq#1121). hotfix/* branches now run test_only; a hotfix
release publishes from a reviewed vX.Y.Z tag through publish_release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:38:30 -05:00
James MaesandClaude Opus 4.8 e22e8d96cd docs: add CLAUDE.md pointer to QQQ knowledge-base dossier + hub
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 05:31:03 -05:00
james.maesandClaude Opus 4.7 f2df9b63f6 chore: add CODEOWNERS pointing to sole maintainer
Architecture audit pass 2026-05-21. Minimal CODEOWNERS file
making the implicit ownership explicit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 17:14:05 -05:00
james.maesandClaude Opus 4.7 964567d92f docs: add README and LICENSE (Apache 2.0)
Adds the missing README and LICENSE files identified by an
architecture audit on 2026-05-21. README marks the repo as
experimental/scaffold given current 0.9999.0 sentinel-version
deps; LICENSE matches the Apache 2.0 declaration in pom.xml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 17:11:56 -05:00
28 changed files with 616 additions and 1495 deletions

No files matched your search

+10 -52
View File
@@ -1,56 +1,14 @@
version: 2.1
setup: true
orbs:
qqq-orb: kingsrook/qqq-orb@0.6
qqq-orb: kingsrook/qqq-orb@0.8
workflows:
test_only:
setup:
jobs:
- qqq-orb/mvn_test_only:
context: [qqq-maven-registry-credentials]
filters:
branches:
ignore: /(develop|main|release/.*|hotfix/.*|integration.*)/
tags:
only: []
publish_snapshot:
jobs:
- qqq-orb/mvn_publish:
context: [qqq-maven-registry-credentials]
branch_type: snapshot
filters:
branches:
only:
- develop
publish_release_candidate:
jobs:
- qqq-orb/mvn_publish:
context: [qqq-maven-registry-credentials]
branch_type: release_candidate
filters:
branches:
only:
- /release\/.*/
publish_release:
jobs:
- qqq-orb/mvn_publish:
context: [qqq-maven-registry-credentials]
branch_type: release
filters:
branches:
ignore: /.*/
tags:
only: [/v.*/]
publish_hotfix_release:
jobs:
- qqq-orb/mvn_publish:
context: [qqq-maven-registry-credentials]
branch_type: hotfix
filters:
branches:
only:
- /hotfix\/.*/
- qqq-orb/generate_pipeline:
orb_version: '0.8'
filters:
branches:
ignore: automation/qbit-rc-pending
tags:
only: /v.*/
+7
View File
@@ -0,0 +1,7 @@
name: build
on:
push:
jobs:
maven:
uses: self:KofTwentyTwo/ci-workflows/.gitea/workflows/maven.yaml@v1
secrets: inherit
+1
View File
@@ -0,0 +1 @@
* @KofTwentyTwo
+23
View File
@@ -0,0 +1,23 @@
name: CodeQL
'on':
push:
branches:
- main
- develop
- release/**
- hotfix/**
pull_request: {}
schedule:
- cron: 41 16 * * 0
workflow_dispatch: {}
permissions:
contents: read
actions: read
security-events: write
packages: read
concurrency:
group: codeql-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
uses: QRun-IO/qqq-orb/.github/workflows/qbit-codeql.yml@c288a8864fe9054f68410e1d78f5863aea4c4d22
+16
View File
@@ -0,0 +1,16 @@
profile: qbit
orb_version: '0.8'
default_branch: main
java_version: '21'
browsers: true
api_checks: false
docs_only: false
release_on_main: false
release_tag_policy: v-prefix
test_branch_policy: feature
publish:
snapshot: true
release_candidate: true
release: true
asciidoc: false
release_completion: false
+17
View File
@@ -0,0 +1,17 @@
# qbit-custom-apps
## Knowledge base
Reviewed knowledge for this repo and the wider QQQ platform lives in the second-brain
vault (`$SECOND_BRAIN_VAULT`):
- Hub / entry point: `knowledge/qqq/qqq-hub.md`
- This repo's dossier: `knowledge/qqq/repos/qbit-custom-apps.md`
(reviewed at commit `f2df9b63f6cb`, branch `main`, 2026-07-04)
- QBit mechanics refresher: `knowledge/qqq/architecture/metadata-model.md`
Key facts from the review: experimental/demo-stage QBit; real development is on
`origin/develop` (never merged to main); main pins qqq-backend-core and
qqq-frontend-material-dashboard to the local-dev sentinel `0.9999.0` (not buildable from
public repos); licensing is contradictory (Apache-2.0 LICENSE vs AGPL pom/headers, plus a
proprietary ColdTrack header on `LookerWidgetRenderer.java`); no tests, no releases.
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright
owner or by an individual or Legal Entity authorized to submit on
behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written
communication sent to the Licensor or its representatives, including
but not limited to communication on electronic mailing lists, source
code control systems, and issue tracking systems that are managed by,
or on behalf of, the Licensor for the purpose of discussing and
improving the Work, but excluding communication that is conspicuously
marked or otherwise designated in writing by the copyright owner as
"Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2022-2025 QRunIO, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+46
View File
@@ -0,0 +1,46 @@
# qbit-custom-apps
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
> **Status:** ⚠️ **Experimental / scaffold.** This qbit declares dependencies against `0.9999.0` sentinel versions of `qqq-backend-core` and `qqq-frontend-material-dashboard`, which means it does **not** consume a released framework version. Treat as exploratory until a maintainer confirms its intended state.
QBit that aims to let qqq apps register **custom application screens** declaratively — pages built from widgets, forms, and table views — without writing dedicated front-end components.
**Type:** Application QBit
**For:** Developers building qqq apps that need bespoke screens beyond standard table CRUD
## Why this exists
qqq's standard dashboard renders auto-generated screens from table metadata. Most apps eventually need pages that *don't* map to a single table — operator dashboards, configurator wizards, multi-step workflows that pull data from several sources, embedded Looker dashboards, etc. `qbit-custom-apps` is intended to let those screens be declared as metadata.
## What it provides
The repository contains the following package layout:
```
src/main/java/com/kingsrook/qbits/customapps/
├── definition/ # CustomAppDefinition and related metadata
├── model/ # Data models backing custom apps
├── metadata/ # Metadata producers and registrators
└── widgets/ # Widget composition utilities
```
## How it relates to other qqq repos
- **Declared dependencies:** `qqq-backend-core`, `qqq-backend-module-rdbms`, `qqq-frontend-material-dashboard`, `qqq-middleware-api`, `qqq-middleware-javalin` — all currently pinned to the `0.9999.0` sentinel version (development build).
- **Inherits from:** `qbit-build-parent` (in the `qbit-bom` repo).
- **Frontend pair:** Custom apps render via the standard qqq dashboard; no separate frontend component needed.
## Known gaps
- No automated tests at the time this README was added.
- Sentinel `0.9999.0` versions indicate this qbit is not currently consuming any released qqq build — meaning it can't be cleanly installed by a downstream app.
- This README was added by an audit pass; original maintainer should verify intent and either pin to a real qqq version or mark the repo archived.
## License
Apache License 2.0 — see [LICENSE](./LICENSE).
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md), [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md), [CODE_STYLE.md](./CODE_STYLE.md), and [SECURITY.md](./SECURITY.md).
+16 -12
View File
@@ -24,16 +24,12 @@
<properties>
<revision>0.1.0-SNAPSHOT</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
</properties>
<parent>
<groupId>com.kingsrook</groupId>
<artifactId>qbit-build-parent</artifactId>
<version>1.4.0</version>
<version>1.5.1</version>
</parent>
<groupId>com.kingsrook.qbits</groupId>
@@ -82,16 +78,24 @@
</scm>
<!-- Keep QQQ modules aligned with the published core/frontend release. -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-bom-pom</artifactId>
<version>0.40.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-backend-core</artifactId>
<version>0.40.0-custom-apps-qbit-a8315bc5-20260206.224214-1</version>
</dependency>
<dependency>
<groupId>com.kingsrook.qbits</groupId>
<artifactId>qbit-user-role-permissions</artifactId>
<version>0.31.0</version>
<version>0.40.0</version>
</dependency>
<dependency>
<groupId>com.kingsrook.qqq</groupId>
@@ -106,7 +110,7 @@
<dependency>
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-frontend-material-dashboard</artifactId>
<version>0.40.0-custom-apps-qbit-f0df995-20260206.202533-1</version>
<version>0.40.0</version>
</dependency>
<dependency>
@@ -23,10 +23,13 @@ package com.kingsrook.qbits.customapps;
import java.util.List;
import java.util.Optional;
import com.kingsrook.qqq.api.model.metadata.ApiInstanceMetaData;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.producers.MetaDataCustomizerInterface;
import com.kingsrook.qqq.backend.core.model.metadata.qbits.QBitConfig;
import com.kingsrook.qqq.backend.core.model.metadata.qbits.QBitMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.utils.ClassPathUtils;
@@ -57,6 +60,17 @@ public class CustomAppsQBitConfig implements QBitConfig
/***************************************************************************
*
***************************************************************************/
public static boolean isApiModuleAvailableAndDoesQBitIncludeApiVersions()
{
Optional<QBitMetaData> optionalQBitConfig = QContext.getQInstance().getQBits().values().stream().filter(qb -> qb.getConfig() instanceof CustomAppsQBitConfig).findFirst();
return (CustomAppsQBitConfig.getApiMiddlewareModuleAvailable() && optionalQBitConfig.isPresent() && ((CustomAppsQBitConfig) (optionalQBitConfig.get().getConfig())).getIncludeApiVersions());
}
/***************************************************************************
**
***************************************************************************/
@@ -24,14 +24,43 @@ package com.kingsrook.qbits.customapps;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.kingsrook.qbits.customapps.definition.CustomAppsRegistry;
import com.kingsrook.qbits.customapps.model.CustomApp;
import com.kingsrook.qbits.customapps.model.CustomAppBackendConfig;
import com.kingsrook.qbits.customapps.model.CustomAppBackendEnum;
import com.kingsrook.qbits.customapps.model.CustomAppContainer;
import com.kingsrook.qbits.customapps.model.CustomAppIcon;
import com.kingsrook.qbits.customapps.model.CustomAppSection;
import com.kingsrook.qbits.customapps.widgets.LookerWidgetRenderer;
import com.kingsrook.qqq.backend.core.actions.tables.QueryAction;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.instances.QMetaDataVariableInterpreter;
import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterOrderBy;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.WidgetType;
import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducerMultiOutput;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppSection;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
import com.kingsrook.qqq.backend.core.model.metadata.qbits.QBitMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.qbits.QBitMetaDataProducer;
import com.kingsrook.qqq.backend.core.utils.ListingHash;
import com.kingsrook.qqq.backend.core.utils.StringUtils;
import com.kingsrook.qqq.backend.core.utils.collections.MapBuilder;
import static com.kingsrook.qqq.backend.core.logging.LogUtils.logPair;
/*******************************************************************************
@@ -89,6 +118,214 @@ public class CustomAppsQBitProducer implements QBitMetaDataProducer<CustomAppsQB
/***************************************************************************
*
***************************************************************************/
public List<QAppMetaData> getCustomAppList(QInstance qInstance) throws QException
{
///////////////////////////////////////////////////
// look up data needed to set up the custom apps //
///////////////////////////////////////////////////
List<CustomAppContainer> customAppContainerList = QueryAction.execute(CustomAppContainer.TABLE_NAME, CustomAppContainer.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")));
List<CustomAppSection> customAppSectionList = QueryAction.execute(CustomAppSection.TABLE_NAME, CustomAppSection.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")));
List<CustomApp> customAppList = QueryAction.execute(CustomApp.TABLE_NAME, CustomApp.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")));
List<CustomAppIcon> customAppIcons = QueryAction.execute(CustomAppIcon.TABLE_NAME, CustomAppIcon.class, new QQueryFilter());
List<CustomAppBackendConfig> customAppBackendConfigList = QueryAction.execute(CustomAppBackendConfig.TABLE_NAME, CustomAppBackendConfig.class, new QQueryFilter());
Map<Integer, CustomAppBackendConfig> customAppBackendConfigMap = customAppBackendConfigList.stream().collect(Collectors.toMap(CustomAppBackendConfig::getId, Function.identity()));
/////////////////////
// icon id to icon //
/////////////////////
Map<Integer, CustomAppIcon> customAppIconMap = customAppIcons.stream().collect(Collectors.toMap(CustomAppIcon::getId, Function.identity()));
//////////////////////////////
// container id to sections //
//////////////////////////////
ListingHash<Integer, CustomAppSection> sectionsMap = new ListingHash<>();
customAppSectionList.forEach(section -> sectionsMap.add(section.getCustomAppContainerId(), section));
////////////////////////
// section id to apps //
////////////////////////
ListingHash<Integer, CustomApp> appsMap = new ListingHash<>();
customAppList.forEach(app -> appsMap.add(app.getCustomAppSectionId(), app));
///////////////////////////////////
// iterate over containers first //
///////////////////////////////////
List<QAppMetaData> containers = new ArrayList<>();
for(CustomAppContainer container : customAppContainerList)
{
////////////////////////////////////////
// iterate over sections for this app //
////////////////////////////////////////
List<QAppSection> sections = new ArrayList<>();
for(CustomAppSection section : sectionsMap.get(container.getId()))
{
///////////////////////
// iterate over apps //
///////////////////////
List<String> appNameList = new ArrayList<>();
if(appsMap.containsKey(section.getId()))
{
for(CustomApp app : appsMap.get(section.getId()))
{
//////////////////////////////////////////////////
// turn the label into a valid name for the app //
//////////////////////////////////////////////////
String appName = nameToCamelCase(app.getName());
appName = "qca" + StringUtils.ucFirst(appName);
/////////////////////////////////////////
// create a custom widget for this app //
/////////////////////////////////////////
String widgetName = appName + "Widget";
QWidgetMetaDataInterface widget = buildWidget(qInstance, app, customAppBackendConfigMap, widgetName);
CustomAppIcon appIcon = customAppIconMap.get(app.getCustomAppIconId());
QAppMetaData appMetaData = new QAppMetaData()
.withIcon(new QIcon(appIcon.getIconId()))
.withName(appName)
.withLabel(app.getName())
.withWidgets(List.of(widget.getName()));
appNameList.add(appMetaData.getName());
/////////////////////////////////////
// add to qinstance if not already //
/////////////////////////////////////
if(!qInstance.getApps().containsKey(appMetaData.getName()))
{
qInstance.getApps().put(appMetaData.getName(), appMetaData);
}
}
}
/////////////////////////////////////////////////
// build section with its apps and add to list //
/////////////////////////////////////////////////
String sectionName = nameToCamelCase(section.getName());
sectionName = "cas" + StringUtils.ucFirst(sectionName);
QAppSection appSection = new QAppSection()
.withApps(appNameList)
.withName(sectionName)
.withLabel(section.getName());
sections.add(appSection);
}
///////////////////////
// build the new app //
///////////////////////
String containerName = nameToCamelCase(container.getName());
containerName = "cac" + StringUtils.ucFirst(containerName);
CustomAppIcon containerIcon = customAppIconMap.get(container.getCustomAppIconId());
QAppMetaData containerApp = new QAppMetaData()
.withName(containerName)
.withLabel(container.getName())
.withIcon(new QIcon().withName(containerIcon.getIconId()))
.withSections(sections);
containers.add(containerApp);
/////////////////////////////////////
// add to qinstance if not already //
/////////////////////////////////////
if(!qInstance.getApps().containsKey(containerApp.getName()))
{
qInstance.getApps().put(containerApp.getName(), containerApp);
}
}
return (containers);
}
/*******************************************************************************
** builds a widget to be used for a customapps app
*******************************************************************************/
private QWidgetMetaDataInterface buildWidget(QInstance qInstance, CustomApp customApp, Map<Integer, CustomAppBackendConfig> customAppBackendConfigMap, String widgetName)
{
CustomAppBackendConfig customAppBackendConfig = customAppBackendConfigMap.get(customApp.getCustomAppBackendConfigId());
switch(CustomAppBackendEnum.getById(customAppBackendConfig.getCustomAppBackendId()))
{
case LOOKER:
return (buildLookerWidget(qInstance, customApp, widgetName));
default:
throw new IllegalArgumentException("Unknown custom app backend: " + customAppBackendConfig.getCustomAppBackendId());
}
}
/*******************************************************************************
** builds a widget to be used for a customapps app
*******************************************************************************/
private QWidgetMetaDataInterface buildLookerWidget(QInstance qInstance, CustomApp customApp, String widgetName)
{
String componentSourceUrl = new QMetaDataVariableInterpreter().interpret("${env.Q_CUSTOM_APPS_SOURCE_URL}");
if(StringUtils.hasContent(componentSourceUrl))
{
LOG.debug("Using component source url from environment", logPair("url", componentSourceUrl));
}
else
{
componentSourceUrl = "/dynamic-qfmd-components/q-custom-apps.bundle.js";
}
//////////////////////////////
// add the dashboard to url //
//////////////////////////////
Integer dashboardId = customApp.getLookerDashboardId();
componentSourceUrl += "?dashboardId=" + dashboardId;
Map<String, Serializable> defaultValues = MapBuilder.of(
"componentName", "CustomApp",
"componentSourceUrl", componentSourceUrl,
"dashboardId", dashboardId,
"sx", new HashMap<>(Map.of("height", "calc(90vh)", "minHeight", "600px"))
);
QWidgetMetaData lookerWidget = new QWidgetMetaData()
.withName(widgetName)
.withType(WidgetType.CUSTOM_COMPONENT.getType())
.withCodeReference(new QCodeReference(LookerWidgetRenderer.class))
.withGridColumns(12)
.withIsCard(false)
.withLabel(null)
.withDefaultValues(defaultValues);
if(qInstance.getWidget(widgetName) == null)
{
qInstance.add(lookerWidget);
}
return (lookerWidget);
}
/*******************************************************************************
** transform an app name into a camelCase name
*******************************************************************************/
private static String nameToCamelCase(String label)
{
String[] parts = label
.replaceAll("[^a-zA-Z0-9]+", " ")
.trim()
.split("\\s+");
StringBuilder result = new StringBuilder(parts[0].toLowerCase());
for(int i = 1; i < parts.length; i++)
{
result.append(parts[i].substring(0, 1).toUpperCase()).append(parts[i].substring(1).toLowerCase());
}
return result.toString();
}
/*******************************************************************************
** Getter for qBitConfig
*******************************************************************************/
@@ -1,128 +0,0 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qbits.customapps.customizers;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import com.kingsrook.qqq.backend.core.actions.values.QCustomPossibleValueProvider;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.actions.values.SearchPossibleValueSourceInput;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValue;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppContainerPlaceBeforeContainerPossibleValueSource implements QCustomPossibleValueProvider<String>
{
private static final QLogger LOG = QLogger.getLogger(CustomAppContainerPlaceBeforeContainerPossibleValueSource.class);
public static final String NAME = "placeBeforeContainer";
/*******************************************************************************
**
*******************************************************************************/
@Override
public QPossibleValue<String> getPossibleValue(Serializable idValue)
{
try
{
for(QAppMetaData app : getNavApps())
{
if(app.getLabel().equals(idValue))
{
return appToPossibleValue(app);
}
}
}
catch(Exception e)
{
LOG.error("Unable to find app with label: {}", idValue);
}
return null;
}
/*******************************************************************************
**
*******************************************************************************/
@Override
public List<QPossibleValue<String>> search(SearchPossibleValueSourceInput input) throws QException
{
List<QPossibleValue<String>> rs = new ArrayList<>();
for(QAppMetaData app : getNavApps())
{
rs.add(appToPossibleValue(app));
}
return rs;
}
/*******************************************************************************
**
*******************************************************************************/
private static List<QAppMetaData> getNavApps() throws QException
{
//////////////////////////////////////////////////////////////////////////
// determine which apps are in the nav bar based on not having a parent //
//////////////////////////////////////////////////////////////////////////
List<QAppMetaData> navApps = new ArrayList<>();
Map<String, QAppMetaData> apps = QContext.getQInstance().getApps();
for(String appName : apps.keySet())
{
QAppMetaData app = apps.get(appName);
if(app.getParentAppName() == null)
{
navApps.add(app);
}
}
//////////////////////////////////////////
// sort the navApps by their sort order //
//////////////////////////////////////////
navApps.sort(Comparator.comparing(QAppMetaData::getSortOrder));
return (navApps);
}
/*******************************************************************************
**
*******************************************************************************/
private static QPossibleValue<String> appToPossibleValue(QAppMetaData app)
{
return new QPossibleValue<>(app.getLabel(), app.getLabel());
}
}
@@ -1,123 +0,0 @@
/*
* Copyright © 2022-2024. ColdTrack <contact@coldtrack.com>. All Rights Reserved.
*/
package com.kingsrook.qbits.customapps.customizers;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import com.kingsrook.qbits.customapps.model.CustomAppContainer;
import com.kingsrook.qbits.customapps.utils.CustomAppPermissionUtils;
import com.kingsrook.qbits.customapps.utils.CustomAppsUtils;
import com.kingsrook.qbits.userrolepermissions.model.Permission;
import com.kingsrook.qqq.backend.core.actions.customizers.RecordCustomizerUtilityInterface;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface;
import com.kingsrook.qqq.backend.core.actions.tables.DeleteAction;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataInput;
import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataOutput;
import com.kingsrook.qqq.backend.core.model.actions.tables.delete.DeleteInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.update.UpdateInput;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppContainerTableCustomizer implements TableCustomizerInterface
{
/*******************************************************************************
** custom actions to run after table meta data was created by the meta data action
**
*******************************************************************************/
@Override
public void postMetaDataAction(TableMetaDataInput tableMetaDataInput, TableMetaDataOutput tableMetaDataOutput) throws QException
{
/////////////////////////////////
// add dynamic chips for icons //
/////////////////////////////////
CustomAppsUtils.addDynamicIconChipAdornments(tableMetaDataOutput.getTable(), "customAppIconId");
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> preInsert(InsertInput insertInput, List<QRecord> records, boolean isPreview) throws QException
{
if(!isPreview)
{
preInsertOrUpdate(records, Optional.empty());
}
return (records);
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> preUpdate(UpdateInput updateInput, List<QRecord> records, boolean isPreview, Optional<List<QRecord>> oldRecordList) throws QException
{
if(!isPreview)
{
preInsertOrUpdate(records, oldRecordList);
}
return (records);
}
/*******************************************************************************
**
*******************************************************************************/
private void preInsertOrUpdate(List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException
{
Optional<Map<Serializable, QRecord>> oldRecordMap = oldRecordListToMap("id", oldRecordList);
for(QRecord record : records)
{
///////////////////////////////////////////////////////////////////////
// create a permission for this container (or insert if none exists) //
///////////////////////////////////////////////////////////////////////
String name = ValueUtils.getValueAsString(RecordCustomizerUtilityInterface.getValueFromRecordElseFromOldRecord("name", record, record.getValue("id"), oldRecordMap));
CustomAppContainer container = new CustomAppContainer(record).withName(name);
Permission permission = CustomAppPermissionUtils.buildOrGetPermission(container.getName(), CustomAppContainer.TABLE_NAME);
record.setValue("permissionId", permission.getId());
}
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> postDelete(DeleteInput deleteInput, List<QRecord> records) throws QException
{
List<Serializable> permissionIds = new ArrayList<>();
for(QRecord record : records)
{
////////////////////////////////////////////
// delete a permission for this container //
////////////////////////////////////////////
CustomAppContainer container = new CustomAppContainer(record);
Integer permissionId = container.getPermissionId();
permissionIds.add(permissionId);
}
new DeleteAction().execute(new DeleteInput(Permission.TABLE_NAME).withPrimaryKeys(permissionIds));
return TableCustomizerInterface.super.postDelete(deleteInput, records);
}
}
@@ -1,89 +0,0 @@
/*
* Copyright © 2022-2025. ColdTrack <contact@coldtrack.com>. All Rights Reserved.
*/
package com.kingsrook.qbits.customapps.customizers;
import java.util.List;
import com.kingsrook.qbits.customapps.metadata.CustomAppsGenericCompositeWidgetMetaDataProducer;
import com.kingsrook.qbits.customapps.model.CustomAppIcon;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.tables.QueryOrGetInputInterface;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.CompositeWidgetData;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.icon.IconBlockData;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.icon.IconStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.icon.IconValues;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextBlockData;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextValues;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppIconTableCustomizer implements TableCustomizerInterface
{
public static final String LABEL_COLOR = "rgb(52, 71, 103)";
public static final String VALUE_COLOR = "rgb(123, 128, 154)";
/***************************************************************************
*
***************************************************************************/
@Override
public List<QRecord> postQuery(QueryOrGetInputInterface queryInput, List<QRecord> records) throws QException
{
for(QRecord record : records)
{
setIconPreview(record);
}
return records;
}
/***************************************************************************
*
***************************************************************************/
private static IconBlockData iconBlock(String color, String iconName)
{
return new IconBlockData().withValues(new IconValues().withName(iconName))
.withStyles(new IconStyles().withColor(color).withFontSize("125px"));
}
/***************************************************************************
*
***************************************************************************/
public static TextBlockData valueTextBlock(String color, String text)
{
return new TextBlockData().withValues(new TextValues(text))
.withStyles(new TextStyles().withColor(color).withSize("14").withWeight("bold"));
}
/***************************************************************************
*
***************************************************************************/
private static void setIconPreview(QRecord record)
{
CustomAppIcon customAppIcon = new CustomAppIcon(record);
if(customAppIcon.getIconId() != null && customAppIcon.getName() != null)
{
CustomAppsGenericCompositeWidgetMetaDataProducer.setDividerValue(record, "divider");
CompositeWidgetData previewComposite = new CompositeWidgetData().withLayout(CompositeWidgetData.Layout.FLEX_ROW)
.withBlock(valueTextBlock(LABEL_COLOR, "Icon Preview: "))
.withBlock(iconBlock(VALUE_COLOR, customAppIcon.getIconId()));
record.setValue("iconPreview", previewComposite);
}
}
}
@@ -1,117 +0,0 @@
/*
* Copyright © 2022-2024. ColdTrack <contact@coldtrack.com>. All Rights Reserved.
*/
package com.kingsrook.qbits.customapps.customizers;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import com.kingsrook.qbits.customapps.model.CustomApp;
import com.kingsrook.qbits.customapps.utils.CustomAppPermissionUtils;
import com.kingsrook.qbits.customapps.utils.CustomAppsUtils;
import com.kingsrook.qbits.userrolepermissions.model.Permission;
import com.kingsrook.qqq.backend.core.actions.customizers.RecordCustomizerUtilityInterface;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface;
import com.kingsrook.qqq.backend.core.actions.tables.DeleteAction;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataInput;
import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataOutput;
import com.kingsrook.qqq.backend.core.model.actions.tables.delete.DeleteInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.update.UpdateInput;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppTableCustomizer implements TableCustomizerInterface
{
/*******************************************************************************
** custom actions to run after table meta data was created by the meta data action
**
*******************************************************************************/
@Override
public void postMetaDataAction(TableMetaDataInput tableMetaDataInput, TableMetaDataOutput tableMetaDataOutput) throws QException
{
CustomAppsUtils.addDynamicIconChipAdornments(tableMetaDataOutput.getTable(), "customAppIconId");
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> preInsert(InsertInput insertInput, List<QRecord> records, boolean isPreview) throws QException
{
if(!isPreview)
{
preInsertOrUpdate(records, Optional.empty());
}
return (records);
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> preUpdate(UpdateInput updateInput, List<QRecord> records, boolean isPreview, Optional<List<QRecord>> oldRecordList) throws QException
{
if(!isPreview)
{
preInsertOrUpdate(records, oldRecordList);
}
return (records);
}
/*******************************************************************************
**
*******************************************************************************/
private void preInsertOrUpdate(List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException
{
Optional<Map<Serializable, QRecord>> oldRecordMap = oldRecordListToMap("id", oldRecordList);
for(QRecord record : records)
{
///////////////////////////////////////////////////////////////////////
// create a permission for this app (or insert if none exists) //
///////////////////////////////////////////////////////////////////////
String appName = ValueUtils.getValueAsString(RecordCustomizerUtilityInterface.getValueFromRecordElseFromOldRecord("name", record, record.getValue("id"), oldRecordMap));
CustomApp app = new CustomApp(record).withName(appName);
Permission permission = CustomAppPermissionUtils.buildOrGetPermission(app.getName(), CustomApp.TABLE_NAME);
record.setValue("permissionId", permission.getId());
}
}
/***************************************************************************
**
***************************************************************************/
@Override
public List<QRecord> postDelete(DeleteInput deleteInput, List<QRecord> records) throws QException
{
for(QRecord record : records)
{
//////////////////////////////////////
// delete a permission for this app //
//////////////////////////////////////
CustomApp app = new CustomApp(record);
Integer permissionId = app.getPermissionId();
new DeleteAction().execute(new DeleteInput(Permission.TABLE_NAME).withPrimaryKey(permissionId));
}
return TableCustomizerInterface.super.postDelete(deleteInput, records);
}
}
@@ -124,7 +124,7 @@ public class CustomAppsRegistry implements QSupplementalInstanceMetaData, QHelpC
@Override
public void acceptHelpContent(QInstance qInstance, QHelpContent helpContent, Map<String, String> nameValuePairs)
{
// not yet needed
// todo?
}
}
@@ -1,36 +0,0 @@
/*
* Copyright © 2022-2025. ColdTrack <contact@coldtrack.com>. All Rights Reserved.
*/
package com.kingsrook.qbits.customapps.metadata;
import com.kingsrook.qbits.customapps.customizers.CustomAppContainerPlaceBeforeContainerPossibleValueSource;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducer;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSource;
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSourceType;
/*******************************************************************************
** Meta Data Producer for CustomAppContainerPlaceBeforeContainerPVS
**
**
*******************************************************************************/
public class CustomAppContainerPlaceBeforeContainerPVSMetaDataProducer extends MetaDataProducer<QPossibleValueSource>
{
public static final String NAME = "CustomAppContainerPlaceBeforeContainerPVS";
/*******************************************************************************
**
*******************************************************************************/
@Override
public QPossibleValueSource produce(QInstance qInstance) throws QException
{
return (new QPossibleValueSource().withName(NAME).withType(QPossibleValueSourceType.CUSTOM).withCustomCodeReference(new QCodeReference(CustomAppContainerPlaceBeforeContainerPossibleValueSource.class)));
}
}
@@ -1,307 +0,0 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qbits.customapps.metadata;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.kingsrook.qbits.customapps.model.CustomApp;
import com.kingsrook.qbits.customapps.model.CustomAppBackendConfig;
import com.kingsrook.qbits.customapps.model.CustomAppBackendEnum;
import com.kingsrook.qbits.customapps.model.CustomAppContainer;
import com.kingsrook.qbits.customapps.model.CustomAppIcon;
import com.kingsrook.qbits.customapps.model.CustomAppSection;
import com.kingsrook.qbits.customapps.utils.CustomAppsUtils;
import com.kingsrook.qbits.customapps.widgets.LookerWidgetRenderer;
import com.kingsrook.qqq.backend.core.actions.tables.QueryAction;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.instances.QMetaDataVariableInterpreter;
import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterOrderBy;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.WidgetType;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppSection;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
import com.kingsrook.qqq.backend.core.model.metadata.permissions.DenyBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.permissions.PermissionLevel;
import com.kingsrook.qqq.backend.core.utils.ListingHash;
import com.kingsrook.qqq.backend.core.utils.StringUtils;
import com.kingsrook.qqq.backend.core.utils.collections.MapBuilder;
import static com.kingsrook.qqq.backend.core.logging.LogUtils.logPair;
/*******************************************************************************
* Meta Data Producer for ViewScreenGenericCompositeWidget
*
* builds up a record containing data used to build the custom apps layout
*******************************************************************************/
public class CustomAppsDynamicMetaDataProducer
{
private static final QLogger LOG = QLogger.getLogger(CustomAppsDynamicMetaDataProducer.class);
public static final String NAME = "CustomAppsDynamicMetaDataProducer";
/***************************************************************************
*
***************************************************************************/
public CustomAppData getCustomAppList(QInstance qInstance) throws QException
{
///////////////////////////////////////////////////
// look up data needed to set up the custom apps //
///////////////////////////////////////////////////
List<CustomAppContainer> customAppContainerList = QueryAction.execute(CustomAppContainer.TABLE_NAME, CustomAppContainer.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")).withOrderBy(new QFilterOrderBy("name")));
List<CustomAppSection> customAppSectionList = QueryAction.execute(CustomAppSection.TABLE_NAME, CustomAppSection.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")));
List<CustomApp> customAppList = QueryAction.execute(CustomApp.TABLE_NAME, CustomApp.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("sequenceNo")));
List<CustomAppIcon> customAppIcons = QueryAction.execute(CustomAppIcon.TABLE_NAME, CustomAppIcon.class, new QQueryFilter());
List<CustomAppBackendConfig> customAppBackendConfigList = QueryAction.execute(CustomAppBackendConfig.TABLE_NAME, CustomAppBackendConfig.class, new QQueryFilter());
Map<Integer, CustomAppBackendConfig> customAppBackendConfigMap = customAppBackendConfigList.stream().collect(Collectors.toMap(CustomAppBackendConfig::getId, Function.identity()));
/////////////////////
// icon id to icon //
/////////////////////
Map<Integer, CustomAppIcon> customAppIconMap = customAppIcons.stream().collect(Collectors.toMap(CustomAppIcon::getId, Function.identity()));
//////////////////////////////
// container id to sections //
//////////////////////////////
ListingHash<Integer, CustomAppSection> sectionsMap = new ListingHash<>();
customAppSectionList.forEach(section -> sectionsMap.add(section.getCustomAppContainerId(), section));
////////////////////////
// section id to apps //
////////////////////////
ListingHash<Integer, CustomApp> appsMap = new ListingHash<>();
customAppList.forEach(app -> appsMap.add(app.getCustomAppSectionId(), app));
///////////////////////////////////
// iterate over containers first //
///////////////////////////////////
List<QAppMetaData> containers = new ArrayList<>();
Map<String, QAppMetaData> appMap = new HashMap<>();
Map<String, QWidgetMetaDataInterface> widgetMap = new HashMap<>();
Map<String, String> positionMap = new HashMap<>();
for(CustomAppContainer container : customAppContainerList)
{
//////////////////////////
// if no sections, skip //
//////////////////////////
if(sectionsMap.get(container.getId()) == null)
{
continue;
}
////////////////////////////////////////
// iterate over sections for this app //
////////////////////////////////////////
List<QAppSection> sections = new ArrayList<>();
for(CustomAppSection section : sectionsMap.get(container.getId()))
{
//////////////////////
// if no apps, skip //
//////////////////////
if(appsMap.get(section.getId()) == null)
{
continue;
}
///////////////////////
// iterate over apps //
///////////////////////
int appCount = 0;
List<String> appNameList = new ArrayList<>();
if(appsMap.containsKey(section.getId()))
{
for(CustomApp app : appsMap.get(section.getId()))
{
//////////////////////////////////////////////////
// turn the label into a valid name for the app //
//////////////////////////////////////////////////
String appName = CustomAppsUtils.getCamelCaseName(app.getName(), CustomApp.TABLE_NAME);
/////////////////////////////////////////////////////
// make sure user has permission to this app //
////////////////////////////////////////////////////
if(!QContext.getQSession().hasPermission(appName + ".hasAccess"))
{
continue;
}
/////////////////////////////////////////
// create a custom widget for this app //
/////////////////////////////////////////
String widgetName = appName + "Widget";
QWidgetMetaDataInterface widget = buildWidget(qInstance, app, customAppBackendConfigMap, widgetName);
CustomAppIcon appIcon = customAppIconMap.get(app.getCustomAppIconId());
QAppMetaData appMetaData = new QAppMetaData()
.withPermissionRules(qInstance.getDefaultPermissionRules().withLevel(PermissionLevel.HAS_ACCESS_PERMISSION).withPermissionBaseName(appName).withDenyBehavior(DenyBehavior.HIDDEN))
.withIcon(new QIcon(appIcon.getIconId()))
.withName(appName)
.withLabel(app.getName())
.withWidgets(List.of(widget.getName()));
appNameList.add(appMetaData.getName());
appCount++;
////////////////////////
// add to output data //
////////////////////////
widgetMap.put(widgetName, widget);
appMap.put(appMetaData.getName(), appMetaData);
}
}
///////////////////////////////////////////////////////
// if no apps for this section, continue to next one //
///////////////////////////////////////////////////////
if(appCount == 0)
{
continue;
}
/////////////////////////////////////////////////
// build section with its apps and add to list //
/////////////////////////////////////////////////
String sectionName = CustomAppsUtils.getCamelCaseName(section.getName(), CustomAppSection.TABLE_NAME);
QAppSection appSection = new QAppSection()
.withApps(appNameList)
.withName(sectionName)
.withLabel(section.getName());
sections.add(appSection);
}
/////////////////////////
// build the container //
/////////////////////////
String containerName = CustomAppsUtils.getCamelCaseName(container.getName(), CustomAppContainer.TABLE_NAME);
//////////////////////////
// if no sections, skip //
//////////////////////////
if(sections.isEmpty())
{
continue;
}
/////////////////////////////////////////////////////
// make sure user has permission to this container //
/////////////////////////////////////////////////////
if(!QContext.getQSession().hasPermission(containerName + ".hasAccess"))
{
continue;
}
CustomAppIcon containerIcon = customAppIconMap.get(container.getCustomAppIconId());
QAppMetaData containerApp = new QAppMetaData()
.withPermissionRules(qInstance.getDefaultPermissionRules().withLevel(PermissionLevel.HAS_ACCESS_PERMISSION).withPermissionBaseName(containerName).withDenyBehavior(DenyBehavior.HIDDEN))
.withName(containerName)
.withLabel(container.getName())
.withIcon(new QIcon().withName(containerIcon.getIconId()))
.withSections(sections);
containers.add(containerApp);
positionMap.put(containerName, container.getPlaceBeforeContainer());
}
return (new CustomAppData(containers, positionMap, appMap, widgetMap));
}
/*******************************************************************************
** builds a widget to be used for a customapps app
*******************************************************************************/
private QWidgetMetaDataInterface buildWidget(QInstance qInstance, CustomApp customApp, Map<Integer, CustomAppBackendConfig> customAppBackendConfigMap, String widgetName)
{
CustomAppBackendConfig customAppBackendConfig = customAppBackendConfigMap.get(customApp.getCustomAppBackendConfigId());
switch(CustomAppBackendEnum.getById(customAppBackendConfig.getCustomAppBackendId()))
{
case LOOKER:
return (buildLookerWidget(qInstance, customApp, widgetName));
default:
throw new IllegalArgumentException("Unknown custom app backend: " + customAppBackendConfig.getCustomAppBackendId());
}
}
/*******************************************************************************
** builds a widget to be used for a customapps app
*******************************************************************************/
private QWidgetMetaDataInterface buildLookerWidget(QInstance qInstance, CustomApp customApp, String widgetName)
{
String componentSourceUrl = new QMetaDataVariableInterpreter().interpret("${env.Q_CUSTOM_APPS_SOURCE_URL}");
if(StringUtils.hasContent(componentSourceUrl))
{
LOG.debug("Using component source url from environment", logPair("url", componentSourceUrl));
}
else
{
componentSourceUrl = "/dynamic-qfmd-components/q-embed-looker-dashboards.bundle.js";
}
//////////////////////////////
// add the dashboard to url //
/////////////////////////
Integer dashboardId = customApp.getLookerDashboardId();
componentSourceUrl += "?dashboardId=" + dashboardId;
Map<String, Serializable> defaultValues = MapBuilder.of(
"componentName", "EmbedLookerDashboards",
"componentSourceUrl", componentSourceUrl,
"dashboardId", dashboardId,
// "authenticationUrl", this.customAppsQBitConfig.getAuthenticationUrl(),
"sx", new HashMap<>(Map.of("height", "calc(90vh)", "minHeight", "600px"))
);
QWidgetMetaData lookerWidget = new QWidgetMetaData()
.withName(widgetName)
.withType(WidgetType.CUSTOM_COMPONENT.getType())
.withCodeReference(new QCodeReference(LookerWidgetRenderer.class))
.withGridColumns(12)
.withIsCard(false)
.withLabel(null)
.withDefaultValues(defaultValues);
if(qInstance.getWidget(widgetName) == null)
{
qInstance.addWidget(lookerWidget);
}
return (lookerWidget);
}
public record CustomAppData(List<QAppMetaData> containerList, Map<String, String> positionMap, Map<String, QAppMetaData> appMap, Map<String, QWidgetMetaDataInterface> widgetMap) {}
}
@@ -1,112 +0,0 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qbits.customapps.metadata;
import com.kingsrook.qqq.backend.core.actions.dashboard.widgets.AbstractWidgetRenderer;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetInput;
import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetOutput;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.CompositeWidgetData;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.WidgetType;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.divider.DividerBlockData;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducer;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
import com.kingsrook.qqq.backend.core.model.metadata.fields.FieldAdornment;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
/*******************************************************************************
* Meta Data Producer for ViewScreenGenericCompositeWidget
*
* e.g., generic widget to be used on table virtual fields, to display a composite
* block widget.
*******************************************************************************/
public class CustomAppsGenericCompositeWidgetMetaDataProducer extends MetaDataProducer<QWidgetMetaData>
{
public static final String NAME = "CustomAppsGenericCompositeWidget";
/*******************************************************************************
**
*******************************************************************************/
@Override
public QWidgetMetaData produce(QInstance qInstance) throws QException
{
QWidgetMetaData genericCompositeBlockWidget = new QWidgetMetaData()
.withName(NAME)
.withType(WidgetType.COMPOSITE.getType())
.withShowReloadButton(false)
.withShowExportButton(false)
.withIsCard(false)
.withCodeReference(new QCodeReference(NoopWidgetRenderer.class));
return genericCompositeBlockWidget;
}
/***************************************************************************
*
***************************************************************************/
public static <T extends QFieldMetaData> T applyToField(T field)
{
field.withFieldAdornment(new FieldAdornment(AdornmentType.WIDGET)
.withValue(AdornmentType.WidgetValues.WIDGET_NAME, CustomAppsGenericCompositeWidgetMetaDataProducer.NAME));
return (field);
}
/***************************************************************************
* for a virtual field that is being used to draw a horizontal divider line,
* set the appropriate widget-data value for the field in a record.
***************************************************************************/
public static void setDividerValue(QRecord record, String fieldName)
{
CompositeWidgetData compositeWidgetData = new CompositeWidgetData()
.withBlock(new DividerBlockData());
record.setValue(fieldName, compositeWidgetData);
}
/***************************************************************************
** this widget - is not rendered in the traditional way, but rather,
** its data comes from the record's field, so noop to render here.
***************************************************************************/
public static class NoopWidgetRenderer extends AbstractWidgetRenderer
{
/***************************************************************************
**
***************************************************************************/
@Override
public RenderWidgetOutput render(RenderWidgetInput input) throws QException
{
return null;
}
}
}
@@ -24,29 +24,22 @@ package com.kingsrook.qbits.customapps.model;
import java.io.Serializable;
import java.time.Instant;
import com.kingsrook.qbits.customapps.customizers.CustomAppTableCustomizer;
import com.kingsrook.qbits.userrolepermissions.model.Permission;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizers;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
import com.kingsrook.qqq.backend.core.model.metadata.producers.MetaDataCustomizerInterface;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QFieldSection;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.SectionFactory;
import com.kingsrook.qqq.backend.core.model.metadata.tables.Tier;
import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
/*******************************************************************************
** QRecord Entity for CustomApp table
** QRecord Entity for CustomAppSection table
*******************************************************************************/
@QMetaDataProducingEntity(
producePossibleValueSource = true,
@@ -64,6 +57,7 @@ public class CustomApp extends QRecordEntity implements Serializable
***************************************************************************/
public static class TableMetaDataCustomizer implements MetaDataCustomizerInterface<QTableMetaData>
{
/***************************************************************************
**
***************************************************************************/
@@ -77,16 +71,8 @@ public class CustomApp extends QRecordEntity implements Serializable
.withRecordLabelFormat("%s")
.withRecordLabelFields("name")
.withSection(SectionFactory.defaultT1("id"))
.withSection(SectionFactory.defaultT2("name", "customAppIconId", "customAppBackendConfigId", "customAppSectionId", "sequenceNo", "lookerDashboardId", "permissionId"))
.withSection(new QFieldSection("users", new QIcon().withName("person"), Tier.T2).withWidgetName("customAppPermissions"))
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"))
.withCustomizer(TableCustomizers.POST_META_DATA_ACTION, new QCodeReference(CustomAppTableCustomizer.class))
.withCustomizer(TableCustomizers.POST_DELETE_RECORD, new QCodeReference(CustomAppTableCustomizer.class))
.withCustomizer(TableCustomizers.PRE_INSERT_RECORD, new QCodeReference(CustomAppTableCustomizer.class))
.withCustomizer(TableCustomizers.PRE_UPDATE_RECORD, new QCodeReference(CustomAppTableCustomizer.class));
table.getField("customAppIconId").withFieldAdornment(AdornmentType.CHIP);
.withSection(SectionFactory.defaultT2("name", "customAppIconId", "customAppBackendConfigId", "customAppSectionId", "sequenceNo", "lookerDashboardId"))
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"));
return (table);
}
@@ -100,21 +86,18 @@ public class CustomApp extends QRecordEntity implements Serializable
@QField(maxLength = 100, valueTooLongBehavior = ValueTooLongBehavior.ERROR, isRequired = true)
private String name;
@QField(label = "Backend Config", isRequired = true, possibleValueSourceName = CustomAppBackendConfig.TABLE_NAME)
@QField(isRequired = true, possibleValueSourceName = CustomAppBackendConfig.TABLE_NAME)
private Integer customAppBackendConfigId;
@QField(label = "Section", isRequired = true, possibleValueSourceName = CustomAppSection.TABLE_NAME)
@QField(isRequired = true, possibleValueSourceName = CustomAppSection.TABLE_NAME)
private Integer customAppSectionId;
@QField(label = "Icon", isRequired = true, possibleValueSourceName = CustomAppIcon.TABLE_NAME)
@QField(isRequired = true, possibleValueSourceName = CustomAppIcon.TABLE_NAME)
private Integer customAppIconId;
@QField(isRequired = true)
private Integer sequenceNo;
@QField(isEditable = false, possibleValueSourceName = Permission.TABLE_NAME)
private Integer permissionId;
@QField(isRequired = true)
private Integer lookerDashboardId;
@@ -422,35 +405,4 @@ public class CustomApp extends QRecordEntity implements Serializable
return (this);
}
/*******************************************************************************
** Getter for permissionId
*******************************************************************************/
public Integer getPermissionId()
{
return (this.permissionId);
}
/*******************************************************************************
** Setter for permissionId
*******************************************************************************/
public void setPermissionId(Integer permissionId)
{
this.permissionId = permissionId;
}
/*******************************************************************************
** Fluent setter for permissionId
*******************************************************************************/
public CustomApp withPermissionId(Integer permissionId)
{
this.permissionId = permissionId;
return (this);
}
}
@@ -97,7 +97,7 @@ public class CustomAppBackendConfig extends QRecordEntity implements Serializabl
@QField(maxLength = 100, valueTooLongBehavior = ValueTooLongBehavior.ERROR, isRequired = true)
private String name;
@QField(label = "Backend", isRequired = true, possibleValueSourceName = CustomAppBackendPossibleValueMetaDataProducer.NAME)
@QField(isRequired = true, possibleValueSourceName = CustomAppBackendPossibleValueMetaDataProducer.NAME)
private Integer customAppBackendId;
@QField(isEditable = false)
@@ -24,19 +24,11 @@ package com.kingsrook.qbits.customapps.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.List;
import com.kingsrook.qbits.customapps.customizers.CustomAppContainerTableCustomizer;
import com.kingsrook.qbits.customapps.metadata.CustomAppContainerPlaceBeforeContainerPVSMetaDataProducer;
import com.kingsrook.qbits.userrolepermissions.model.Permission;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizers;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.data.QAssociation;
import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.joins.QJoinMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
@@ -45,11 +37,8 @@ import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.Child
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.ChildRecordListWidget;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.ChildTable;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
import com.kingsrook.qqq.backend.core.model.metadata.tables.Association;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QFieldSection;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.SectionFactory;
import com.kingsrook.qqq.backend.core.model.metadata.tables.Tier;
import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
@@ -70,8 +59,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
)
public class CustomAppContainer extends QRecordEntity implements Serializable
{
public static final String TABLE_NAME = "customAppContainer";
public static final String ASSOCIATION_NAME_CUSTOM_APP_SECTIONS = "customAppSections";
public static final String TABLE_NAME = "customAppContainer";
@@ -96,20 +84,9 @@ public class CustomAppContainer extends QRecordEntity implements Serializable
.withRecordLabelFormat("%s")
.withRecordLabelFields("name")
.withSection(SectionFactory.defaultT1("id"))
.withSection(SectionFactory.defaultT2("name", "customAppIconId", "placeBeforeContainer", "sequenceNo", "permissionId"))
.withSection(SectionFactory.defaultT2("name", "customAppIconId", "sequenceNo"))
.withSection(SectionFactory.customT2("apps", new QIcon("polyline")).withWidgetName(sectionsChildJoinName))
.withSection(new QFieldSection("users", new QIcon().withName("person"), Tier.T2).withWidgetName("customAppContainerPermissions"))
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"))
.withCustomizer(TableCustomizers.POST_META_DATA_ACTION, new QCodeReference(CustomAppContainerTableCustomizer.class))
.withCustomizer(TableCustomizers.POST_DELETE_RECORD, new QCodeReference(CustomAppContainerTableCustomizer.class))
.withCustomizer(TableCustomizers.POST_QUERY_RECORD, new QCodeReference(CustomAppContainerTableCustomizer.class))
.withCustomizer(TableCustomizers.PRE_INSERT_RECORD, new QCodeReference(CustomAppContainerTableCustomizer.class))
.withCustomizer(TableCustomizers.PRE_UPDATE_RECORD, new QCodeReference(CustomAppContainerTableCustomizer.class))
.withAssociation(new Association().withName(ASSOCIATION_NAME_CUSTOM_APP_SECTIONS).withJoinName(sectionsChildJoinName).withAssociatedTableName(CustomAppSection.TABLE_NAME));
table.getField("customAppIconId").withFieldAdornment(AdornmentType.CHIP);
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"));
return (table);
}
@@ -126,24 +103,15 @@ public class CustomAppContainer extends QRecordEntity implements Serializable
@QField(label = "Icon", isRequired = true, possibleValueSourceName = CustomAppIcon.TABLE_NAME)
private Integer customAppIconId;
@QField(possibleValueSourceName = CustomAppContainerPlaceBeforeContainerPVSMetaDataProducer.NAME)
private String placeBeforeContainer;
@QField()
@QField(isRequired = true)
private Integer sequenceNo;
@QField(isEditable = false, possibleValueSourceName = Permission.TABLE_NAME)
private Integer permissionId;
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
@QAssociation(name = ASSOCIATION_NAME_CUSTOM_APP_SECTIONS)
private List<CustomAppSection> sections;
/*******************************************************************************
@@ -290,31 +258,31 @@ public class CustomAppContainer extends QRecordEntity implements Serializable
/*******************************************************************************
** Getter for placeBeforeContainer
** Getter for sequenceNo
*******************************************************************************/
public String getPlaceBeforeContainer()
public Integer getSequenceNo()
{
return (this.placeBeforeContainer);
return (this.sequenceNo);
}
/*******************************************************************************
** Setter for placeBeforeContainer
** Setter for sequenceNo
*******************************************************************************/
public void setPlaceBeforeContainer(String placeBeforeContainer)
public void setSequenceNo(Integer sequenceNo)
{
this.placeBeforeContainer = placeBeforeContainer;
this.sequenceNo = sequenceNo;
}
/*******************************************************************************
** Fluent setter for placeBeforeContainer
** Fluent setter for sequenceNo
*******************************************************************************/
public CustomAppContainer withPlaceBeforeContainer(String placeBeforeContainer)
public CustomAppContainer withSequenceNo(Integer sequenceNo)
{
this.placeBeforeContainer = placeBeforeContainer;
this.sequenceNo = sequenceNo;
return (this);
}
@@ -349,97 +317,4 @@ public class CustomAppContainer extends QRecordEntity implements Serializable
return (this);
}
/*******************************************************************************
** Getter for permissionId
*******************************************************************************/
public Integer getPermissionId()
{
return (this.permissionId);
}
/*******************************************************************************
** Setter for permissionId
*******************************************************************************/
public void setPermissionId(Integer permissionId)
{
this.permissionId = permissionId;
}
/*******************************************************************************
** Fluent setter for permissionId
*******************************************************************************/
public CustomAppContainer withPermissionId(Integer permissionId)
{
this.permissionId = permissionId;
return (this);
}
/*******************************************************************************
** Getter for sequenceNo
*******************************************************************************/
public Integer getSequenceNo()
{
return (this.sequenceNo);
}
/*******************************************************************************
** Setter for sequenceNo
*******************************************************************************/
public void setSequenceNo(Integer sequenceNo)
{
this.sequenceNo = sequenceNo;
}
/*******************************************************************************
** Fluent setter for sequenceNo
*******************************************************************************/
public CustomAppContainer withSequenceNo(Integer sequenceNo)
{
this.sequenceNo = sequenceNo;
return (this);
}
/*******************************************************************************
** Getter for sections
*******************************************************************************/
public List<CustomAppSection> getSections()
{
return (this.sections);
}
/*******************************************************************************
** Setter for sections
*******************************************************************************/
public void setSections(List<CustomAppSection> sections)
{
this.sections = sections;
}
/*******************************************************************************
** Fluent setter for sections
*******************************************************************************/
public CustomAppContainer withSections(List<CustomAppSection> sections)
{
this.sections = sections;
return (this);
}
}
@@ -24,22 +24,15 @@ package com.kingsrook.qbits.customapps.model;
import java.io.Serializable;
import java.time.Instant;
import com.kingsrook.qbits.customapps.customizers.CustomAppIconTableCustomizer;
import com.kingsrook.qbits.customapps.metadata.CustomAppsGenericCompositeWidgetMetaDataProducer;
import com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizers;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QVirtualFieldMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
import com.kingsrook.qqq.backend.core.model.metadata.producers.MetaDataCustomizerInterface;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QFieldSectionAlternativeType;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.SectionFactory;
import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
@@ -78,25 +71,9 @@ public class CustomAppIcon extends QRecordEntity implements Serializable
.withRecordLabelFormat("%s")
.withRecordLabelFields("name")
.withSection(SectionFactory.defaultT1("id"))
.withSection(SectionFactory.defaultT2("name", "iconId").withGridColumns(12)
.withAlternative(QFieldSectionAlternativeType.RECORD_VIEW, (s) ->
{
s.getFieldNames().add("divider");
s.getFieldNames().add("iconPreview");
}
))
.withSection(SectionFactory.defaultT2("name", "iconId"))
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"));
table.withCustomizer(TableCustomizers.POST_QUERY_RECORD, new QCodeReference(CustomAppIconTableCustomizer.class));
////////////////////
// virtual fields //
////////////////////
table.withVirtualField(CustomAppsGenericCompositeWidgetMetaDataProducer.applyToField(
new QVirtualFieldMetaData("iconPreview", QFieldType.STRING)));
table.withVirtualField(CustomAppsGenericCompositeWidgetMetaDataProducer.applyToField(
new QVirtualFieldMetaData("divider", QFieldType.STRING)));
return (table);
}
}
@@ -24,9 +24,7 @@ package com.kingsrook.qbits.customapps.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.List;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.data.QAssociation;
import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
@@ -39,7 +37,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.Child
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.ChildRecordListWidget;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.ChildTable;
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
import com.kingsrook.qqq.backend.core.model.metadata.tables.Association;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.SectionFactory;
import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
@@ -62,8 +59,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey;
)
public class CustomAppSection extends QRecordEntity implements Serializable
{
public static final String TABLE_NAME = "customAppSection";
public static final String ASSOCIATION_NAME_CUSTOM_APPS = "customApps";
public static final String TABLE_NAME = "customAppSection";
@@ -89,9 +85,7 @@ public class CustomAppSection extends QRecordEntity implements Serializable
.withSection(SectionFactory.defaultT1("id"))
.withSection(SectionFactory.defaultT2("customAppContainerId", "name", "sequenceNo"))
.withSection(SectionFactory.customT2("apps", new QIcon("polyline")).withWidgetName(appsChildJoinName))
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"))
.withAssociation(new Association().withName(ASSOCIATION_NAME_CUSTOM_APPS).withJoinName(appsChildJoinName).withAssociatedTableName(CustomApp.TABLE_NAME));
.withSection(SectionFactory.defaultT3("createDate", "modifyDate"));
return (table);
}
@@ -105,7 +99,7 @@ public class CustomAppSection extends QRecordEntity implements Serializable
@QField(maxLength = 100, valueTooLongBehavior = ValueTooLongBehavior.ERROR, isRequired = true)
private String name;
@QField(label = "Container", isRequired = true, possibleValueSourceName = CustomAppContainer.TABLE_NAME)
@QField(isRequired = true, possibleValueSourceName = CustomAppContainer.TABLE_NAME)
private Integer customAppContainerId;
@QField(isRequired = true)
@@ -117,9 +111,6 @@ public class CustomAppSection extends QRecordEntity implements Serializable
@QField(isEditable = false)
private Instant modifyDate;
@QAssociation(name = ASSOCIATION_NAME_CUSTOM_APPS)
private List<CustomApp> apps;
/*******************************************************************************
@@ -325,35 +316,4 @@ public class CustomAppSection extends QRecordEntity implements Serializable
return (this);
}
/*******************************************************************************
** Getter for apps
*******************************************************************************/
public List<CustomApp> getApps()
{
return (this.apps);
}
/*******************************************************************************
** Setter for apps
*******************************************************************************/
public void setApps(List<CustomApp> apps)
{
this.apps = apps;
}
/*******************************************************************************
** Fluent setter for apps
*******************************************************************************/
public CustomAppSection withApps(List<CustomApp> apps)
{
this.apps = apps;
return (this);
}
}
@@ -1,73 +0,0 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2025. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qbits.customapps.utils;
import com.kingsrook.qbits.userrolepermissions.model.Permission;
import com.kingsrook.qbits.userrolepermissions.model.PermissionObjectType;
import com.kingsrook.qqq.backend.core.actions.tables.GetAction;
import com.kingsrook.qqq.backend.core.actions.tables.InsertAction;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.tables.get.GetInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.get.GetOutput;
import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertOutput;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppPermissionUtils
{
/***************************************************************************
**
***************************************************************************/
public static Permission buildOrGetPermission(String name, String tableName) throws QException
{
String objectName = CustomAppsUtils.getCamelCaseName(name, tableName);
String permissionName = objectName + ".hasAccess";
/////////////////////////////////////
// if permission exists, return it //
/////////////////////////////////////
GetOutput output = new GetAction().execute(new GetInput(Permission.TABLE_NAME).withPrimaryKey(permissionName));
if(output.getRecord() != null)
{
return (new Permission(output.getRecord()));
}
//////////////////////////////////////////////////////
// otherwise create a new permission to be inserted //
//////////////////////////////////////////////////////
Permission permission = new Permission()
.withName(permissionName)
.withDescription("Permission to access " + name)
.withObjectType(PermissionObjectType.APP.getId())
.withObjectLabel(name);
InsertInput permissionInput = new InsertInput(Permission.TABLE_NAME).withRecordEntity(permission);
InsertOutput permissionOutput = new InsertAction().execute(permissionInput);
return (new Permission(permissionOutput.getRecords().get(0)));
}
}
@@ -1,114 +0,0 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2025. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qbits.customapps.utils;
import java.util.List;
import java.util.Optional;
import com.kingsrook.qbits.customapps.model.CustomApp;
import com.kingsrook.qbits.customapps.model.CustomAppContainer;
import com.kingsrook.qbits.customapps.model.CustomAppIcon;
import com.kingsrook.qbits.customapps.model.CustomAppSection;
import com.kingsrook.qqq.backend.core.actions.tables.QueryAction;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterOrderBy;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
import com.kingsrook.qqq.backend.core.model.metadata.fields.FieldAdornment;
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendFieldMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendTableMetaData;
import com.kingsrook.qqq.backend.core.utils.StringUtils;
import static com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType.ChipValues.iconAndColorValues;
/*******************************************************************************
**
*******************************************************************************/
public class CustomAppsUtils
{
/***************************************************************************
**
***************************************************************************/
public static void addDynamicIconChipAdornments(QFrontendTableMetaData table, String fieldName) throws QException
{
QFrontendFieldMetaData field = table.getFields().get(fieldName);
Optional<FieldAdornment> chipAdornmentOpt = field.getAdornments().stream().filter(a -> a.getType().equals(AdornmentType.CHIP)).findFirst();
if(chipAdornmentOpt.isPresent())
{
////////////////////////////////////////////////////////////
// look up all icons in the system and add chips for them //
////////////////////////////////////////////////////////////
List<CustomAppIcon> customAppIcons = QueryAction.execute(CustomAppIcon.TABLE_NAME, CustomAppIcon.class, new QQueryFilter().withOrderBy(new QFilterOrderBy("name")));
for(CustomAppIcon icon : customAppIcons)
{
chipAdornmentOpt.get().withValues(iconAndColorValues(icon.getId(), icon.getIconId(), AdornmentType.ChipValues.COLOR_SECONDARY));
}
}
}
/***************************************************************************
**
***************************************************************************/
public static String getCamelCaseName(String name, String tableName)
{
name = nameToCamelCase(name);
switch(tableName)
{
case CustomApp.TABLE_NAME -> name = "qca" + StringUtils.ucFirst(name);
case CustomAppSection.TABLE_NAME -> name = "qcas" + StringUtils.ucFirst(name);
case CustomAppContainer.TABLE_NAME -> name = "qcac" + StringUtils.ucFirst(name);
default ->
{
////////////////////////////////////////////////////////////
// dont add a prefix in this case and lowercase the start //
////////////////////////////////////////////////////////////
name = StringUtils.lcFirst(name);
}
}
return (name);
}
/*******************************************************************************
** transform an app name into a camelCase name
*******************************************************************************/
private static String nameToCamelCase(String label)
{
String[] parts = label
.replaceAll("[^a-zA-Z0-9]+", " ")
.trim()
.split("\\s+");
StringBuilder result = new StringBuilder(parts[0].toLowerCase());
for(int i = 1; i < parts.length; i++)
{
result.append(parts[i].substring(0, 1).toUpperCase()).append(parts[i].substring(1).toLowerCase());
}
return result.toString();
}
}
@@ -8,7 +8,6 @@ package com.kingsrook.qbits.customapps.widgets;
import java.util.Map;
import com.kingsrook.qqq.backend.core.actions.dashboard.widgets.AbstractWidgetRenderer;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.exceptions.QUserFacingException;
import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetInput;
import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetOutput;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.QWidgetData;
@@ -29,18 +28,9 @@ public class LookerWidgetRenderer extends AbstractWidgetRenderer
try
{
Map<String, String> queryParams = input.getQueryParams();
if(!queryParams.containsKey("dashboardId") || queryParams.get("dashboardId") == null)
{
throw (new QUserFacingException("LookerWidgetRenderer requires a dashboardId to be provided."));
}
int dashboardId = Integer.parseInt(queryParams.get("dashboardId"));
Integer dashboardId = Integer.parseInt(queryParams.get("dashboardId"));
return (new RenderWidgetOutput(new LookerWidgetData().withDashboardId(dashboardId)));
}
catch(QException qe)
{
throw (qe);
}
catch(Exception e)
{
throw (new QException("Error rendering LookerWidget", e));
-59
View File
@@ -1,59 +0,0 @@
DROP TABLE IF EXISTS custom_app_container;
CREATE TABLE custom_app_container
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
create_date TIMESTAMP DEFAULT now(),
modify_date TIMESTAMP DEFAULT now(),
custom_app_icon_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
sequence_no INTEGER NOT NULL,
permission_id INTEGER,
place_before_container VARCHAR(100)
);
DROP TABLE IF EXISTS custom_app_section;
CREATE TABLE custom_app_section
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
create_date TIMESTAMP DEFAULT now(),
modify_date TIMESTAMP DEFAULT now(),
custom_app_container_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
sequence_no INTEGER NOT NULL
);
DROP TABLE IF EXISTS custom_app;
CREATE TABLE custom_app
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
create_date TIMESTAMP DEFAULT now(),
modify_date TIMESTAMP DEFAULT now(),
custom_app_section_id INTEGER NOT NULL,
custom_app_backend_config_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
custom_app_icon_id VARCHAR(100) NOT NULL,
sequence_no INTEGER NOT NULL,
looker_dashboard_id INTEGER,
permission_id INTEGER
);
DROP TABLE IF EXISTS custom_app_backend_config;
CREATE TABLE custom_app_backend_config
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
create_date TIMESTAMP DEFAULT now(),
modify_date TIMESTAMP DEFAULT now(),
custom_app_backend_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL
);
DROP TABLE IF EXISTS custom_app_icon;
CREATE TABLE custom_app_icon
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
create_date TIMESTAMP DEFAULT now(),
modify_date TIMESTAMP DEFAULT now(),
icon_id VARCHAR(100) NOT NULL,
name VARCHAR(100) NOT NULL
);