From 1c5c381b73ae06882420fd040c39ad93380d40ef Mon Sep 17 00:00:00 2001 From: Nils Israel Date: Mon, 15 Jan 2024 18:17:07 +0100 Subject: [PATCH] change crlf to lf --- .editorconfig | 16 +- .eslintignore | 18 +- .eslintrc.js | 12 +- .github/workflows/build.yml | 116 ++--- .gitignore | 336 ++++++------- README.adoc | 20 +- addondemo.app.dev/pom.xml | 72 +-- .../src/main/resources/config.properties | 28 +- .../src/main/resources/logback.xml | 62 +-- .../src/main/webapp/WEB-INF/web.xml | 158 +++--- addondemo.app.war/Dockerfile | 6 +- addondemo.app.war/pom.xml | 208 ++++---- .../src/main/resources/config.properties | 18 +- .../src/main/resources/logback.xml | 40 +- .../src/main/webapp/WEB-INF/web.xml | 160 +++--- addondemo.client/pom.xml | 64 +-- .../apps/addondemo/client/ClientSession.java | 66 +-- .../client/DefaultIconProviderService.java | 30 +- .../scout/apps/addondemo/client/Desktop.java | 472 +++++++++--------- .../apps/addondemo/client/ResourceBase.java | 28 +- .../client/helloworld/HelloWorldForm.java | 194 +++---- .../client/helloworld/HelloWorldPage.java | 62 +-- .../client/search/SearchOutline.java | 56 +-- .../client/settings/SettingsOutline.java | 48 +- .../addondemo/client/work/WorkOutline.java | 68 +-- .../client/helloworld/HelloWorldFormTest.java | 134 ++--- .../src/test/resources/logback-test.xml | 8 +- addondemo.server/pom.xml | 74 +-- .../addondemo/server/ServerServletFilter.java | 128 ++--- .../apps/addondemo/server/ServerSession.java | 62 +-- .../server/helloworld/HelloWorldService.java | 38 +- .../security/ServerAccessControlService.java | 54 +- .../src/main/resources/META-INF/scout.xml | 6 +- .../helloworld/HelloWorldServiceTest.java | 64 +-- .../src/test/resources/logback-test.xml | 8 +- addondemo.shared/pom.xml | 72 +-- .../shared/helloworld/HelloWorldFormData.java | 52 +- .../scout/apps/addondemo/shared/Icons.java | 26 +- .../shared/helloworld/IHelloWorldService.java | 28 +- .../shared/security/AccessControlService.java | 58 +-- .../text/DefaultTextProviderService.java | 30 +- .../src/main/resources/META-INF/scout.xml | 6 +- .../addondemo/shared/texts/Texts.properties | 20 +- .../shared/texts/Texts_de.properties | 18 +- .../shared/texts/Texts_fr.properties | 18 +- .../src/test/resources/logback-test.xml | 8 +- addondemo.ui.html/.gitignore | 6 +- addondemo.ui.html/package.json | 80 +-- addondemo.ui.html/pom.xml | 54 +- .../addondemo/ui/html/UiServletFilter.java | 152 +++--- .../src/main/js/addondemo-theme-dark.less | 4 +- .../src/main/js/addondemo-theme.less | 4 +- addondemo.ui.html/src/main/js/addondemo.ts | 8 +- addondemo.ui.html/src/main/js/index.ts | 20 +- addondemo.ui.html/src/main/js/login.ts | 6 +- addondemo.ui.html/src/main/js/logout.ts | 6 +- .../src/main/js/style/colors.less | 14 +- .../src/main/resources/META-INF/scout.xml | 6 +- .../WebContent/favicon/browserconfig.xml | 24 +- .../WebContent/favicon/manifest.json | 82 +-- .../resources/WebContent/includes/head.html | 50 +- .../WebContent/includes/no-script.html | 22 +- .../src/main/resources/WebContent/index.html | 30 +- .../src/main/resources/WebContent/login.html | 30 +- .../src/main/resources/WebContent/logout.html | 30 +- .../resources/WebContent/popup-window.html | 26 +- .../main/resources/WebContent/popup-window.js | 28 +- .../WebContent/unsupported-browser.html | 38 +- addondemo.ui.html/tsconfig.json | 18 +- addondemo.ui.html/webpack.config.js | 32 +- addondemo/pom.xml | 150 +++--- addondemo/run-configs/[webapp] all.launch | 48 +- .../run-configs/[webapp] dev server.launch | 32 +- addondemo/run-configs/[webapp] dev ui.launch | 32 +- addondemo/run-configs/js build.cmd | 80 +-- addondemo/run-configs/js build.launch | 10 +- package.json | 24 +- pnpm-workspace.yaml | 6 +- pom.xml | 102 ++-- 79 files changed, 2262 insertions(+), 2262 deletions(-) diff --git a/.editorconfig b/.editorconfig index ec59673..5741178 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ -root = true - -[*] -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=true -indent_style=space -indent_size=2 +root = true + +[*] +charset=utf-8 +trim_trailing_whitespace=true +insert_final_newline=true +indent_style=space +indent_size=2 diff --git a/.eslintignore b/.eslintignore index 720248c..610b48b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,9 +1,9 @@ -.git -.idea -dist -node_modules -target -**/src/main/resources -**/src/test/resources -**/src/main/java -**/src/test/java +.git +.idea +dist +node_modules +target +**/src/main/resources +**/src/test/resources +**/src/main/java +**/src/test/java diff --git a/.eslintrc.js b/.eslintrc.js index 85da9ac..92e0cc6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,6 @@ -module.exports = { - extends: '@eclipse-scout', - rules: { - 'linebreak-style': 'off' - } -}; +module.exports = { + extends: '@eclipse-scout', + rules: { + 'linebreak-style': 'off' + } +}; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2880a78..5ec6c40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,58 +1,58 @@ -name: build, package and deploy java parts - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - DOCKER_REGISTRY: ghcr.io - DOCKER_IMAGE_NAME: ${{ github.repository }} - DOCKER_TAG: ${{ github.sha }} - CI: true - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - - permissions: - checks: write - contents: read - packages: write - - strategy: - matrix: - java-version: [ 17 ] - - steps: - - uses: actions/checkout@v3 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java-version }} - distribution: 'temurin' - cache: maven - - - run: mvn -B verify --fail-at-end --no-transfer-progress --file pom.xml - - - name: Publish Unit Test Report - if: success() || failure() - uses: scacap/action-surefire-report@v1 - - # push image except on PR - - run: docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG }} - if: github.event_name != 'pull_request' - - - +name: build, package and deploy java parts + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + DOCKER_REGISTRY: ghcr.io + DOCKER_IMAGE_NAME: ${{ github.repository }} + DOCKER_TAG: ${{ github.sha }} + CI: true + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + checks: write + contents: read + packages: write + + strategy: + matrix: + java-version: [ 17 ] + + steps: + - uses: actions/checkout@v3 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + cache: maven + + - run: mvn -B verify --fail-at-end --no-transfer-progress --file pom.xml + + - name: Publish Unit Test Report + if: success() || failure() + uses: scacap/action-surefire-report@v1 + + # push image except on PR + - run: docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG }} + if: github.event_name != 'pull_request' + + + diff --git a/.gitignore b/.gitignore index dfa372f..f9a6753 100644 --- a/.gitignore +++ b/.gitignore @@ -1,168 +1,168 @@ -# Created by https://www.toptal.com/developers/gitignore/api/maven,node -# Edit at https://www.toptal.com/developers/gitignore?templates=maven,node - -### Maven ### -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar - -# Eclipse m2e generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -### Node Patch ### -# Serverless Webpack directories -.webpack/ - -# Optional stylelint cache - -# SvelteKit build / generate output -.svelte-kit - -# End of https://www.toptal.com/developers/gitignore/api/intellij,maven,node - -test-results -.idea -*.iml -pnpm-lock.yaml +# Created by https://www.toptal.com/developers/gitignore/api/maven,node +# Edit at https://www.toptal.com/developers/gitignore?templates=maven,node + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# Eclipse m2e generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +# End of https://www.toptal.com/developers/gitignore/api/intellij,maven,node + +test-results +.idea +*.iml +pnpm-lock.yaml diff --git a/README.adoc b/README.adoc index 17c5f45..d88393b 100644 --- a/README.adoc +++ b/README.adoc @@ -1,10 +1,10 @@ -# Demo Application for Eclipse Scout Addon - -An https://eclipse.dev/scout/[Eclipse Scout] application intended to demonstrate https://github.com/nisrael/sxda-scout-addon[sxda-scout-addon], which provides wrapper modules for -commonly used open source form field elements. - -This program and the accompanying materials are made -available under the terms of the Eclipse Public License 2.0 -which is available at https://www.eclipse.org/legal/epl-2.0/ - -SPDX-License-Identifier: EPL-2.0 +# Demo Application for Eclipse Scout Addon + +An https://eclipse.dev/scout/[Eclipse Scout] application intended to demonstrate https://github.com/nisrael/sxda-scout-addon[sxda-scout-addon], which provides wrapper modules for +commonly used open source form field elements. + +This program and the accompanying materials are made +available under the terms of the Eclipse Public License 2.0 +which is available at https://www.eclipse.org/legal/epl-2.0/ + +SPDX-License-Identifier: EPL-2.0 diff --git a/addondemo.app.dev/pom.xml b/addondemo.app.dev/pom.xml index 99de135..61920db 100644 --- a/addondemo.app.dev/pom.xml +++ b/addondemo.app.dev/pom.xml @@ -1,36 +1,36 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.app.dev - war - - Addon Demo Application (Development) - - - - org.eclipse.scout.rt - org.eclipse.scout.dev.jetty - - - org.eclipse.scout.rt - org.eclipse.scout.rt.serverbridge - - - io.sxda.scout.apps - addondemo.server - - - io.sxda.scout.apps - addondemo.ui.html - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.app.dev + war + + Addon Demo Application (Development) + + + + org.eclipse.scout.rt + org.eclipse.scout.dev.jetty + + + org.eclipse.scout.rt + org.eclipse.scout.rt.serverbridge + + + io.sxda.scout.apps + addondemo.server + + + io.sxda.scout.apps + addondemo.ui.html + + + diff --git a/addondemo.app.dev/src/main/resources/config.properties b/addondemo.app.dev/src/main/resources/config.properties index e50d556..58bb441 100644 --- a/addondemo.app.dev/src/main/resources/config.properties +++ b/addondemo.app.dev/src/main/resources/config.properties @@ -1,14 +1,14 @@ -### Application -scout.application.name=Addon Demo -scout.application.version=development - -### Environment -scout.devMode=true -scout.auth.cookieSessionValidateSecure=false - -### Security -scout.auth.credentials=admin:admin;scott:tiger -scout.auth.credentialsPlaintext=true - -### Storage location for FileSystemUserPreferencesStorageService -scout.client.userArea=${user.home}/io.sxda.scout.apps-addondemo.ui.html.dev +### Application +scout.application.name=Addon Demo +scout.application.version=development + +### Environment +scout.devMode=true +scout.auth.cookieSessionValidateSecure=false + +### Security +scout.auth.credentials=admin:admin;scott:tiger +scout.auth.credentialsPlaintext=true + +### Storage location for FileSystemUserPreferencesStorageService +scout.client.userArea=${user.home}/io.sxda.scout.apps-addondemo.ui.html.dev diff --git a/addondemo.app.dev/src/main/resources/logback.xml b/addondemo.app.dev/src/main/resources/logback.xml index cc49a4b..0ca0ca4 100644 --- a/addondemo.app.dev/src/main/resources/logback.xml +++ b/addondemo.app.dev/src/main/resources/logback.xml @@ -1,31 +1,31 @@ - - - - - - - TRACE - INFO - - - - - - - WARN - ERROR - - System.err - - - - - - - - - - - - - + + + + + + + TRACE + INFO + + + + + + + WARN + ERROR + + System.err + + + + + + + + + + + + + diff --git a/addondemo.app.dev/src/main/webapp/WEB-INF/web.xml b/addondemo.app.dev/src/main/webapp/WEB-INF/web.xml index 228d4e6..388fd9a 100644 --- a/addondemo.app.dev/src/main/webapp/WEB-INF/web.xml +++ b/addondemo.app.dev/src/main/webapp/WEB-INF/web.xml @@ -1,79 +1,79 @@ - - - - Addon Demo HTML UI Development - - - org.eclipse.scout.rt.server.commons.WebappEventListener - - - org.eclipse.scout.rt.server.commons.HttpSessionMutex - - - - AuthFilter - io.sxda.scout.apps.addondemo.ui.html.UiServletFilter - - filter-exclude - - /favicon/* - /fonts/* - /logo.png - /*login*.js - /*logout*.js - /*addondemo-theme*.css - - - - - AuthFilter - /* - - - - GzipServletFilter - org.eclipse.scout.rt.server.commons.servlet.filter.gzip.GzipServletFilter - - - GzipServletFilter - /* - - - - UiServlet - org.eclipse.scout.rt.ui.html.UiServlet - - - UiServlet - /* - - - - diagnostics - org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet - - - diagnostics - /diagnostics - - - - - - 60 - - true - - - - - logbackDisableServletContainerInitializer - true - - - + + + + Addon Demo HTML UI Development + + + org.eclipse.scout.rt.server.commons.WebappEventListener + + + org.eclipse.scout.rt.server.commons.HttpSessionMutex + + + + AuthFilter + io.sxda.scout.apps.addondemo.ui.html.UiServletFilter + + filter-exclude + + /favicon/* + /fonts/* + /logo.png + /*login*.js + /*logout*.js + /*addondemo-theme*.css + + + + + AuthFilter + /* + + + + GzipServletFilter + org.eclipse.scout.rt.server.commons.servlet.filter.gzip.GzipServletFilter + + + GzipServletFilter + /* + + + + UiServlet + org.eclipse.scout.rt.ui.html.UiServlet + + + UiServlet + /* + + + + diagnostics + org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet + + + diagnostics + /diagnostics + + + + + + 60 + + true + + + + + logbackDisableServletContainerInitializer + true + + + diff --git a/addondemo.app.war/Dockerfile b/addondemo.app.war/Dockerfile index d81bc8e..631b51e 100644 --- a/addondemo.app.war/Dockerfile +++ b/addondemo.app.war/Dockerfile @@ -1,3 +1,3 @@ -FROM tomcat:9-jdk17-temurin-jammy -COPY target/io.sxda.scout.apps.addondemo.war /usr/local/tomcat/webapps/ROOT.war -CMD ["catalina.sh", "run"] +FROM tomcat:9-jdk17-temurin-jammy +COPY target/io.sxda.scout.apps.addondemo.war /usr/local/tomcat/webapps/ROOT.war +CMD ["catalina.sh", "run"] diff --git a/addondemo.app.war/pom.xml b/addondemo.app.war/pom.xml index d5626c0..b79ebd4 100644 --- a/addondemo.app.war/pom.xml +++ b/addondemo.app.war/pom.xml @@ -1,104 +1,104 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.app.war - war - - Addon Demo Application - - sxda-scout-apps-addondemo - local - - - - - ci - - false - - env.CI - true - - - - - ${env.DOCKER_REGISTRY}/${env.DOCKER_IMAGE_NAME} - - ${env.DOCKER_TAG} - - - - - - io.sxda.scout.apps.addondemo - - - - - ${project.basedir}/src/main/resources - true - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - \ - - - - - com.spotify - dockerfile-maven-plugin - 1.4.13 - - - default - - build - - - - - - ${docker.repository} - ${docker.tag} - - - - - - - - org.eclipse.scout.rt - org.eclipse.scout.rt.serverbridge - - - io.sxda.scout.apps - addondemo.server - - - io.sxda.scout.apps - addondemo.ui.html - - - - - jakarta.servlet - jakarta.servlet-api - provided - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.app.war + war + + Addon Demo Application + + sxda-scout-apps-addondemo + local + + + + + ci + + false + + env.CI + true + + + + + ${env.DOCKER_REGISTRY}/${env.DOCKER_IMAGE_NAME} + + ${env.DOCKER_TAG} + + + + + + io.sxda.scout.apps.addondemo + + + + + ${project.basedir}/src/main/resources + true + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + \ + + + + + com.spotify + dockerfile-maven-plugin + 1.4.13 + + + default + + build + + + + + + ${docker.repository} + ${docker.tag} + + + + + + + + org.eclipse.scout.rt + org.eclipse.scout.rt.serverbridge + + + io.sxda.scout.apps + addondemo.server + + + io.sxda.scout.apps + addondemo.ui.html + + + + + jakarta.servlet + jakarta.servlet-api + provided + + + diff --git a/addondemo.app.war/src/main/resources/config.properties b/addondemo.app.war/src/main/resources/config.properties index 9d0ff06..004af4a 100644 --- a/addondemo.app.war/src/main/resources/config.properties +++ b/addondemo.app.war/src/main/resources/config.properties @@ -1,9 +1,9 @@ -### Application -scout.application.name=Addon Demo -scout.application.version=${project.version} - -### Security -scout.auth.credentials=admin:Q5hBRXwi25yU57UdwZESrw==.cvvCvJLQmtdQSu2VI8Di4f0j/bmf6q3YFOfb3esdRLiXnNnWIl3wHjBI8QSu8K1TfO1lvADmb9aOc1GEEfXztA==;scott:xeCQwEtqP6sRfuvAYYUPHw==.6plBwhPiyYurpq8EysozTOrXe/FTw+pA3uyM0jnuPYz0zx16a4yDxVmhHik/YFiWGhTwMnhx4+bSk3rb5IOn+A== - -### Storage location for FileSystemUserPreferencesStorageService -scout.client.userArea=\${user.home}/io.sxda.scout.apps-addondemo.ui.html +### Application +scout.application.name=Addon Demo +scout.application.version=${project.version} + +### Security +scout.auth.credentials=admin:Q5hBRXwi25yU57UdwZESrw==.cvvCvJLQmtdQSu2VI8Di4f0j/bmf6q3YFOfb3esdRLiXnNnWIl3wHjBI8QSu8K1TfO1lvADmb9aOc1GEEfXztA==;scott:xeCQwEtqP6sRfuvAYYUPHw==.6plBwhPiyYurpq8EysozTOrXe/FTw+pA3uyM0jnuPYz0zx16a4yDxVmhHik/YFiWGhTwMnhx4+bSk3rb5IOn+A== + +### Storage location for FileSystemUserPreferencesStorageService +scout.client.userArea=\${user.home}/io.sxda.scout.apps-addondemo.ui.html diff --git a/addondemo.app.war/src/main/resources/logback.xml b/addondemo.app.war/src/main/resources/logback.xml index c502adb..917e825 100644 --- a/addondemo.app.war/src/main/resources/logback.xml +++ b/addondemo.app.war/src/main/resources/logback.xml @@ -1,20 +1,20 @@ - - - - - - - ${catalina.base}/logs/io.sxda.scout.apps.addondemo.ui.html.log - - ${catalina.base}/logs/io.sxda.scout.apps.addondemo.ui.html-%d{yyyy-MM-dd}.log - 100 - - - - - - - - - - + + + + + + + ${catalina.base}/logs/io.sxda.scout.apps.addondemo.ui.html.log + + ${catalina.base}/logs/io.sxda.scout.apps.addondemo.ui.html-%d{yyyy-MM-dd}.log + 100 + + + + + + + + + + diff --git a/addondemo.app.war/src/main/webapp/WEB-INF/web.xml b/addondemo.app.war/src/main/webapp/WEB-INF/web.xml index 3269fff..7efc815 100644 --- a/addondemo.app.war/src/main/webapp/WEB-INF/web.xml +++ b/addondemo.app.war/src/main/webapp/WEB-INF/web.xml @@ -1,80 +1,80 @@ - - - - Addon Demo - - - org.eclipse.scout.rt.server.commons.WebappEventListener - - - org.eclipse.scout.rt.server.commons.HttpSessionMutex - - - - AuthFilter - io.sxda.scout.apps.addondemo.ui.html.UiServletFilter - - filter-exclude - - /favicon/* - /fonts/* - /logo.png - /*login*.js - /*logout*.js - /*addondemo-theme*.css - - - - - AuthFilter - /* - - - - GzipServletFilter - org.eclipse.scout.rt.server.commons.servlet.filter.gzip.GzipServletFilter - - - GzipServletFilter - /* - - - - UiServlet - org.eclipse.scout.rt.ui.html.UiServlet - - - UiServlet - /* - - - - diagnostics - org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet - - - diagnostics - /diagnostics - - - - - 5 - - true - - true - - - - - logbackDisableServletContainerInitializer - true - - - + + + + Addon Demo + + + org.eclipse.scout.rt.server.commons.WebappEventListener + + + org.eclipse.scout.rt.server.commons.HttpSessionMutex + + + + AuthFilter + io.sxda.scout.apps.addondemo.ui.html.UiServletFilter + + filter-exclude + + /favicon/* + /fonts/* + /logo.png + /*login*.js + /*logout*.js + /*addondemo-theme*.css + + + + + AuthFilter + /* + + + + GzipServletFilter + org.eclipse.scout.rt.server.commons.servlet.filter.gzip.GzipServletFilter + + + GzipServletFilter + /* + + + + UiServlet + org.eclipse.scout.rt.ui.html.UiServlet + + + UiServlet + /* + + + + diagnostics + org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet + + + diagnostics + /diagnostics + + + + + 5 + + true + + true + + + + + logbackDisableServletContainerInitializer + true + + + diff --git a/addondemo.client/pom.xml b/addondemo.client/pom.xml index a0f2e20..576ef1d 100644 --- a/addondemo.client/pom.xml +++ b/addondemo.client/pom.xml @@ -1,32 +1,32 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.client - - Addon Demo Client - - - - org.eclipse.scout.rt - org.eclipse.scout.rt.client - - - io.sxda.scout.apps - addondemo.shared - - - org.eclipse.scout.rt - org.eclipse.scout.rt.client.test - test - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.client + + Addon Demo Client + + + + org.eclipse.scout.rt + org.eclipse.scout.rt.client + + + io.sxda.scout.apps + addondemo.shared + + + org.eclipse.scout.rt + org.eclipse.scout.rt.client.test + test + + + diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ClientSession.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ClientSession.java index 73c7ac4..cfb43e2 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ClientSession.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ClientSession.java @@ -1,33 +1,33 @@ -package io.sxda.scout.apps.addondemo.client; - -import org.eclipse.scout.rt.client.AbstractClientSession; -import org.eclipse.scout.rt.client.IClientSession; -import org.eclipse.scout.rt.client.session.ClientSessionProvider; -import org.eclipse.scout.rt.shared.services.common.code.CODES; - -import io.sxda.scout.apps.addondemo.client.Desktop; - -/** - * @author nisrael - */ -public class ClientSession extends AbstractClientSession { - - public ClientSession() { - super(true); - } - - /** - * @return The {@link IClientSession} which is associated with the current thread, or {@code null} if not found. - */ - public static ClientSession get() { - return ClientSessionProvider.currentSession(ClientSession.class); - } - - @Override - protected void execLoadSession() { - //pre-load all known code types - CODES.getAllCodeTypes("io.sxda.scout.apps.addondemo.shared"); - - setDesktop(new Desktop()); - } -} +package io.sxda.scout.apps.addondemo.client; + +import org.eclipse.scout.rt.client.AbstractClientSession; +import org.eclipse.scout.rt.client.IClientSession; +import org.eclipse.scout.rt.client.session.ClientSessionProvider; +import org.eclipse.scout.rt.shared.services.common.code.CODES; + +import io.sxda.scout.apps.addondemo.client.Desktop; + +/** + * @author nisrael + */ +public class ClientSession extends AbstractClientSession { + + public ClientSession() { + super(true); + } + + /** + * @return The {@link IClientSession} which is associated with the current thread, or {@code null} if not found. + */ + public static ClientSession get() { + return ClientSessionProvider.currentSession(ClientSession.class); + } + + @Override + protected void execLoadSession() { + //pre-load all known code types + CODES.getAllCodeTypes("io.sxda.scout.apps.addondemo.shared"); + + setDesktop(new Desktop()); + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/DefaultIconProviderService.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/DefaultIconProviderService.java index d81c8bf..9679339 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/DefaultIconProviderService.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/DefaultIconProviderService.java @@ -1,15 +1,15 @@ -package io.sxda.scout.apps.addondemo.client; - -import java.net.URL; - -import org.eclipse.scout.rt.client.services.common.icon.AbstractIconProviderService; - -/** - * @author nisrael - */ -public class DefaultIconProviderService extends AbstractIconProviderService { - @Override - protected URL findResource(String relativePath) { - return ResourceBase.class.getResource("icons/" + relativePath); - } -} +package io.sxda.scout.apps.addondemo.client; + +import java.net.URL; + +import org.eclipse.scout.rt.client.services.common.icon.AbstractIconProviderService; + +/** + * @author nisrael + */ +public class DefaultIconProviderService extends AbstractIconProviderService { + @Override + protected URL findResource(String relativePath) { + return ResourceBase.class.getResource("icons/" + relativePath); + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/Desktop.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/Desktop.java index 292cf64..e52beef 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/Desktop.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/Desktop.java @@ -1,236 +1,236 @@ -package io.sxda.scout.apps.addondemo.client; - -import java.beans.PropertyChangeEvent; -import java.util.List; - -import org.eclipse.scout.rt.client.session.ClientSessionProvider; -import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke; -import org.eclipse.scout.rt.client.ui.action.menu.AbstractMenu; -import org.eclipse.scout.rt.client.ui.action.menu.IMenu; -import org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop; -import org.eclipse.scout.rt.client.ui.desktop.notification.NativeNotificationDefaults; -import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutlineViewButton; -import org.eclipse.scout.rt.client.ui.desktop.outline.IOutline; -import org.eclipse.scout.rt.client.ui.form.ScoutInfoForm; -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.platform.text.TEXTS; -import org.eclipse.scout.rt.platform.util.CollectionUtility; -import org.eclipse.scout.rt.platform.util.StringUtility; -import org.eclipse.scout.rt.security.IAccessControlService; - -import io.sxda.scout.apps.addondemo.client.Desktop.UserProfileMenu.ThemeMenu.DarkThemeMenu; -import io.sxda.scout.apps.addondemo.client.Desktop.UserProfileMenu.ThemeMenu.DefaultThemeMenu; -import io.sxda.scout.apps.addondemo.client.search.SearchOutline; -import io.sxda.scout.apps.addondemo.client.settings.SettingsOutline; -import io.sxda.scout.apps.addondemo.client.work.WorkOutline; -import io.sxda.scout.apps.addondemo.shared.Icons; - -/** - * @author nisrael - */ -public class Desktop extends AbstractDesktop { - - public Desktop() { - addPropertyChangeListener(PROP_THEME, this::onThemeChanged); - } - - @Override - protected String getConfiguredTitle() { - return TEXTS.get("ApplicationTitle"); - } - - @Override - protected String getConfiguredLogoId() { - return Icons.AppLogo; - } - - @Override - protected NativeNotificationDefaults getConfiguredNativeNotificationDefaults() { - return super.getConfiguredNativeNotificationDefaults().withIconId("application_logo.png"); - } - - @Override - protected List> getConfiguredOutlines() { - return CollectionUtility.>arrayList( - WorkOutline.class, SearchOutline.class, SettingsOutline.class); - } - - @Override - protected void execDefaultView() { - selectFirstVisibleOutline(); - } - - protected void selectFirstVisibleOutline() { - for (IOutline outline : getAvailableOutlines()) { - if (outline.isEnabled() && outline.isVisible()) { - setOutline(outline.getClass()); - return; - } - } - } - - protected void onThemeChanged(PropertyChangeEvent evt) { - IMenu darkMenu = getMenuByClass(DarkThemeMenu.class); - IMenu defaultMenu = getMenuByClass(DefaultThemeMenu.class); - String newThemeName = (String) evt.getNewValue(); - if (DarkThemeMenu.DARK_THEME.equalsIgnoreCase(newThemeName)) { - darkMenu.setIconId(Icons.CheckedBold); - defaultMenu.setIconId(null); - } else { - darkMenu.setIconId(null); - defaultMenu.setIconId(Icons.CheckedBold); - } - } - - @Order(1000) - public class UserProfileMenu extends AbstractMenu { - - @Override - protected String getConfiguredKeyStroke() { - return IKeyStroke.F10; - } - - @Override - protected String getConfiguredIconId() { - return Icons.PersonSolid; - } - - @Override - protected String getConfiguredText() { - String userId = BEANS.get(IAccessControlService.class).getUserIdOfCurrentSubject(); - return StringUtility.uppercaseFirst(userId); - } - - @Order(1000) - public class AboutMenu extends AbstractMenu { - - @Override - protected String getConfiguredText() { - return TEXTS.get("About"); - } - - @Override - protected void execAction() { - ScoutInfoForm form = new ScoutInfoForm(); - form.startModify(); - } - } - - @Order(2000) - public class ThemeMenu extends AbstractMenu { - - @Override - protected String getConfiguredText() { - return TEXTS.get("Theme"); - } - - @Order(1000) - public class DefaultThemeMenu extends AbstractMenu { - - private static final String DEFAULT_THEME = "Default"; - - @Override - protected String getConfiguredText() { - return DEFAULT_THEME; - } - - @Override - protected void execAction() { - setTheme(DEFAULT_THEME.toLowerCase()); - } - } - - @Order(2000) - public class DarkThemeMenu extends AbstractMenu { - - private static final String DARK_THEME = "Dark"; - - @Override - protected String getConfiguredText() { - return DARK_THEME; - } - - @Override - protected void execAction() { - setTheme(DARK_THEME.toLowerCase()); - } - } - } - - @Order(3000) - public class LogoutMenu extends AbstractMenu { - - @Override - protected String getConfiguredText() { - return TEXTS.get("Logout"); - } - - @Override - protected void execAction() { - ClientSessionProvider.currentSession().stop(); - } - } - } - - @Order(1000) - public class WorkOutlineViewButton extends AbstractOutlineViewButton { - - public WorkOutlineViewButton() { - this(WorkOutline.class); - } - - protected WorkOutlineViewButton(Class outlineClass) { - super(Desktop.this, outlineClass); - } - - @Override - protected String getConfiguredKeyStroke() { - return IKeyStroke.F2; - } - } - - @Order(2000) - public class SearchOutlineViewButton extends AbstractOutlineViewButton { - - public SearchOutlineViewButton() { - this(SearchOutline.class); - } - - protected SearchOutlineViewButton(Class outlineClass) { - super(Desktop.this, outlineClass); - } - - @Override - protected DisplayStyle getConfiguredDisplayStyle() { - return DisplayStyle.TAB; - } - - @Override - protected String getConfiguredKeyStroke() { - return IKeyStroke.F3; - } - } - - @Order(3000) - public class SettingsOutlineViewButton extends AbstractOutlineViewButton { - - public SettingsOutlineViewButton() { - this(SettingsOutline.class); - } - - protected SettingsOutlineViewButton(Class outlineClass) { - super(Desktop.this, outlineClass); - } - - @Override - protected DisplayStyle getConfiguredDisplayStyle() { - return DisplayStyle.TAB; - } - - @Override - protected String getConfiguredKeyStroke() { - return IKeyStroke.F10; - } - } -} +package io.sxda.scout.apps.addondemo.client; + +import java.beans.PropertyChangeEvent; +import java.util.List; + +import org.eclipse.scout.rt.client.session.ClientSessionProvider; +import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke; +import org.eclipse.scout.rt.client.ui.action.menu.AbstractMenu; +import org.eclipse.scout.rt.client.ui.action.menu.IMenu; +import org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop; +import org.eclipse.scout.rt.client.ui.desktop.notification.NativeNotificationDefaults; +import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutlineViewButton; +import org.eclipse.scout.rt.client.ui.desktop.outline.IOutline; +import org.eclipse.scout.rt.client.ui.form.ScoutInfoForm; +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.platform.text.TEXTS; +import org.eclipse.scout.rt.platform.util.CollectionUtility; +import org.eclipse.scout.rt.platform.util.StringUtility; +import org.eclipse.scout.rt.security.IAccessControlService; + +import io.sxda.scout.apps.addondemo.client.Desktop.UserProfileMenu.ThemeMenu.DarkThemeMenu; +import io.sxda.scout.apps.addondemo.client.Desktop.UserProfileMenu.ThemeMenu.DefaultThemeMenu; +import io.sxda.scout.apps.addondemo.client.search.SearchOutline; +import io.sxda.scout.apps.addondemo.client.settings.SettingsOutline; +import io.sxda.scout.apps.addondemo.client.work.WorkOutline; +import io.sxda.scout.apps.addondemo.shared.Icons; + +/** + * @author nisrael + */ +public class Desktop extends AbstractDesktop { + + public Desktop() { + addPropertyChangeListener(PROP_THEME, this::onThemeChanged); + } + + @Override + protected String getConfiguredTitle() { + return TEXTS.get("ApplicationTitle"); + } + + @Override + protected String getConfiguredLogoId() { + return Icons.AppLogo; + } + + @Override + protected NativeNotificationDefaults getConfiguredNativeNotificationDefaults() { + return super.getConfiguredNativeNotificationDefaults().withIconId("application_logo.png"); + } + + @Override + protected List> getConfiguredOutlines() { + return CollectionUtility.>arrayList( + WorkOutline.class, SearchOutline.class, SettingsOutline.class); + } + + @Override + protected void execDefaultView() { + selectFirstVisibleOutline(); + } + + protected void selectFirstVisibleOutline() { + for (IOutline outline : getAvailableOutlines()) { + if (outline.isEnabled() && outline.isVisible()) { + setOutline(outline.getClass()); + return; + } + } + } + + protected void onThemeChanged(PropertyChangeEvent evt) { + IMenu darkMenu = getMenuByClass(DarkThemeMenu.class); + IMenu defaultMenu = getMenuByClass(DefaultThemeMenu.class); + String newThemeName = (String) evt.getNewValue(); + if (DarkThemeMenu.DARK_THEME.equalsIgnoreCase(newThemeName)) { + darkMenu.setIconId(Icons.CheckedBold); + defaultMenu.setIconId(null); + } else { + darkMenu.setIconId(null); + defaultMenu.setIconId(Icons.CheckedBold); + } + } + + @Order(1000) + public class UserProfileMenu extends AbstractMenu { + + @Override + protected String getConfiguredKeyStroke() { + return IKeyStroke.F10; + } + + @Override + protected String getConfiguredIconId() { + return Icons.PersonSolid; + } + + @Override + protected String getConfiguredText() { + String userId = BEANS.get(IAccessControlService.class).getUserIdOfCurrentSubject(); + return StringUtility.uppercaseFirst(userId); + } + + @Order(1000) + public class AboutMenu extends AbstractMenu { + + @Override + protected String getConfiguredText() { + return TEXTS.get("About"); + } + + @Override + protected void execAction() { + ScoutInfoForm form = new ScoutInfoForm(); + form.startModify(); + } + } + + @Order(2000) + public class ThemeMenu extends AbstractMenu { + + @Override + protected String getConfiguredText() { + return TEXTS.get("Theme"); + } + + @Order(1000) + public class DefaultThemeMenu extends AbstractMenu { + + private static final String DEFAULT_THEME = "Default"; + + @Override + protected String getConfiguredText() { + return DEFAULT_THEME; + } + + @Override + protected void execAction() { + setTheme(DEFAULT_THEME.toLowerCase()); + } + } + + @Order(2000) + public class DarkThemeMenu extends AbstractMenu { + + private static final String DARK_THEME = "Dark"; + + @Override + protected String getConfiguredText() { + return DARK_THEME; + } + + @Override + protected void execAction() { + setTheme(DARK_THEME.toLowerCase()); + } + } + } + + @Order(3000) + public class LogoutMenu extends AbstractMenu { + + @Override + protected String getConfiguredText() { + return TEXTS.get("Logout"); + } + + @Override + protected void execAction() { + ClientSessionProvider.currentSession().stop(); + } + } + } + + @Order(1000) + public class WorkOutlineViewButton extends AbstractOutlineViewButton { + + public WorkOutlineViewButton() { + this(WorkOutline.class); + } + + protected WorkOutlineViewButton(Class outlineClass) { + super(Desktop.this, outlineClass); + } + + @Override + protected String getConfiguredKeyStroke() { + return IKeyStroke.F2; + } + } + + @Order(2000) + public class SearchOutlineViewButton extends AbstractOutlineViewButton { + + public SearchOutlineViewButton() { + this(SearchOutline.class); + } + + protected SearchOutlineViewButton(Class outlineClass) { + super(Desktop.this, outlineClass); + } + + @Override + protected DisplayStyle getConfiguredDisplayStyle() { + return DisplayStyle.TAB; + } + + @Override + protected String getConfiguredKeyStroke() { + return IKeyStroke.F3; + } + } + + @Order(3000) + public class SettingsOutlineViewButton extends AbstractOutlineViewButton { + + public SettingsOutlineViewButton() { + this(SettingsOutline.class); + } + + protected SettingsOutlineViewButton(Class outlineClass) { + super(Desktop.this, outlineClass); + } + + @Override + protected DisplayStyle getConfiguredDisplayStyle() { + return DisplayStyle.TAB; + } + + @Override + protected String getConfiguredKeyStroke() { + return IKeyStroke.F10; + } + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ResourceBase.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ResourceBase.java index 3b53d62..dd8fbb2 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ResourceBase.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/ResourceBase.java @@ -1,14 +1,14 @@ -package io.sxda.scout.apps.addondemo.client; - -/** - * This class is the base for resources contained in this module. Do not move it to another package, as the - * package is part of the resource name. - *

- * Usage: ResourceBase.class.getResource("relativeFolder/file.ext") - * - * @author nisrael - */ -public final class ResourceBase { - private ResourceBase() { - } -} +package io.sxda.scout.apps.addondemo.client; + +/** + * This class is the base for resources contained in this module. Do not move it to another package, as the + * package is part of the resource name. + *

+ * Usage: ResourceBase.class.getResource("relativeFolder/file.ext") + * + * @author nisrael + */ +public final class ResourceBase { + private ResourceBase() { + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldForm.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldForm.java index 5910c44..4facd94 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldForm.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldForm.java @@ -1,97 +1,97 @@ -package io.sxda.scout.apps.addondemo.client.helloworld; - -import org.eclipse.scout.rt.client.dto.FormData; -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.client.ui.form.AbstractForm; -import org.eclipse.scout.rt.client.ui.form.AbstractFormHandler; -import org.eclipse.scout.rt.client.ui.form.fields.groupbox.AbstractGroupBox; -import org.eclipse.scout.rt.client.ui.form.fields.stringfield.AbstractStringField; -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.platform.text.TEXTS; -import org.eclipse.scout.rt.shared.AbstractIcons; - -import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox; -import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox.MessageField; -import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; -import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; - -/** - * @author nisrael - */ -@FormData(value = HelloWorldFormData.class, sdkCommand = FormData.SdkCommand.CREATE) -public class HelloWorldForm extends AbstractForm { - - public HelloWorldForm() { - setHandler(new ViewHandler()); - } - - @Override - protected boolean getConfiguredAskIfNeedSave() { - return false; - } - - @Override - protected int getConfiguredModalityHint() { - return MODALITY_HINT_MODELESS; - } - - @Override - protected String getConfiguredIconId() { - return AbstractIcons.World; - } - - public MainBox getMainBox() { - return getFieldByClass(MainBox.class); - } - - public TopBox getTopBox() { - return getFieldByClass(TopBox.class); - } - - public MessageField getMessageField() { - return getFieldByClass(MessageField.class); - } - - @Order(1000) - public class MainBox extends AbstractGroupBox { - - @Order(1000) - public class TopBox extends AbstractGroupBox { - - @Override - protected String getConfiguredLabel() { - return TEXTS.get("MessageFromServer"); - } - - @Order(1000) - public class MessageField extends AbstractStringField { - @Override - protected int getConfiguredGridW() { - return 2; - } - - @Override - protected String getConfiguredLabel() { - return TEXTS.get("Message"); - } - - @Override - protected boolean getConfiguredEnabled() { - return false; - } - } - } - } - - public class ViewHandler extends AbstractFormHandler { - - @Override - protected void execLoad() { - IHelloWorldService service = BEANS.get(IHelloWorldService.class); - HelloWorldFormData formData = new HelloWorldFormData(); - exportFormData(formData); - formData = service.load(formData); - importFormData(formData); - } - } -} +package io.sxda.scout.apps.addondemo.client.helloworld; + +import org.eclipse.scout.rt.client.dto.FormData; +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.client.ui.form.AbstractForm; +import org.eclipse.scout.rt.client.ui.form.AbstractFormHandler; +import org.eclipse.scout.rt.client.ui.form.fields.groupbox.AbstractGroupBox; +import org.eclipse.scout.rt.client.ui.form.fields.stringfield.AbstractStringField; +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.platform.text.TEXTS; +import org.eclipse.scout.rt.shared.AbstractIcons; + +import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox; +import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox.MessageField; +import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; +import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; + +/** + * @author nisrael + */ +@FormData(value = HelloWorldFormData.class, sdkCommand = FormData.SdkCommand.CREATE) +public class HelloWorldForm extends AbstractForm { + + public HelloWorldForm() { + setHandler(new ViewHandler()); + } + + @Override + protected boolean getConfiguredAskIfNeedSave() { + return false; + } + + @Override + protected int getConfiguredModalityHint() { + return MODALITY_HINT_MODELESS; + } + + @Override + protected String getConfiguredIconId() { + return AbstractIcons.World; + } + + public MainBox getMainBox() { + return getFieldByClass(MainBox.class); + } + + public TopBox getTopBox() { + return getFieldByClass(TopBox.class); + } + + public MessageField getMessageField() { + return getFieldByClass(MessageField.class); + } + + @Order(1000) + public class MainBox extends AbstractGroupBox { + + @Order(1000) + public class TopBox extends AbstractGroupBox { + + @Override + protected String getConfiguredLabel() { + return TEXTS.get("MessageFromServer"); + } + + @Order(1000) + public class MessageField extends AbstractStringField { + @Override + protected int getConfiguredGridW() { + return 2; + } + + @Override + protected String getConfiguredLabel() { + return TEXTS.get("Message"); + } + + @Override + protected boolean getConfiguredEnabled() { + return false; + } + } + } + } + + public class ViewHandler extends AbstractFormHandler { + + @Override + protected void execLoad() { + IHelloWorldService service = BEANS.get(IHelloWorldService.class); + HelloWorldFormData formData = new HelloWorldFormData(); + exportFormData(formData); + formData = service.load(formData); + importFormData(formData); + } + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldPage.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldPage.java index 725d903..a68685b 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldPage.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldPage.java @@ -1,31 +1,31 @@ -package io.sxda.scout.apps.addondemo.client.helloworld; - -import org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithNodes; -import org.eclipse.scout.rt.client.ui.form.IForm; -import org.eclipse.scout.rt.platform.text.TEXTS; - -/** - * @author nisrael - */ -public class HelloWorldPage extends AbstractPageWithNodes { - - @Override - protected boolean getConfiguredLeaf() { - return true; - } - - @Override - protected boolean getConfiguredTableVisible() { - return false; - } - - @Override - protected String getConfiguredTitle() { - return TEXTS.get("HelloWorld"); - } - - @Override - protected Class getConfiguredDetailForm() { - return HelloWorldForm.class; - } -} +package io.sxda.scout.apps.addondemo.client.helloworld; + +import org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithNodes; +import org.eclipse.scout.rt.client.ui.form.IForm; +import org.eclipse.scout.rt.platform.text.TEXTS; + +/** + * @author nisrael + */ +public class HelloWorldPage extends AbstractPageWithNodes { + + @Override + protected boolean getConfiguredLeaf() { + return true; + } + + @Override + protected boolean getConfiguredTableVisible() { + return false; + } + + @Override + protected String getConfiguredTitle() { + return TEXTS.get("HelloWorld"); + } + + @Override + protected Class getConfiguredDetailForm() { + return HelloWorldForm.class; + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/search/SearchOutline.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/search/SearchOutline.java index d574bbc..82419e2 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/search/SearchOutline.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/search/SearchOutline.java @@ -1,28 +1,28 @@ -package io.sxda.scout.apps.addondemo.client.search; - -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractSearchOutline; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.sxda.scout.apps.addondemo.shared.Icons; - -/** - * @author nisrael - */ -@Order(2000) -public class SearchOutline extends AbstractSearchOutline { - - private static final Logger LOG = LoggerFactory.getLogger(SearchOutline.class); - - @Override - protected void execSearch(final String query) { - LOG.info("Search started"); - // TODO [nisrael]: Implement search - } - - @Override - protected String getConfiguredIconId() { - return Icons.Search; - } -} +package io.sxda.scout.apps.addondemo.client.search; + +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractSearchOutline; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.sxda.scout.apps.addondemo.shared.Icons; + +/** + * @author nisrael + */ +@Order(2000) +public class SearchOutline extends AbstractSearchOutline { + + private static final Logger LOG = LoggerFactory.getLogger(SearchOutline.class); + + @Override + protected void execSearch(final String query) { + LOG.info("Search started"); + // TODO [nisrael]: Implement search + } + + @Override + protected String getConfiguredIconId() { + return Icons.Search; + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/settings/SettingsOutline.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/settings/SettingsOutline.java index 436b777..ec10b3e 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/settings/SettingsOutline.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/settings/SettingsOutline.java @@ -1,24 +1,24 @@ -package io.sxda.scout.apps.addondemo.client.settings; - -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline; -import org.eclipse.scout.rt.platform.text.TEXTS; - -import io.sxda.scout.apps.addondemo.shared.Icons; - -/** - * @author nisrael - */ -@Order(3000) -public class SettingsOutline extends AbstractOutline { - - @Override - protected String getConfiguredTitle() { - return TEXTS.get("Settings"); - } - - @Override - protected String getConfiguredIconId() { - return Icons.Gear; - } -} +package io.sxda.scout.apps.addondemo.client.settings; + +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline; +import org.eclipse.scout.rt.platform.text.TEXTS; + +import io.sxda.scout.apps.addondemo.shared.Icons; + +/** + * @author nisrael + */ +@Order(3000) +public class SettingsOutline extends AbstractOutline { + + @Override + protected String getConfiguredTitle() { + return TEXTS.get("Settings"); + } + + @Override + protected String getConfiguredIconId() { + return Icons.Gear; + } +} diff --git a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/work/WorkOutline.java b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/work/WorkOutline.java index 2f7cbd6..9c9d3d3 100644 --- a/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/work/WorkOutline.java +++ b/addondemo.client/src/main/java/io/sxda/scout/apps/addondemo/client/work/WorkOutline.java @@ -1,34 +1,34 @@ -package io.sxda.scout.apps.addondemo.client.work; - -import java.util.List; - -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline; -import org.eclipse.scout.rt.client.ui.desktop.outline.pages.IPage; -import org.eclipse.scout.rt.platform.text.TEXTS; - -import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldPage; -import io.sxda.scout.apps.addondemo.shared.Icons; - -/** - * @author nisrael - */ -@Order(1000) -public class WorkOutline extends AbstractOutline { - - @Override - protected void execCreateChildPages(List> pageList) { - super.execCreateChildPages(pageList); - pageList.add(new HelloWorldPage()); - } - - @Override - protected String getConfiguredTitle() { - return TEXTS.get("Work"); - } - - @Override - protected String getConfiguredIconId() { - return Icons.Pencil; - } -} +package io.sxda.scout.apps.addondemo.client.work; + +import java.util.List; + +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline; +import org.eclipse.scout.rt.client.ui.desktop.outline.pages.IPage; +import org.eclipse.scout.rt.platform.text.TEXTS; + +import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldPage; +import io.sxda.scout.apps.addondemo.shared.Icons; + +/** + * @author nisrael + */ +@Order(1000) +public class WorkOutline extends AbstractOutline { + + @Override + protected void execCreateChildPages(List> pageList) { + super.execCreateChildPages(pageList); + pageList.add(new HelloWorldPage()); + } + + @Override + protected String getConfiguredTitle() { + return TEXTS.get("Work"); + } + + @Override + protected String getConfiguredIconId() { + return Icons.Pencil; + } +} diff --git a/addondemo.client/src/test/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldFormTest.java b/addondemo.client/src/test/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldFormTest.java index 87bd821..6c4ff3f 100644 --- a/addondemo.client/src/test/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldFormTest.java +++ b/addondemo.client/src/test/java/io/sxda/scout/apps/addondemo/client/helloworld/HelloWorldFormTest.java @@ -1,67 +1,67 @@ -package io.sxda.scout.apps.addondemo.client.helloworld; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - -import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox.MessageField; -import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; -import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; -import org.eclipse.scout.rt.client.testenvironment.TestEnvironmentClientSession; -import org.eclipse.scout.rt.testing.client.runner.ClientTestRunner; -import org.eclipse.scout.rt.testing.client.runner.RunWithClientSession; -import org.eclipse.scout.rt.testing.platform.mock.BeanMock; -import org.eclipse.scout.rt.testing.platform.runner.RunWithSubject; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Contains Tests for the {@link HelloWorldForm}. - * - * @author nisrael - */ -@RunWith(ClientTestRunner.class) -@RunWithSubject("anonymous") -@RunWithClientSession(TestEnvironmentClientSession.class) -public class HelloWorldFormTest { - - private static final String MESSAGE_VALUE = "testData"; - - // Register a mock service for {@link IHelloWorldService} - @BeanMock - private IHelloWorldService m_mockSvc; - - /** - * Return a reference {@link HelloWorldFormData} on method - * {@link IHelloWorldService#load(HelloWorldFormData)}. - */ - @Before - public void setup() { - HelloWorldFormData result = new HelloWorldFormData(); - result.getMessage().setValue(MESSAGE_VALUE); - - when(m_mockSvc.load(any())).thenReturn(result); - } - - /** - * Tests that the {@link MessageField} is disabled. - */ - @Test - public void testMessageFieldDisabled() { - HelloWorldForm frm = new HelloWorldForm(); - assertFalse(frm.getMessageField().isEnabled()); - } - - /** - * Tests that the {@link MessageField} is correctly filled after start. - */ - @Test - public void testMessageCorrectlyImported() { - HelloWorldForm frm = new HelloWorldForm(); - frm.start(); - - assertEquals(MESSAGE_VALUE, frm.getMessageField().getValue()); - } -} +package io.sxda.scout.apps.addondemo.client.helloworld; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm.MainBox.TopBox.MessageField; +import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; +import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; +import org.eclipse.scout.rt.client.testenvironment.TestEnvironmentClientSession; +import org.eclipse.scout.rt.testing.client.runner.ClientTestRunner; +import org.eclipse.scout.rt.testing.client.runner.RunWithClientSession; +import org.eclipse.scout.rt.testing.platform.mock.BeanMock; +import org.eclipse.scout.rt.testing.platform.runner.RunWithSubject; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Contains Tests for the {@link HelloWorldForm}. + * + * @author nisrael + */ +@RunWith(ClientTestRunner.class) +@RunWithSubject("anonymous") +@RunWithClientSession(TestEnvironmentClientSession.class) +public class HelloWorldFormTest { + + private static final String MESSAGE_VALUE = "testData"; + + // Register a mock service for {@link IHelloWorldService} + @BeanMock + private IHelloWorldService m_mockSvc; + + /** + * Return a reference {@link HelloWorldFormData} on method + * {@link IHelloWorldService#load(HelloWorldFormData)}. + */ + @Before + public void setup() { + HelloWorldFormData result = new HelloWorldFormData(); + result.getMessage().setValue(MESSAGE_VALUE); + + when(m_mockSvc.load(any())).thenReturn(result); + } + + /** + * Tests that the {@link MessageField} is disabled. + */ + @Test + public void testMessageFieldDisabled() { + HelloWorldForm frm = new HelloWorldForm(); + assertFalse(frm.getMessageField().isEnabled()); + } + + /** + * Tests that the {@link MessageField} is correctly filled after start. + */ + @Test + public void testMessageCorrectlyImported() { + HelloWorldForm frm = new HelloWorldForm(); + frm.start(); + + assertEquals(MESSAGE_VALUE, frm.getMessageField().getValue()); + } +} diff --git a/addondemo.client/src/test/resources/logback-test.xml b/addondemo.client/src/test/resources/logback-test.xml index 8336504..12a8572 100644 --- a/addondemo.client/src/test/resources/logback-test.xml +++ b/addondemo.client/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/addondemo.server/pom.xml b/addondemo.server/pom.xml index 7417dfe..ad963aa 100644 --- a/addondemo.server/pom.xml +++ b/addondemo.server/pom.xml @@ -1,37 +1,37 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.server - - Addon Demo Server - - - - org.eclipse.scout.rt.server - org.eclipse.scout.rt - - - io.sxda.scout.apps - addondemo.shared - - - org.eclipse.scout.rt - org.eclipse.scout.rt.server.test - test - - - ch.qos.logback - logback-classic - test - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.server + + Addon Demo Server + + + + org.eclipse.scout.rt.server + org.eclipse.scout.rt + + + io.sxda.scout.apps + addondemo.shared + + + org.eclipse.scout.rt + org.eclipse.scout.rt.server.test + test + + + ch.qos.logback + logback-classic + test + + + diff --git a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerServletFilter.java b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerServletFilter.java index 6915aac..06da1aa 100644 --- a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerServletFilter.java +++ b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerServletFilter.java @@ -1,64 +1,64 @@ -package io.sxda.scout.apps.addondemo.server; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.server.commons.authentication.DevelopmentAccessController; -import org.eclipse.scout.rt.server.commons.authentication.ServiceTunnelAccessTokenAccessController; -import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController; -import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController.TrivialAuthConfig; - -/** - * This is the main server side servlet filter. - * - * @author nisrael - */ -public class ServerServletFilter implements Filter { - - private TrivialAccessController m_trivialAccessController; - private ServiceTunnelAccessTokenAccessController m_tunnelAccessController; - private DevelopmentAccessController m_developmentAccessController; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - m_trivialAccessController = BEANS.get(TrivialAccessController.class).init(new TrivialAuthConfig().withExclusionFilter(filterConfig.getInitParameter("filter-exclude"))); - m_tunnelAccessController = BEANS.get(ServiceTunnelAccessTokenAccessController.class).init(); - m_developmentAccessController = BEANS.get(DevelopmentAccessController.class).init(); - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - final HttpServletRequest req = (HttpServletRequest) request; - final HttpServletResponse resp = (HttpServletResponse) response; - - if (m_trivialAccessController.handle(req, resp, chain)) { - return; - } - - if (m_tunnelAccessController.handle(req, resp, chain)) { - return; - } - - if (m_developmentAccessController.handle(req, resp, chain)) { - return; - } - - resp.sendError(HttpServletResponse.SC_FORBIDDEN); - } - - @Override - public void destroy() { - m_developmentAccessController.destroy(); - m_tunnelAccessController.destroy(); - m_trivialAccessController.destroy(); - } -} +package io.sxda.scout.apps.addondemo.server; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.server.commons.authentication.DevelopmentAccessController; +import org.eclipse.scout.rt.server.commons.authentication.ServiceTunnelAccessTokenAccessController; +import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController; +import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController.TrivialAuthConfig; + +/** + * This is the main server side servlet filter. + * + * @author nisrael + */ +public class ServerServletFilter implements Filter { + + private TrivialAccessController m_trivialAccessController; + private ServiceTunnelAccessTokenAccessController m_tunnelAccessController; + private DevelopmentAccessController m_developmentAccessController; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + m_trivialAccessController = BEANS.get(TrivialAccessController.class).init(new TrivialAuthConfig().withExclusionFilter(filterConfig.getInitParameter("filter-exclude"))); + m_tunnelAccessController = BEANS.get(ServiceTunnelAccessTokenAccessController.class).init(); + m_developmentAccessController = BEANS.get(DevelopmentAccessController.class).init(); + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + final HttpServletRequest req = (HttpServletRequest) request; + final HttpServletResponse resp = (HttpServletResponse) response; + + if (m_trivialAccessController.handle(req, resp, chain)) { + return; + } + + if (m_tunnelAccessController.handle(req, resp, chain)) { + return; + } + + if (m_developmentAccessController.handle(req, resp, chain)) { + return; + } + + resp.sendError(HttpServletResponse.SC_FORBIDDEN); + } + + @Override + public void destroy() { + m_developmentAccessController.destroy(); + m_tunnelAccessController.destroy(); + m_trivialAccessController.destroy(); + } +} diff --git a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerSession.java b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerSession.java index 537181c..4c1138e 100644 --- a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerSession.java +++ b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/ServerSession.java @@ -1,31 +1,31 @@ -package io.sxda.scout.apps.addondemo.server; - -import org.eclipse.scout.rt.server.AbstractServerSession; -import org.eclipse.scout.rt.server.session.ServerSessionProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author nisrael - */ -public class ServerSession extends AbstractServerSession { - - private static final long serialVersionUID = 1L; - private static final Logger LOG = LoggerFactory.getLogger(ServerSession.class); - - public ServerSession() { - super(true); - } - - /** - * @return The {@link ServerSession} which is associated with the current thread, or {@code null} if not found. - */ - public static ServerSession get() { - return ServerSessionProvider.currentSession(ServerSession.class); - } - - @Override - protected void execLoadSession() { - LOG.info("created a new session for {}", getUserId()); - } -} +package io.sxda.scout.apps.addondemo.server; + +import org.eclipse.scout.rt.server.AbstractServerSession; +import org.eclipse.scout.rt.server.session.ServerSessionProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author nisrael + */ +public class ServerSession extends AbstractServerSession { + + private static final long serialVersionUID = 1L; + private static final Logger LOG = LoggerFactory.getLogger(ServerSession.class); + + public ServerSession() { + super(true); + } + + /** + * @return The {@link ServerSession} which is associated with the current thread, or {@code null} if not found. + */ + public static ServerSession get() { + return ServerSessionProvider.currentSession(ServerSession.class); + } + + @Override + protected void execLoadSession() { + LOG.info("created a new session for {}", getUserId()); + } +} diff --git a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldService.java b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldService.java index 0526ede..0893f72 100644 --- a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldService.java +++ b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldService.java @@ -1,19 +1,19 @@ -package io.sxda.scout.apps.addondemo.server.helloworld; - -import io.sxda.scout.apps.addondemo.server.ServerSession; -import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; -import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; - -/** - * @author nisrael - */ -public class HelloWorldService implements IHelloWorldService { - - @Override - public HelloWorldFormData load(HelloWorldFormData input) { - StringBuilder msg = new StringBuilder(); - msg.append("Hello ").append(ServerSession.get().getUserId()).append('!'); - input.getMessage().setValue(msg.toString()); - return input; - } -} +package io.sxda.scout.apps.addondemo.server.helloworld; + +import io.sxda.scout.apps.addondemo.server.ServerSession; +import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; +import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; + +/** + * @author nisrael + */ +public class HelloWorldService implements IHelloWorldService { + + @Override + public HelloWorldFormData load(HelloWorldFormData input) { + StringBuilder msg = new StringBuilder(); + msg.append("Hello ").append(ServerSession.get().getUserId()).append('!'); + input.getMessage().setValue(msg.toString()); + return input; + } +} diff --git a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/security/ServerAccessControlService.java b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/security/ServerAccessControlService.java index c0ad0c9..3c56600 100644 --- a/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/security/ServerAccessControlService.java +++ b/addondemo.server/src/main/java/io/sxda/scout/apps/addondemo/server/security/ServerAccessControlService.java @@ -1,27 +1,27 @@ -package io.sxda.scout.apps.addondemo.server.security; - -import io.sxda.scout.apps.addondemo.shared.security.AccessControlService; -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.platform.Replace; -import org.eclipse.scout.rt.security.DefaultPermissionCollection; -import org.eclipse.scout.rt.security.IPermissionCollection; -import org.eclipse.scout.rt.security.PermissionLevel; -import org.eclipse.scout.rt.shared.security.RemoteServiceAccessPermission; - -/** - * @author nisrael - */ -@Replace -public class ServerAccessControlService extends AccessControlService { - - @Override - protected IPermissionCollection execLoadPermissions(String userId) { - IPermissionCollection permissions = BEANS.get(DefaultPermissionCollection.class); - permissions.add(new RemoteServiceAccessPermission("*.shared.*", "*"), PermissionLevel.ALL); - - //TODO [nisrael]: Fill access control service - or replace this default implementation by simply return BEANS.get(AllPermissionCollection.class) - - permissions.setReadOnly(); - return permissions; - } -} +package io.sxda.scout.apps.addondemo.server.security; + +import io.sxda.scout.apps.addondemo.shared.security.AccessControlService; +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.platform.Replace; +import org.eclipse.scout.rt.security.DefaultPermissionCollection; +import org.eclipse.scout.rt.security.IPermissionCollection; +import org.eclipse.scout.rt.security.PermissionLevel; +import org.eclipse.scout.rt.shared.security.RemoteServiceAccessPermission; + +/** + * @author nisrael + */ +@Replace +public class ServerAccessControlService extends AccessControlService { + + @Override + protected IPermissionCollection execLoadPermissions(String userId) { + IPermissionCollection permissions = BEANS.get(DefaultPermissionCollection.class); + permissions.add(new RemoteServiceAccessPermission("*.shared.*", "*"), PermissionLevel.ALL); + + //TODO [nisrael]: Fill access control service - or replace this default implementation by simply return BEANS.get(AllPermissionCollection.class) + + permissions.setReadOnly(); + return permissions; + } +} diff --git a/addondemo.server/src/main/resources/META-INF/scout.xml b/addondemo.server/src/main/resources/META-INF/scout.xml index 10f6f90..760933e 100644 --- a/addondemo.server/src/main/resources/META-INF/scout.xml +++ b/addondemo.server/src/main/resources/META-INF/scout.xml @@ -1,3 +1,3 @@ - - - + + + diff --git a/addondemo.server/src/test/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldServiceTest.java b/addondemo.server/src/test/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldServiceTest.java index 46d7dc2..06dfb49 100644 --- a/addondemo.server/src/test/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldServiceTest.java +++ b/addondemo.server/src/test/java/io/sxda/scout/apps/addondemo/server/helloworld/HelloWorldServiceTest.java @@ -1,32 +1,32 @@ -package io.sxda.scout.apps.addondemo.server.helloworld; - -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.testing.platform.runner.RunWithSubject; -import org.eclipse.scout.rt.testing.server.runner.RunWithServerSession; -import org.eclipse.scout.rt.testing.server.runner.ServerTestRunner; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -import io.sxda.scout.apps.addondemo.server.ServerSession; -import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; -import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; - -/** - * @author nisrael - */ -@RunWith(ServerTestRunner.class) -@RunWithSubject(HelloWorldServiceTest.SUBJECT_NAME) -@RunWithServerSession(ServerSession.class) -public class HelloWorldServiceTest { - public static final String SUBJECT_NAME = "test_subject"; - - @Test - public void testMessageContainsSubjectName() { - HelloWorldFormData input = new HelloWorldFormData(); - input = BEANS.get(IHelloWorldService.class).load(input); - - Assert.assertNotNull(input.getMessage()); - Assert.assertEquals("Hello " + SUBJECT_NAME + "!", input.getMessage().getValue()); - } -} +package io.sxda.scout.apps.addondemo.server.helloworld; + +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.testing.platform.runner.RunWithSubject; +import org.eclipse.scout.rt.testing.server.runner.RunWithServerSession; +import org.eclipse.scout.rt.testing.server.runner.ServerTestRunner; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +import io.sxda.scout.apps.addondemo.server.ServerSession; +import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; +import io.sxda.scout.apps.addondemo.shared.helloworld.IHelloWorldService; + +/** + * @author nisrael + */ +@RunWith(ServerTestRunner.class) +@RunWithSubject(HelloWorldServiceTest.SUBJECT_NAME) +@RunWithServerSession(ServerSession.class) +public class HelloWorldServiceTest { + public static final String SUBJECT_NAME = "test_subject"; + + @Test + public void testMessageContainsSubjectName() { + HelloWorldFormData input = new HelloWorldFormData(); + input = BEANS.get(IHelloWorldService.class).load(input); + + Assert.assertNotNull(input.getMessage()); + Assert.assertEquals("Hello " + SUBJECT_NAME + "!", input.getMessage().getValue()); + } +} diff --git a/addondemo.server/src/test/resources/logback-test.xml b/addondemo.server/src/test/resources/logback-test.xml index 8336504..12a8572 100644 --- a/addondemo.server/src/test/resources/logback-test.xml +++ b/addondemo.server/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/addondemo.shared/pom.xml b/addondemo.shared/pom.xml index 3b1878f..a1c41c1 100644 --- a/addondemo.shared/pom.xml +++ b/addondemo.shared/pom.xml @@ -1,36 +1,36 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.shared - - Addon Demo Shared - - - - org.eclipse.scout.rt.shared - org.eclipse.scout.rt - - - org.eclipse.scout.rt - org.eclipse.scout.rt.shared.test - test - - - org.slf4j - jul-to-slf4j - - - ch.qos.logback - logback-classic - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.shared + + Addon Demo Shared + + + + org.eclipse.scout.rt.shared + org.eclipse.scout.rt + + + org.eclipse.scout.rt + org.eclipse.scout.rt.shared.test + test + + + org.slf4j + jul-to-slf4j + + + ch.qos.logback + logback-classic + + + diff --git a/addondemo.shared/src/generated/java/io/sxda/scout/apps/addondemo/shared/helloworld/HelloWorldFormData.java b/addondemo.shared/src/generated/java/io/sxda/scout/apps/addondemo/shared/helloworld/HelloWorldFormData.java index 8e08e31..4eacf3f 100644 --- a/addondemo.shared/src/generated/java/io/sxda/scout/apps/addondemo/shared/helloworld/HelloWorldFormData.java +++ b/addondemo.shared/src/generated/java/io/sxda/scout/apps/addondemo/shared/helloworld/HelloWorldFormData.java @@ -1,26 +1,26 @@ -package io.sxda.scout.apps.addondemo.shared.helloworld; - -import javax.annotation.Generated; - -import org.eclipse.scout.rt.shared.data.form.AbstractFormData; -import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; - -/** - * NOTE:
- * This class is auto generated by the Scout SDK. No manual modifications - * recommended. - */ -@Generated(value = "io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm", comments = "This class is auto generated by the Scout SDK. No manual modifications recommended.") -public class HelloWorldFormData extends AbstractFormData { - - private static final long serialVersionUID = 1L; - - public Message getMessage() { - return getFieldByClass(Message.class); - } - - public static class Message extends AbstractValueFieldData { - - private static final long serialVersionUID = 1L; - } -} +package io.sxda.scout.apps.addondemo.shared.helloworld; + +import javax.annotation.Generated; + +import org.eclipse.scout.rt.shared.data.form.AbstractFormData; +import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; + +/** + * NOTE:
+ * This class is auto generated by the Scout SDK. No manual modifications + * recommended. + */ +@Generated(value = "io.sxda.scout.apps.addondemo.client.helloworld.HelloWorldForm", comments = "This class is auto generated by the Scout SDK. No manual modifications recommended.") +public class HelloWorldFormData extends AbstractFormData { + + private static final long serialVersionUID = 1L; + + public Message getMessage() { + return getFieldByClass(Message.class); + } + + public static class Message extends AbstractValueFieldData { + + private static final long serialVersionUID = 1L; + } +} diff --git a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/Icons.java b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/Icons.java index 69efc50..516dcca 100644 --- a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/Icons.java +++ b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/Icons.java @@ -1,13 +1,13 @@ -package io.sxda.scout.apps.addondemo.shared; - -import org.eclipse.scout.rt.shared.AbstractIcons; - -/** - * @author nisrael - */ -public class Icons extends AbstractIcons { - - private static final long serialVersionUID = 1L; - - public static final String AppLogo = "application_logo.svg"; -} +package io.sxda.scout.apps.addondemo.shared; + +import org.eclipse.scout.rt.shared.AbstractIcons; + +/** + * @author nisrael + */ +public class Icons extends AbstractIcons { + + private static final long serialVersionUID = 1L; + + public static final String AppLogo = "application_logo.svg"; +} diff --git a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/helloworld/IHelloWorldService.java b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/helloworld/IHelloWorldService.java index 7d26f8d..691e7fa 100644 --- a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/helloworld/IHelloWorldService.java +++ b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/helloworld/IHelloWorldService.java @@ -1,14 +1,14 @@ -package io.sxda.scout.apps.addondemo.shared.helloworld; - -import org.eclipse.scout.rt.platform.service.IService; -import org.eclipse.scout.rt.shared.TunnelToServer; - -import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; - -/** - * @author nisrael - */ -@TunnelToServer -public interface IHelloWorldService extends IService { - HelloWorldFormData load(HelloWorldFormData input); -} +package io.sxda.scout.apps.addondemo.shared.helloworld; + +import org.eclipse.scout.rt.platform.service.IService; +import org.eclipse.scout.rt.shared.TunnelToServer; + +import io.sxda.scout.apps.addondemo.shared.helloworld.HelloWorldFormData; + +/** + * @author nisrael + */ +@TunnelToServer +public interface IHelloWorldService extends IService { + HelloWorldFormData load(HelloWorldFormData input); +} diff --git a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/security/AccessControlService.java b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/security/AccessControlService.java index 11f4cdd..c51f742 100644 --- a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/security/AccessControlService.java +++ b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/security/AccessControlService.java @@ -1,29 +1,29 @@ -package io.sxda.scout.apps.addondemo.shared.security; - -import org.eclipse.scout.rt.security.AbstractAccessControlService; -import org.eclipse.scout.rt.security.IAccessControlService; -import org.eclipse.scout.rt.security.IPermissionCollection; -import org.eclipse.scout.rt.shared.ISession; -import org.eclipse.scout.rt.shared.session.Sessions; - -/** - * {@link IAccessControlService} service that uses {@link ISession#getUserId()} as internal cache key required by - * {@link AbstractAccessControlService} implementation. - *

- * Replace this service at server side to load permission collection. It is not required to implement - * {@link #execLoadPermissions(String)} at client side. - * - * @author nisrael - */ -public class AccessControlService extends AbstractAccessControlService { - - @Override - protected String getCurrentUserCacheKey() { - return Sessions.getCurrentUserId(); - } - - @Override - protected IPermissionCollection execLoadPermissions(String userId) { - return null; - } -} +package io.sxda.scout.apps.addondemo.shared.security; + +import org.eclipse.scout.rt.security.AbstractAccessControlService; +import org.eclipse.scout.rt.security.IAccessControlService; +import org.eclipse.scout.rt.security.IPermissionCollection; +import org.eclipse.scout.rt.shared.ISession; +import org.eclipse.scout.rt.shared.session.Sessions; + +/** + * {@link IAccessControlService} service that uses {@link ISession#getUserId()} as internal cache key required by + * {@link AbstractAccessControlService} implementation. + *

+ * Replace this service at server side to load permission collection. It is not required to implement + * {@link #execLoadPermissions(String)} at client side. + * + * @author nisrael + */ +public class AccessControlService extends AbstractAccessControlService { + + @Override + protected String getCurrentUserCacheKey() { + return Sessions.getCurrentUserId(); + } + + @Override + protected IPermissionCollection execLoadPermissions(String userId) { + return null; + } +} diff --git a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/text/DefaultTextProviderService.java b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/text/DefaultTextProviderService.java index fe40cd4..f7add44 100644 --- a/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/text/DefaultTextProviderService.java +++ b/addondemo.shared/src/main/java/io/sxda/scout/apps/addondemo/shared/text/DefaultTextProviderService.java @@ -1,15 +1,15 @@ -package io.sxda.scout.apps.addondemo.shared.text; - -import org.eclipse.scout.rt.platform.Order; -import org.eclipse.scout.rt.platform.text.AbstractDynamicNlsTextProviderService; - -/** - * @author nisrael - */ -@Order(-2000) -public class DefaultTextProviderService extends AbstractDynamicNlsTextProviderService { - @Override - public String getDynamicNlsBaseName() { - return "io.sxda.scout.apps.addondemo.shared.texts.Texts"; - } -} +package io.sxda.scout.apps.addondemo.shared.text; + +import org.eclipse.scout.rt.platform.Order; +import org.eclipse.scout.rt.platform.text.AbstractDynamicNlsTextProviderService; + +/** + * @author nisrael + */ +@Order(-2000) +public class DefaultTextProviderService extends AbstractDynamicNlsTextProviderService { + @Override + public String getDynamicNlsBaseName() { + return "io.sxda.scout.apps.addondemo.shared.texts.Texts"; + } +} diff --git a/addondemo.shared/src/main/resources/META-INF/scout.xml b/addondemo.shared/src/main/resources/META-INF/scout.xml index 10f6f90..760933e 100644 --- a/addondemo.shared/src/main/resources/META-INF/scout.xml +++ b/addondemo.shared/src/main/resources/META-INF/scout.xml @@ -1,3 +1,3 @@ - - - + + + diff --git a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts.properties b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts.properties index 917199f..1053f81 100644 --- a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts.properties +++ b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts.properties @@ -1,10 +1,10 @@ -About=About -ApplicationTitle=Addon Demo -AuthorizationFailed=Permission denied -HelloWorld=Hello World -Logout=Logout -Message=Message -MessageFromServer=Message from Server -Settings=Settings -Theme=Theme -Work=Work +About=About +ApplicationTitle=Addon Demo +AuthorizationFailed=Permission denied +HelloWorld=Hello World +Logout=Logout +Message=Message +MessageFromServer=Message from Server +Settings=Settings +Theme=Theme +Work=Work diff --git a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_de.properties b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_de.properties index 0337103..e1928cf 100644 --- a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_de.properties +++ b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_de.properties @@ -1,9 +1,9 @@ -About=Info -ApplicationTitle=Addon Demo -AuthorizationFailed=Zugriff verweigert -Logout=Abmelden -Message=Nachricht -MessageFromServer=Nachricht vom Server -Settings=Einstellungen -Theme=Theme -Work=Arbeit +About=Info +ApplicationTitle=Addon Demo +AuthorizationFailed=Zugriff verweigert +Logout=Abmelden +Message=Nachricht +MessageFromServer=Nachricht vom Server +Settings=Einstellungen +Theme=Theme +Work=Arbeit diff --git a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_fr.properties b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_fr.properties index ece2357..c11e3b7 100644 --- a/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_fr.properties +++ b/addondemo.shared/src/main/resources/io/sxda/scout/apps/addondemo/shared/texts/Texts_fr.properties @@ -1,9 +1,9 @@ -About=Info -ApplicationTitle=Addon Demo -AuthorizationFailed=Accès refusé -Logout=Annuler -Message=Message -MessageFromServer=Message du serveur -Settings=Paramètres -Theme=Theme -Work=Travail +About=Info +ApplicationTitle=Addon Demo +AuthorizationFailed=Accès refusé +Logout=Annuler +Message=Message +MessageFromServer=Message du serveur +Settings=Paramètres +Theme=Theme +Work=Travail diff --git a/addondemo.shared/src/test/resources/logback-test.xml b/addondemo.shared/src/test/resources/logback-test.xml index 8336504..12a8572 100644 --- a/addondemo.shared/src/test/resources/logback-test.xml +++ b/addondemo.shared/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/addondemo.ui.html/.gitignore b/addondemo.ui.html/.gitignore index 3dfc9da..0f59a68 100644 --- a/addondemo.ui.html/.gitignore +++ b/addondemo.ui.html/.gitignore @@ -1,3 +1,3 @@ -node_modules -dist -test-results +node_modules +dist +test-results diff --git a/addondemo.ui.html/package.json b/addondemo.ui.html/package.json index 227eb06..91c0358 100644 --- a/addondemo.ui.html/package.json +++ b/addondemo.ui.html/package.json @@ -1,40 +1,40 @@ -{ - "name": "@addondemo/ui", - "version": "1.0.0-SNAPSHOT", - "engines": { - "node": ">=18.12.1", - "npm": ">=9.1.1", - "pnpm": ">=7.16.0" - }, - "main": "./src/main/js/index.ts", - "files": [ - "src/main/resources/WebContent", - "src/main/js", - "target/dist" - ], - "scripts": { - "pnpm-install": "pnpm install --ignore-scripts", - "testserver:start": "scout-scripts test-server:start", - "testserver:stop": "scout-scripts test-server:stop", - "test:ci": "scout-scripts test:ci", - "build:dev": "scout-scripts build:dev", - "build:prod": "scout-scripts build:prod", - "build:all": "scout-scripts build:dev && scout-scripts build:prod", - "build:dev:watch": "scout-scripts build:dev:watch", - "cleanup:snapshots": "releng-scripts cleanup:snapshots", - "version:snapshot:dependencies": "releng-scripts version:snapshot:dependencies", - "version:snapshot": "releng-scripts version:snapshot", - "version:release:dependencies": "releng-scripts version:release:dependencies", - "version:release": "releng-scripts version:release" - }, - "devDependencies": { - "@eclipse-scout/cli": "23.2.15", - "@eclipse-scout/releng": "^22.0.0", - "@eclipse-scout/tsconfig": "23.2.15", - "@types/jquery": "3.5.16" - }, - "dependencies": { - "@eclipse-scout/core": "23.2.15", - "jquery": "3.6.0" - } -} +{ + "name": "@addondemo/ui", + "version": "1.0.0-SNAPSHOT", + "engines": { + "node": ">=18.12.1", + "npm": ">=9.1.1", + "pnpm": ">=7.16.0" + }, + "main": "./src/main/js/index.ts", + "files": [ + "src/main/resources/WebContent", + "src/main/js", + "target/dist" + ], + "scripts": { + "pnpm-install": "pnpm install --ignore-scripts", + "testserver:start": "scout-scripts test-server:start", + "testserver:stop": "scout-scripts test-server:stop", + "test:ci": "scout-scripts test:ci", + "build:dev": "scout-scripts build:dev", + "build:prod": "scout-scripts build:prod", + "build:all": "scout-scripts build:dev && scout-scripts build:prod", + "build:dev:watch": "scout-scripts build:dev:watch", + "cleanup:snapshots": "releng-scripts cleanup:snapshots", + "version:snapshot:dependencies": "releng-scripts version:snapshot:dependencies", + "version:snapshot": "releng-scripts version:snapshot", + "version:release:dependencies": "releng-scripts version:release:dependencies", + "version:release": "releng-scripts version:release" + }, + "devDependencies": { + "@eclipse-scout/cli": "23.2.15", + "@eclipse-scout/releng": "^22.0.0", + "@eclipse-scout/tsconfig": "23.2.15", + "@types/jquery": "3.5.16" + }, + "dependencies": { + "@eclipse-scout/core": "23.2.15", + "jquery": "3.6.0" + } +} diff --git a/addondemo.ui.html/pom.xml b/addondemo.ui.html/pom.xml index 25b3324..200d197 100644 --- a/addondemo.ui.html/pom.xml +++ b/addondemo.ui.html/pom.xml @@ -1,27 +1,27 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo - 1.0.0-SNAPSHOT - ../addondemo - - - addondemo.ui.html - - Addon Demo HTML UI - - - - org.eclipse.scout.rt - org.eclipse.scout.rt.ui.html - - - io.sxda.scout.apps - addondemo.client - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo + 1.0.0-SNAPSHOT + ../addondemo + + + addondemo.ui.html + + Addon Demo HTML UI + + + + org.eclipse.scout.rt + org.eclipse.scout.rt.ui.html + + + io.sxda.scout.apps + addondemo.client + + + diff --git a/addondemo.ui.html/src/main/java/io/sxda/scout/apps/addondemo/ui/html/UiServletFilter.java b/addondemo.ui.html/src/main/java/io/sxda/scout/apps/addondemo/ui/html/UiServletFilter.java index 6cef261..9f9b620 100644 --- a/addondemo.ui.html/src/main/java/io/sxda/scout/apps/addondemo/ui/html/UiServletFilter.java +++ b/addondemo.ui.html/src/main/java/io/sxda/scout/apps/addondemo/ui/html/UiServletFilter.java @@ -1,76 +1,76 @@ -package io.sxda.scout.apps.addondemo.ui.html; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.eclipse.scout.rt.platform.BEANS; -import org.eclipse.scout.rt.platform.security.ConfigFileCredentialVerifier; -import org.eclipse.scout.rt.server.commons.authentication.*; -import org.eclipse.scout.rt.server.commons.authentication.FormBasedAccessController.FormBasedAuthConfig; -import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController.TrivialAuthConfig; - -/** - * This is the main servlet filter for the HTML UI. - * - * @author nisrael - */ -public class UiServletFilter implements Filter { - - private TrivialAccessController m_trivialAccessController; - private FormBasedAccessController m_formBasedAccessController; - private DevelopmentAccessController m_developmentAccessController; - private AnonymousAccessController m_anonymousAccessController; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - m_trivialAccessController = BEANS.get(TrivialAccessController.class) - .init(new TrivialAuthConfig() - .withExclusionFilter(filterConfig.getInitParameter("filter-exclude")) - .withLoginPageInstalled(true)); - m_formBasedAccessController = BEANS.get(FormBasedAccessController.class) - .init(new FormBasedAuthConfig() - .withCredentialVerifier(BEANS.get(ConfigFileCredentialVerifier.class))); - m_developmentAccessController = BEANS.get(DevelopmentAccessController.class).init(); - m_anonymousAccessController = BEANS.get(AnonymousAccessController.class).init(); - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - final HttpServletRequest req = (HttpServletRequest) request; - final HttpServletResponse resp = (HttpServletResponse) response; - - if (m_trivialAccessController.handle(req, resp, chain)) { - return; - } - - if (m_formBasedAccessController.handle(req, resp, chain)) { - return; - } - - if (m_developmentAccessController.handle(req, resp, chain)) { - return; - } - - if (m_anonymousAccessController.handle(req, resp, chain)) { - return; - } - - BEANS.get(ServletFilterHelper.class).forwardToLoginForm(req, resp); - } - - @Override - public void destroy() { - m_developmentAccessController.destroy(); - m_formBasedAccessController.destroy(); - m_trivialAccessController.destroy(); - m_trivialAccessController.destroy(); - } -} +package io.sxda.scout.apps.addondemo.ui.html; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.scout.rt.platform.BEANS; +import org.eclipse.scout.rt.platform.security.ConfigFileCredentialVerifier; +import org.eclipse.scout.rt.server.commons.authentication.*; +import org.eclipse.scout.rt.server.commons.authentication.FormBasedAccessController.FormBasedAuthConfig; +import org.eclipse.scout.rt.server.commons.authentication.TrivialAccessController.TrivialAuthConfig; + +/** + * This is the main servlet filter for the HTML UI. + * + * @author nisrael + */ +public class UiServletFilter implements Filter { + + private TrivialAccessController m_trivialAccessController; + private FormBasedAccessController m_formBasedAccessController; + private DevelopmentAccessController m_developmentAccessController; + private AnonymousAccessController m_anonymousAccessController; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + m_trivialAccessController = BEANS.get(TrivialAccessController.class) + .init(new TrivialAuthConfig() + .withExclusionFilter(filterConfig.getInitParameter("filter-exclude")) + .withLoginPageInstalled(true)); + m_formBasedAccessController = BEANS.get(FormBasedAccessController.class) + .init(new FormBasedAuthConfig() + .withCredentialVerifier(BEANS.get(ConfigFileCredentialVerifier.class))); + m_developmentAccessController = BEANS.get(DevelopmentAccessController.class).init(); + m_anonymousAccessController = BEANS.get(AnonymousAccessController.class).init(); + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + final HttpServletRequest req = (HttpServletRequest) request; + final HttpServletResponse resp = (HttpServletResponse) response; + + if (m_trivialAccessController.handle(req, resp, chain)) { + return; + } + + if (m_formBasedAccessController.handle(req, resp, chain)) { + return; + } + + if (m_developmentAccessController.handle(req, resp, chain)) { + return; + } + + if (m_anonymousAccessController.handle(req, resp, chain)) { + return; + } + + BEANS.get(ServletFilterHelper.class).forwardToLoginForm(req, resp); + } + + @Override + public void destroy() { + m_developmentAccessController.destroy(); + m_formBasedAccessController.destroy(); + m_trivialAccessController.destroy(); + m_trivialAccessController.destroy(); + } +} diff --git a/addondemo.ui.html/src/main/js/addondemo-theme-dark.less b/addondemo.ui.html/src/main/js/addondemo-theme-dark.less index 5baff19..70c135f 100644 --- a/addondemo.ui.html/src/main/js/addondemo-theme-dark.less +++ b/addondemo.ui.html/src/main/js/addondemo-theme-dark.less @@ -1,2 +1,2 @@ -@import "~@eclipse-scout/core/src/index-dark"; -@import "index"; +@import "~@eclipse-scout/core/src/index-dark"; +@import "index"; diff --git a/addondemo.ui.html/src/main/js/addondemo-theme.less b/addondemo.ui.html/src/main/js/addondemo-theme.less index c50dbe9..1fdede5 100644 --- a/addondemo.ui.html/src/main/js/addondemo-theme.less +++ b/addondemo.ui.html/src/main/js/addondemo-theme.less @@ -1,2 +1,2 @@ -@import "~@eclipse-scout/core/src/index"; -@import "index"; +@import "~@eclipse-scout/core/src/index"; +@import "index"; diff --git a/addondemo.ui.html/src/main/js/addondemo.ts b/addondemo.ui.html/src/main/js/addondemo.ts index 09e836a..ae857c6 100644 --- a/addondemo.ui.html/src/main/js/addondemo.ts +++ b/addondemo.ui.html/src/main/js/addondemo.ts @@ -1,4 +1,4 @@ -import {RemoteApp} from '@eclipse-scout/core'; -import './index'; - -new RemoteApp().init(); +import {RemoteApp} from '@eclipse-scout/core'; +import './index'; + +new RemoteApp().init(); diff --git a/addondemo.ui.html/src/main/js/index.ts b/addondemo.ui.html/src/main/js/index.ts index 57c0216..17571e6 100644 --- a/addondemo.ui.html/src/main/js/index.ts +++ b/addondemo.ui.html/src/main/js/index.ts @@ -1,10 +1,10 @@ -import {ObjectFactory} from '@eclipse-scout/core'; - -// export your custom JS files here. Example: -// export * from './yourFolder/YourClass'; - -// Define namespace and put it onto window (necessary for model variants, e.g. @ModelVariant(${classPrefixLowerCase}.Example) -import * as self from './index'; - -export default self; -ObjectFactory.get().registerNamespace('addondemo', self); +import {ObjectFactory} from '@eclipse-scout/core'; + +// export your custom JS files here. Example: +// export * from './yourFolder/YourClass'; + +// Define namespace and put it onto window (necessary for model variants, e.g. @ModelVariant(${classPrefixLowerCase}.Example) +import * as self from './index'; + +export default self; +ObjectFactory.get().registerNamespace('addondemo', self); diff --git a/addondemo.ui.html/src/main/js/login.ts b/addondemo.ui.html/src/main/js/login.ts index 8c90e9e..c6d5c9a 100644 --- a/addondemo.ui.html/src/main/js/login.ts +++ b/addondemo.ui.html/src/main/js/login.ts @@ -1,3 +1,3 @@ -import {LoginApp} from '@eclipse-scout/core'; - -new LoginApp().init(); +import {LoginApp} from '@eclipse-scout/core'; + +new LoginApp().init(); diff --git a/addondemo.ui.html/src/main/js/logout.ts b/addondemo.ui.html/src/main/js/logout.ts index 2e8ecc3..1464f34 100644 --- a/addondemo.ui.html/src/main/js/logout.ts +++ b/addondemo.ui.html/src/main/js/logout.ts @@ -1,3 +1,3 @@ -import {LogoutApp} from '@eclipse-scout/core'; - -new LogoutApp().init(); +import {LogoutApp} from '@eclipse-scout/core'; + +new LogoutApp().init(); diff --git a/addondemo.ui.html/src/main/js/style/colors.less b/addondemo.ui.html/src/main/js/style/colors.less index 8da9538..a54e340 100644 --- a/addondemo.ui.html/src/main/js/style/colors.less +++ b/addondemo.ui.html/src/main/js/style/colors.less @@ -1,7 +1,7 @@ -/** - * Change colors here - * Fore more details see the styling chapters in the Scout documentation (https://eclipsescout.github.io/) - * - * Sample: - * @desktop-header-background-color: @palette-red-4; - */ +/** + * Change colors here + * Fore more details see the styling chapters in the Scout documentation (https://eclipsescout.github.io/) + * + * Sample: + * @desktop-header-background-color: @palette-red-4; + */ diff --git a/addondemo.ui.html/src/main/resources/META-INF/scout.xml b/addondemo.ui.html/src/main/resources/META-INF/scout.xml index 10f6f90..760933e 100644 --- a/addondemo.ui.html/src/main/resources/META-INF/scout.xml +++ b/addondemo.ui.html/src/main/resources/META-INF/scout.xml @@ -1,3 +1,3 @@ - - - + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/favicon/browserconfig.xml b/addondemo.ui.html/src/main/resources/WebContent/favicon/browserconfig.xml index 82cd9f3..fee45c6 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/favicon/browserconfig.xml +++ b/addondemo.ui.html/src/main/resources/WebContent/favicon/browserconfig.xml @@ -1,12 +1,12 @@ - - - - - - - - - #da532c - - - + + + + + + + + + #da532c + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/favicon/manifest.json b/addondemo.ui.html/src/main/resources/WebContent/favicon/manifest.json index 944e429..6210a1b 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/favicon/manifest.json +++ b/addondemo.ui.html/src/main/resources/WebContent/favicon/manifest.json @@ -1,41 +1,41 @@ -{ - "name": "Addon Demo", - "icons": [ - { - "src": "android-chrome-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "android-chrome-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "android-chrome-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "android-chrome-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "android-chrome-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "android-chrome-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -} +{ + "name": "Addon Demo", + "icons": [ + { + "src": "android-chrome-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "android-chrome-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "android-chrome-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "android-chrome-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "android-chrome-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "android-chrome-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} diff --git a/addondemo.ui.html/src/main/resources/WebContent/includes/head.html b/addondemo.ui.html/src/main/resources/WebContent/includes/head.html index 24895a9..0c152f5 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/includes/head.html +++ b/addondemo.ui.html/src/main/resources/WebContent/includes/head.html @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/includes/no-script.html b/addondemo.ui.html/src/main/resources/WebContent/includes/no-script.html index 0fda888..9919f18 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/includes/no-script.html +++ b/addondemo.ui.html/src/main/resources/WebContent/includes/no-script.html @@ -1,11 +1,11 @@ -

-
-
- -
-

- -
-
- + diff --git a/addondemo.ui.html/src/main/resources/WebContent/index.html b/addondemo.ui.html/src/main/resources/WebContent/index.html index a127410..afd92b9 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/index.html +++ b/addondemo.ui.html/src/main/resources/WebContent/index.html @@ -1,15 +1,15 @@ - - - - - Addon Demo - - - - - -
- - - - + + + + + Addon Demo + + + + + +
+ + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/login.html b/addondemo.ui.html/src/main/resources/WebContent/login.html index 8f20285..d7d8ff6 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/login.html +++ b/addondemo.ui.html/src/main/resources/WebContent/login.html @@ -1,15 +1,15 @@ - - - - - Addon Demo - - - - - -
- - - - + + + + + Addon Demo + + + + + +
+ + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/logout.html b/addondemo.ui.html/src/main/resources/WebContent/logout.html index 266020b..48df905 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/logout.html +++ b/addondemo.ui.html/src/main/resources/WebContent/logout.html @@ -1,15 +1,15 @@ - - - - - Addon Demo - - - - - -
- - - - + + + + + Addon Demo + + + + + +
+ + + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/popup-window.html b/addondemo.ui.html/src/main/resources/WebContent/popup-window.html index cc2dd3b..4baca01 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/popup-window.html +++ b/addondemo.ui.html/src/main/resources/WebContent/popup-window.html @@ -1,13 +1,13 @@ - - - - - <scout:message key="ui.LoadingPopupWindow" /> - - - - -
- - - + + + + + <scout:message key="ui.LoadingPopupWindow" /> + + + + +
+ + + diff --git a/addondemo.ui.html/src/main/resources/WebContent/popup-window.js b/addondemo.ui.html/src/main/resources/WebContent/popup-window.js index 2c48245..566c17e 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/popup-window.js +++ b/addondemo.ui.html/src/main/resources/WebContent/popup-window.js @@ -1,14 +1,14 @@ -// Note: all other forms of attaching a 'load' listener -// to either the window or the document are not reliable. - -// When window is opened by main-window the popupWindow instance is always set -let url, eventData = { - window: window -}; -if (window.popupWindow) { - eventData.popupWindow = window.popupWindow; -} else { - url = new window.opener.scout.URL(document.location); - eventData.formId = url.getParameter('formId'); -} -window.opener.$(window.opener.document).trigger('popupWindowReady', eventData); +// Note: all other forms of attaching a 'load' listener +// to either the window or the document are not reliable. + +// When window is opened by main-window the popupWindow instance is always set +let url, eventData = { + window: window +}; +if (window.popupWindow) { + eventData.popupWindow = window.popupWindow; +} else { + url = new window.opener.scout.URL(document.location); + eventData.formId = url.getParameter('formId'); +} +window.opener.$(window.opener.document).trigger('popupWindowReady', eventData); diff --git a/addondemo.ui.html/src/main/resources/WebContent/unsupported-browser.html b/addondemo.ui.html/src/main/resources/WebContent/unsupported-browser.html index a32ef9f..f5443e6 100644 --- a/addondemo.ui.html/src/main/resources/WebContent/unsupported-browser.html +++ b/addondemo.ui.html/src/main/resources/WebContent/unsupported-browser.html @@ -1,19 +1,19 @@ -
-
-
-
- -
- -
    -
  • -
  • -
  • -
  • -
-
- -
-
-
-
+
+
+
+
+ +
+ +
    +
  • +
  • +
  • +
  • +
+
+ +
+
+
+
diff --git a/addondemo.ui.html/tsconfig.json b/addondemo.ui.html/tsconfig.json index 0c98673..f3412e7 100644 --- a/addondemo.ui.html/tsconfig.json +++ b/addondemo.ui.html/tsconfig.json @@ -1,9 +1,9 @@ -{ - "extends": "@eclipse-scout/tsconfig/tsconfig.json", - "compilerOptions": { - "outDir": "target/dist/d.ts" - }, - "include": [ - "./src/main/js/**/*" - ] -} +{ + "extends": "@eclipse-scout/tsconfig/tsconfig.json", + "compilerOptions": { + "outDir": "target/dist/d.ts" + }, + "include": [ + "./src/main/js/**/*" + ] +} diff --git a/addondemo.ui.html/webpack.config.js b/addondemo.ui.html/webpack.config.js index fee0525..6207005 100644 --- a/addondemo.ui.html/webpack.config.js +++ b/addondemo.ui.html/webpack.config.js @@ -1,16 +1,16 @@ -const baseConfig = require('@eclipse-scout/cli/scripts/webpack-defaults'); - -module.exports = (env, args) => { - args.resDirArray = ['src/main/resources/WebContent', 'node_modules/@eclipse-scout/core/res']; - const config = baseConfig(env, args); - - config.entry = { - 'addondemo': './src/main/js/addondemo.ts', - 'login': './src/main/js/login.ts', - 'logout': './src/main/js/logout.ts', - 'addondemo-theme': './src/main/js/addondemo-theme.less', - 'addondemo-theme-dark': './src/main/js/addondemo-theme-dark.less' - }; - - return config; -}; +const baseConfig = require('@eclipse-scout/cli/scripts/webpack-defaults'); + +module.exports = (env, args) => { + args.resDirArray = ['src/main/resources/WebContent', 'node_modules/@eclipse-scout/core/res']; + const config = baseConfig(env, args); + + config.entry = { + 'addondemo': './src/main/js/addondemo.ts', + 'login': './src/main/js/login.ts', + 'logout': './src/main/js/logout.ts', + 'addondemo-theme': './src/main/js/addondemo-theme.less', + 'addondemo-theme-dark': './src/main/js/addondemo-theme-dark.less' + }; + + return config; +}; diff --git a/addondemo/pom.xml b/addondemo/pom.xml index 01f8104..4606187 100644 --- a/addondemo/pom.xml +++ b/addondemo/pom.xml @@ -1,75 +1,75 @@ - - - - 4.0.0 - - - io.sxda.scout.apps - addondemo-root - 1.0.0-SNAPSHOT - ../pom.xml - - - addondemo - pom - Addon Demo - - - ${project.version} - 17 - 23.2.15 - --mapping.0.regex=@eclipse-scout --mapping.0.version=${org.eclipse.scout.rt.version} - - - - ../addondemo.shared - ../addondemo.server - ../addondemo.client - ../addondemo.app.war - ../addondemo.app.dev - ../addondemo.ui.html - - - - - - - org.eclipse.scout.rt - org.eclipse.scout.rt - ${org.eclipse.scout.rt.version} - pom - import - - - - - io.sxda.scout.apps - addondemo.client - ${io.sxda.scout.apps.addondemo.version} - - - io.sxda.scout.apps - addondemo.shared - ${io.sxda.scout.apps.addondemo.version} - - - io.sxda.scout.apps - addondemo.server - ${io.sxda.scout.apps.addondemo.version} - - - io.sxda.scout.apps - addondemo.ui.html - ${io.sxda.scout.apps.addondemo.version} - - - - + + + + 4.0.0 + + + io.sxda.scout.apps + addondemo-root + 1.0.0-SNAPSHOT + ../pom.xml + + + addondemo + pom + Addon Demo + + + ${project.version} + 17 + 23.2.15 + --mapping.0.regex=@eclipse-scout --mapping.0.version=${org.eclipse.scout.rt.version} + + + + ../addondemo.shared + ../addondemo.server + ../addondemo.client + ../addondemo.app.war + ../addondemo.app.dev + ../addondemo.ui.html + + + + + + + org.eclipse.scout.rt + org.eclipse.scout.rt + ${org.eclipse.scout.rt.version} + pom + import + + + + + io.sxda.scout.apps + addondemo.client + ${io.sxda.scout.apps.addondemo.version} + + + io.sxda.scout.apps + addondemo.shared + ${io.sxda.scout.apps.addondemo.version} + + + io.sxda.scout.apps + addondemo.server + ${io.sxda.scout.apps.addondemo.version} + + + io.sxda.scout.apps + addondemo.ui.html + ${io.sxda.scout.apps.addondemo.version} + + + + diff --git a/addondemo/run-configs/[webapp] all.launch b/addondemo/run-configs/[webapp] all.launch index 94ada29..873a420 100644 --- a/addondemo/run-configs/[webapp] all.launch +++ b/addondemo/run-configs/[webapp] all.launch @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addondemo/run-configs/[webapp] dev server.launch b/addondemo/run-configs/[webapp] dev server.launch index d4fe1da..39519a7 100644 --- a/addondemo/run-configs/[webapp] dev server.launch +++ b/addondemo/run-configs/[webapp] dev server.launch @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/addondemo/run-configs/[webapp] dev ui.launch b/addondemo/run-configs/[webapp] dev ui.launch index acbdd63..4b9968b 100644 --- a/addondemo/run-configs/[webapp] dev ui.launch +++ b/addondemo/run-configs/[webapp] dev ui.launch @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/addondemo/run-configs/js build.cmd b/addondemo/run-configs/js build.cmd index f5f7ae8..fdb2e46 100644 --- a/addondemo/run-configs/js build.cmd +++ b/addondemo/run-configs/js build.cmd @@ -1,40 +1,40 @@ -@echo off - -:: This script installs all the JS dependencies and builds the JavaScript and CSS bundles. -:: It also starts a watcher which triggers a rebuild of these bundles whenever JS or CSS code changes. -:: -:: It has to be run once before the UI server is started. -:: You need to rerun it if you update your JS dependencies (package.json). -:: Please see the Scout documentation for details about the available run scripts: https://eclipsescout.github.io/23.2/technical-guide-js.html#command-line-interface-cli -:: -:: To make this script work you need a current version of Node.js (>=18.12.1), npm (>=9.1.1) and pnpm (>=7.16.0). -:: Node.js (incl. npm) is available here: https://nodejs.org/. -:: pnpm is available here: https://pnpm.io/ - -:: Check if node is available -where node >nul 2>nul -if %errorlevel% neq 0 ( - echo node cannot be found. Make sure Node.js is installed and the PATH variable correctly set. See the content of this script for details. 1>&2 - exit /b 1 -) - -:: Check if pnpm is available -where pnpm >nul 2>nul -if %errorlevel% neq 0 ( - echo pnpm cannot be found. Make sure pnpm is installed. See the content of this script for details. 1>&2 - exit /b 1 -) - -:: Install all JavaScript dependencies defined in the package.json => creates the node_modules folder -cd .. -echo Running 'pnpm install' in %cd% -call pnpm install --ignore-scripts -if %errorlevel% neq 0 exit /b %errorlevel% -echo pnpm install finished successfully! -echo. - -:: Build the JavaScript and CSS bundles and start the watcher => creates the dist folder -cd addondemo.ui.html -echo Running 'pnpm build:dev:watch' -call pnpm run build:dev:watch -if %errorlevel% neq 0 exit /b %errorlevel% +@echo off + +:: This script installs all the JS dependencies and builds the JavaScript and CSS bundles. +:: It also starts a watcher which triggers a rebuild of these bundles whenever JS or CSS code changes. +:: +:: It has to be run once before the UI server is started. +:: You need to rerun it if you update your JS dependencies (package.json). +:: Please see the Scout documentation for details about the available run scripts: https://eclipsescout.github.io/23.2/technical-guide-js.html#command-line-interface-cli +:: +:: To make this script work you need a current version of Node.js (>=18.12.1), npm (>=9.1.1) and pnpm (>=7.16.0). +:: Node.js (incl. npm) is available here: https://nodejs.org/. +:: pnpm is available here: https://pnpm.io/ + +:: Check if node is available +where node >nul 2>nul +if %errorlevel% neq 0 ( + echo node cannot be found. Make sure Node.js is installed and the PATH variable correctly set. See the content of this script for details. 1>&2 + exit /b 1 +) + +:: Check if pnpm is available +where pnpm >nul 2>nul +if %errorlevel% neq 0 ( + echo pnpm cannot be found. Make sure pnpm is installed. See the content of this script for details. 1>&2 + exit /b 1 +) + +:: Install all JavaScript dependencies defined in the package.json => creates the node_modules folder +cd .. +echo Running 'pnpm install' in %cd% +call pnpm install --ignore-scripts +if %errorlevel% neq 0 exit /b %errorlevel% +echo pnpm install finished successfully! +echo. + +:: Build the JavaScript and CSS bundles and start the watcher => creates the dist folder +cd addondemo.ui.html +echo Running 'pnpm build:dev:watch' +call pnpm run build:dev:watch +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/addondemo/run-configs/js build.launch b/addondemo/run-configs/js build.launch index eecd118..f097e86 100644 --- a/addondemo/run-configs/js build.launch +++ b/addondemo/run-configs/js build.launch @@ -1,5 +1,5 @@ - - - - - + + + + + diff --git a/package.json b/package.json index f32909f..a45d70f 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ -{ - "name": "@addondemo/root", - "version": "1.0.0-SNAPSHOT", - "private": true, - "scripts": { - "pnpm-install": "pnpm install --ignore-scripts" - }, - "dependencies": { - "eslint": "8.27.0", - "@eclipse-scout/eslint-config": "23.2.15" - } -} +{ + "name": "@addondemo/root", + "version": "1.0.0-SNAPSHOT", + "private": true, + "scripts": { + "pnpm-install": "pnpm install --ignore-scripts" + }, + "dependencies": { + "eslint": "8.27.0", + "@eclipse-scout/eslint-config": "23.2.15" + } +} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e352ad2..9f49e78 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,3 @@ -packages: -- '.' -- 'addondemo.ui.html' +packages: +- '.' +- 'addondemo.ui.html' diff --git a/pom.xml b/pom.xml index ed9fb84..23ea8a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,51 +1,51 @@ - - - 4.0.0 - - org.eclipse.scout - maven_rt_plugin_config-master - 23.2.0 - - - io.sxda.scout.apps - addondemo-root - 1.0.0-SNAPSHOT - pom - Addon Demo Root - - ${project.version} - [23.2.13,24.0.0) - 17 - - - ${project.basedir}${file.separator}target${file.separator}node - ${project.basedir}${file.separator}target${file.separator}node${file.separator}node_modules - ${project.basedir} - --progress=false --clean=false - target/karma-reports - --mapping.0.regex=@eclipse-scout --mapping.0.version=${org.eclipse.scout.rt.version} - - - - - org.apache.maven.plugins - maven-deploy-plugin - false - - true - - - - org.apache.maven.plugins - maven-install-plugin - false - - true - - - - - - addondemo - - + + + 4.0.0 + + org.eclipse.scout + maven_rt_plugin_config-master + 23.2.0 + + + io.sxda.scout.apps + addondemo-root + 1.0.0-SNAPSHOT + pom + Addon Demo Root + + ${project.version} + [23.2.13,24.0.0) + 17 + + + ${project.basedir}${file.separator}target${file.separator}node + ${project.basedir}${file.separator}target${file.separator}node${file.separator}node_modules + ${project.basedir} + --progress=false --clean=false + target/karma-reports + --mapping.0.regex=@eclipse-scout --mapping.0.version=${org.eclipse.scout.rt.version} + + + + + org.apache.maven.plugins + maven-deploy-plugin + false + + true + + + + org.apache.maven.plugins + maven-install-plugin + false + + true + + + + + + addondemo + +