diff --git a/.github/workflows/backwards-compatibility-java17.yml b/.github/workflows/backwards-compatibility-java17.yml deleted file mode 100644 index 0ac488e7..00000000 --- a/.github/workflows/backwards-compatibility-java17.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Backwards Compatibility (JDK 17) - -on: - push: - branches: [develop] - paths: - - "core-customize/manifest.json" - - "core-customize/hybris/bin/custom/sapcxtools/**/*.java" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-beans.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-items.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/extensioninfo.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/external-dependencies.xml" - pull_request: - branches: [main, develop] - schedule: - - cron: "0 15 * * 0,3" - workflow_dispatch: - -jobs: - compatibility: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: ["2211.47"] - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: "adopt" - java-version: "17" - cache: "gradle" - - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 - - name: Set up cache for SAP artifacts - uses: actions/cache@v4 - with: - key: sap-artifacts-cache-${{ hashFiles('core-customize/manifest.json') }}-${{ matrix.version }} - path: dependencies - - name: Configure SAP version - run: | - sed -i 's/\"commerceSuiteVersion\": \"[^\"]*\"/\"commerceSuiteVersion\": \"${{ matrix.version }}\"/' core-customize/manifest.json - - name: SAP download config - env: - SAPCX_ARTEFACT_BASEURL: ${{ secrets.SAPCX_ARTEFACT_BASEURL }} - SAPCX_ARTEFACT_USER: ${{ secrets.SAPCX_ARTEFACT_USER }} - SAPCX_ARTEFACT_PASSWORD: ${{ secrets.SAPCX_ARTEFACT_PASSWORD }} - shell: bash - run: | - mkdir -p ${HOME}/.gradle - echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV - echo "SAPCX_ARTEFACT_BASEURL=${SAPCX_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_USER=${SAPCX_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_PASSWORD=${SAPCX_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties - - name: SAP Commerce environment - run: | - echo "HYBRIS_OPT_CONFIG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config/local-config" >> $GITHUB_ENV - echo "HYBRIS_BIN_DIR=$GITHUB_WORKSPACE/core-customize/hybris/bin" >> $GITHUB_ENV - echo "HYBRIS_CONF_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config" >> $GITHUB_ENV - echo "HYBRIS_LOG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/log" >> $GITHUB_ENV - - name: Bootstrap platform - run: ./gradlew setupLocalDevelopment - - name: Build platform - run: ./gradlew yall - - name: Run unit tests - run: | - cat $GITHUB_WORKSPACE/ci/config/testing-unit.properties > $HYBRIS_CONF_DIR/local-config/99-local.properties - ./gradlew yunittests - - # Target never fails, therefore, check for test errors and fail if errors were found - for file in $HYBRIS_LOG_DIR/junit/test-results/unit/*.xml; do if [ "$(grep -cE '<(error|failure)' "${file}")" -gt 0 ]; then exit 1; fi; done - - name: Run integration tests - run: | - cat $GITHUB_WORKSPACE/ci/config/testing-integration.properties > $HYBRIS_CONF_DIR/local-config/99-local.properties - ./gradlew yintegrationtests - - # Target never fails, therefore, check for test errors and fail if errors were found - for file in $HYBRIS_LOG_DIR/junit/test-results/integration/*.xml; do if [ "$(grep -cE '<(error|failure)' "${file}")" -gt 0 ]; then exit 1; fi; done diff --git a/.github/workflows/buildandtest.yml b/.github/workflows/buildandtest.yml index d6a25cd0..78bc603f 100644 --- a/.github/workflows/buildandtest.yml +++ b/.github/workflows/buildandtest.yml @@ -5,11 +5,11 @@ on: branches: [develop] paths: - "core-customize/manifest.json" - - "core-customize/hybris/bin/custom/sapcxtools/**/*.java" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-beans.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-items.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/extensioninfo.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/external-dependencies.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/*.java" + - "core-customize/hybris/bin/custom/cxdevtools/**/*-beans.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/*-items.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/extensioninfo.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/external-dependencies.xml" pull_request: branches: [main, develop] schedule: @@ -20,34 +20,34 @@ jobs: build-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v4 + - name: Set up JDK + uses: actions/setup-java@v5 with: - distribution: "adopt" - java-version: "17" + distribution: "sapmachine" + java-version: "21" cache: "gradle" - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 + uses: gradle/actions/wrapper-validation@v5 - name: Set up cache for SAP artifacts - uses: actions/cache@v4 + uses: actions/cache@v5 with: key: sap-artifacts-cache-${{ hashFiles('core-customize/manifest.json') }} path: dependencies - name: SAP download config env: - SAPCX_ARTEFACT_BASEURL: ${{ secrets.SAPCX_ARTEFACT_BASEURL }} - SAPCX_ARTEFACT_USER: ${{ secrets.SAPCX_ARTEFACT_USER }} - SAPCX_ARTEFACT_PASSWORD: ${{ secrets.SAPCX_ARTEFACT_PASSWORD }} + CXDEV_ARTEFACT_BASEURL: ${{ secrets.CXDEV_ARTEFACT_BASEURL }} + CXDEV_ARTEFACT_USER: ${{ secrets.CXDEV_ARTEFACT_USER }} + CXDEV_ARTEFACT_PASSWORD: ${{ secrets.CXDEV_ARTEFACT_PASSWORD }} shell: bash run: | mkdir -p ${HOME}/.gradle echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV - echo "SAPCX_ARTEFACT_BASEURL=${SAPCX_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_USER=${SAPCX_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_PASSWORD=${SAPCX_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_BASEURL=${CXDEV_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_USER=${CXDEV_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_PASSWORD=${CXDEV_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties - name: SAP Commerce environment run: | echo "HYBRIS_OPT_CONFIG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config/local-config" >> $GITHUB_ENV diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index 8d242409..d8522684 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -11,14 +11,14 @@ jobs: code-analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 + - uses: actions/checkout@v6 + - name: Set up JDK + uses: actions/setup-java@v5 with: - distribution: "adopt" - java-version: "17" + distribution: "sapmachine" + java-version: "21" cache: "gradle" - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 + uses: gradle/actions/wrapper-validation@v5 - name: Verify code conventions run: ./gradlew spotlessCheck diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 30360ab1..96739ea2 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -5,11 +5,11 @@ on: branches: [develop] paths: - "core-customize/manifest.json" - - "core-customize/hybris/bin/custom/sapcxtools/**/*.java" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-beans.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/*-items.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/extensioninfo.xml" - - "core-customize/hybris/bin/custom/sapcxtools/**/external-dependencies.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/*.java" + - "core-customize/hybris/bin/custom/cxdevtools/**/*-beans.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/*-items.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/extensioninfo.xml" + - "core-customize/hybris/bin/custom/cxdevtools/**/external-dependencies.xml" pull_request: branches: [main, develop] workflow_dispatch: @@ -19,34 +19,34 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - extension: ["sapcommercetoolkit", "sapcxbackoffice", "sapcxreporting", "sapcxsearch", "sapcxenvconfig", "sapcxsinglesignon"] + extension: ["cxdevtoolkit", "cxdevbackoffice", "cxdevreporting", "cxdevenvconfig"] steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 + - uses: actions/checkout@v6 + - name: Set up JDK + uses: actions/setup-java@v5 with: - distribution: "adopt" - java-version: "17" + distribution: "sapmachine" + java-version: "21" cache: "gradle" - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 + uses: gradle/actions/wrapper-validation@v5 - name: Set up cache for SAP artifacts - uses: actions/cache@v4 + uses: actions/cache@v5 with: key: sap-artifacts-cache-${{ hashFiles('core-customize/manifest.json') }} path: dependencies - name: SAP download config env: - SAPCX_ARTEFACT_BASEURL: ${{ secrets.SAPCX_ARTEFACT_BASEURL }} - SAPCX_ARTEFACT_USER: ${{ secrets.SAPCX_ARTEFACT_USER }} - SAPCX_ARTEFACT_PASSWORD: ${{ secrets.SAPCX_ARTEFACT_PASSWORD }} + CXDEV_ARTEFACT_BASEURL: ${{ secrets.CXDEV_ARTEFACT_BASEURL }} + CXDEV_ARTEFACT_USER: ${{ secrets.CXDEV_ARTEFACT_USER }} + CXDEV_ARTEFACT_PASSWORD: ${{ secrets.CXDEV_ARTEFACT_PASSWORD }} shell: bash run: | mkdir -p ${HOME}/.gradle echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV - echo "SAPCX_ARTEFACT_BASEURL=${SAPCX_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_USER=${SAPCX_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties - echo "SAPCX_ARTEFACT_PASSWORD=${SAPCX_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_BASEURL=${CXDEV_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_USER=${CXDEV_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties + echo "CXDEV_ARTEFACT_PASSWORD=${CXDEV_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties - name: SAP Commerce environment run: | echo "HYBRIS_OPT_CONFIG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config/local-config" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index 1b39e82b..1dc0c171 100644 --- a/.gitignore +++ b/.gitignore @@ -29,9 +29,9 @@ core-customize/hybris/roles/ core-customize/hybris/log/ core-customize/hybris/temp/ core-customize/hybris/data/ -core-customize/hybris/config/local-config/9[0-9]-local.properties +core-customize/hybris/config/local-config/ -# only allow sapcxtools extension +# only allow cxdevtools extension core-customize/hybris/bin/modules/ core-customize/hybris/bin/platform/ diff --git a/.java-version b/.java-version index 8e2afd34..962d54c3 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -17 \ No newline at end of file +21.0.9-sapmchn \ No newline at end of file diff --git a/.node-version b/.node-version index 58a4133d..adb55585 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.13.0 +22.14.0 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 382cf1ff..0b8f976b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -## SAP CX Tools Contributor License Agreement +## CX DEV Tools Contributor License Agreement - You will only submit contributions where you have authored 100% of the content. - You will only submit contributions to which you have the necessary rights. This means that if you are employed you @@ -42,7 +42,7 @@ Please add the following lines to your pull request description: ```markdown --- -I hereby agree to the terms of the SAP CX Tools Contributor License Agreement. +I hereby agree to the terms of the CX DEV Tools Contributor License Agreement. ``` ## Coding Conventions @@ -120,64 +120,3 @@ Use American English spelling rules when writing documentation as well as for co - `WARN`: potential usage or configuration errors that should not halt execution - `INFO`: information the users might want to know but not by default - `DEBUG`: information the developers might want to know to understand execution - -## Extensions - -All of the extensions have their own repository and are integrated using `git subtree` into this repository or into project. This -procedure was choosen for two major reasons: - -1. A centralized repository holding defined releases of the individual extensions and guaranteeing the compatibility with the standard. -1. The individual extension repositories allow a clean integration into projects, i.e. direct integration of the source code. - -### How-to use - -In order to use an extension from the sapcx.tools you can either download the build artefact from our build pipeline (work in progress) or -integration the extension directly into your repository using git subtree. The following commands shall give you a guidance on how to -integration the extensions into your local repository. Keep in mind, that you need to run these commands from the root of your project. -For the sake of simplicity, we assume that you use the default CCv2 repository layout for your project: - -- The following command is used to add an extension "foobar" into your repository: -`git subtree add --squash --message="add extension foobar from SAP CX Tools" --prefix=core-customize/hybris/bin/custom/sapcxtools/foobar git@github.com:sapcxtools/foobar.git main` -- For future updates, please use the following command: -`git subtree pull --squash --message="update extension foobar from SAP CX Tools" --prefix=core-customize/hybris/bin/custom/sapcxtools/foobar git@github.com:sapcxtools/foobar.git main` -- If you want to push changes from the local repository into the extension, please use: -`git subtree push --prefix=core-customize/hybris/bin/custom/sapcxtools/foobar git@github.com:sapcxtools/foobar.git feature/` - -Please note, we typically use `--squash` to reduce the number of commits within your project repository. If you want the whole history -available in your project, feel free to leave out this parameter. Still, we do not recommend this. We also do not recommend to pull other -branches than main. This could lead to conflicts once you want to update back to main. - -### Guidelines for the individual extension repositories - -Before merging a feature into the `main` branch of an extension, a github workflow sends the feature-branch to the centralized repository. -Let's assume a new feature `feature/my-idea` was pushed via `git subtree push` into extension `foobar`. The workflow checks out the -centralized repository, and creates a branch called `foobar/feature/my-idea`. Then it performs a `git subtree pull` command without -`--squash` and pointing to the feature branch `feature/my-idea` from the `foobar` extension. It pushes the new branch to the centralized -repository. - -The centralized repository now also runs a github workflow that automatically creates a pull-request into the `develop` branch for this -feature. With that pull-request, the default workflows from the centralized repository are executed, verifying if everything is fine. In -addition, the repository maintainer will perform custom reviews and may ask you for changes. You can perform your changes within your -project repository and by pushing those to the extension repository `foobar` by updating your feature-branch `feature/my-idea`. This can -be done by running the same `git subtree push` command as before, after you have made your changes in the project repository. - -The github workflow will detect your updates and updates the feature-branch on the centralized repository by resetting it to the previous -state, typically develop, and run `git subtree pull` just like the first time. We need to reset the feature-branch `foobar/feature/my-idea` -first, otherwise we would get an additional merge commit for every update of the the feature-branch. - -Once the pull-request from feature-branch `foobar/feature/my-idea` was accepted and merged into `develop` the feature-branch `feature-my-idea` -will also be removed from the extensions repository. Another github workflow is triggered that automatically pulls the changes with the -`develop` branch of the centralized repository and updates the `develop` branch of the extensions repository by running: -`git subtree pull --squash --message="merge feature/my-idea into develop" --prefix=core-customize/hybris/bin/custom/sapcxtools/foobar git@github.com:sapcxtools/foobar.git develop` - -When the next version of SAP CX tools is released, the same action is done, all included extensions are triggered to also merge their -`develop` branches into their `main` branches, just like the centralized repository. After the release we recommend you to run an update -as mentioned above. Again, we do not recommend to skip the `--squash` option, as you will see all your commits twice in the history. - -__CAUTION:__ For those who use this repository itself to develop on features, please make sure that you do not push your changes from the -extensions to the extensions repositories using `git subtree push`. This will be done automatically for you, once your pull-request has -been accepted and merged into `develop`. Also make sure that you only use the pattern `feature/` for your feature-branches, so there -won't be any kind of conflicts with the feature-branches that have automatically been created. - -While this process seems to be complicated, it guarantees that all extensions included in SAP CX tools are interoperatable and work -individually, with only their own dependencies resolved. If you have questions, feel free to get in touch with us in the discussion board. diff --git a/LICENSE.md b/LICENSE.md index 7aff51ca..8ab94bdf 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2023] [SAP CX Tools] + Copyright [2023] [CX DEV Tools] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index a046c1e0..2a2118b7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ -# SAP CX Workspace +# CX DEV Workspace -[![Build & Test](https://github.com/sapcxtools/workspace/actions/workflows/buildandtest.yml/badge.svg)](https://github.com/sapcxtools/workspace/actions/workflows/buildandtest.yml) -[![Code Analysis](https://github.com/sapcxtools/workspace/actions/workflows/code-analysis.yml/badge.svg)](https://github.com/sapcxtools/workspace/actions/workflows/code-analysis.yml) -[![Code Coverage](https://codecov.io/gh/sapcxtools/workspace/branch/main/graph/badge.svg?token=F1BIK8R7NZ)](https://codecov.io/gh/sapcxtools/workspace) - -[![Dependency Check](https://github.com/sapcxtools/workspace/actions/workflows/dependency-check.yml/badge.svg)](https://github.com/sapcxtools/workspace/actions/workflows/dependency-check.yml) -[![Backwards Compatibility](https://github.com/sapcxtools/workspace/actions/workflows/backwards-compatibility-java17.yml/badge.svg)](https://github.com/sapcxtools/workspace/actions/workflows/backwards-compatibility-java17.yml) -[![Backwards Compatibility](https://github.com/sapcxtools/workspace/actions/workflows/backwards-compatibility-java11.yml/badge.svg)](https://github.com/sapcxtools/workspace/actions/workflows/backwards-compatibility-java11.yml) +[![Build & Test](https://github.com/cxdevtools/workspace/actions/workflows/buildandtest.yml/badge.svg)](https://github.com/cxdevtools/workspace/actions/workflows/buildandtest.yml) +[![Code Analysis](https://github.com/cxdevtools/workspace/actions/workflows/code-analysis.yml/badge.svg)](https://github.com/cxdevtools/workspace/actions/workflows/code-analysis.yml) +[![Code Coverage](https://codecov.io/gh/cxdevtools/workspace/branch/main/graph/badge.svg?token=F1BIK8R7NZ)](https://codecov.io/gh/cxdevtools/workspace) +[![Dependency Check](https://github.com/cxdevtools/workspace/actions/workflows/dependency-check.yml/badge.svg)](https://github.com/cxdevtools/workspace/actions/workflows/dependency-check.yml) All extensions available in this repository are built with high test coverage and do not influence the behavior of your project without changes to your configuration. This is guaranteed and intended by design, because the extensions @@ -17,8 +14,8 @@ configuration parameter. ## Contributing Contributions are both welcomed and appreciated. For specific guidelines regarding contributions, please see -[CONTRIBUTING.md](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) in the root directory of the +[CONTRIBUTING.md](https://github.com/cxdevtools/workspace/blob/main/CONTRIBUTING.md) in the root directory of the project. Those willing to use milestone or SNAPSHOT releases are encouraged to file feature requests and bug reports -using the project's [issue tracker](https://github.com/sapcxtools/workspace/issues). Issues marked with an -`help wanted` label are specifically +using the project's [issue tracker](https://github.com/cxdevtools/workspace/issues). Issues marked with an +`help wanted` label are specifically targeted for community contributions. diff --git a/build.gradle.kts b/build.gradle.kts index 6a574fcb..185c414e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.diffplug.spotless") version("6.25.0") + id("com.diffplug.spotless") version("8.2.1") } repositories { @@ -10,8 +10,8 @@ spotless { val importOrderConfigFile = project.file("core-customize/conventions/eclipse.importorder") val javaFormatterConfigFile = project.file("core-customize/conventions/eclipse-formatter-settings.xml") java { - target("core-customize/hybris/bin/custom/sapcxtools/**/*.java") - targetExclude("core-customize/hybris/bin/custom/sapcxtools/**/gensrc/**") + target("core-customize/hybris/bin/custom/cxdevtools/**/*.java") + targetExclude("core-customize/hybris/bin/custom/cxdevtools/**/gensrc/**") importOrderFile(importOrderConfigFile) eclipse().configFile(javaFormatterConfigFile) removeUnusedImports() @@ -26,6 +26,6 @@ spotless { // "js-storefront/*/src/**/*.ts", // "js-storefront/*/src/**/*.html" // ) - // prettier("2.5.1").configFile(frontendFormatterConfigFile) + // prettier("3.5.3").configFile(frontendFormatterConfigFile) //} } \ No newline at end of file diff --git a/ci/config/localextensions-template.xml b/ci/config/localextensions-template.xml index 0dbccaad..eced0c49 100644 --- a/ci/config/localextensions-template.xml +++ b/ci/config/localextensions-template.xml @@ -3,7 +3,7 @@ - + diff --git a/ci/config/testing-integration.properties b/ci/config/testing-integration.properties index 1a7447a9..051a9e60 100644 --- a/ci/config/testing-integration.properties +++ b/ci/config/testing-integration.properties @@ -1,8 +1,8 @@ -standalone.javaoptions=${tomcat.mem} -javaagent:${HYBRIS_BIN_DIR}/../../../ci/lib/jacocoagent.jar=includes=tools.sapcx.commerce.*,destfile=${HYBRIS_LOG_DIR}/junit/jacoco-integration.exec +standalone.javaoptions=${tomcat.mem} -javaagent:${HYBRIS_BIN_DIR}/../../../ci/lib/jacocoagent.jar=includes=me.cxdev.commerce.*,destfile=${HYBRIS_LOG_DIR}/junit/jacoco-integration.exec installed.tenants=junit -testclasses.extensions=sapcommercetoolkit,sapcxbackoffice,sapcxreporting,sapcxsearch,sapcxenvconfig,sapcxsinglesignon -testclasses.packages=tools.sapcx.commerce.* +testclasses.extensions=cxdevtoolkit,cxdevbackoffice,cxdevreporting,cxdevenvconfig +testclasses.packages=me.cxdev.* testclasses.suppress.junit.tenant=false testclasses.reportdir=${HYBRIS_LOG_DIR}/junit/test-results/integration diff --git a/ci/config/testing-unit.properties b/ci/config/testing-unit.properties index c5d94f9a..b370b8f8 100644 --- a/ci/config/testing-unit.properties +++ b/ci/config/testing-unit.properties @@ -1,8 +1,8 @@ -standalone.javaoptions=${tomcat.mem} -javaagent:${HYBRIS_BIN_DIR}/../../../ci/lib/jacocoagent.jar=includes=tools.sapcx.commerce.*,destfile=${HYBRIS_LOG_DIR}/junit/jacoco-unit.exec +standalone.javaoptions=${tomcat.mem} -javaagent:${HYBRIS_BIN_DIR}/../../../ci/lib/jacocoagent.jar=includes=me.cxdev.commerce.*,destfile=${HYBRIS_LOG_DIR}/junit/jacoco-unit.exec installed.tenants= -testclasses.extensions=sapcommercetoolkit,sapcxbackoffice,sapcxreporting,sapcxsearch,sapcxenvconfig,sapcxsinglesignon -testclasses.packages=tools.sapcx.commerce.* +testclasses.extensions=cxdevtoolkit,cxdevbackoffice,cxdevreporting,cxdevenvconfig +testclasses.packages=me.cxdev.* testclasses.suppress.junit.tenant=true testclasses.reportdir=${HYBRIS_LOG_DIR}/junit/test-results/unit diff --git a/codecov.yml b/codecov.yml index 6b0e6a3f..820efb36 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,4 +1,4 @@ ignore: - - "core-customize/hybris/bin/custom/sapcxtools/**/backoffice/src/**/*" - - "core-customize/hybris/bin/custom/sapcxtools/**/gensrc/**/*" - - "core-customize/hybris/bin/custom/sapcxtools/**/testsrc/**/*" + - "core-customize/hybris/bin/custom/cxdevtools/**/backoffice/src/**/*" + - "core-customize/hybris/bin/custom/cxdevtools/**/gensrc/**/*" + - "core-customize/hybris/bin/custom/cxdevtools/**/testsrc/**/*" diff --git a/core-customize/build.gradle.kts b/core-customize/build.gradle.kts index 6aa0e6e1..c264117a 100644 --- a/core-customize/build.gradle.kts +++ b/core-customize/build.gradle.kts @@ -1,32 +1,125 @@ import org.apache.tools.ant.taskdefs.condition.Os import de.undercouch.gradle.tasks.download.Download +import de.undercouch.gradle.tasks.download.VerifyAction import java.time.Instant import java.util.Base64 plugins { - id("sap.commerce.build") version("4.0.0") - id("sap.commerce.build.ccv2") version("4.0.0") - id("de.undercouch.download") version("5.5.0") + id("sap.commerce.build") version("5.0.2") + id("sap.commerce.build.ccv2") version("5.0.2") + id("de.undercouch.download") version("5.6.0") + `maven-publish` } -val DEPENDENCY_FOLDER = "../dependencies" +val solrVersionMap = mapOf( + /* + * version 8 unfortunately has a different download URL and is currently not working. But it is the version that is + * supplied with the standard zip, so we're fine unless the solr version is changed and then changed back in + * manifest.json + */ + "8.11" to "8.11.2", + "9.2" to "9.2.1", + "9.5" to "9.5.0" +) + +val dependencyDir = "../dependencies" +val workingDir = project.projectDir +val binDir = "${workingDir}/hybris/bin" + repositories { - flatDir { dirs(DEPENDENCY_FOLDER) } + flatDir { dirs(dependencyDir) } mavenCentral() } -if (project.hasProperty("SAPCX_ARTEFACT_BASEURL") && project.hasProperty("SAPCX_ARTEFACT_USER") && project.hasProperty("SAPCX_ARTEFACT_PASSWORD")) { - val BASEURL = project.property("SAPCX_ARTEFACT_BASEURL") as String - val USER = project.property("SAPCX_ARTEFACT_USER") as String - val PASSWORD = project.property("SAPCX_ARTEFACT_PASSWORD") as String +val solrVersion = solrVersionMap[CCV2.manifest.solrVersion] ?: "9.2.1" +val solrServer: Configuration by configurations.creating + +dependencies { + solrServer("org.apache.solr:solr:${solrVersion}") +} + +hybris { + // what files should be deleted when cleaning up the platform? + // (cloudhofolders will be downloaded by custom configuration) + cleanGlob.set("glob:**hybris/bin/{modules**,platform**,cloudhotfolders**}") + + // what should be unpacked from the platform zip files? + bootstrapInclude.set( + listOf( + "hybris/**", // + "azurecloudhotfolder/**", // + "cloudcommons/**", // + "cloudhotfolder/**" // + ) + ) + + // what should excluded when unpacking? + // the default value is a npm package folder that includes UTF-8 filenames, which lead to problems on linux + bootstrapExclude.set( + listOf( + "hybris/bin/ext-content/npmancillary/resources/npm/node_modules/http-server/node_modules/ecstatic/test/**" + ) + ) + + // Control the sparse platform bootstrap. + // When enabled, the commerce extensions are extracted from the distribution zip on a as-needed basis. + // Only extensions that are actually used in the project (either directly listed in the localextensions.xml or + // required by other extensions) are extracted. + // The platform itself is always extracted. + // When this mode is enabled, the bootstrapInclude configuration property is ignored. + sparseBootstrap { + enabled = true + alwaysIncluded = listOf("solrserver") + } +} + +tasks.register("fetchSolr") { + src(uri("https://archive.apache.org/dist/solr/solr/${solrVersion}/solr-${solrVersion}.tgz")) + dest("${dependencyDir}/solr-${solrVersion}.tgz") + overwrite(false) +} + +val repackSolr = tasks.register("repackSolr") { + dependsOn("fetchSolr") + from(tarTree("${dependencyDir}/solr-${solrVersion}.tgz")) + archiveFileName = "solr-${solrVersion}.zip" + destinationDirectory = file(dependencyDir) +} + +publishing { + publications { + create("solr") { + groupId = "org.apache.solr" + artifactId = "solr" + version = solrVersion + + artifact(repackSolr.get().archiveFile) + } + } +} + +tasks.named("yinstallSolr") { + // this task is available because of the solr-publication above. + dependsOn("publishSolrPublicationToMavenLocal") +} + +tasks.ybuild { + dependsOn("publishSolrPublicationToMavenLocal") + group = "build" +} + +if (project.hasProperty("CXDEV_ARTEFACT_BASEURL") && project.hasProperty("CXDEV_ARTEFACT_USER") && project.hasProperty("CXDEV_ARTEFACT_PASSWORD")) { + val BASEURL = project.property("CXDEV_ARTEFACT_BASEURL") as String + val USER = project.property("CXDEV_ARTEFACT_USER") as String + val PASSWORD = project.property("CXDEV_ARTEFACT_PASSWORD") as String val AUTHORIZATION = Base64.getEncoder().encodeToString((USER + ":" + PASSWORD).toByteArray()) - val COMMERCE_VERSION = CCV2.manifest.commerceSuiteVersion + val COMMERCE_VERSION = CCV2.manifest.effectiveVersion tasks.register("downloadPlatform") { src(BASEURL + "/commerce/hybris-commerce-suite-${COMMERCE_VERSION}.zip") - dest(file("${DEPENDENCY_FOLDER}/hybris-commerce-suite-${COMMERCE_VERSION}.zip")) + dest(file("${dependencyDir}/hybris-commerce-suite-${COMMERCE_VERSION}.zip")) header("Authorization", "Basic ${AUTHORIZATION}") overwrite(false) tempAndMove(true) @@ -43,7 +136,7 @@ if (project.hasProperty("SAPCX_ARTEFACT_BASEURL") && project.hasProperty("SAPCX_ val INTEXTPACK_VERSION = CCV2.manifest.extensionPacks.first{"hybris-commerce-integrations".equals(it.name)}.version tasks.register("downloadIntExtPack") { src(BASEURL + "/integration/hybris-commerce-integrations-${INTEXTPACK_VERSION}.zip") - dest(file("${DEPENDENCY_FOLDER}/hybris-commerce-integrations-${INTEXTPACK_VERSION}.zip")) + dest(file("${dependencyDir}/hybris-commerce-integrations-${INTEXTPACK_VERSION}.zip")) header("Authorization", "Basic ${AUTHORIZATION}") overwrite(false) tempAndMove(true) @@ -66,60 +159,27 @@ tasks.register("generateLocalProperties") { } } -val symlinkConfigTask = tasks.register("symlinkConfig") -val hybrisConfig = file("hybris/config") +val symlinkConfigTask: TaskProvider = tasks.register("symlinkConfig") val localConfig = file("hybris/config/local-config") -val homeDirectory = file(project.gradle.gradleUserHomeDir.parent) mapOf( - "10-local.properties" to "cloud/common.properties", - "20-local.properties" to "cloud/persona/development.properties", - "50-local.properties" to "cloud/local-dev.properties", - "90-local.properties" to "local/90-local.properties", - "91-local.properties" to "local/91-local.properties", - "92-local.properties" to "local/92-local.properties", - "93-local.properties" to "local/93-local.properties", - "94-local.properties" to "local/94-local.properties", - "95-local.properties" to "local/95-local.properties", - "96-local.properties" to "local/96-local.properties", - "97-local.properties" to "local/97-local.properties", - "98-local.properties" to "local/98-local.properties" + "10-local.properties" to file("hybris/config/cloud/common.properties"), + "20-local.properties" to file("hybris/config/cloud/persona/development.properties"), + "50-local.properties" to file("hybris/config/cloud/local-dev.properties") ).forEach{ - val link = it.key - var path = file(hybrisConfig.absolutePath + "/" + it.value) - if (!path.exists()) { - path = file(homeDirectory.absolutePath + "/.sap-commerce/local-config/" + it.key) - } - - if (path.exists()) { - val symlinkTask = tasks.register("symlink-${link}") { - val relPath = path.relativeTo(localConfig) - if (Os.isFamily(Os.FAMILY_UNIX)) { - commandLine("sh", "-c", "ln -sfn ${relPath} ${link}") - } else { - // https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/ - val windowsPath = relPath.toString().replace("[/]".toRegex(), "\\") - commandLine("cmd", "/c", """mklink "${link}" "${windowsPath}" """) - } - workingDir(localConfig) - dependsOn("generateLocalProperties") - } - symlinkConfigTask.configure { - dependsOn(symlinkTask) - } - } else { - // Unlink if no longer existing - val unlinkTask = tasks.register("unlink-${link}") { - if (Os.isFamily(Os.FAMILY_UNIX)) { - commandLine("sh", "-c", "rm -f ${link}") - } else { - commandLine("cmd", "/c", "del /q ${link}") - } - workingDir(localConfig) - dependsOn("generateLocalProperties") - } - symlinkConfigTask.configure { - dependsOn(unlinkTask) + val symlinkTask = tasks.register("symlink${it.key}") { + val path = it.value.relativeTo(localConfig) + if (Os.isFamily(Os.FAMILY_UNIX)) { + commandLine("sh", "-c", "ln -sfn $path ${it.key}") + } else { + // https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/ + val windowsPath = path.toString().replace("[/]".toRegex(), "\\") + commandLine("cmd", "/c", """mklink "${it.key}" "$windowsPath" """) } + workingDir(localConfig) + dependsOn("generateLocalProperties") + } + symlinkConfigTask.configure { + dependsOn(symlinkTask) } } @@ -132,6 +192,13 @@ tasks.register("generateLocalDeveloperProperties") { } } +// https://help.sap.com/viewer/b2f400d4c0414461a4bb7e115dccd779/LATEST/en-US/784f9480cf064d3b81af9cad5739fecc.html +tasks.register("enableModeltMock") { + from("hybris/bin/custom/extras/modelt/extensioninfo.disabled") + into("hybris/bin/custom/extras/modelt/") + rename { "extensioninfo.xml" } +} + tasks.named("installManifestAddons") { mustRunAfter("generateLocalProperties") } @@ -139,5 +206,11 @@ tasks.named("installManifestAddons") { tasks.register("setupLocalDevelopment") { group = "SAP Commerce" description = "Setup local development" - dependsOn("bootstrapPlatform", "generateLocalDeveloperProperties", "installManifestAddons") -} + dependsOn( + "bootstrapPlatform", + "yinstallSolr", + "generateLocalDeveloperProperties", + "installManifestAddons", + "enableModeltMock" + ) +} \ No newline at end of file diff --git a/core-customize/conventions/eclipse-formatter-settings.xml b/core-customize/conventions/eclipse-formatter-settings.xml index dec1ff27..c6fdbc93 100644 --- a/core-customize/conventions/eclipse-formatter-settings.xml +++ b/core-customize/conventions/eclipse-formatter-settings.xml @@ -1,6 +1,6 @@ - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.gitignore b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.gitignore similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.gitignore rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.gitignore index bd0966d2..ca19572e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.gitignore +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.gitignore @@ -7,7 +7,7 @@ testclasses eclipsebin gensrc -# .classpath files and lib folder in sapcxtools to ignore +# .classpath files and lib folder in cxdevtools to ignore .classpath lib/ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/.project b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.project similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/.project rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.project index 9d969f6c..1b0eb4f1 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/.project +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/.project @@ -1,6 +1,6 @@ - sapcxsearch + cxdevbackoffice diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/LICENSE.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/LICENSE.md similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/LICENSE.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/LICENSE.md index 9776fe0d..8676c108 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/LICENSE.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2025] [SAP CX Tools] + Copyright [2025] [CX DEV Tools] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/README.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/README.md similarity index 75% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/README.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/README.md index 9c4a0c89..bc93772e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/README.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/README.md @@ -1,11 +1,11 @@ -# SAP CX Backoffice +# CX DEV Backoffice -The `sapcxbackoffice` extension improves the experience with the SAP CX Backoffice Application. +The `cxdevbackoffice` extension improves the experience with the CX DEV Backoffice Application. ## FEATURE DESCRIPTION -This extension provides the common backoffice configuration for SAP CX Tools, e.g. -the base node in the tree navigation with the ID `sapcxtools_treenode_main`. +This extension provides the common backoffice configuration for CX DEV Tools, e.g. +the base node in the tree navigation with the ID `cxdevtools_treenode_main`. In addition, it contributes two major features to the backoffice application. @@ -26,12 +26,12 @@ be introduced for each and every relation that influences the sync status of an Instead, one can configure the relation by introducing a platform property with the following convention: -`sapcxbackoffice.sync.relateditems.=,,...` +`cxdevbackoffice.sync.relateditems.=,,...` For example, the following relations would be valid: -- `sapcxbackoffice.sync.relateditems.Product=mymedia,prospect,reference` -- `sapcxbackoffice.sync.relateditems.Category=heroProduct` +- `cxdevbackoffice.sync.relateditems.Product=mymedia,prospect,reference` +- `cxdevbackoffice.sync.relateditems.Category=heroProduct` ### How to activate and use @@ -47,13 +47,13 @@ For the sync status updates, one need to configure a property using the conventi | Parameter | Type | Description | |-----------|------|-------------| -| sapcxbackoffice.i18n.data.sortbyisocode | boolean | Order languages of localized fields by their ISO code in backoffice administration (default: false) | -| sapcxbackoffice.i18n.ui.locales | String | Limit UI languages for backoffice login. If empty, use all available languages (default: empty) | -| sapcxbackoffice.sync.relateditems.* | String | Sync status configuration for items with related items that should update the sync status (one line per type) | +| cxdevbackoffice.i18n.data.sortbyisocode | boolean | Order languages of localized fields by their ISO code in backoffice administration (default: false) | +| cxdevbackoffice.i18n.ui.locales | String | Limit UI languages for backoffice login. If empty, use all available languages (default: empty) | +| cxdevbackoffice.sync.relateditems.* | String | Sync status configuration for items with related items that should update the sync status (one line per type) | ## License _Licensed under the Apache License, Version 2.0, January 2004_ -_Copyright 2025, SAP CX Tools_ \ No newline at end of file +_Copyright 2026, CX DEV Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java index b84e92f8..2261375d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/i18n/ConfigurableBackofficeLocaleService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.backoffice.i18n; +package me.cxdev.commerce.backoffice.i18n; import java.util.ArrayList; import java.util.Collections; @@ -15,8 +15,6 @@ import de.hybris.platform.servicelayer.i18n.I18NService; import de.hybris.platform.servicelayer.user.UserService; -import org.springframework.beans.factory.annotation.Required; - /** * Enhancement of the {@link BackofficeLocaleService} to enhance configuration possibilities! *

@@ -73,24 +71,20 @@ private synchronized void cxInitializeUILocales() { } } - @Required public void setUserService(UserService userService) { this.userService = userService; } - @Required @Override public void setI18nService(I18NService i18nService) { super.setI18nService(i18nService); this.i18nService = i18nService; } - @Required public void setSortDataLocalesByIsoCode(boolean sortDataLocalesByIsoCode) { this.sortDataLocalesByIsoCode = sortDataLocalesByIsoCode; } - @Required public void setLocalesForBackofficeUi(String localesForBackofficeUi) { this.localesForBackofficeUi.clear(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java similarity index 87% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java index 5185f8a6..9e3da019 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/src/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/src/me/cxdev/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitor.java @@ -1,7 +1,6 @@ -package tools.sapcx.commerce.backoffice.sync; +package me.cxdev.commerce.backoffice.sync; import java.util.*; -import java.util.stream.Collectors; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.core.model.type.ComposedTypeModel; @@ -12,23 +11,22 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.assertj.core.util.VisibleForTesting; -import org.springframework.beans.factory.annotation.Required; /** * Generic implementation of {@link ItemVisitor}. This class shall avoid that new {@link ItemVisitor} classes need to * be introduced for each and every relation that influences the sync status of an {@link ItemModel}. Instead, one can * configure the relation by introducing a platform property with the following convention: * - * sapcxbackoffice.sync.relateditems.=,,... + * cxdevbackoffice.sync.relateditems.=,,... * * For example, the following relations would be valid: - * sapcxbackoffice.sync.relateditems.Product=mymedia,prospect,reference - * sapcxbackoffice.sync.relateditems.Category=heroProduct + * cxdevbackoffice.sync.relateditems.Product=mymedia,prospect,reference + * cxdevbackoffice.sync.relateditems.Category=heroProduct * ... */ public class GenericItemSyncRelatedItemsVisitor implements ItemVisitor { @VisibleForTesting - protected static final String CXBACKOFFICE_SYNC_RELATEDITEMS = "sapcxbackoffice.sync.relateditems."; + protected static final String CXBACKOFFICE_SYNC_RELATEDITEMS = "cxdevbackoffice.sync.relateditems."; private ModelService modelService; private Map> attributes = new HashMap<>(); @@ -46,14 +44,14 @@ public List visit(ItemModel itemModel, List list, Map this.getAttributeAsList(itemModel, attr)) .filter(Objects::nonNull) .flatMap(Collection::stream) - .collect(Collectors.toList()); + .toList(); } private ArrayList getTypeCodesForItemModel(ItemModel itemModel) { ComposedTypeModel type = typeService.getComposedTypeForClass(itemModel.getClass()); List superTypes = CollectionUtils.emptyIfNull(type.getAllSuperTypes()).stream() .map(ComposedTypeModel::getCode) - .collect(Collectors.toList()); + .toList(); ArrayList typeCodes = new ArrayList<>(superTypes); typeCodes.add(type.getCode()); return typeCodes; @@ -70,17 +68,14 @@ private Collection getAttributeAsList(ItemModel model, String attribu return Collections.emptyList(); } - @Required public void setModelService(ModelService modelService) { this.modelService = modelService; } - @Required public void setTypeService(TypeService typeService) { this.typeService = typeService; } - @Required public void setHybrisProperties(Properties hybrisProperties) { this.hybrisProperties = hybrisProperties; } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java index 4c67a02a..3978a404 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/i18n/ConfigurableBackofficeLocaleServiceTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.backoffice.i18n; +package me.cxdev.commerce.backoffice.i18n; import static org.assertj.core.api.Assertions.assertThat; @@ -11,8 +11,8 @@ import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.I18NServiceStubForLocales; -import tools.sapcx.commerce.toolkit.testing.testdoubles.user.UserServiceFake; +import me.cxdev.commerce.toolkit.testing.testdoubles.core.I18NServiceStubForLocales; +import me.cxdev.commerce.toolkit.testing.testdoubles.user.UserServiceFake; @UnitTest public class ConfigurableBackofficeLocaleServiceTests { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java index 8d4d2204..f20eb504 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/backoffice/testsrc/tools/sapcx/commerce/backoffice/sync/GenericItemSyncRelatedItemsVisitorTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.backoffice.sync; +package me.cxdev.commerce.backoffice.sync; import static org.hamcrest.Matchers.*; @@ -19,8 +19,8 @@ import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.DummyTypeService; -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.InMemoryModelService; +import me.cxdev.commerce.toolkit.testing.testdoubles.core.DummyTypeService; +import me.cxdev.commerce.toolkit.testing.testdoubles.core.InMemoryModelService; @UnitTest public class GenericItemSyncRelatedItemsVisitorTests { diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/buildcallbacks.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/buildcallbacks.xml new file mode 100644 index 00000000..208d84b7 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/buildcallbacks.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/extensioninfo.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/extensioninfo.xml similarity index 65% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/extensioninfo.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/extensioninfo.xml index ff94db64..e12900c6 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/extensioninfo.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/extensioninfo.xml @@ -1,11 +1,10 @@ - - + + - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/external-dependencies.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/external-dependencies.xml similarity index 76% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/external-dependencies.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/external-dependencies.xml index f7f0286f..e203eb33 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/external-dependencies.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/external-dependencies.xml @@ -1,9 +1,9 @@ 4.0.0 - tools.sapcx - sapcxsearch - 4.4.0 + me.cxdev + cxdevbackoffice + 5.0.0 jar diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/project.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/project.properties similarity index 63% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/project.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/project.properties index 4e8e6dfd..cb293e0d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/project.properties +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/project.properties @@ -1,16 +1,16 @@ # ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools +# Copyright (c) 2026 CX DEV Tools # ---------------------------------------------------------------------------- # Location of the file for the global platform spring application context -sapcxbackoffice.application-context=sapcxbackoffice-spring.xml +cxdevbackoffice.application-context=cxdevbackoffice-spring.xml # Order languages of localized fields by their ISO code in backoffice administration -sapcxbackoffice.i18n.data.sortbyisocode=false +cxdevbackoffice.i18n.data.sortbyisocode=false # Limit UI languages for backoffice login (use all if empty) -sapcxbackoffice.i18n.ui.locales= +cxdevbackoffice.i18n.ui.locales= # Sync status configuration for items with related items that should update the sync status, examples: -# sapcxbackoffice.sync.relateditems.Product=linkedProspectForDownloadMedia,referenceToOtherType -# sapcxbackoffice.sync.relateditems.Category=linkedHeroProduct +# cxdevbackoffice.sync.relateditems.Product=linkedProspectForDownloadMedia,referenceToOtherType +# cxdevbackoffice.sync.relateditems.Category=linkedHeroProduct diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/cockpitng/cng/css/sapcxbackoffice_common.scss b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cockpitng/cng/css/cxdevbackoffice_common.scss similarity index 87% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/cockpitng/cng/css/sapcxbackoffice_common.scss rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cockpitng/cng/css/cxdevbackoffice_common.scss index 835433d1..b0ab06ed 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/cockpitng/cng/css/sapcxbackoffice_common.scss +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cockpitng/cng/css/cxdevbackoffice_common.scss @@ -1,8 +1,8 @@ @import "cockpitng-globals.scss"; -@import "./support/sapcxbackoffice-variables.scss"; +@import "./support/cxdevbackoffice-variables.scss"; /*Icons for explorer tree */ -div.yw-explorerTree .y-tree-icon-sapcxtools_treenode_main.y-tree-icon:before { +div.yw-explorerTree .y-tree-icon-cxdevtools_treenode_main.y-tree-icon:before { font-family: var(--bo-content-icon-font-family); content: "\e10c"; color: var(--bo-content-icon-color); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/cockpitng/cng/css/support/sapcxbackoffice-variables.scss b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cockpitng/cng/css/support/cxdevbackoffice-variables.scss similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/cockpitng/cng/css/support/sapcxbackoffice-variables.scss rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cockpitng/cng/css/support/cxdevbackoffice-variables.scss diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-config.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-config.xml similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-config.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-config.xml index 3788d0f1..20146822 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-config.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-config.xml @@ -17,7 +17,7 @@ - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-spring.xml similarity index 86% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-spring.xml index 4e2604c1..9c8896d9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-spring.xml @@ -18,14 +18,14 @@ - + - - + + - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-widgets.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-widgets.xml similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-backoffice-widgets.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-backoffice-widgets.xml diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-spring.xml similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/resources/sapcxbackoffice-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/resources/cxdevbackoffice-spring.xml diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/src/tools/sapcx/commerce/backoffice/constants/CxBackofficeConstants.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/src/me/cxdev/commerce/backoffice/constants/CxBackofficeConstants.java similarity index 70% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/src/tools/sapcx/commerce/backoffice/constants/CxBackofficeConstants.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/src/me/cxdev/commerce/backoffice/constants/CxBackofficeConstants.java index c10edb17..fe84238a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/src/tools/sapcx/commerce/backoffice/constants/CxBackofficeConstants.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/src/me/cxdev/commerce/backoffice/constants/CxBackofficeConstants.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.backoffice.constants; +package me.cxdev.commerce.backoffice.constants; /** * Global class for all constants. This class is required by the platform and * will not been used for any other purpose. */ public final class CxBackofficeConstants { - public static final String EXTENSIONNAME = "sapcxbackoffice"; + public static final String EXTENSIONNAME = "cxdevbackoffice"; private CxBackofficeConstants() { // empty to avoid instantiating this constant class diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/testsrc/tools/sapcx/commerce/backoffice/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/testsrc/me/cxdev/commerce/backoffice/config/ExtensionConfigurationTests.java similarity index 57% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/testsrc/tools/sapcx/commerce/backoffice/config/ExtensionConfigurationTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/testsrc/me/cxdev/commerce/backoffice/config/ExtensionConfigurationTests.java index 2d13e2ff..d8513071 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/testsrc/tools/sapcx/commerce/backoffice/config/ExtensionConfigurationTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevbackoffice/testsrc/me/cxdev/commerce/backoffice/config/ExtensionConfigurationTests.java @@ -1,19 +1,19 @@ -package tools.sapcx.commerce.backoffice.config; +package me.cxdev.commerce.backoffice.config; import de.hybris.bootstrap.annotations.UnitTest; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; +import me.cxdev.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; @UnitTest public class ExtensionConfigurationTests { @Test public void extensionConfiguration() { InstalledExtensionVerifier.verifier() - .requires("sapcxbackoffice") + .requires("cxdevbackoffice") .requires("backoffice") - .requires("sapcommercetoolkit") + .requires("cxdevtoolkit") .verify(); } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.gitignore b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.gitignore similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.gitignore rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.gitignore index bd0966d2..ca19572e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.gitignore +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.gitignore @@ -7,7 +7,7 @@ testclasses eclipsebin gensrc -# .classpath files and lib folder in sapcxtools to ignore +# .classpath files and lib folder in cxdevtools to ignore .classpath lib/ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.project b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.project similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.project rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.project index 67082239..70b27ace 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/.project +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/.project @@ -1,6 +1,6 @@ - sapcxtemplate + cxdevenvconfig diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/LICENSE.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/LICENSE.md similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/LICENSE.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/LICENSE.md index 9776fe0d..8676c108 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/LICENSE.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2025] [SAP CX Tools] + Copyright [2025] [CX DEV Tools] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/README.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/README.md similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/README.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/README.md index 1b47fc10..0e13ca42 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/README.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/README.md @@ -1,6 +1,6 @@ -# SAP CX Environment Configuration +# CX DEV Environment Configuration -The `sapcxenvconfig` extension provides core implementations to provide environment specific configuration +The `cxdevenvconfig` extension provides core implementations to provide environment specific configuration to the Spartacus frontend. SAP does not deliver any solution to this topic, see also the long running thread and discussion going on at https://github.com/SAP/spartacus/issues/5772 (since 2018!). @@ -16,11 +16,11 @@ environment specific base, solving the issue above. ### How to activate and use To activate the functionality, one needs to set the configuration parameters accordingly for each -environment, i.e. the `sapcxenvconfig.environment.id` and `sapcxenvconfig.environment.name` property +environment, i.e. the `cxdevenvconfig.environment.id` and `cxdevenvconfig.environment.name` property which are set to values used for local development by default. In addition, the desired frontend configuration properties needs to be added as properties, each -prefixed with `sapcxenvconfig.frontend.` (see an example below). +prefixed with `cxdevenvconfig.frontend.` (see an example below). In addition to the backend configuration, the composable storefront needs to be extended with a config factory, typically in the `custom-config.module.ts` module file: @@ -30,7 +30,7 @@ config factory, typically in the `custom-config.module.ts` module file: import { Meta } from '@angular/platform-browser'; import { XhrFactory } from '@angular/common'; import { provideConfigFactory } from "@spartacus/core"; -import { securedConfigChunkFromBackend } from "./sapcxenvconfig"; +import { securedConfigChunkFromBackend } from "./cxdevenvconfig"; @NgModule({ // ... @@ -41,7 +41,7 @@ import { securedConfigChunkFromBackend } from "./sapcxenvconfig"; }) ``` -The imported file `sapcxenvconfig.ts` should be created next to the `custom-config.module.ts` and +The imported file `cxdevenvconfig.ts` should be created next to the `custom-config.module.ts` and contains the following content (complete file shown): ```typescript @@ -113,11 +113,11 @@ native HTTP request functionality of the browsers. | Parameter | Type | Description | |-----------|------|-------------| -| sapcxenvconfig.environment.id | String | the ID of the environment (default: L1) | -| sapcxenvconfig.environment.name | String | the name of the environment (default: Local Development) | -| sapcxenvconfig.frontend.mykey | String | specifies a frontend configuration property with key `mykey` and a value given to the property | -| sapcxenvconfig.frontend.myobject.variable1 | String | specifies a frontend configuration property within context `myobject` with key `variable1` and a value given to the property | -| sapcxenvconfig.frontend.myobject.variable2 | String | specifies a frontend configuration property within context `myobject` with key `variable2` and a value given to the property | +| cxdevenvconfig.environment.id | String | the ID of the environment (default: L1) | +| cxdevenvconfig.environment.name | String | the name of the environment (default: Local Development) | +| cxdevenvconfig.frontend.mykey | String | specifies a frontend configuration property with key `mykey` and a value given to the property | +| cxdevenvconfig.frontend.myobject.variable1 | String | specifies a frontend configuration property within context `myobject` with key `variable1` and a value given to the property | +| cxdevenvconfig.frontend.myobject.variable2 | String | specifies a frontend configuration property within context `myobject` with key `variable2` and a value given to the property | #### Example configuration @@ -125,16 +125,16 @@ native HTTP request functionality of the browsers. As an example, the following frontend configuration properties will result in the JSON object returned as shown below: ``` -sapcxenvconfig.environment.id=P1 -sapcxenvconfig.environment.name=Production -sapcxenvconfig.frontend.domain.type=SampleType -sapcxenvconfig.frontend.domain.object1.id=obj1 -sapcxenvconfig.frontend.domain.object1.name=Any Object -sapcxenvconfig.frontend.domain.object2.id=obj2 -sapcxenvconfig.frontend.domain.object2.name=Other Object -sapcxenvconfig.frontend.domain.other.key=value -sapcxenvconfig.frontend.toplevel.key=value -sapcxenvconfig.frontend.toplevel.enabled=true +cxdevenvconfig.environment.id=P1 +cxdevenvconfig.environment.name=Production +cxdevenvconfig.frontend.domain.type=SampleType +cxdevenvconfig.frontend.domain.object1.id=obj1 +cxdevenvconfig.frontend.domain.object1.name=Any Object +cxdevenvconfig.frontend.domain.object2.id=obj2 +cxdevenvconfig.frontend.domain.object2.name=Other Object +cxdevenvconfig.frontend.domain.other.key=value +cxdevenvconfig.frontend.toplevel.key=value +cxdevenvconfig.frontend.toplevel.enabled=true ``` ```json @@ -165,10 +165,10 @@ sapcxenvconfig.frontend.toplevel.enabled=true ``` Another example for configuring OAuth with Auth0 within the frontend can be found in the documentation of the -`sapcxenvconfig` extension. +`cxdevenvconfig` extension. ## License _Licensed under the Apache License, Version 2.0, January 2004_ -_Copyright 2025, SAP CX Tools_ \ No newline at end of file +_Copyright 2026, CX DEV Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/extensioninfo.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/extensioninfo.xml similarity index 75% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/extensioninfo.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/extensioninfo.xml index 56ec022d..5b4fe641 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/extensioninfo.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/extensioninfo.xml @@ -1,8 +1,8 @@ + name="cxdevenvconfig" version="5.0.0" usemaven="true"> - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/external-dependencies.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/external-dependencies.xml similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/external-dependencies.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/external-dependencies.xml index 6b485118..11d6e5ea 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/external-dependencies.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/external-dependencies.xml @@ -1,9 +1,9 @@ 4.0.0 - tools.sapcx - sapcxenvconfig - 4.4.0 + me.cxdev + cxdevenvconfig + 5.0.0 jar diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/project.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/project.properties similarity index 74% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/project.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/project.properties index 4b3b6280..3679c74c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/project.properties +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/project.properties @@ -1,9 +1,9 @@ # ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools +# Copyright (c) 2026 CX DEV Tools # ---------------------------------------------------------------------------- # Location of the file for the global platform spring application context -sapcxenvconfig.application-context=sapcxenvconfig-spring.xml +cxdevenvconfig.application-context=cxdevenvconfig-spring.xml ############################################################################## # Environment specific frontend configuration @@ -12,7 +12,7 @@ sapcxenvconfig.application-context=sapcxenvconfig-spring.xml # environment.name - the name of the environment (default: Local Development) # # Frontend configuration properties (for an example, please see README.md) -# sapcxenvconfig.frontend.toplevel.key=value (optional) +# cxdevenvconfig.frontend.toplevel.key=value (optional) ############################################################################## -sapcxenvconfig.environment.id=L1 -sapcxenvconfig.environment.name=Local Development +cxdevenvconfig.environment.id=L1 +cxdevenvconfig.environment.name=Local Development diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-beans.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-beans.xml similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-beans.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-beans.xml index 9ee96182..d1b5f999 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-beans.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-beans.xml @@ -1,6 +1,6 @@ - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-spring.xml similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-spring.xml index ff530059..699266b4 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/sapcxenvconfig-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/cxdevenvconfig-spring.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/occ/v2/sapcxenvconfigocc/web/spring/sapcxenvconfig-web-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/occ/v2/cxdevenvconfigocc/web/spring/cxdevenvconfig-web-spring.xml similarity index 88% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/occ/v2/sapcxenvconfigocc/web/spring/sapcxenvconfig-web-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/occ/v2/cxdevenvconfigocc/web/spring/cxdevenvconfig-web-spring.xml index 8ce6ad6c..afc910f0 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/resources/occ/v2/sapcxenvconfigocc/web/spring/sapcxenvconfig-web-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/resources/occ/v2/cxdevenvconfigocc/web/spring/cxdevenvconfig-web-spring.xml @@ -7,7 +7,7 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/constants/CxEnvConfigConstants.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/constants/CxEnvConfigConstants.java similarity index 63% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/constants/CxEnvConfigConstants.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/constants/CxEnvConfigConstants.java index 09329820..46eef2b4 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/constants/CxEnvConfigConstants.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/constants/CxEnvConfigConstants.java @@ -1,11 +1,10 @@ -package tools.sapcx.commerce.config.constants; +package me.cxdev.commerce.config.constants; @SuppressWarnings({ "deprecation", "squid:CallToDeprecatedMethod" }) public class CxEnvConfigConstants extends GeneratedCxEnvConfigConstants { - public static final String EXTENSIONNAME = "sapcxenvconfig"; + public static final String EXTENSIONNAME = "cxdevenvconfig"; private CxEnvConfigConstants() { // empty } - } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/controller/FrontendConfigurationController.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/controller/FrontendConfigurationController.java similarity index 85% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/controller/FrontendConfigurationController.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/controller/FrontendConfigurationController.java index 4c2ed196..24adfa33 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/controller/FrontendConfigurationController.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/controller/FrontendConfigurationController.java @@ -1,6 +1,4 @@ -package tools.sapcx.commerce.config.controller; - -import javax.annotation.Resource; +package me.cxdev.commerce.config.controller; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -9,8 +7,9 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import tools.sapcx.commerce.config.FrontendConfigurationWsDto; -import tools.sapcx.commerce.config.frontend.FrontendConfigurationService; +import jakarta.annotation.Resource; +import me.cxdev.commerce.config.FrontendConfigurationWsDto; +import me.cxdev.commerce.config.frontend.FrontendConfigurationService; @RestController @RequestMapping(value = "/{baseSiteId}/configuration") diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java index 41cee986..fae650df 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.config.frontend; +package me.cxdev.commerce.config.frontend; import java.nio.charset.Charset; import java.util.ArrayList; @@ -10,9 +10,9 @@ import pl.jalokim.propertiestojson.util.PropertiesToJsonConverterBuilder; public class EnvironmentSpecificFrontendConfigurationService implements FrontendConfigurationService { - static final String ENVIRONMENT_ID_CONFIGURATION_KEY = "sapcxenvconfig.environment.id"; - static final String ENVIRONMENT_NAME_CONFIGURATION_KEY = "sapcxenvconfig.environment.name"; - static final String FRONTEND_CONFIGURATION_PREFIX = "sapcxenvconfig.frontend"; + static final String ENVIRONMENT_ID_CONFIGURATION_KEY = "cxdevenvconfig.environment.id"; + static final String ENVIRONMENT_NAME_CONFIGURATION_KEY = "cxdevenvconfig.environment.name"; + static final String FRONTEND_CONFIGURATION_PREFIX = "cxdevenvconfig.frontend"; private ConfigurationService configurationService; private int generatedHashCode = -1; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/FrontendConfigurationService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/FrontendConfigurationService.java similarity index 76% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/FrontendConfigurationService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/FrontendConfigurationService.java index 1afae2fd..3e5dece1 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/src/tools/sapcx/commerce/config/frontend/FrontendConfigurationService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/src/me/cxdev/commerce/config/frontend/FrontendConfigurationService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.config.frontend; +package me.cxdev.commerce.config.frontend; public interface FrontendConfigurationService { String getEnvironmentId(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/ConfigurationServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/ConfigurationServiceFake.java similarity index 74% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/ConfigurationServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/ConfigurationServiceFake.java index 53baf01f..1161b201 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/ConfigurationServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/ConfigurationServiceFake.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.config.frontend; +package me.cxdev.commerce.config.frontend; import de.hybris.platform.servicelayer.config.ConfigurationService; -import org.apache.commons.configuration.BaseConfiguration; -import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration2.BaseConfiguration; +import org.apache.commons.configuration2.Configuration; public class ConfigurationServiceFake implements ConfigurationService { private BaseConfiguration configuration = new BaseConfiguration(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java similarity index 88% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java index f6361028..5b0190c9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/testsrc/tools/sapcx/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevenvconfig/testsrc/me/cxdev/commerce/config/frontend/EnvironmentSpecificFrontendConfigurationServiceTests.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.config.frontend; +package me.cxdev.commerce.config.frontend; +import static me.cxdev.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.ENVIRONMENT_ID_CONFIGURATION_KEY; +import static me.cxdev.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.ENVIRONMENT_NAME_CONFIGURATION_KEY; +import static me.cxdev.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.FRONTEND_CONFIGURATION_PREFIX; import static org.assertj.core.api.Assertions.assertThat; -import static tools.sapcx.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.ENVIRONMENT_ID_CONFIGURATION_KEY; -import static tools.sapcx.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.ENVIRONMENT_NAME_CONFIGURATION_KEY; -import static tools.sapcx.commerce.config.frontend.EnvironmentSpecificFrontendConfigurationService.FRONTEND_CONFIGURATION_PREFIX; import java.util.Map; @@ -19,7 +19,7 @@ public class EnvironmentSpecificFrontendConfigurationServiceTests { @Test public void withNoPropertiesSet_returnEmptyJsonObject() { - setupService(Map.of("sapcxenvconfig.unknown.key", "value")); + setupService(Map.of("cxdevenvconfig.unknown.key", "value")); // @formatter:off String frontendConfiguration = service.getFrontendConfiguration(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/.gitignore b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/.gitignore similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/.gitignore rename to core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/.gitignore diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/.project b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/.project new file mode 100644 index 00000000..1c129615 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/.project @@ -0,0 +1,19 @@ + + + cxdevproxy + + + + + org.eclipse.jdt.core.javabuilder + + + + org.springframework.ide.eclipse.core.springbuilder + + + + + org.eclipse.jdt.core.javanature + + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/CONTRIBUTING.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/CONTRIBUTING.md similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/CONTRIBUTING.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/CONTRIBUTING.md diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/LICENSE.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/LICENSE.md similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/LICENSE.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/LICENSE.md diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/README.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/README.md new file mode 100644 index 00000000..c5c47226 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/README.md @@ -0,0 +1,100 @@ +# CX Dev Proxy + +The `cxdevproxy` extension improves and simplifies the local development experience for SAP Commerce by providing an +embedded, highly configurable Undertow reverse proxy. + +## FEATURE DESCRIPTION + +This extension solves common local routing and authentication challenges when developing headless storefronts (like +Spartacus/Angular) against a local SAP Commerce backend. It provides a seamless "all-in-one" endpoint for developers. + +In addition, it contributes several major features to the local development lifecycle. + +### Embedded Reverse Proxy & Header Forwarding + +A lightweight Undertow server that listens on a unified port (e.g., `8080`) and dynamically routes traffic to either the +local frontend dev server (e.g., Angular on `4200`) or the SAP Commerce backend (Tomcat on `9002`). +The `ForwardedHeadersHandler` automatically injects `X-Forwarded-Host`, `X-Forwarded-Proto`, and `X-Forwarded-Port` +headers. This prevents infinite HTTPS redirect loops from Spring Security and ensures that Tomcat generates absolute +URLs correctly. + +### Developer Portal & JWT Mocking + +Provides a local Developer Portal (accessible via the root or `index.html`) to easily switch between different mocked +user sessions (Employees or Customers). +When a user is selected, the `JwtInjectorHandler` intercepts backend requests, dynamically generates a signed JWT using +the local domain's private key (via Nimbus JOSE+JWT), and injects it as a `Bearer` token. The static JWT claims can be +easily managed via JSON templates. + +### Startup Interception + +The `StartupPageHandler` listens to the Hybris tenant lifecycle. While the master tenant is starting up or shutting +down, all incoming proxy requests are intercepted, and a localized, auto-refreshing "503 Service Unavailable" +maintenance page is served to prevent hanging requests or backend errors. + +### Modular Static Content + +The `StaticContentHandler` allows serving static files (HTML, CSS, JS, images) directly from the classpath without +invoking the backend server. Files placed in `resources/cxdevproxy/static-content/` are automatically served. + +### Extensible Conditional Handlers + +The proxy pipeline is highly customizable. The `ConditionalDelegateHandler` allows executing specific handlers only if a +set of conditions is met (e.g., matching HTTP methods, specific paths, or headers). It supports complex logical +expressions via `AndCondition`, `OrCondition`, and `NotCondition`. + +## How to activate and use + +To activate this feature, simply set the `cxdevproxy.enabled` property to `true` in your `local.properties`. + +**Adding Static Content:** +Other extensions can contribute to the proxy's static files (like adding new pages to the Developer Portal) by simply +placing files inside their own `resources/cxdevproxy/static-content/` directory. The proxy classloader will pick them up +automatically. + +**Adding new Mock Users (JWT Templates):** +To add a new mock user, create a JSON file with the static claims in `resources/cxdevproxy/jwt/employee/.json` or +`resources/cxdevproxy/jwt/customer/.json`. + +**Adding Custom Handlers and Conditions:** +You can extend the proxy routing by defining new conditions and handlers in your Spring configuration. Simply create +your custom conditions and inject them into a `ConditionalDelegateHandler` via Spring XML: + +```xml + + + +``` + +Then add your handler to the `backendHandlers` list of the `UndertowProxyManager` bean. + + +## Configuration parameters + +| Parameter | Type | Description | +|-----------|------|-------------| +| cxdevproxy.enabled | boolean | Feature toggle. Must be set to `true` to start the Undertow proxy server (default: false). | +| cxdevproxy.application-context | String | Specifies the location of the spring context file automatically added to the global platform application context. | +| cxdevproxy.ssl.enabled | boolean | Enables HTTPS for the Undertow server. If false, forces HTTP routing. | +| cxdevproxy.ssl.keystore.path | String | Absolute path to the PKCS12 keystore used for SSL offloading and JWT signing. | +| cxdevproxy.ssl.keystore.password | String | Password for the configured keystore. | +| cxdevproxy.ssl.keystore.alias | String | Alias of the private key within the keystore used for SSL and JWT signing. | +| cxdevproxy.server.bindaddress | String | Network interface the proxy listens on (e.g., `127.0.0.1` or `0.0.0.0`). | +| cxdevproxy.server.protocol | String | The protocol exposed by the proxy (`http` or `https`). | +| cxdevproxy.server.hostname | String | The public hostname of the proxy (e.g., `local.cxdev.me`). Used for the `X-Forwarded-Host` header. | +| cxdevproxy.server.port | int | The port the Undertow proxy listens on (default: `8080`). | +| cxdevproxy.proxy.frontend.protocol | String | Protocol for frontend routing (e.g., `http` or `https`). | +| cxdevproxy.proxy.frontend.hostname | String | Hostname of the local frontend dev server (e.g., `localhost`). | +| cxdevproxy.proxy.frontend.port | int | Port of the local frontend dev server (e.g., `4200`). | +| cxdevproxy.proxy.backend.protocol | String | Protocol for backend routing (e.g., `https`). | +| cxdevproxy.proxy.backend.hostname | String | Hostname of the local SAP Commerce backend (e.g., `localhost`). | +| cxdevproxy.proxy.backend.port | int | Port of the local SAP Commerce backend (e.g., `9002`). | +| cxdevproxy.proxy.backend.contexts | String | Comma-separated list of paths to route to the backend. If empty, uses auto-discovery via webroot properties. | + + +## License + +_Licensed under the Apache License, Version 2.0, January 2004_ + +_Copyright 2026, SAP CX Tools_ + diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/extensioninfo.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/extensioninfo.xml new file mode 100644 index 00000000..d392fa64 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/extensioninfo.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/external-dependencies.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/external-dependencies.xml new file mode 100644 index 00000000..5513ac13 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/external-dependencies.xml @@ -0,0 +1,95 @@ + + 4.0.0 + me.cxdev + cxdevproxy + 5.0.0 + jar + + + 2.16.0 + 25.0.2 + + + + + io.undertow + undertow-core + 2.3.23.Final + + + + org.jboss.xnio + xnio-api + 3.8.17.Final + + + org.jboss.xnio + xnio-nio + 3.8.17.Final + + + org.jboss.threads + jboss-threads + 3.9.2 + + + + org.wildfly.client + wildfly-client-config + 1.0.1.Final + + + org.wildfly.common + wildfly-common + 2.0.1 + + + + io.smallrye.common + smallrye-common-constraint + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-cpu + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-expression + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-function + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-net + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-os + ${smallrye.common.version} + + + io.smallrye.common + smallrye-common-ref + ${smallrye.common.version} + + + + org.graalvm.sdk + nativeimage + ${graalvm.sdk.version} + + + org.graalvm.sdk + word + ${graalvm.sdk.version} + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/project.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/project.properties new file mode 100644 index 00000000..693e16b1 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/project.properties @@ -0,0 +1,40 @@ +# Specifies the location of the spring context file automatically added to the global platform application context. +cxdevproxy.application-context=cxdevproxy-spring.xml + +# ----------------------------------------------------------------------- +# CXDEVPROXY CONFIGURATION +# ----------------------------------------------------------------------- + +# Feature Toggle: Must be explicitly set to 'true' to start the Undertow proxy server. +cxdevproxy.enabled=false + +# SSL / Keystore Configuration +# Defines the keystore details used for securing the proxy server via HTTPS. +cxdevproxy.ssl.enabled=true +cxdevproxy.ssl.keystore.path=${HYBRIS_CONFIG_DIR}/../../../certificates/local.cxdev.me.p12 +cxdevproxy.ssl.keystore.password=123456 +cxdevproxy.ssl.keystore.alias=local.cxdev.me + +# Undertow Server Binding +# Defines the network interface, hostname, and port the embedded proxy will listen on. +cxdevproxy.server.bindaddress=127.0.0.1 +cxdevproxy.server.protocol=https +cxdevproxy.server.hostname=local.cxdev.me +cxdevproxy.server.port=8080 + +# Frontend Routing (Target) +# Target configuration for routing frontend requests (e.g., local Angular dev server). +cxdevproxy.proxy.frontend.protocol=https +cxdevproxy.proxy.frontend.hostname=localhost +cxdevproxy.proxy.frontend.port=4200 + +# Backend Routing (Target) +# Target configuration for routing SAP Commerce backend requests (local Tomcat). +cxdevproxy.proxy.backend.protocol=https +cxdevproxy.proxy.backend.hostname=localhost +cxdevproxy.proxy.backend.port=9002 + +# Backend Contexts (Comma-separated) +# Explicit list of URL paths to be routed to the backend. +# If left empty, auto-discovery will automatically determine backend routes via the .webroot properties. +cxdevproxy.proxy.backend.contexts= \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy-spring.xml new file mode 100644 index 00000000..ca820573 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy-spring.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-handler-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-handler-spring.xml new file mode 100644 index 00000000..c652e28d --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-handler-spring.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-jwt-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-jwt-spring.xml new file mode 100644 index 00000000..7bec4c12 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/config/cxdevproxy-jwt-spring.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besteller.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besteller.json new file mode 100644 index 00000000..c6d8cfcd --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besteller.json @@ -0,0 +1,5 @@ +{ + "sub": "besteller", + "name": "Moritz Besteller", + "authorities": ["ROLE_B2BCUSTOMERGROUP", "ROLE_B2BCUSTOMERADMINGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besucher.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besucher.json new file mode 100644 index 00000000..b02daaaa --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/besucher.json @@ -0,0 +1,5 @@ +{ + "sub": "besucher", + "name": "Max Besucher", + "authorities": ["ROLE_B2BCUSTOMERGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/customer.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/customer.json new file mode 100644 index 00000000..56de5216 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/customer.json @@ -0,0 +1,5 @@ +{ + "sub": "customer@cxdev.me", + "name": "Default Customer", + "authorities": ["ROLE_B2BCUSTOMERGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/training.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/training.json new file mode 100644 index 00000000..59769665 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/customer/training.json @@ -0,0 +1,5 @@ +{ + "sub": "besucher", + "name": "Franz Training", + "authorities": ["ROLE_B2BCUSTOMERGROUP", "ROLE_TRAININGGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/admin.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/admin.json new file mode 100644 index 00000000..8d8be540 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/admin.json @@ -0,0 +1,5 @@ +{ + "sub": "admin", + "name": "Shop Admin", + "authorities": ["ROLE_ADMINGROUP", "ROLE_EMPLOYEEGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/cmsmanager.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/cmsmanager.json new file mode 100644 index 00000000..2a2608e1 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/cmsmanager.json @@ -0,0 +1,5 @@ +{ + "sub": "cmsmanager", + "name": "CMS Manager", + "authorities": ["ROLE_CMSMANAGERGROUP", "ROLE_EMPLOYEEGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/productmanager.json b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/productmanager.json new file mode 100644 index 00000000..a30fe49c --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/jwt/employee/productmanager.json @@ -0,0 +1,5 @@ +{ + "sub": "productmanager", + "name": "Product Manager", + "authorities": ["ROLE_PRODUCTMANAGERGROUP", "ROLE_EMPLOYEEGROUP"] +} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/favicon.ico b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/favicon.ico new file mode 100644 index 00000000..9bcfd4b3 Binary files /dev/null and b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/favicon.ico differ diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/index.html b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/index.html new file mode 100644 index 00000000..84c136d0 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/cxdevproxy/static-content/index.html @@ -0,0 +1,131 @@ + + + + + + CX Dev Proxy - Portal + + + + +

+

🚀 CX Dev Proxy

+ +
+ Currently logged in as:
+ None + (None) +
+ + + +

🢠Employees (Internal Apps)

+
+
+

admin

Shop Admin (Full Access)

+
+
+

cmsmanager

SmartEdit & CMS Access

+
+
+

productmanager

PIM & Backoffice Access

+
+
+ +

ðŸ›ï¸ Customers (Storefront)

+
+
+

besucher

Max Besucher

+
+
+

besteller

Moritz Besteller

+
+
+

training

Franz Training

+
+
+
+ + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_de.properties new file mode 100644 index 00000000..0d8c8f34 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_de.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Server startet... +cxdevproxy.startup.page.message=SAP Commerce ist am Starten. Bitte warten, diese Seite aktualisiert sich automatisch. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_en.properties new file mode 100644 index 00000000..5256c76e --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_en.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Starting up... +cxdevproxy.startup.page.message=SAP Commerce is currently starting. Please wait, this page will refresh automatically. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_es.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_es.properties new file mode 100644 index 00000000..a812999e --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_es.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Iniciando... +cxdevproxy.startup.page.message=SAP Commerce se está iniciando. Por favor, espere, esta página se actualizará automáticamente. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_fr.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_fr.properties new file mode 100644 index 00000000..3e6619b8 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_fr.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Démarrage en cours... +cxdevproxy.startup.page.message=SAP Commerce est en cours de démarrage. Veuillez patienter, cette page s'actualisera automatiquement. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_it.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_it.properties new file mode 100644 index 00000000..6501850d --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_it.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Avvio in corso... +cxdevproxy.startup.page.message=SAP Commerce è in fase di avvio. Attendere, questa pagina si aggiornerà automaticamente. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ja.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ja.properties new file mode 100644 index 00000000..11be4837 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ja.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=???... +cxdevproxy.startup.page.message=??SAP Commerce???????????????????????????????????? \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_no.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_no.properties new file mode 100644 index 00000000..e8ab29c2 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_no.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Starter opp... +cxdevproxy.startup.page.message=SAP Commerce starter for øyeblikket. Vennligst vent, denne siden vil oppdateres automatisk. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_pt.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_pt.properties new file mode 100644 index 00000000..cda88528 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_pt.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Iniciando... +cxdevproxy.startup.page.message=O SAP Commerce está iniciando. Por favor, aguarde, esta página será atualizada automaticamente. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ru.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ru.properties new file mode 100644 index 00000000..abedb311 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_ru.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=??????... +cxdevproxy.startup.page.message=SAP Commerce ? ?????? ?????? ???????????. ??????????, ?????????, ??? ???????? ????????? ?????????????. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_sv.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_sv.properties new file mode 100644 index 00000000..ab703c06 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_sv.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=Startar... +cxdevproxy.startup.page.message=SAP Commerce startar för närvarande. Vänligen vänta, den här sidan uppdateras automatiskt. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_zh.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_zh.properties new file mode 100644 index 00000000..cb7bacd7 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/resources/localization/cxdevproxy-locales_zh.properties @@ -0,0 +1,2 @@ +cxdevproxy.startup.page.title=????... +cxdevproxy.startup.page.message=SAP Commerce ?????????????????? \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/AndCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/AndCondition.java new file mode 100644 index 00000000..bc2a1385 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/AndCondition.java @@ -0,0 +1,25 @@ +package me.cxdev.commerce.proxy.condition; + +import java.util.List; + +import io.undertow.server.HttpServerExchange; + +/** + * A logical AND condition that evaluates to true only if all + * of its underlying conditions match. + */ +public class AndCondition implements ExchangeCondition { + private List conditions; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (conditions == null || conditions.isEmpty()) { + return false; + } + return conditions.stream().allMatch(c -> c.matches(exchange)); + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/ExchangeCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/ExchangeCondition.java new file mode 100644 index 00000000..6afe8a63 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/ExchangeCondition.java @@ -0,0 +1,17 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; + +/** + * Represents a condition that evaluates an incoming HTTP request. + * Used to determine if a specific proxy handler should be executed. + */ +public interface ExchangeCondition { + /** + * Evaluates the condition against the current HTTP exchange. + * + * @param exchange The current Undertow HTTP server exchange. + * @return {@code true} if the condition is met, {@code false} otherwise. + */ + boolean matches(HttpServerExchange exchange); +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HeaderExistsCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HeaderExistsCondition.java new file mode 100644 index 00000000..9616a526 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HeaderExistsCondition.java @@ -0,0 +1,25 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; +import io.undertow.util.HttpString; + +import org.apache.commons.lang3.StringUtils; + +/** + * Condition that matches if the request contains a specific HTTP header. + */ +public class HeaderExistsCondition implements ExchangeCondition { + private String headerName; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (StringUtils.isBlank(headerName)) { + return false; + } + return exchange.getRequestHeaders().contains(new HttpString(headerName)); + } + + public void setHeaderName(String headerName) { + this.headerName = headerName; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HttpMethodCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HttpMethodCondition.java new file mode 100644 index 00000000..8ac8c468 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/HttpMethodCondition.java @@ -0,0 +1,25 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; + +import org.apache.commons.lang3.StringUtils; + +/** + * Condition that matches if the HTTP request method (e.g., GET, POST) + * equals the configured method. + */ +public class HttpMethodCondition implements ExchangeCondition { + private String method; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (StringUtils.isBlank(method)) { + return false; + } + return exchange.getRequestMethod().toString().equalsIgnoreCase(method); + } + + public void setMethod(String method) { + this.method = method; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/NotCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/NotCondition.java new file mode 100644 index 00000000..6f8e2a8c --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/NotCondition.java @@ -0,0 +1,22 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; + +/** + * A logical NOT condition that negates the result of a single underlying condition. + */ +public class NotCondition implements ExchangeCondition { + private ExchangeCondition condition; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (condition == null) { + return false; // Fail-safe if not properly configured + } + return !condition.matches(exchange); + } + + public void setCondition(ExchangeCondition condition) { + this.condition = condition; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/OrCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/OrCondition.java new file mode 100644 index 00000000..d38e70ec --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/OrCondition.java @@ -0,0 +1,25 @@ +package me.cxdev.commerce.proxy.condition; + +import java.util.List; + +import io.undertow.server.HttpServerExchange; + +/** + * A logical OR condition that evaluates to true if at least one + * of its underlying conditions matches. + */ +public class OrCondition implements ExchangeCondition { + private List conditions; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (conditions == null || conditions.isEmpty()) { + return false; + } + return conditions.stream().anyMatch(c -> c.matches(exchange)); + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/PathStartsWithCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/PathStartsWithCondition.java new file mode 100644 index 00000000..fa27c41b --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/PathStartsWithCondition.java @@ -0,0 +1,24 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; + +import org.apache.commons.lang3.StringUtils; + +/** + * Condition that matches if the request path starts with a specific prefix. + */ +public class PathStartsWithCondition implements ExchangeCondition { + private String prefix; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (StringUtils.isBlank(prefix)) { + return false; + } + return exchange.getRequestPath().startsWith(prefix); + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/QueryParameterExistsCondition.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/QueryParameterExistsCondition.java new file mode 100644 index 00000000..e7c923a0 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/condition/QueryParameterExistsCondition.java @@ -0,0 +1,24 @@ +package me.cxdev.commerce.proxy.condition; + +import io.undertow.server.HttpServerExchange; + +import org.apache.commons.lang3.StringUtils; + +/** + * Condition that matches if the request URL contains a specific query parameter. + */ +public class QueryParameterExistsCondition implements ExchangeCondition { + private String paramName; + + @Override + public boolean matches(HttpServerExchange exchange) { + if (StringUtils.isBlank(paramName)) { + return false; + } + return exchange.getQueryParameters().containsKey(paramName); + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/constants/CxDevProxyConstants.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/constants/CxDevProxyConstants.java new file mode 100644 index 00000000..a8fce5b5 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/constants/CxDevProxyConstants.java @@ -0,0 +1,14 @@ +package me.cxdev.commerce.proxy.constants; + +/** + * Global class for all CXDEV Proxy constants. + */ +public final class CxDevProxyConstants extends GeneratedCxDevProxyConstants { + public static final String EXTENSIONNAME = "cxdevproxy"; + + private CxDevProxyConstants() { + // empty to avoid instantiating this constant class + } + + // implement here constants used by this extension +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ConditionalDelegateHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ConditionalDelegateHandler.java new file mode 100644 index 00000000..240ab0fe --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ConditionalDelegateHandler.java @@ -0,0 +1,65 @@ +package me.cxdev.commerce.proxy.handler; + +import java.util.List; + +import io.undertow.server.HttpServerExchange; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import me.cxdev.commerce.proxy.condition.ExchangeCondition; +import me.cxdev.commerce.proxy.livecycle.ProxyHttpServerExchangeHandler; + +/** + * A composite handler that delegates execution to a list of underlying handlers + * only if a configured set of conditions is met. + *

+ * By default, ALL conditions must evaluate to {@code true} (AND logic). + * This can be changed to OR logic by setting {@code requireAllConditions} to {@code false}. + *

+ */ +public class ConditionalDelegateHandler implements ProxyHttpServerExchangeHandler { + private static final Logger LOG = LoggerFactory.getLogger(ConditionalDelegateHandler.class); + + private List conditions; + private List delegates; + + // If true, acts as AND. If false, acts as OR. + private boolean requireAllConditions = true; + + /** + * Evaluates the configured conditions. If the criteria are met, the request + * is passed to all configured delegate handlers. + * + * @param exchange The current HTTP server exchange. + */ + @Override + public void apply(HttpServerExchange exchange) { + if (conditions == null || conditions.isEmpty() || delegates == null || delegates.isEmpty()) { + return; + } + + boolean match = requireAllConditions + ? conditions.stream().allMatch(c -> c.matches(exchange)) + : conditions.stream().anyMatch(c -> c.matches(exchange)); + + if (match) { + LOG.debug("Conditions met. Executing {} delegate handler(s) for {}", delegates.size(), exchange.getRequestPath()); + for (ProxyHttpServerExchangeHandler delegate : delegates) { + delegate.apply(exchange); + } + } + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + public void setDelegates(List delegates) { + this.delegates = delegates; + } + + public void setRequireAllConditions(boolean requireAllConditions) { + this.requireAllConditions = requireAllConditions; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ForwardedHeadersHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ForwardedHeadersHandler.java new file mode 100644 index 00000000..155ee5ed --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/ForwardedHeadersHandler.java @@ -0,0 +1,105 @@ +package me.cxdev.commerce.proxy.handler; + +import java.net.InetSocketAddress; + +import io.undertow.server.HttpServerExchange; +import io.undertow.util.Headers; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import me.cxdev.commerce.proxy.livecycle.ProxyHttpServerExchangeHandler; + +/** + * Interceptor that ensures the {@code X-Forwarded-*} headers are correctly populated + * on the incoming HTTP exchange before it is routed to the target system. + *

+ * If the headers (Proto, Host, Port) are already provided by an upstream proxy or load balancer, + * they are preserved. Additionally, the original client's IP address is appended to the + * {@code X-Forwarded-For} header. This is a crucial requirement for SAP Commerce (Tomcat) + * to correctly resolve absolute URLs, avoid redirect loops, and determine the security context. + *

+ */ +public class ForwardedHeadersHandler implements ProxyHttpServerExchangeHandler { + private static final Logger LOG = LoggerFactory.getLogger(ForwardedHeadersHandler.class); + + private String serverProtocol; + private String serverHostname; + private int serverPort; + + /** + * Injects the required forwarded headers into the current HTTP exchange. + * Evaluates existing headers and falls back to server configuration or + * the incoming {@code Host} header if necessary. + * + * @param exchange The current HTTP server exchange being processed. + */ + @Override + public void apply(HttpServerExchange exchange) { + // 1. Resolve and set X-Forwarded-Proto + String existingProto = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_PROTO); + if (StringUtils.isBlank(existingProto)) { + exchange.getRequestHeaders().put(Headers.X_FORWARDED_PROTO, this.serverProtocol); + } + + // 2. Resolve and set X-Forwarded-Host & X-Forwarded-Port + String existingHost = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_HOST); + String existingPort = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_PORT); + + if (StringUtils.isBlank(existingHost) || StringUtils.isBlank(existingPort)) { + String hostHeader = exchange.getRequestHeaders().getFirst(Headers.HOST); + String forwardedHost = this.serverHostname; + int forwardedPort = this.serverPort; + + if (StringUtils.isNotBlank(hostHeader)) { + if (hostHeader.contains(":")) { + String[] parts = hostHeader.split(":"); + forwardedHost = parts[0]; + try { + forwardedPort = Integer.parseInt(parts[1]); + } catch (NumberFormatException e) { + LOG.warn("Could not parse port from Host header: '{}'. Falling back to protocol default.", hostHeader); + forwardedPort = "https".equalsIgnoreCase(this.serverProtocol) ? 443 : 80; + } + } else { + forwardedHost = hostHeader; + forwardedPort = "https".equalsIgnoreCase(this.serverProtocol) ? 443 : 80; + } + } + + if (StringUtils.isBlank(existingHost)) { + exchange.getRequestHeaders().put(Headers.X_FORWARDED_HOST, forwardedHost); + } + if (StringUtils.isBlank(existingPort)) { + exchange.getRequestHeaders().put(Headers.X_FORWARDED_PORT, String.valueOf(forwardedPort)); + } + } + + // 3. Append client IP to X-Forwarded-For + InetSocketAddress sourceAddress = exchange.getSourceAddress(); + if (sourceAddress != null && sourceAddress.getAddress() != null) { + String clientIp = sourceAddress.getAddress().getHostAddress(); + String existingFor = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_FOR); + + if (StringUtils.isNotBlank(existingFor)) { + // Append to the standard HTTP comma-separated list if multiple proxies are involved + exchange.getRequestHeaders().put(Headers.X_FORWARDED_FOR, existingFor + ", " + clientIp); + } else { + exchange.getRequestHeaders().put(Headers.X_FORWARDED_FOR, clientIp); + } + } + } + + public void setServerProtocol(String serverProtocol) { + this.serverProtocol = serverProtocol; + } + + public void setServerHostname(String serverHostname) { + this.serverHostname = serverHostname; + } + + public void setServerPort(int serverPort) { + this.serverPort = serverPort; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/JwtInjectorHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/JwtInjectorHandler.java new file mode 100644 index 00000000..4a8b7d5f --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/JwtInjectorHandler.java @@ -0,0 +1,58 @@ +package me.cxdev.commerce.proxy.handler; + +import io.undertow.server.HttpServerExchange; +import io.undertow.server.handlers.Cookie; +import io.undertow.util.Headers; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import me.cxdev.commerce.proxy.livecycle.ProxyHttpServerExchangeHandler; +import me.cxdev.commerce.proxy.service.JwtTokenService; + +/** + * Interceptor that injects a mocked JWT into the HTTP request before routing it to the backend. + *

+ * It checks the incoming request for a specific cookie ({@code cxdev_user}) set by the + * proxy's developer portal. If found, it requests a signed JWT from the {@link JwtTokenService} + * and appends it as an standard {@code Authorization: Bearer } header. + *

+ */ +public class JwtInjectorHandler implements ProxyHttpServerExchangeHandler { + private static final Logger LOG = LoggerFactory.getLogger(JwtInjectorHandler.class); + private static final String USER_ID_COOKIE_NAME = "cxdevproxy_user_id"; + private static final String USER_TYPE_COOKIE_NAME = "cxdevproxy_user_type"; + + private JwtTokenService jwtTokenService; + + /** + * Evaluates the request cookies and injects the JWT Authorization header if applicable. + * + * @param exchange The current HTTP server exchange. + */ + @Override + public void apply(HttpServerExchange exchange) { + Cookie userIdCookie = exchange.getRequestCookie(USER_ID_COOKIE_NAME); + Cookie userTypeCookie = exchange.getRequestCookie(USER_TYPE_COOKIE_NAME); + + if (userIdCookie != null && StringUtils.isNotBlank(userIdCookie.getValue())) { + String userType = userTypeCookie.getValue(); + String userId = userIdCookie.getValue(); + String token = jwtTokenService.getOrGenerateToken(userType, userId); + + if (token != null) { + // Remove any existing authorization header from the client to enforce our mock token + exchange.getRequestHeaders().remove(Headers.AUTHORIZATION); + + // Inject the mocked token + exchange.getRequestHeaders().put(Headers.AUTHORIZATION, "Bearer " + token); + LOG.debug("Injected mocked JWT for user '{}' into request to {}", userId, exchange.getRequestPath()); + } + } + } + + public void setJwtTokenService(JwtTokenService jwtTokenService) { + this.jwtTokenService = jwtTokenService; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StartupPageHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StartupPageHandler.java new file mode 100644 index 00000000..3e173288 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StartupPageHandler.java @@ -0,0 +1,128 @@ +package me.cxdev.commerce.proxy.handler; + +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import de.hybris.platform.core.MasterTenant; +import de.hybris.platform.core.Registry; +import de.hybris.platform.core.Tenant; +import de.hybris.platform.core.TenantListener; + +import io.undertow.server.HttpServerExchange; +import io.undertow.util.Headers; +import io.undertow.util.StatusCodes; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; + +import me.cxdev.commerce.proxy.livecycle.ProxyLocalRouteHandler; + +/** + * Intercepts incoming requests while the SAP Commerce server is still in its startup phase. + *

+ * This handler acts as a {@link TenantListener} to monitor the lifecycle of the 'master' tenant. + * As long as the master tenant is not fully started, this handler intercepts all traffic and + * serves an auto-refreshing "503 Service Unavailable" maintenance page using native Java ResourceBundles. + *

+ */ +public class StartupPageHandler implements ProxyLocalRouteHandler, TenantListener, InitializingBean { + + private static final Logger LOG = LoggerFactory.getLogger(StartupPageHandler.class); + private static final String BUNDLE_BASE_NAME = "localization/cxdevproxy-locales"; + + // volatile ensures thread visibility between Hybris startup threads and Undertow worker threads + private volatile boolean masterTenantReady = false; + + @Override + public void afterPropertiesSet() { + Registry.registerTenantListener(this); + } + + @Override + public void afterTenantStartUp(Tenant tenant) { + if (MasterTenant.getInstance().equals(tenant)) { + LOG.info("Master tenant has started. Proxy is now routing traffic."); + this.masterTenantReady = true; + } + } + + @Override + public void beforeTenantShutDown(Tenant tenant) { + if (MasterTenant.getInstance().equals(tenant)) { + LOG.info("Master tenant is shutting down. Proxy will block traffic."); + this.masterTenantReady = false; + } + } + + @Override + public void afterSetActivateSession(Tenant tenant) { + } + + @Override + public void beforeUnsetActivateSession(Tenant tenant) { + } + + @Override + public boolean matches(HttpServerExchange exchange) { + return !masterTenantReady; + } + + @Override + public void handleRequest(HttpServerExchange exchange) { + exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE); + exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html; charset=UTF-8"); + + Locale requestLocale = determineLocale(exchange); + String title = "Starting up..."; + String message = "SAP Commerce is currently starting. Please wait..."; + + try { + // Loads the message bundle natively from the classpath, bypassing the Hybris DB + ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_BASE_NAME, requestLocale); + title = bundle.getString("cxdevproxy.startup.page.title"); + message = bundle.getString("cxdevproxy.startup.page.message"); + } catch (MissingResourceException e) { + LOG.warn("Could not find message bundle '{}' or keys for locale '{}'. Falling back to default text.", BUNDLE_BASE_NAME, requestLocale); + } + + String html = String.format( + "" + + "" + + "" + + "" + + "%s" + + "" + + "" + + "" + + "" + + "

%s

" + + "

%s

" + + "
" + + "" + + "", + title, title, message); + + exchange.getResponseSender().send(html); + } + + /** + * Determines the preferred locale from the browser's Accept-Language header. + * Supports English and German. Defaults to English. + */ + private Locale determineLocale(HttpServerExchange exchange) { + String acceptLanguage = exchange.getRequestHeaders().getFirst(Headers.ACCEPT_LANGUAGE); + if (StringUtils.isNotBlank(acceptLanguage)) { + return Locale.forLanguageTag(acceptLanguage.toLowerCase()); + } + return Locale.ENGLISH; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StaticContentHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StaticContentHandler.java new file mode 100644 index 00000000..caa9c7ab --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/handler/StaticContentHandler.java @@ -0,0 +1,74 @@ +package me.cxdev.commerce.proxy.handler; + +import de.hybris.platform.core.Registry; + +import io.undertow.server.HttpServerExchange; +import io.undertow.server.handlers.resource.ClassPathResourceManager; +import io.undertow.server.handlers.resource.Resource; +import io.undertow.server.handlers.resource.ResourceHandler; +import io.undertow.server.handlers.resource.ResourceManager; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import me.cxdev.commerce.proxy.livecycle.ProxyLocalRouteHandler; + +/** + * A local route handler that serves static files directly from the extension's classpath. + *

+ * It looks for files within the {@code resources/static-content} directory. If a requested + * file exists locally, this handler intercepts the request and bypasses the standard + * frontend or backend proxy routing. + *

+ */ +public class StaticContentHandler implements ProxyLocalRouteHandler { + private static final Logger LOG = LoggerFactory.getLogger(StaticContentHandler.class); + private static final String STATIC_FOLDER = "cxdevproxy/static-content"; + + private final ResourceManager resourceManager; + private final ResourceHandler resourceHandler; + + /** + * Initializes the static content handler. + * Sets up Undertow's native resource management using the current classloader. + */ + public StaticContentHandler() { + // Uses the extension's classloader to resolve files from the resources folder + this.resourceManager = new ClassPathResourceManager(Registry.class.getClassLoader(), STATIC_FOLDER); + + // Undertow's native handler for serving static files securely and efficiently + this.resourceHandler = new ResourceHandler(this.resourceManager); + } + + /** + * Evaluates whether the incoming request targets an existing static file. + * + * @param exchange The current HTTP server exchange. + * @return {@code true} if the requested path matches an existing file in the static folder, {@code false} otherwise. + */ + @Override + public boolean matches(HttpServerExchange exchange) { + try { + String path = exchange.getRequestPath(); + Resource resource = resourceManager.getResource(path); + + // Match only if the resource actually exists and is a file (not a directory) + return resource != null && !resource.isDirectory(); + } catch (Exception e) { + LOG.error("Error checking for static resource: {}", exchange.getRequestPath(), e); + return false; + } + } + + /** + * Serves the matched static file to the client. + * + * @param exchange The current HTTP server exchange. + * @throws Exception If an error occurs while reading or writing the file. + */ + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + // Delegate the actual file serving (MIME types, caching headers, etc.) to Undertow + resourceHandler.handleRequest(exchange); + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyHttpServerExchangeHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyHttpServerExchangeHandler.java new file mode 100644 index 00000000..b5303135 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyHttpServerExchangeHandler.java @@ -0,0 +1,15 @@ +package me.cxdev.commerce.proxy.livecycle; + +import io.undertow.server.HttpServerExchange; + +/** + * Interface for applying custom rules and headers to an Undertow HttpServerExchange + * before it is proxied to the target server. + */ +public interface ProxyHttpServerExchangeHandler { + /** + * Applies rules or modifications to the exchange. + * * @param exchange the current HTTP server exchange + */ + void apply(HttpServerExchange exchange); +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyLocalRouteHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyLocalRouteHandler.java new file mode 100644 index 00000000..95b33872 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/ProxyLocalRouteHandler.java @@ -0,0 +1,26 @@ +package me.cxdev.commerce.proxy.livecycle; + +import io.undertow.server.HttpServerExchange; + +/** + * Interface for handling requests directly within the Undertow proxy, + * bypassing the standard routing to the frontend or backend. + * Useful for serving local HTML pages or mocking endpoints. + */ +public interface ProxyLocalRouteHandler { + /** + * Determines if this handler is responsible for the current request. + * + * @param exchange the current HTTP server exchange + * @return true if this handler should process the request, false otherwise + */ + boolean matches(HttpServerExchange exchange); + + /** + * Processes the request and sends a direct response to the client. + * + * @param exchange the current HTTP server exchange + * @throws Exception if an error occurs during processing + */ + void handleRequest(HttpServerExchange exchange) throws Exception; +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/UndertowProxyManager.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/UndertowProxyManager.java new file mode 100644 index 00000000..8f2d7a84 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/livecycle/UndertowProxyManager.java @@ -0,0 +1,397 @@ +package me.cxdev.commerce.proxy.livecycle; + +import static java.util.function.Predicate.isEqual; +import static java.util.function.Predicate.not; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.net.URI; +import java.security.KeyStore; +import java.util.Arrays; +import java.util.List; + +import javax.net.ssl.*; + +import de.hybris.bootstrap.config.ExtensionInfo; +import de.hybris.bootstrap.config.WebExtensionModule; +import de.hybris.platform.core.MasterTenant; +import de.hybris.platform.core.Registry; +import de.hybris.platform.util.Utilities; + +import io.undertow.Undertow; +import io.undertow.protocols.ssl.UndertowXnioSsl; +import io.undertow.server.HttpHandler; +import io.undertow.server.HttpServerExchange; +import io.undertow.server.handlers.proxy.LoadBalancingProxyClient; +import io.undertow.server.handlers.proxy.ProxyHandler; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.SmartLifecycle; +import org.xnio.OptionMap; +import org.xnio.Xnio; +import org.xnio.ssl.XnioSsl; + +import me.cxdev.commerce.proxy.trust.AcceptAllTrustManager; + +/** + * Manages the lifecycle of an embedded Undertow reverse proxy server for SAP Commerce. + *

+ * This manager is responsible for starting and stopping the Undertow server, configuring + * inbound SSL connections, and setting up the routing rules to dispatch incoming requests + * either to a local frontend (e.g., an Angular Dev Server) or the SAP Commerce backend (Tomcat). + * It also supports intercepting requests via custom local route handlers. + *

+ */ +public class UndertowProxyManager implements SmartLifecycle { + private static final Logger LOG = LoggerFactory.getLogger(UndertowProxyManager.class); + + // Spring Injected Properties + private boolean enabled; + + // SSL Properties + private boolean sslEnabled; + private String sslKeystorePath; + private String sslKeystorePassword; + private String sslKeystoreAlias; + + // Server Binding Properties + private String serverBindAddress; + private String serverHostname; + private String serverProtocol; + private int serverPort; + + // Proxy Target Properties + private String frontendProtocol; + private String frontendHostname; + private int frontendPort; + private String backendProtocol; + private String backendHostname; + private int backendPort; + private String backendContexts; + + // List of Local Routes + private List localRouteHandlers; + + // Proxy Handlers + private List frontendHandlers; + private List backendHandlers; + + private Undertow server; + private boolean running = false; + + /** + * Starts the embedded Undertow proxy server. + * Initializes proxy clients for frontend and backend, applies custom handler rules, + * and binds the server to the configured host and port. + */ + @Override + public void start() { + if (!enabled) { + LOG.info("cxdevproxy is disabled (cxdevproxy.enabled=false). Undertow proxy will not be started."); + return; + } + + if (!sslEnabled) { + this.serverProtocol = "http"; + LOG.info("SSL is disabled. Forcing server protocol to 'http'."); + } + + LOG.info("Starting embedded Undertow proxy (Protocol: {})...", this.serverProtocol); + + try { + String frontendUrl = frontendProtocol + "://" + frontendHostname + ":" + frontendPort; + LoadBalancingProxyClient frontendClient = new LoadBalancingProxyClient() + .addHost(new URI(frontendUrl), createTrustAllXnioSsl(frontendHostname)) + .setConnectionsPerThread(20); + + String backendUrl = backendProtocol + "://" + backendHostname + ":" + backendPort; + LoadBalancingProxyClient backendClient = new LoadBalancingProxyClient() + .addHost(new URI(backendUrl), createTrustAllXnioSsl(backendHostname)) + .setConnectionsPerThread(20); + + HttpHandler baseFrontendHandler = ProxyHandler.builder().setProxyClient(frontendClient).build(); + HttpHandler baseBackendHandler = ProxyHandler.builder().setProxyClient(backendClient).setMaxRequestTime(30000).build(); + + HttpHandler finalFrontendHandler = applyFrontendRules(baseFrontendHandler); + HttpHandler finalBackendHandler = applyBackendRules(baseBackendHandler); + + List activeBackendContexts = determineBackendContexts(); + LOG.info("Active backend routing contexts: {}", activeBackendContexts); + + HttpHandler routingHandler = exchange -> { + // 1. Check if a local route handler wants to intercept the request + if (localRouteHandlers != null) { + for (ProxyLocalRouteHandler localHandler : localRouteHandlers) { + if (localHandler.matches(exchange)) { + LOG.debug("Serving request {} {} with local handler {}.", exchange.getRequestMethod(), exchange.getRequestURI(), + localHandler.getClass().getSimpleName()); + localHandler.handleRequest(exchange); + return; + } + } + } + + // 2. Regular proxy routing if no local handler matched + routeRequest(exchange, activeBackendContexts, finalBackendHandler, finalFrontendHandler); + }; + + Undertow.Builder serverBuilder = Undertow.builder().setHandler(routingHandler); + + if (sslEnabled) { + SSLContext serverSslContext = createServerSSLContext(); + if (serverSslContext == null) { + return; + } + serverBuilder.addHttpsListener(serverPort, serverBindAddress, serverSslContext); + LOG.info("Undertow proxy listening securely on {}://{}:{} (HTTPS).", serverProtocol, serverBindAddress, serverPort); + } else { + serverBuilder.addHttpListener(serverPort, serverBindAddress); + LOG.info("Undertow proxy listening on {}://{}:{} (HTTP).", serverProtocol, serverBindAddress, serverPort); + } + + server = serverBuilder.build(); + server.start(); + running = true; + + } catch (Exception e) { + LOG.error("Error starting Undertow proxy", e); + } + } + + /** + * Determines the URL context paths that should be routed to the SAP Commerce backend. + * Uses explicitly configured contexts if provided, otherwise performs auto-discovery + * by scanning all installed web extensions for their web roots. + * + * @return A list of backend context paths (e.g., ["/backoffice", "/occ"]). + */ + private List determineBackendContexts() { + if (StringUtils.isNotBlank(this.backendContexts)) { + return Arrays.stream(this.backendContexts.split(",")) + .map(String::trim) + .filter(StringUtils::isNotBlank) + .toList(); + } + + LOG.info("No manual backend contexts configured. Starting auto-discovery via Utilities.getWebroot()..."); + + return Utilities.getInstalledExtensionNames(MasterTenant.getInstance()).stream() + .map(Utilities::getExtensionInfo) + .filter(ExtensionInfo::isWebExtension) + .map(ExtensionInfo::getWebModule) + .map(WebExtensionModule::getWebRoot) + .filter(not(isEqual("/"))) + .distinct() + .sorted() + .toList(); + } + + /** + * Routes the incoming HTTP request to either the backend or the frontend proxy handler + * based on the request path and the determined backend contexts. + * + * @param exchange The current HTTP server exchange. + * @param backendContexts The list of context paths mapped to the backend. + * @param backendHandler The handler responsible for backend routing. + * @param frontendHandler The handler responsible for frontend routing. + * @throws Exception If an error occurs during routing. + */ + private void routeRequest(HttpServerExchange exchange, List backendContexts, HttpHandler backendHandler, HttpHandler frontendHandler) throws Exception { + String path = exchange.getRequestPath(); + boolean isBackendRequest = backendContexts.stream().anyMatch(path::startsWith); + + if (isBackendRequest) { + LOG.debug("Serving request {} {} with backend handler.", exchange.getRequestMethod(), exchange.getRequestURI()); + backendHandler.handleRequest(exchange); + } else { + LOG.debug("Serving request {} {} with frontend handler.", exchange.getRequestMethod(), exchange.getRequestURI()); + frontendHandler.handleRequest(exchange); + } + } + + /** + * Wraps the base frontend handler with any configured custom interceptors/handlers. + * + * @param next The base proxy handler. + * @return A chained HTTP handler applying all configured frontend rules. + */ + protected HttpHandler applyFrontendRules(HttpHandler next) { + return exchange -> { + if (frontendHandlers != null) { + frontendHandlers.forEach(handler -> handler.apply(exchange)); + } + next.handleRequest(exchange); + }; + } + + /** + * Wraps the base backend handler with any configured custom interceptors/handlers. + * + * @param next The base proxy handler. + * @return A chained HTTP handler applying all configured backend rules. + */ + protected HttpHandler applyBackendRules(HttpHandler next) { + return exchange -> { + if (backendHandlers != null) { + backendHandlers.forEach(handler -> handler.apply(exchange)); + } + next.handleRequest(exchange); + }; + } + + /** + * Creates the SSL context used by the Undertow server to accept incoming HTTPS connections. + * Loads the keystore configured in the properties. + * + * @return The configured SSLContext, or null if configuration is invalid. + * @throws Exception If keystore loading or context initialization fails. + */ + private SSLContext createServerSSLContext() throws Exception { + if (StringUtils.isBlank(sslKeystorePath)) { + LOG.error("Keystore path is empty or not set. Proxy startup aborted."); + return null; + } + + File keystoreFile = new File(sslKeystorePath.trim()); + + if (!keystoreFile.exists() || !keystoreFile.isFile()) { + LOG.error("Keystore not found at: {}. Proxy server will not be started.", keystoreFile.getAbsolutePath()); + return null; + } + + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + try (InputStream is = new FileInputStream(keystoreFile)) { + keyStore.load(is, sslKeystorePassword != null ? sslKeystorePassword.toCharArray() : new char[0]); + } + + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(keyStore, sslKeystorePassword != null ? sslKeystorePassword.toCharArray() : new char[0]); + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(kmf.getKeyManagers(), null, null); + return sslContext; + } + + /** + * Creates a permissive SSL client context for outbound proxy connections to target systems. + * Disables strict certificate validation to allow proxying to local self-signed endpoints. + * + * @param serverNameIndicator The SNI hostname to use, if any. + * @return The configured XnioSsl instance. + * @throws Exception If SSL context initialization fails. + */ + private XnioSsl createTrustAllXnioSsl(String serverNameIndicator) throws Exception { + TrustManager[] trustAllCerts = new TrustManager[] { + new AcceptAllTrustManager() + }; + + SSLContext sc = SSLContext.getInstance("TLS"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + + ClassLoader rootClassLoader = Registry.class.getClassLoader(); + return new UndertowXnioSsl(Xnio.getInstance(rootClassLoader), OptionMap.EMPTY, sc); + } + + /** + * Stops the embedded Undertow proxy server and releases resources. + */ + @Override + public void stop() { + if (server != null) { + LOG.info("Stopping embedded Undertow proxy..."); + server.stop(); + running = false; + } + } + + @Override + public boolean isRunning() { + return running; + } + + @Override + public int getPhase() { + return Integer.MAX_VALUE; + } + + // --- Setters for Spring Injection --- + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public void setSslEnabled(boolean sslEnabled) { + this.sslEnabled = sslEnabled; + } + + public void setSslKeystorePath(String sslKeystorePath) { + this.sslKeystorePath = sslKeystorePath; + } + + public void setSslKeystorePassword(String sslKeystorePassword) { + this.sslKeystorePassword = sslKeystorePassword; + } + + public void setSslKeystoreAlias(String sslKeystoreAlias) { + this.sslKeystoreAlias = sslKeystoreAlias; + } + + public void setServerBindAddress(String serverBindAddress) { + this.serverBindAddress = serverBindAddress; + } + + public void setServerHostname(String serverHostname) { + this.serverHostname = serverHostname; + } + + public void setServerProtocol(String serverProtocol) { + this.serverProtocol = serverProtocol; + } + + public void setServerPort(int serverPort) { + this.serverPort = serverPort; + } + + public void setFrontendProtocol(String frontendProtocol) { + this.frontendProtocol = frontendProtocol; + } + + public void setFrontendHostname(String frontendHostname) { + this.frontendHostname = frontendHostname; + } + + public void setFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + } + + public void setBackendProtocol(String backendProtocol) { + this.backendProtocol = backendProtocol; + } + + public void setBackendHostname(String backendHostname) { + this.backendHostname = backendHostname; + } + + public void setBackendPort(int backendPort) { + this.backendPort = backendPort; + } + + public void setBackendContexts(String backendContexts) { + this.backendContexts = backendContexts; + } + + public void setLocalRouteHandlers(List localRouteHandlers) { + this.localRouteHandlers = localRouteHandlers; + } + + public void setFrontendHandlers(List frontendHandlers) { + this.frontendHandlers = frontendHandlers; + } + + public void setBackendHandlers(List backendHandlers) { + this.backendHandlers = backendHandlers; + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/service/JwtTokenService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/service/JwtTokenService.java new file mode 100644 index 00000000..9c07ec42 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/service/JwtTokenService.java @@ -0,0 +1,184 @@ +package me.cxdev.commerce.proxy.service; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.security.KeyStore; +import java.security.PrivateKey; +import java.util.Date; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import com.nimbusds.jose.JWSAlgorithm; +import com.nimbusds.jose.JWSHeader; +import com.nimbusds.jose.JWSSigner; +import com.nimbusds.jose.crypto.RSASSASigner; +import com.nimbusds.jwt.JWTClaimsSet; +import com.nimbusds.jwt.SignedJWT; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; + +/** + * Service responsible for loading JWT templates, generating signed tokens, and caching them. + *

+ * It uses the local domain's private key (extracted from the PKCS12 keystore) to sign the + * tokens using the RS256 algorithm. Static claims are loaded from JSON templates in the + * classpath, while dynamic claims (like iat, exp) are calculated on the fly. + *

+ */ +public class JwtTokenService implements InitializingBean { + private static final Logger LOG = LoggerFactory.getLogger(JwtTokenService.class); + private static final long TOKEN_VALIDITY_MS = 3600 * 1000L; // 1 hour validity + + private String keystorePath; + private String keystorePassword; + private String keystoreAlias; + + private PrivateKey privateKey; + private final Map tokenCache = new ConcurrentHashMap<>(); + + @Override + public void afterPropertiesSet() throws Exception { + loadPrivateKey(); + } + + /** + * Extracts the private key from the configured PKCS12 keystore. + */ + private void loadPrivateKey() throws Exception { + if (StringUtils.isBlank(keystorePath)) { + LOG.warn("Keystore path not configured. JWT signing will not work."); + return; + } + + File keystoreFile = new File(keystorePath.trim()); + if (!keystoreFile.exists()) { + LOG.error("Keystore not found at {}. JWT signing disabled.", keystoreFile.getAbsolutePath()); + return; + } + + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + char[] password = keystorePassword != null ? keystorePassword.toCharArray() : new char[0]; + + try (InputStream is = new FileInputStream(keystoreFile)) { + keyStore.load(is, password); + } + + KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry( + keystoreAlias, new KeyStore.PasswordProtection(password)); + + if (privateKeyEntry != null) { + this.privateKey = privateKeyEntry.getPrivateKey(); + LOG.info("Successfully loaded private key for alias '{}' for JWT signing.", keystoreAlias); + } else { + LOG.error("Could not find private key for alias '{}'.", keystoreAlias); + } + } + + /** + * Retrieves a signed JWT for the given user ID. + * Uses a cached token if it is still valid; otherwise, generates a new one. + * + * @param userType The type of the user (e.g., "employee"). + * @param userId The ID of the user (e.g., "admin"). + * @return The signed JWT as a Base64 encoded string, or null if generation fails. + */ + public String getOrGenerateToken(String userType, String userId) { + if (privateKey == null) { + return null; + } + + CachedToken cached = tokenCache.get(userId); + if (cached != null && cached.isValid()) { + return cached.getToken(); + } + + String newToken = generateSignedToken(userType, userId); + if (newToken != null) { + // Cache token to expire slightly before the actual JWT expiry to avoid edge cases + tokenCache.put(userId, new CachedToken(newToken, System.currentTimeMillis() + TOKEN_VALIDITY_MS - 60000)); + } + return newToken; + } + + /** + * Reads the JSON template, appends dynamic claims, and signs the JWT. + */ + private String generateSignedToken(String userType, String userId) { + String templatePath = "cxdevproxy/jwt/" + userType + "/" + userId + ".json"; + try (InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath)) { + if (is == null) { + LOG.warn("No JWT template found for user at classpath: {}", templatePath); + return null; + } + + String jsonContent = IOUtils.toString(is, StandardCharsets.UTF_8); + + // Parse static claims from the JSON file + JWTClaimsSet templateClaims = JWTClaimsSet.parse(jsonContent); + + // Calculate dynamic validity + Date now = new Date(); + Date expiry = new Date(now.getTime() + TOKEN_VALIDITY_MS); + + // Merge claims + JWTClaimsSet finalClaims = new JWTClaimsSet.Builder(templateClaims) + .issueTime(now) + .expirationTime(expiry) + .issuer("cxdevproxy") + .build(); + + // Sign the JWT + JWSSigner signer = new RSASSASigner(this.privateKey); + JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.RS256).keyID(keystoreAlias).build(); + + SignedJWT signedJWT = new SignedJWT(header, finalClaims); + signedJWT.sign(signer); + + LOG.debug("Successfully generated new signed JWT for user '{}'", userId); + return signedJWT.serialize(); + + } catch (Exception e) { + LOG.error("Failed to generate JWT for user '{}'", userId, e); + return null; + } + } + + public void setKeystorePath(String keystorePath) { + this.keystorePath = keystorePath; + } + + public void setKeystorePassword(String keystorePassword) { + this.keystorePassword = keystorePassword; + } + + public void setKeystoreAlias(String keystoreAlias) { + this.keystoreAlias = keystoreAlias; + } + + /** + * Internal wrapper to hold a cached token and its local expiration time. + */ + private static class CachedToken { + private final String token; + private final long expiresAt; + + public CachedToken(String token, long expiresAt) { + this.token = token; + this.expiresAt = expiresAt; + } + + public String getToken() { + return token; + } + + public boolean isValid() { + return System.currentTimeMillis() < expiresAt; + } + } +} diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/trust/AcceptAllTrustManager.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/trust/AcceptAllTrustManager.java new file mode 100644 index 00000000..f3b3fb51 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevproxy/src/me/cxdev/commerce/proxy/trust/AcceptAllTrustManager.java @@ -0,0 +1,38 @@ +package me.cxdev.commerce.proxy.trust; + +import java.net.Socket; +import java.security.cert.X509Certificate; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.X509ExtendedTrustManager; + +public class AcceptAllTrustManager extends X509ExtendedTrustManager { + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) { + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) { + } +} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.gitignore b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.gitignore similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.gitignore rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.gitignore index bd0966d2..ca19572e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.gitignore +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.gitignore @@ -7,7 +7,7 @@ testclasses eclipsebin gensrc -# .classpath files and lib folder in sapcxtools to ignore +# .classpath files and lib folder in cxdevtools to ignore .classpath lib/ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.project b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.project similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.project rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.project index 45b9753c..57cfb0e0 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/.project +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/.project @@ -1,6 +1,6 @@ - sapcxreporting + cxdevreporting diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/LICENSE.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/LICENSE.md similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/LICENSE.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/LICENSE.md index 9776fe0d..8676c108 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/LICENSE.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2025] [SAP CX Tools] + Copyright [2025] [CX DEV Tools] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/README.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/README.md similarity index 83% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/README.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/README.md index 348fbc80..3368577d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/README.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/README.md @@ -1,6 +1,6 @@ -# SAP CX Reporting +# CX DEV Reporting -The `sapcxreporting` extension provides reporting capabilities within the Backoffice. With support of flexible search queries a report +The `cxdevreporting` extension provides reporting capabilities within the Backoffice. With support of flexible search queries a report configuration with dynamic configuration properties, i.e. one can use named properties within the query and link them within the backoffice application to existing objects like products, categories, catalog versions, user or groups, and configuration values from the properties. @@ -46,7 +46,7 @@ The configuration of a report should be self-explaining: You can provide your own Subclasses of `QueryReportConfigurationParameter` to support your customer project with additional lookup capabilities on custom objects, e.g. special item types introduces by the project team. To get an example, have a look into the -`sapcxreporting-items.xml` file to see how it was done for some standard types. +`cxdevreporting-items.xml` file to see how it was done for some standard types. ### Known limitations of the implementation: - with large result sets the POI library reaches its limitations, use CSV as a fallback @@ -55,16 +55,16 @@ capabilities on custom objects, e.g. special item types introduces by the projec | Parameter | Type | Description | |-----------|------|-------------| -| sapcxreporting.report.format.csv.encoding | character | default option for new reports, default: `UTF-8` | -| sapcxreporting.report.format.csv.commentchar | character | default option for new reports, default: `#` | -| sapcxreporting.report.format.csv.fieldseparator | character | default option for new reports, default: `;` | -| sapcxreporting.report.format.csv.textseparator | character | default option for new reports, default: `"` | -| sapcxreporting.report.format.csv.linebreak | character | default option for new reports, default: `\n` | -| sapcxreporting.report.format.excel.highlightheader | boolean | default option for new reports, default: `false` | -| sapcxreporting.report.format.excel.alternatinglines | boolean | default option for new reports, default: `false` | -| sapcxreporting.report.format.excel.freezeheader | boolean | default option for new reports, default: `true` | -| sapcxreporting.report.format.excel.activatefilter | boolean | default option for new reports, default: `true` | -| sapcxreporting.report.format.excel.autosizecolumns | boolean | default option for new reports, default: `true` | +| cxdevreporting.report.format.csv.encoding | character | default option for new reports, default: `UTF-8` | +| cxdevreporting.report.format.csv.commentchar | character | default option for new reports, default: `#` | +| cxdevreporting.report.format.csv.fieldseparator | character | default option for new reports, default: `;` | +| cxdevreporting.report.format.csv.textseparator | character | default option for new reports, default: `"` | +| cxdevreporting.report.format.csv.linebreak | character | default option for new reports, default: `\n` | +| cxdevreporting.report.format.excel.highlightheader | boolean | default option for new reports, default: `false` | +| cxdevreporting.report.format.excel.alternatinglines | boolean | default option for new reports, default: `false` | +| cxdevreporting.report.format.excel.freezeheader | boolean | default option for new reports, default: `true` | +| cxdevreporting.report.format.excel.activatefilter | boolean | default option for new reports, default: `true` | +| cxdevreporting.report.format.excel.autosizecolumns | boolean | default option for new reports, default: `true` | @@ -72,4 +72,4 @@ capabilities on custom objects, e.g. special item types introduces by the projec _Licensed under the Apache License, Version 2.0, January 2004_ -_Copyright 2025, SAP CX Tools_ \ No newline at end of file +_Copyright 2026, CX DEV Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/email-templates/messages.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/scss/cxdevreporting-variables.scss similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/email-templates/messages.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/scss/cxdevreporting-variables.scss diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/definition.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/definition.xml similarity index 67% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/definition.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/definition.xml index c0b3d2f1..cfad7465 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/definition.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/definition.xml @@ -1,13 +1,13 @@ - Download Report Executes the query and downloads the generated report. - SAP CX Tools + CX DEV Tools 1.0 - tools.sapcx.commerce.reporting.backoffice.action.ExecuteReportAction - tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel + me.cxdev.commerce.reporting.backoffice.action.ExecuteReportAction + me.cxdev.commerce.reporting.model.QueryReportConfigurationModel java.lang.Object icons/icon_action_exportreport_default.png icons/icon_action_exportreport_hover.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_default.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_default.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_default.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_default.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_disabled.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_disabled.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_disabled.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_disabled.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_hover.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_hover.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_hover.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/icons/icon_action_exportreport_hover.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/labels/labels_de.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels_de.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/labels/labels_de.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/labels/labels_en.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels_en.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/executereport/labels/labels_en.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/definition.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/definition.xml similarity index 67% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/definition.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/definition.xml index 9c53f00a..2f6eaf72 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/definition.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/definition.xml @@ -1,13 +1,13 @@ - Validate Report Executes the query and verifies if it is valid. - SAP CX Tools + CX DEV Tools 1.0 - tools.sapcx.commerce.reporting.backoffice.action.ValidateReportAction - tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel + me.cxdev.commerce.reporting.backoffice.action.ValidateReportAction + me.cxdev.commerce.reporting.model.QueryReportConfigurationModel java.lang.Object icons/icon_action_validatereport_default.png icons/icon_action_validatereport_hover.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_default.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_default.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_default.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_default.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_disabled.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_disabled.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_disabled.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_disabled.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_hover.png b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_hover.png similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_hover.png rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/icons/icon_action_validatereport_hover.png diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_de.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_de.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_de.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_en.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_en.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/resources/widgets/actions/validatereport/labels/labels_en.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ExecuteReportAction.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ExecuteReportAction.java similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ExecuteReportAction.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ExecuteReportAction.java index 5b0ed628..98866be8 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ExecuteReportAction.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ExecuteReportAction.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.backoffice.action; +package me.cxdev.commerce.reporting.backoffice.action; import static org.apache.commons.lang3.StringUtils.defaultIfBlank; @@ -10,8 +10,6 @@ import java.util.Map; import java.util.Optional; -import javax.annotation.Resource; - import com.hybris.cockpitng.actions.ActionContext; import com.hybris.cockpitng.actions.ActionResult; import com.hybris.cockpitng.actions.CockpitAction; @@ -24,11 +22,12 @@ import org.zkoss.zul.Filedownload; import org.zkoss.zul.Messagebox; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.ReportService; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.FlexibleSearchGenericSearchService; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; +import jakarta.annotation.Resource; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.ReportService; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.FlexibleSearchGenericSearchService; +import me.cxdev.commerce.reporting.search.GenericSearchResult; public class ExecuteReportAction implements CockpitAction { private static final Logger LOG = LoggerFactory.getLogger(ExecuteReportAction.class); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ValidateReportAction.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ValidateReportAction.java similarity index 84% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ValidateReportAction.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ValidateReportAction.java index 13bfdcb4..4e311964 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/src/tools/sapcx/commerce/reporting/backoffice/action/ValidateReportAction.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/src/me/cxdev/commerce/reporting/backoffice/action/ValidateReportAction.java @@ -1,10 +1,8 @@ -package tools.sapcx.commerce.reporting.backoffice.action; +package me.cxdev.commerce.reporting.backoffice.action; import java.text.MessageFormat; import java.util.Map; -import javax.annotation.Resource; - import com.hybris.cockpitng.actions.ActionContext; import com.hybris.cockpitng.actions.ActionResult; import com.hybris.cockpitng.actions.CockpitAction; @@ -13,10 +11,11 @@ import org.slf4j.LoggerFactory; import org.zkoss.zhtml.Messagebox; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.ReportService; -import tools.sapcx.commerce.reporting.search.FlexibleSearchGenericSearchService; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; +import jakarta.annotation.Resource; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.ReportService; +import me.cxdev.commerce.reporting.search.FlexibleSearchGenericSearchService; +import me.cxdev.commerce.reporting.search.GenericSearchResult; public class ValidateReportAction implements CockpitAction { private static final Logger LOG = LoggerFactory.getLogger(ValidateReportAction.class); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/testsrc/tools/sapcx/commerce/reporting/backoffice/.gitkeep b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/testsrc/tools/sapcx/commerce/reporting/backoffice/.gitkeep similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/testsrc/tools/sapcx/commerce/reporting/backoffice/.gitkeep rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/backoffice/testsrc/tools/sapcx/commerce/reporting/backoffice/.gitkeep diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/extensioninfo.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/extensioninfo.xml similarity index 68% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/extensioninfo.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/extensioninfo.xml index 0e42956a..ea5f96aa 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/extensioninfo.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/extensioninfo.xml @@ -1,12 +1,11 @@ - + - + - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/external-dependencies.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/external-dependencies.xml similarity index 85% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/external-dependencies.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/external-dependencies.xml index 290834be..0e6bb88d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/external-dependencies.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/external-dependencies.xml @@ -1,9 +1,9 @@ 4.0.0 - tools.sapcx - sapcxreporting - 4.4.0 + me.cxdev + cxdevreporting + 5.0.0 jar diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/project.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/project.properties new file mode 100644 index 00000000..d65cf311 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/project.properties @@ -0,0 +1,26 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2026 CX DEV Tools +# ---------------------------------------------------------------------------- + +# Location of the file for the global platform spring application context +cxdevreporting.application-context=cxdevreporting-spring.xml + +# Report job config +cxdevreporting.report.job.code=reportGeneratorJobPerformable + +# CSV format settings +cxdevreporting.report.format.csv.encoding=UTF-8 +cxdevreporting.report.format.csv.commentchar=# +cxdevreporting.report.format.csv.fieldseparator=; +cxdevreporting.report.format.csv.textseparator=" +cxdevreporting.report.format.csv.linebreak=\n + +# Excel format settings +cxdevreporting.report.format.excel.highlightheader=false +cxdevreporting.report.format.excel.alternatinglines=false +cxdevreporting.report.format.excel.freezeheader=true +cxdevreporting.report.format.excel.activatefilter=true +cxdevreporting.report.format.excel.autosizecolumns=true + +# Sample data +cxdevtoolkit.impeximport.sampledata.8100.reports=/cxdevreporting/sampledata/default-reports.impex \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-config.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-config.xml similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-config.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-config.xml index 2d6ec488..d9a83a8d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-config.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-config.xml @@ -17,13 +17,13 @@ - - - - - - - + + + + + + + @@ -108,8 +108,8 @@ - - + + @@ -147,8 +147,8 @@ - - + + @@ -163,9 +163,9 @@ - - - + + + @@ -187,7 +187,7 @@ - + rows @@ -198,15 +198,15 @@ - - + + - + showOptionalField @@ -239,8 +239,8 @@ - - + + diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_de.properties new file mode 100644 index 00000000..001561e3 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_de.properties @@ -0,0 +1,11 @@ +cxdevreporting.treenode.reporting=Reporting +cxdevreporting.treenode.reporting.parameters=Parameter +cxdevreporting.backoffice.tab.report=Bericht +cxdevreporting.backoffice.section.report=Konfiguration +cxdevreporting.backoffice.panel.general=Allgemein +cxdevreporting.backoffice.panel.query=Anfrage +cxdevreporting.backoffice.tab.reportformat=Formatierung +cxdevreporting.backoffice.section.reportformat.csv=CSV Einstellungen +cxdevreporting.backoffice.section.reportformat.excel=Excel Einstellungen +cxdevreporting.backoffice.tab.reportschedules=Zeitplan +cxdevreporting.backoffice.section.reportschedules=Einstellungen \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_en.properties new file mode 100644 index 00000000..1e1fa24c --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-labels/labels_en.properties @@ -0,0 +1,11 @@ +cxdevreporting.treenode.reporting=Reporting +cxdevreporting.treenode.reporting.parameters=Parameter +cxdevreporting.backoffice.tab.report=Report +cxdevreporting.backoffice.section.report=Configuration +cxdevreporting.backoffice.panel.general=General +cxdevreporting.backoffice.panel.query=Query +cxdevreporting.backoffice.tab.reportformat=Format +cxdevreporting.backoffice.section.reportformat.csv=CSV settings +cxdevreporting.backoffice.section.reportformat.excel=Excel settings +cxdevreporting.backoffice.tab.reportschedules=Schedules +cxdevreporting.backoffice.section.reportschedules=Settings \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-spring.xml similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-spring.xml index da4ef30b..a686650b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-backoffice-spring.xml @@ -4,7 +4,7 @@ - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-beans.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-beans.xml similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-beans.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-beans.xml index e870aae4..8198ad43 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-beans.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-beans.xml @@ -1,6 +1,6 @@ - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-items.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-items.xml similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-items.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-items.xml index a605e982..20d271a8 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-items.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-items.xml @@ -68,7 +68,7 @@ - tools.sapcx.commerce.reporting.enums.ReportExportFormat.EXCEL + me.cxdev.commerce.reporting.enums.ReportExportFormat.EXCEL @@ -92,43 +92,43 @@ - de.hybris.platform.util.Config.getString("sapcxreporting.report.format.csv.encoding", "UTF-8") + de.hybris.platform.util.Config.getString("cxdevreporting.report.format.csv.encoding", "UTF-8") - de.hybris.platform.util.Config.getChar("sapcxreporting.report.format.csv.commentchar", '#') + de.hybris.platform.util.Config.getChar("cxdevreporting.report.format.csv.commentchar", '#') - de.hybris.platform.util.Config.getChar("sapcxreporting.report.format.csv.fieldseparator", ';') + de.hybris.platform.util.Config.getChar("cxdevreporting.report.format.csv.fieldseparator", ';') - de.hybris.platform.util.Config.getChar("sapcxreporting.report.format.csv.textseparator", '"') + de.hybris.platform.util.Config.getChar("cxdevreporting.report.format.csv.textseparator", '"') - de.hybris.platform.util.Config.getString("sapcxreporting.report.format.csv.linebreak", "\n") + de.hybris.platform.util.Config.getString("cxdevreporting.report.format.csv.linebreak", "\n") - de.hybris.platform.util.Config.getBoolean("sapcxreporting.report.format.excel.highlightheader", false) + de.hybris.platform.util.Config.getBoolean("cxdevreporting.report.format.excel.highlightheader", false) - de.hybris.platform.util.Config.getBoolean("sapcxreporting.report.format.excel.freezeheader", false) + de.hybris.platform.util.Config.getBoolean("cxdevreporting.report.format.excel.freezeheader", false) - de.hybris.platform.util.Config.getBoolean("sapcxreporting.report.format.excel.activatefilter", false) + de.hybris.platform.util.Config.getBoolean("cxdevreporting.report.format.excel.activatefilter", false) - de.hybris.platform.util.Config.getBoolean("sapcxreporting.report.format.excel.autosizecolumns", false) + de.hybris.platform.util.Config.getBoolean("cxdevreporting.report.format.excel.autosizecolumns", false) - de.hybris.platform.util.Config.getBoolean("sapcxreporting.report.format.excel.alternatinglines", false) + de.hybris.platform.util.Config.getBoolean("cxdevreporting.report.format.excel.alternatinglines", false) diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-spring.xml new file mode 100644 index 00000000..d8516bcb --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting-spring.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting/sampledata/default-reports.impex b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting/sampledata/default-reports.impex similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting/sampledata/default-reports.impex rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/cxdevreporting/sampledata/default-reports.impex diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/localization/cxdevreporting-locales_de.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales_de.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/localization/cxdevreporting-locales_de.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/localization/cxdevreporting-locales_en.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales_en.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/resources/localization/cxdevreporting-locales_en.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/constants/CxReportingConstants.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/constants/CxReportingConstants.java similarity index 73% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/constants/CxReportingConstants.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/constants/CxReportingConstants.java index b79e63e9..6887f24b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/constants/CxReportingConstants.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/constants/CxReportingConstants.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.reporting.constants; +package me.cxdev.commerce.reporting.constants; /** * Global class for all constants. This class is required by the platform and * will not been used for any other purpose. */ public final class CxReportingConstants extends GeneratedCxReportingConstants { - public static final String EXTENSIONNAME = "sapcxreporting"; + public static final String EXTENSIONNAME = "cxdevreporting"; private CxReportingConstants() { // empty to avoid instantiating this constant class diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java similarity index 79% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java index dd85700e..a6553a16 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ReportGenerationScheduleInitDefaultInterceptor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.domain; +package me.cxdev.commerce.reporting.domain; import de.hybris.platform.servicelayer.exceptions.AmbiguousIdentifierException; import de.hybris.platform.servicelayer.exceptions.ModelNotFoundException; @@ -9,15 +9,19 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; -import tools.sapcx.commerce.reporting.model.ReportGenerationScheduleModel; +import me.cxdev.commerce.reporting.model.ReportGenerationScheduleModel; public class ReportGenerationScheduleInitDefaultInterceptor implements InitDefaultsInterceptor { private static final Logger LOG = LoggerFactory.getLogger(ReportGenerationScheduleInitDefaultInterceptor.class); - private FlexibleSearchService flexibleSearchService; - private String jobCode; + private final FlexibleSearchService flexibleSearchService; + private final String jobCode; + + public ReportGenerationScheduleInitDefaultInterceptor(FlexibleSearchService flexibleSearchService, String jobCode) { + this.flexibleSearchService = flexibleSearchService; + this.jobCode = jobCode; + } @Override public void onInitDefaults(ReportGenerationScheduleModel cronJob, InterceptorContext interceptorContext) { @@ -38,14 +42,4 @@ private ServicelayerJobModel getServiceLayerJob() { return null; } } - - @Required - public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService) { - this.flexibleSearchService = flexibleSearchService; - } - - @Required - public void setJobCode(String jobCode) { - this.jobCode = jobCode; - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java similarity index 71% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java index 4c7d8cc8..888f2f32 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandler.java @@ -1,15 +1,18 @@ -package tools.sapcx.commerce.reporting.domain; +package me.cxdev.commerce.reporting.domain; import de.hybris.platform.servicelayer.config.ConfigurationService; import de.hybris.platform.servicelayer.model.attribute.AbstractDynamicAttributeHandler; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Required; -import tools.sapcx.commerce.reporting.model.ConfigurationPropertyAccessorModel; +import me.cxdev.commerce.reporting.model.ConfigurationPropertyAccessorModel; public class ValueFieldOfConfigurationPropertyAccessorAttributeHandler extends AbstractDynamicAttributeHandler { - private ConfigurationService configurationService; + private final ConfigurationService configurationService; + + public ValueFieldOfConfigurationPropertyAccessorAttributeHandler(ConfigurationService configurationService) { + this.configurationService = configurationService; + } @Override public String get(ConfigurationPropertyAccessorModel model) { @@ -24,9 +27,4 @@ public void set(ConfigurationPropertyAccessorModel model, String value) { configurationService.getConfiguration().setProperty(key, value); } } - - @Required - public void setConfigurationService(ConfigurationService configurationService) { - this.configurationService = configurationService; - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ExcelDocumentNotAvailableException.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ExcelDocumentNotAvailableException.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ExcelDocumentNotAvailableException.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ExcelDocumentNotAvailableException.java index cb0e88eb..78a32fa0 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ExcelDocumentNotAvailableException.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ExcelDocumentNotAvailableException.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.download; +package me.cxdev.commerce.reporting.download; public class ExcelDocumentNotAvailableException extends RuntimeException { public ExcelDocumentNotAvailableException() { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ReportDownloadFacade.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ReportDownloadFacade.java similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ReportDownloadFacade.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ReportDownloadFacade.java index ca4d7587..661e4d2f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/ReportDownloadFacade.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/ReportDownloadFacade.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.download; +package me.cxdev.commerce.reporting.download; import java.io.InputStream; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SelfDeletingFileInputStream.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SelfDeletingFileInputStream.java similarity index 78% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SelfDeletingFileInputStream.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SelfDeletingFileInputStream.java index f13b5762..ea227a3a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SelfDeletingFileInputStream.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SelfDeletingFileInputStream.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.download; +package me.cxdev.commerce.reporting.download; import java.io.File; import java.io.FileInputStream; @@ -7,7 +7,7 @@ import org.apache.commons.io.FileUtils; -public class SelfDeletingFileInputStream extends FileInputStream { +class SelfDeletingFileInputStream extends FileInputStream { private final File file; public SelfDeletingFileInputStream(File file) throws FileNotFoundException { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SolrReportDownloadFacade.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SolrReportDownloadFacade.java similarity index 77% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SolrReportDownloadFacade.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SolrReportDownloadFacade.java index 0b54d85d..31e7233b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/download/SolrReportDownloadFacade.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/download/SolrReportDownloadFacade.java @@ -1,19 +1,19 @@ -package tools.sapcx.commerce.reporting.download; +package me.cxdev.commerce.reporting.download; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.Map; -import tools.sapcx.commerce.reporting.enums.ReportExportFormat; -import tools.sapcx.commerce.reporting.report.ReportService; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.AbstractGenericSearchFacade; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.enums.ReportExportFormat; +import me.cxdev.commerce.reporting.report.ReportService; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.AbstractGenericSearchFacade; +import me.cxdev.commerce.reporting.search.GenericSearchResult; public class SolrReportDownloadFacade implements ReportDownloadFacade { - private ReportService reportService; - private Map> reportSearchFacades; + private final ReportService reportService; + private final Map> reportSearchFacades; public SolrReportDownloadFacade(ReportService reportService, Map> reportSearchFacades) { this.reportService = reportService; diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGenerator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGenerator.java new file mode 100644 index 00000000..a5d033e9 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGenerator.java @@ -0,0 +1,12 @@ +package me.cxdev.commerce.reporting.generator; + +import java.io.File; + +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; + +public interface ReportGenerator { + boolean createReport(QueryFileConfigurationData report, GenericSearchResult searchResult, File file); + + String getExtension(); +} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGeneratorJobPerformable.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGeneratorJobPerformable.java similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGeneratorJobPerformable.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGeneratorJobPerformable.java index d9c29286..c884663b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGeneratorJobPerformable.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/ReportGeneratorJobPerformable.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator; +package me.cxdev.commerce.reporting.generator; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -18,9 +18,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import javax.activation.DataSource; -import javax.mail.util.ByteArrayDataSource; - import de.hybris.platform.cronjob.enums.CronJobResult; import de.hybris.platform.cronjob.enums.CronJobStatus; import de.hybris.platform.media.services.MimeService; @@ -33,33 +30,48 @@ import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.assertj.core.util.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.model.ReportGenerationScheduleModel; -import tools.sapcx.commerce.reporting.report.ReportService; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; -import tools.sapcx.commerce.reporting.search.GenericSearchService; -import tools.sapcx.commerce.toolkit.email.HtmlEmailGenerator; -import tools.sapcx.commerce.toolkit.email.HtmlEmailService; +import jakarta.activation.DataSource; +import jakarta.mail.util.ByteArrayDataSource; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.model.ReportGenerationScheduleModel; +import me.cxdev.commerce.reporting.report.ReportService; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.search.GenericSearchService; +import me.cxdev.commerce.toolkit.email.HtmlEmailGenerator; +import me.cxdev.commerce.toolkit.email.HtmlEmailService; public class ReportGeneratorJobPerformable extends AbstractJobPerformable { private static final Logger LOG = LoggerFactory.getLogger(ReportGeneratorJobPerformable.class); private static final int BYTES_TO_READ = 20; - private GenericSearchService genericSearchService; - private ReportService reportService; - private HtmlEmailGenerator htmlEmailGenerator; - private HtmlEmailService htmlEmailService; - private MimeService mimeService; - - private Converter queryConfigurationConverter; + private final GenericSearchService genericSearchService; + private final ReportService reportService; + private final HtmlEmailGenerator htmlEmailGenerator; + private final HtmlEmailService htmlEmailService; + private final MimeService mimeService; + private final Converter queryConfigurationConverter; + + public ReportGeneratorJobPerformable( + GenericSearchService genericSearchService, + ReportService reportService, + HtmlEmailGenerator htmlEmailGenerator, + HtmlEmailService htmlEmailService, + MimeService mimeService, + Converter queryConfigurationConverter) { + this.genericSearchService = genericSearchService; + this.reportService = reportService; + this.htmlEmailGenerator = htmlEmailGenerator; + this.htmlEmailService = htmlEmailService; + this.mimeService = mimeService; + this.queryConfigurationConverter = queryConfigurationConverter; + } @Override public PerformResult perform(ReportGenerationScheduleModel schedule) { @@ -220,34 +232,4 @@ private String getMime(File file) { } return "application/octet-stream"; } - - @Required - public void setGenericSearchService(GenericSearchService genericSearchService) { - this.genericSearchService = genericSearchService; - } - - @Required - public void setReportService(ReportService reportService) { - this.reportService = reportService; - } - - @Required - public void setHtmlEmailGenerator(HtmlEmailGenerator htmlEmailGenerator) { - this.htmlEmailGenerator = htmlEmailGenerator; - } - - @Required - public void setMimeService(MimeService mimeService) { - this.mimeService = mimeService; - } - - @Required - public void setHtmlEmailService(HtmlEmailService htmlEmailService) { - this.htmlEmailService = htmlEmailService; - } - - @Required - public void setQueryConfigurationConverter(Converter queryConfigurationConverter) { - this.queryConfigurationConverter = queryConfigurationConverter; - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvLineBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvLineBuilder.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvLineBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvLineBuilder.java index 2fe0506b..f5663d67 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvLineBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvLineBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator.csv; +package me.cxdev.commerce.reporting.generator.csv; import java.util.HashMap; import java.util.Iterator; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportGenerator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportGenerator.java similarity index 83% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportGenerator.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportGenerator.java index d61d27b4..e549c69e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportGenerator.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportGenerator.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator.csv; +package me.cxdev.commerce.reporting.generator.csv; import java.io.File; import java.io.IOException; @@ -7,10 +7,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import tools.sapcx.commerce.reporting.generator.ReportGenerator; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; -import tools.sapcx.commerce.reporting.search.GenericSearchResultHeader; +import me.cxdev.commerce.reporting.generator.ReportGenerator; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.search.GenericSearchResultHeader; public class CsvReportGenerator implements ReportGenerator { private static final Logger LOG = LoggerFactory.getLogger(CsvReportGenerator.class); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportWriter.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportWriter.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportWriter.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportWriter.java index e368ddfa..ac66098c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/csv/CsvReportWriter.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/csv/CsvReportWriter.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator.csv; +package me.cxdev.commerce.reporting.generator.csv; import java.io.File; import java.io.FileNotFoundException; @@ -9,8 +9,8 @@ import org.apache.commons.lang3.StringUtils; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; /** * Implementation of the {@link CSVWriter} that takes the configuration for the CSV file from the underlying diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/excel/ExcelReportGenerator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/excel/ExcelReportGenerator.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/excel/ExcelReportGenerator.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/excel/ExcelReportGenerator.java index c5e2f312..85ec3353 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/excel/ExcelReportGenerator.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/generator/excel/ExcelReportGenerator.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator.excel; +package me.cxdev.commerce.reporting.generator.excel; import java.io.File; import java.io.FileOutputStream; @@ -17,10 +17,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import tools.sapcx.commerce.reporting.generator.ReportGenerator; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; -import tools.sapcx.commerce.reporting.search.GenericSearchResultHeader; +import me.cxdev.commerce.reporting.generator.ReportGenerator; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.search.GenericSearchResultHeader; public class ExcelReportGenerator implements ReportGenerator { private static final Logger LOG = LoggerFactory.getLogger(ExcelReportGenerator.class); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/populators/QueryReportConfigurationPopulator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/populators/QueryReportConfigurationPopulator.java similarity index 85% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/populators/QueryReportConfigurationPopulator.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/populators/QueryReportConfigurationPopulator.java index 71087d88..7035049d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/populators/QueryReportConfigurationPopulator.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/populators/QueryReportConfigurationPopulator.java @@ -1,10 +1,10 @@ -package tools.sapcx.commerce.reporting.populators; +package me.cxdev.commerce.reporting.populators; import de.hybris.platform.converters.Populator; import de.hybris.platform.servicelayer.dto.converter.ConversionException; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; public class QueryReportConfigurationPopulator implements Populator { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/DefaultReportService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/DefaultReportService.java similarity index 81% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/DefaultReportService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/DefaultReportService.java index 9d0787e4..0c322978 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/DefaultReportService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/DefaultReportService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.report; +package me.cxdev.commerce.reporting.report; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -13,19 +13,22 @@ import org.assertj.core.util.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; -import tools.sapcx.commerce.reporting.enums.ReportExportFormat; -import tools.sapcx.commerce.reporting.generator.ReportGenerator; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationParameterModel; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.enums.ReportExportFormat; +import me.cxdev.commerce.reporting.generator.ReportGenerator; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationParameterModel; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; public class DefaultReportService implements ReportService { private static final Logger LOG = LoggerFactory.getLogger(DefaultReportService.class); - private Map generators; + private final Map generators; + + public DefaultReportService(Map generators) { + this.generators = generators; + } @Override public Optional getReportFile(QueryFileConfigurationData report, GenericSearchResult result) { @@ -92,7 +95,7 @@ public Map getReportParameters(QueryReportConfigurationModel rep public File getReportDirectory() { File reportDir = FileUtils.getTempDirectory() .toPath() - .resolve("sapcxtools") + .resolve("cxdevtools") .resolve("reports") .toFile(); if (!reportDir.exists()) { @@ -105,9 +108,4 @@ public File getReportDirectory() { public List getConfiguredReportFormats() { return generators.keySet().stream().collect(Collectors.toList()); } - - @Required - public void setGenerators(Map generators) { - this.generators = generators; - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/ReportService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/ReportService.java similarity index 77% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/ReportService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/ReportService.java index 85ef386b..11150df5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/report/ReportService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/report/ReportService.java @@ -1,14 +1,14 @@ -package tools.sapcx.commerce.reporting.report; +package me.cxdev.commerce.reporting.report; import java.io.File; import java.util.List; import java.util.Map; import java.util.Optional; -import tools.sapcx.commerce.reporting.enums.ReportExportFormat; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.enums.ReportExportFormat; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; /** * Service to turn a generic search result into medias. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/AbstractGenericSearchFacade.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/AbstractGenericSearchFacade.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/AbstractGenericSearchFacade.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/AbstractGenericSearchFacade.java index f646b1c9..9d9927f7 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/AbstractGenericSearchFacade.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/AbstractGenericSearchFacade.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import static org.apache.commons.collections4.ListUtils.emptyIfNull; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/FlexibleSearchGenericSearchService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/FlexibleSearchGenericSearchService.java similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/FlexibleSearchGenericSearchService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/FlexibleSearchGenericSearchService.java index 104ec396..7d13bcc4 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/FlexibleSearchGenericSearchService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/FlexibleSearchGenericSearchService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import java.sql.Connection; import java.sql.PreparedStatement; @@ -32,7 +32,6 @@ import org.assertj.core.util.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; /** * Implements the {@link GenericSearchService} interface performing searches based on the {@link DefaultFlexibleSearchService}. It supports @@ -43,10 +42,18 @@ public class FlexibleSearchGenericSearchService implements GenericSearchService private static final Logger LOG = LoggerFactory.getLogger(FlexibleSearchGenericSearchService.class); private static final String LOG_MSG_TRANSLATION_INPUT = "FlexibleSearchQuery object for translation: [query: %s], [query parameters: %s], [user - %s], [count - -1], [locale - %s], [ctgVer - %s]"; - private UserService userService; - private SessionService sessionService; - private CatalogVersionService catalogVersionService; - private DefaultFlexibleSearchService flexibleSearchService; + private final UserService userService; + private final SessionService sessionService; + private final CatalogVersionService catalogVersionService; + private final DefaultFlexibleSearchService flexibleSearchService; + + public FlexibleSearchGenericSearchService(UserService userService, SessionService sessionService, CatalogVersionService catalogVersionService, + DefaultFlexibleSearchService flexibleSearchService) { + this.userService = userService; + this.sessionService = sessionService; + this.catalogVersionService = catalogVersionService; + this.flexibleSearchService = flexibleSearchService; + } @Override public GenericSearchResult search(String query, Map parameters) { @@ -193,26 +200,6 @@ private String getValue(ResultSet resultSet, GenericSearchResultHeader columnHea return null; } - @Required - public void setUserService(UserService userService) { - this.userService = userService; - } - - @Required - public void setSessionService(SessionService sessionService) { - this.sessionService = sessionService; - } - - @Required - public void setCatalogVersionService(CatalogVersionService catalogVersionService) { - this.catalogVersionService = catalogVersionService; - } - - @Required - public void setFlexibleSearchService(DefaultFlexibleSearchService flexibleSearchService) { - this.flexibleSearchService = flexibleSearchService; - } - private class Execution extends SessionExecutionBody { private String query; private Map parameters; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResult.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResult.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResult.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResult.java index b1842c55..15bb4f0b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResult.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResult.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.collections4.ListUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; public class GenericSearchResult { private List headers; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResultHeader.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResultHeader.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResultHeader.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResultHeader.java index 667c58da..62823171 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchResultHeader.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchResultHeader.java @@ -1,6 +1,6 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchService.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchService.java index c3b27f82..2a446b8f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/search/GenericSearchService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/src/me/cxdev/commerce/reporting/search/GenericSearchService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import java.util.Map; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/config/ExtensionConfigurationTests.java similarity index 58% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/config/ExtensionConfigurationTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/config/ExtensionConfigurationTests.java index 883ec015..45749f84 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/config/ExtensionConfigurationTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/config/ExtensionConfigurationTests.java @@ -1,19 +1,19 @@ -package tools.sapcx.commerce.reporting.config; +package me.cxdev.commerce.reporting.config; import de.hybris.bootstrap.annotations.UnitTest; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; +import me.cxdev.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; @UnitTest public class ExtensionConfigurationTests { @Test public void extensionConfiguration() { InstalledExtensionVerifier.verifier() - .requires("sapcxreporting") + .requires("cxdevreporting") .requires("platformbackoffice") - .requires("sapcommercetoolkit") + .requires("cxdevtoolkit") .verify(); } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java similarity index 73% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java index a006e29c..59960315 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ReportGeneratorCronJobInitDefaultInterceptorTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.domain; +package me.cxdev.commerce.reporting.domain; import static org.assertj.core.api.Assertions.assertThat; @@ -10,10 +10,10 @@ import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.reporting.model.ReportGenerationScheduleModel; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.InterceptorContextStub; -import tools.sapcx.commerce.toolkit.testing.testdoubles.search.FlexibleSearchServiceStub; +import me.cxdev.commerce.reporting.model.ReportGenerationScheduleModel; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.testdoubles.core.InterceptorContextStub; +import me.cxdev.commerce.toolkit.testing.testdoubles.search.FlexibleSearchServiceStub; @UnitTest public class ReportGeneratorCronJobInitDefaultInterceptorTests { @@ -23,16 +23,13 @@ public class ReportGeneratorCronJobInitDefaultInterceptorTests { @Before public void setUp() throws Exception { interceptorContext = InterceptorContextStub.interceptorContext().stub(); - - interceptor = new ReportGenerationScheduleInitDefaultInterceptor(); - interceptor.setJobCode("jobCode"); } @Test public void ifJobIsNotFound_cronJobWillRemainWithoutAJob() throws InterceptorException { ReportGenerationScheduleModel cronJob = InMemoryModelFactory.createTestableItemModel(ReportGenerationScheduleModel.class); - interceptor.setFlexibleSearchService(new FlexibleSearchServiceStub()); + interceptor = new ReportGenerationScheduleInitDefaultInterceptor(new FlexibleSearchServiceStub(), "jobCode"); interceptor.onInitDefaults(cronJob, interceptorContext); assertThat(cronJob.getJob()).isNull(); @@ -44,7 +41,7 @@ public void emptyCronJobWillBeFilledWithJob() throws InterceptorException { ServicelayerJobModel job = InMemoryModelFactory.createTestableItemModel(ServicelayerJobModel.class); job.setCode("jobCode"); - interceptor.setFlexibleSearchService(new FlexibleSearchServiceStub(job)); + interceptor = new ReportGenerationScheduleInitDefaultInterceptor(new FlexibleSearchServiceStub(job), "jobCode"); interceptor.onInitDefaults(cronJob, interceptorContext); assertThat(cronJob.getJob()).isEqualTo(job); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java similarity index 85% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java index 54667496..35b60055 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/domain/ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests.java @@ -1,21 +1,21 @@ -package tools.sapcx.commerce.reporting.domain; +package me.cxdev.commerce.reporting.domain; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; import static org.assertj.core.api.Assertions.assertThat; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; import de.hybris.bootstrap.annotations.UnitTest; -import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration2.Configuration; import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.reporting.model.ConfigurationPropertyAccessorModel; -import tools.sapcx.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; +import me.cxdev.commerce.reporting.model.ConfigurationPropertyAccessorModel; +import me.cxdev.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; @UnitTest public class ValueFieldOfConfigurationPropertyAccessorAttributeHandlerTests { private ConfigurationServiceFake configurationService; - private ValueFieldOfConfigurationPropertyAccessorAttributeHandler handler = new ValueFieldOfConfigurationPropertyAccessorAttributeHandler(); + private ValueFieldOfConfigurationPropertyAccessorAttributeHandler handler; @Before public void setUp() throws Exception { @@ -23,7 +23,7 @@ public void setUp() throws Exception { configurationService.setProperty("sample.key1", "custom value 1"); configurationService.setProperty("sample.key2", "custom value 2"); - handler.setConfigurationService(configurationService); + handler = new ValueFieldOfConfigurationPropertyAccessorAttributeHandler(configurationService); } @Test @@ -66,7 +66,7 @@ public void whenNoConfigurationKeyIsProvided_verifyThatSetterIgnoresValue() { handler.set(configurationItem, "override"); Configuration configuration = configurationService.getConfiguration(); - assertThat(configuration.getKeys()).hasSize(2); + assertThat(configuration.getKeys()).toIterable().hasSize(2); } @Test diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/generator/csv/CsvReportGeneratorTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/generator/csv/CsvReportGeneratorTests.java similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/generator/csv/CsvReportGeneratorTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/generator/csv/CsvReportGeneratorTests.java index 66ad520b..4d5ec477 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/generator/csv/CsvReportGeneratorTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/generator/csv/CsvReportGeneratorTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.generator.csv; +package me.cxdev.commerce.reporting.generator.csv; import static org.assertj.core.api.Assertions.assertThat; @@ -14,9 +14,9 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; -import tools.sapcx.commerce.reporting.search.GenericSearchResultHeader; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.reporting.search.GenericSearchResultHeader; @UnitTest public class CsvReportGeneratorTests { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/report/DefaultReportServiceTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/report/DefaultReportServiceTests.java similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/report/DefaultReportServiceTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/report/DefaultReportServiceTests.java index 1cf0b372..20f1219f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/report/DefaultReportServiceTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/report/DefaultReportServiceTests.java @@ -1,8 +1,8 @@ -package tools.sapcx.commerce.reporting.report; +package me.cxdev.commerce.reporting.report; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -24,15 +24,15 @@ import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.reporting.enums.ReportExportFormat; -import tools.sapcx.commerce.reporting.generator.ReportGenerator; -import tools.sapcx.commerce.reporting.model.CatalogVersionConfigurationParameterModel; -import tools.sapcx.commerce.reporting.model.CategoryConfigurationParameterModel; -import tools.sapcx.commerce.reporting.model.ProductConfigurationParameterModel; -import tools.sapcx.commerce.reporting.model.QueryReportConfigurationModel; -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.reporting.enums.ReportExportFormat; +import me.cxdev.commerce.reporting.generator.ReportGenerator; +import me.cxdev.commerce.reporting.model.CatalogVersionConfigurationParameterModel; +import me.cxdev.commerce.reporting.model.CategoryConfigurationParameterModel; +import me.cxdev.commerce.reporting.model.ProductConfigurationParameterModel; +import me.cxdev.commerce.reporting.model.QueryReportConfigurationModel; +import me.cxdev.commerce.reporting.report.data.QueryFileConfigurationData; +import me.cxdev.commerce.reporting.search.GenericSearchResult; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; @UnitTest public class DefaultReportServiceTests { @@ -56,15 +56,14 @@ public void setUp() throws Exception { when(reportGenerator.getExtension()).thenReturn("csv"); when(reportGenerator.createReport(eq(fileConfiguration), eq(EMPTY_SEARCH_RESULT), any(File.class))).thenReturn(true); - service = new DefaultReportService(); - service.setGenerators(Map.of(ReportExportFormat.CSV, reportGenerator)); + service = new DefaultReportService(Map.of(ReportExportFormat.CSV, reportGenerator)); } @Test public void verifyReportDirectoryIsExisting() { File reportDirectory = service.getReportDirectory(); assertThat(reportDirectory.exists()).isTrue(); - assertThat(reportDirectory.getAbsolutePath()).endsWith("sapcxtools/reports"); + assertThat(reportDirectory.getAbsolutePath()).endsWith("cxdevtools/reports"); } @Test @@ -74,7 +73,7 @@ public void verifyReportDirectoryIsRecreatedIfMissing() throws IOException { File reportDirectory = service.getReportDirectory(); assertThat(reportDirectory.exists()).isTrue(); - assertThat(reportDirectory.getAbsolutePath()).endsWith("sapcxtools/reports"); + assertThat(reportDirectory.getAbsolutePath()).endsWith("cxdevtools/reports"); } @Test @@ -140,15 +139,13 @@ public void whenReportFileCannotBeCreated_noReportIsGenerated() throws IOExcepti File fileUnabledToBeCreated = mock(File.class); when(fileUnabledToBeCreated.exists()).thenReturn(false); when(fileUnabledToBeCreated.createNewFile()).thenReturn(false); - // doThrow(IOException.class).when(fileUnabledToBeCreated).createNewFile(); - service = new DefaultReportService() { + service = new DefaultReportService(Map.of(ReportExportFormat.CSV, reportGenerator)) { @Override protected File getTemporaryReportFile(String filename) { return fileUnabledToBeCreated; } }; - service.setGenerators(Map.of(ReportExportFormat.CSV, reportGenerator)); Optional reportFile = service.getReportFile(fileConfiguration, EMPTY_SEARCH_RESULT); @@ -162,18 +159,16 @@ public void whenReportFileCreationFails_noReportIsGenerated() throws IOException when(fileUnabledToBeCreated.exists()).thenReturn(false); doThrow(IOException.class).when(fileUnabledToBeCreated).createNewFile(); - service = new DefaultReportService() { + service = new DefaultReportService(Map.of(ReportExportFormat.CSV, reportGenerator)) { @Override protected File getTemporaryReportFile(String filename) { return fileUnabledToBeCreated; } }; - service.setGenerators(Map.of(ReportExportFormat.CSV, reportGenerator)); Optional reportFile = service.getReportFile(fileConfiguration, EMPTY_SEARCH_RESULT); assertThat(reportFile).isNotPresent(); verify(reportGenerator, never()).createReport(eq(fileConfiguration), eq(EMPTY_SEARCH_RESULT), any(File.class)); } - } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java similarity index 87% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java index 13967cf4..4bc1bfc5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/DefaultGenericFlexibleSearchTests.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; @@ -40,12 +40,12 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; -import tools.sapcx.commerce.toolkit.testing.testdoubles.catalog.CatalogVersionServiceFake; -import tools.sapcx.commerce.toolkit.testing.testdoubles.user.SessionServiceFake; -import tools.sapcx.commerce.toolkit.testing.testdoubles.user.UserServiceFake; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.testdoubles.catalog.CatalogVersionServiceFake; +import me.cxdev.commerce.toolkit.testing.testdoubles.user.SessionServiceFake; +import me.cxdev.commerce.toolkit.testing.testdoubles.user.UserServiceFake; @UnitTest @RunWith(MockitoJUnitRunner.class) @@ -68,22 +68,7 @@ public class DefaultGenericFlexibleSearchTests { private GenericSearchResultHeader header2; private ResultSetMock resultSetFake; - private FlexibleSearchGenericSearchService genericFlexibleSearch = new FlexibleSearchGenericSearchService() { - @Override - protected boolean isHanaUsed() { - return false; - } - - @Override - protected void fillStatement(PreparedStatement statement, List values) throws IllegalArgumentException, SQLException { - return; - } - - @Override - HybrisDataSource getDatasource() { - return tenant.getDataSource(); - } - }; + private FlexibleSearchGenericSearchService genericFlexibleSearch; @Before public void setup() throws SQLException { @@ -101,10 +86,22 @@ public void setup() throws SQLException { ((CatalogVersionServiceFake) catalogVersionService) .setReadableCatalogVersions(Collections.singletonList(InMemoryModelFactory.createTestableItemModel(CatalogVersionModel.class))); - genericFlexibleSearch.setUserService(userService); - genericFlexibleSearch.setSessionService(sessionService); - genericFlexibleSearch.setCatalogVersionService(catalogVersionService); - genericFlexibleSearch.setFlexibleSearchService(flexibleSearchService); + genericFlexibleSearch = new FlexibleSearchGenericSearchService(userService, sessionService, catalogVersionService, flexibleSearchService) { + @Override + protected boolean isHanaUsed() { + return false; + } + + @Override + protected void fillStatement(PreparedStatement statement, List values) throws IllegalArgumentException, SQLException { + return; + } + + @Override + HybrisDataSource getDatasource() { + return tenant.getDataSource(); + } + }; header1 = new GenericSearchResultHeader(1, "col1", "Column 1"); header2 = new GenericSearchResultHeader(2, "col2", "Column 2"); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/GenericSearchResultHeaderTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/GenericSearchResultHeaderTests.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/GenericSearchResultHeaderTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/GenericSearchResultHeaderTests.java index 2e5f2c8e..c5d96176 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/GenericSearchResultHeaderTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/GenericSearchResultHeaderTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMetaDataMock.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMetaDataMock.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMetaDataMock.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMetaDataMock.java index 49a066bd..cace31f9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMetaDataMock.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMetaDataMock.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import java.sql.ResultSetMetaData; import java.sql.SQLException; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMock.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMock.java similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMock.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMock.java index 74ab3dc4..440726af 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/testsrc/tools/sapcx/commerce/reporting/search/ResultSetMock.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevreporting/testsrc/me/cxdev/commerce/reporting/search/ResultSetMock.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.reporting.search; +package me.cxdev.commerce.reporting.search; import java.io.ByteArrayInputStream; import java.io.InputStream; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.gitignore b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.gitignore similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.gitignore rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.gitignore index 4c820fbb..a90b6578 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.gitignore +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.gitignore @@ -7,7 +7,7 @@ testclasses eclipsebin gensrc -# .classpath files and lib folder in sapcxtools to ignore +# .classpath files and lib folder in cxdevtools to ignore .classpath lib/ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.project b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.project similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.project rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.project index ed9d8896..b5f56500 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/.project +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/.project @@ -1,6 +1,6 @@ - sapcommercetoolkit + cxdevtoolkit diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/LICENSE.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/LICENSE.md similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/LICENSE.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/LICENSE.md index 9776fe0d..8676c108 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/LICENSE.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/LICENSE.md @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2025] [SAP CX Tools] + Copyright [2025] [CX DEV Tools] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/README.md b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/README.md similarity index 74% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/README.md rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/README.md index 22667ddf..57f1f7f0 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/README.md +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/README.md @@ -1,6 +1,6 @@ # SAP Commerce Toolkit -The `sapcommercetoolkit` extension improves the SAP Commerce developer experience by offering a number of helpful functions optimizing the +The `cxdevtoolkit` extension improves the SAP Commerce developer experience by offering a number of helpful functions optimizing the maintenance & operation of the platform, including data imports (essential, initial, sample & test), handling of emails, and a feature to run unit tests without bootstrapping the platform, incl. a series of test doubles and builders that make writing unit tests easier. @@ -14,9 +14,9 @@ With this implementation, the logging can be enhanced to print all errors and ex ### How to activate and use Example: To enable better logging for catalog synchronization failures, one has to do the following steps: -1) Activate the spring profile 'sapcommercetools-modelservice-failurelogging' +1) Activate the spring profile 'cxdevtoolkit-modelservice-failurelogging' 2) Reduce the logging level of the following loggers to DEBUG -- `tools.sapcx.commerce.toolkit.model.FailureLoggingModelService` +- `me.cxdev.commerce.toolkit.model.FailureLoggingModelService` - `de.hybris.platform.servicelayer.internal.model.impl.DefaultModelService` 3) Set the following properties: - `synchronization.itemcopycreator.stacktraces=true` @@ -47,27 +47,27 @@ default SAP extensions. | Parameter | Type | Description | |------------------------------------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| sapcommercetoolkit.impeximport.configuration.legacymode | Boolean | Flag for running all impex imports in legacy mode
(default: `false`) | -| sapcommercetoolkit.impeximport.configuration.enablecodeexecution | Boolean | Flag for running all impex imports with code execution
(default: `true`) | -| sapcommercetoolkit.impeximport.configuration.validationmode | String | Validation mode for running impex imports
(default: `strict`) | -| sapcommercetoolkit.impeximport.configuration.defaultlocale | String | Default locale for running impex imports
(default: `en`) | -| sapcommercetoolkit.impeximport.environment.legacysystemsetup | Booelan | Define if the legacy system setup mode shall be used. With legacy mode, the system setup is executed from within this extension. Otherwise, the project needs to trigger the system setup.
(default: `true`) | -| sapcommercetoolkit.impeximport.environment.configurationfile | String | Path to the configuration file that is generated and maintained by the extension. This path must be shared between all cluster nodes!
(default: `${HYBRIS_DATA_DIR}/sapcommercetoolkit/configuration.properties`) | -| sapcommercetoolkit.impeximport.environment.isdevelopment | Boolean | Flag for development environments. If an environment is flagged as development, all sample data and test data imports are performed.
(default: `false`) | -| sapcommercetoolkit.impeximport.environment.supportlocalizedfiles | Boolean | Add support for localized files for all activated languages.
(default: `false`) | -| sapcommercetoolkit.impeximport.environment.importsampledata | Boolean | If the flag is set to true, sample data imports are performed on this environment.
(default: `false`) | -| sapcommercetoolkit.impeximport.environment.importtestdata | Boolean | If the flag is set to true, test data imports are performed on this environment.
(default: `false`) | +| cxdevtoolkit.impeximport.configuration.legacymode | Boolean | Flag for running all impex imports in legacy mode
(default: `false`) | +| cxdevtoolkit.impeximport.configuration.enablecodeexecution | Boolean | Flag for running all impex imports with code execution
(default: `true`) | +| cxdevtoolkit.impeximport.configuration.validationmode | String | Validation mode for running impex imports
(default: `strict`) | +| cxdevtoolkit.impeximport.configuration.defaultlocale | String | Default locale for running impex imports
(default: `en`) | +| cxdevtoolkit.impeximport.environment.legacysystemsetup | Booelan | Define if the legacy system setup mode shall be used. With legacy mode, the system setup is executed from within this extension. Otherwise, the project needs to trigger the system setup.
(default: `true`) | +| cxdevtoolkit.impeximport.environment.configurationfile | String | Path to the configuration file that is generated and maintained by the extension. This path must be shared between all cluster nodes!
(default: `${HYBRIS_DATA_DIR}/cxdevtoolkit/configuration.properties`) | +| cxdevtoolkit.impeximport.environment.isdevelopment | Boolean | Flag for development environments. If an environment is flagged as development, all sample data and test data imports are performed.
(default: `false`) | +| cxdevtoolkit.impeximport.environment.supportlocalizedfiles | Boolean | Add support for localized files for all activated languages.
(default: `false`) | +| cxdevtoolkit.impeximport.environment.importsampledata | Boolean | If the flag is set to true, sample data imports are performed on this environment.
(default: `false`) | +| cxdevtoolkit.impeximport.environment.importtestdata | Boolean | If the flag is set to true, test data imports are performed on this environment.
(default: `false`) | ### How to activate and use The feature itself is activated immediately, but it does not perform any operation without your custom configuration. -Import files can be specified in any property file that is considered as a SAP CX configuration location, e.g.: +Import files can be specified in any property file that is considered as a CX DEV configuration location, e.g.: - properties area of manifest.json file - global local.properties file - extension specific project.properties file -The pattern needs to apply to the following rule: `sapcommercetoolkit.impeximport..[.].` +The pattern needs to apply to the following rule: `cxdevtoolkit.impeximport..[.].` - `` must be one of the stages mentioned above - `` only required for type releasepatch! It must identify the release version with alphanumeric ordering. In other words you must guarantee that the order or the release versions is correct, as the mechanism relies on alphanumerical order. @@ -77,32 +77,32 @@ The pattern needs to apply to the following rule: `sapcommercetoolkit.impeximpor #### Sample configuration ```properties -sapcommercetoolkit.impeximport.elementarydata.0100.coredata=/path/to/file.impex -sapcommercetoolkit.impeximport.elementarydata.0500.catalogs=/path/to/file.impex -sapcommercetoolkit.impeximport.releasepatch.release1x0x0.0001.datamigration=/path/to/file.impex -sapcommercetoolkit.impeximport.releasepatch.release1x1x0.0001.datamigration=/path/to/file.impex -sapcommercetoolkit.impeximport.releasepatch.release2x0x0.0001.insertdefaultvalue=/path/to/file.impex -sapcommercetoolkit.impeximport.essentialdata.0010.userrights=/path/to/file.impex -sapcommercetoolkit.impeximport.essentialdata.0300.solrconfiguration=/path/to/file.impex -sapcommercetoolkit.impeximport.essentialdata.5000.cmstemplates=/path/to/file.impex -sapcommercetoolkit.impeximport.overlay.1000.core=/path/to/file.impex -sapcommercetoolkit.impeximport.sampledata.0100.categories=/path/to/file.impex -sapcommercetoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file.impex -sapcommercetoolkit.impeximport.sampledata.0500.products=/path/to/file.impex -sapcommercetoolkit.impeximport.sampledata.1000.users=/path/to/file.impex -sapcommercetoolkit.impeximport.sampledata.5000.cms=/path/to/file.impex -sapcommercetoolkit.impeximport.testdata.0100.categories=/path/to/file.impex -sapcommercetoolkit.impeximport.testdata.0500.products=/path/to/file.impex -sapcommercetoolkit.impeximport.testdata.1000.users=/path/to/file.impex -sapcommercetoolkit.impeximport.testdata.5000.cms=/path/to/file.impex +cxdevtoolkit.impeximport.elementarydata.0100.coredata=/path/to/file.impex +cxdevtoolkit.impeximport.elementarydata.0500.catalogs=/path/to/file.impex +cxdevtoolkit.impeximport.releasepatch.release1x0x0.0001.datamigration=/path/to/file.impex +cxdevtoolkit.impeximport.releasepatch.release1x1x0.0001.datamigration=/path/to/file.impex +cxdevtoolkit.impeximport.releasepatch.release2x0x0.0001.insertdefaultvalue=/path/to/file.impex +cxdevtoolkit.impeximport.essentialdata.0010.userrights=/path/to/file.impex +cxdevtoolkit.impeximport.essentialdata.0300.solrconfiguration=/path/to/file.impex +cxdevtoolkit.impeximport.essentialdata.5000.cmstemplates=/path/to/file.impex +cxdevtoolkit.impeximport.overlay.1000.core=/path/to/file.impex +cxdevtoolkit.impeximport.sampledata.0100.categories=/path/to/file.impex +cxdevtoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file.impex +cxdevtoolkit.impeximport.sampledata.0500.products=/path/to/file.impex +cxdevtoolkit.impeximport.sampledata.1000.users=/path/to/file.impex +cxdevtoolkit.impeximport.sampledata.5000.cms=/path/to/file.impex +cxdevtoolkit.impeximport.testdata.0100.categories=/path/to/file.impex +cxdevtoolkit.impeximport.testdata.0500.products=/path/to/file.impex +cxdevtoolkit.impeximport.testdata.1000.users=/path/to/file.impex +cxdevtoolkit.impeximport.testdata.5000.cms=/path/to/file.impex ``` ### Hints -One should include the `sapcommercetoolkit` within the list of extension to execute projectdata updates on -system init and update via the property `update.executeProjectData.extensionName.list=sapcommercetoolkit`. +One should include the `cxdevtoolkit` within the list of extension to execute projectdata updates on +system init and update via the property `update.executeProjectData.extensionName.list=cxdevtoolkit`. -Typically, one activates the `sapcommercetoolkit.impeximport.environment.supportlocalizedfiles` by setting it to `true`. +Typically, one activates the `cxdevtoolkit.impeximport.environment.supportlocalizedfiles` by setting it to `true`. This will automatically resolve localized files that have the same name as the one specified in the configuration, but with a suffix of the locale before the file extension, e.g. for a configuration of `/path/to/file.impex` and a system supporting the locales (en, de, it) it also resolves the following pathes and tries to import them after the main file: @@ -149,28 +149,28 @@ template engine called `emailTemplateEngine`. For local development there is also a `StoreLocallyHtmlEmailService`. This service does not even send any emails, but instead stores them in a configurable local directory or the database. In order to activate this feature, you need to activate/add the -spring profile `sapcommercetools-fake-localmails` to your `local.properties`: +spring profile `cxdevtoolkit-fake-localmails` to your `local.properties`: ```properties -spring.profiles.active=sapcommercetools-fake-localmails +spring.profiles.active=cxdevtoolkit-fake-localmails ``` ### Configuration parameters | Parameter | Type | Description | |-------------------------------------------------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.method | String | The method for storing mails locally, either `file` or `database`
(default: `file`) | -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.directory | String | The directory to which the email files will be stored to
(default: `${HYBRIS_LOG_DIR}/mails`) | -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.filenamepattern | String | The pattern for the generated files. It can be adjusted with the following parameters: timestamp, datetime, subject, from, to, extension
(default: `{timestamp}_{subject}.{extension}`) | -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.extension | String | Specify the file extension for the generated local files, use whatever is supported by your email client
(default: `eml`) | -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.mediafolder | String | The media folder to place fake email media items into
(default: `fake-emails`) | -| sapcommercetoolkit.fakes.htmlEmailService.localstorage.daysToKeepEmails | int | the number of days to keep local emails in the database
(default: `7`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.method | String | The method for storing mails locally, either `file` or `database`
(default: `file`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.directory | String | The directory to which the email files will be stored to
(default: `${HYBRIS_LOG_DIR}/mails`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.filenamepattern | String | The pattern for the generated files. It can be adjusted with the following parameters: timestamp, datetime, subject, from, to, extension
(default: `{timestamp}_{subject}.{extension}`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.extension | String | Specify the file extension for the generated local files, use whatever is supported by your email client
(default: `eml`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.mediafolder | String | The media folder to place fake email media items into
(default: `fake-emails`) | +| cxdevtoolkit.fakes.htmlEmailService.localstorage.daysToKeepEmails | int | the number of days to keep local emails in the database
(default: `7`) | ### Cleanup of stored email within database If you store the emails within the database, make sure you are initializing the database from time to time (e.g. on local development machines), or to setup a maintenance cronjob that removes the fake emails periodically (e.g. on STAGE). The -sapcommercetoolkit already defines a `cleanupLocallyHtmlEmailsPerformable` bean instance that can be configured by creating +cxdevtoolkit already defines a `cleanupLocallyHtmlEmailsPerformable` bean instance that can be configured by creating a `CronJob` instance with the following configuration: ```impex @@ -241,14 +241,14 @@ public class MyB2BEmailService implements B2BEmailService { ```xml - + - + @@ -277,7 +277,7 @@ this has some limitations, but for the purpose of unit testing with `AbstractIte All the unit testing enhancements are placed within the `testsrc` folder. Therefore, they are activated by default, but only enhance your test execution, not your production system. If you want to make use of the testing capabilities, you need to declare a dependency to the -`sapcommercetoolkit` extension to your extension. This dependency can also be transient, e.g. normally the dependency is only added to the +`cxdevtoolkit` extension to your extension. This dependency can also be transient, e.g. normally the dependency is only added to the `core` extensions `extensioninfo.xml` file of the project and is then available to all extensions within the project: ```xml @@ -287,9 +287,9 @@ test execution, not your production system. If you want to make use of the testi - + - + ``` @@ -352,7 +352,7 @@ In the samples above you might have wondered where this `interceptorContext()` l make unit testing with SAP Commerce much easier. The library is still growing and sometimes the test doubles are not finally there, but we have the goal that one day it has grown to a size big enough to support you in the major use cases throughout the platform. -Test doubles and their builders are placed within the `testsrc` folder within the package `tools.sapcx.commerce.toolkit.testing` and +Test doubles and their builders are placed within the `testsrc` folder within the package `me.cxdev.commerce.toolkit.testing` and below. The naming convention is, that the test doubles should always start with the interface name they are supporting, e.g.: - `CatalogVersionService` => `CatalogVersionServiceFake` - `ConfigurationService` => `ConfigurationServiceFake` @@ -372,4 +372,4 @@ them. And if you are missing a builder, feel free to raise an issue or to create _Licensed under the Apache License, Version 2.0, January 2004_ -_Copyright 2025, SAP CX Tools_ \ No newline at end of file +_Copyright 2026, CX DEV Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/extensioninfo.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/extensioninfo.xml similarity index 76% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/extensioninfo.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/extensioninfo.xml index f612629f..5b202928 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/extensioninfo.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/extensioninfo.xml @@ -1,9 +1,9 @@ + name="cxdevtoolkit" version="5.0.0" usemaven="true"> - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/external-dependencies.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/external-dependencies.xml similarity index 62% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/external-dependencies.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/external-dependencies.xml index 7f9ccf81..923b8543 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/external-dependencies.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/external-dependencies.xml @@ -1,11 +1,27 @@ 4.0.0 - tools.sapcx - sapcommercetoolkit - 4.4.0 + me.cxdev + cxdevtoolkit + 5.0.0 jar + + commons-beanutils + commons-beanutils + 1.11.0 + + + jakarta.mail + jakarta.mail-api + 2.1.3 + + + org.eclipse.angus + angus-mail + 2.0.3 + runtime + org.thymeleaf thymeleaf diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/project.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/project.properties similarity index 58% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/project.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/project.properties index c77300a4..bd2e400b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/project.properties +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/project.properties @@ -1,17 +1,17 @@ # ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools +# Copyright (c) 2026 CX DEV Tools # ---------------------------------------------------------------------------- # Location of the file for the global platform spring application context -sapcommercetoolkit.application-context=sapcommercetoolkit-spring.xml +cxdevtoolkit.application-context=cxdevtoolkit-spring.xml ############################################################################## # ImpEx global import configuration ############################################################################## -sapcommercetoolkit.impeximport.configuration.legacymode=false -sapcommercetoolkit.impeximport.configuration.enablecodeexecution=true -sapcommercetoolkit.impeximport.configuration.validationmode=strict -sapcommercetoolkit.impeximport.configuration.defaultlocale=en +cxdevtoolkit.impeximport.configuration.legacymode=false +cxdevtoolkit.impeximport.configuration.enablecodeexecution=true +cxdevtoolkit.impeximport.configuration.validationmode=strict +cxdevtoolkit.impeximport.configuration.defaultlocale=en ############################################################################## # Environment specific flags @@ -19,7 +19,7 @@ sapcommercetoolkit.impeximport.configuration.defaultlocale=en # legacysystemsetup - Uses the legacy system setup, ie. running the impex from this extension # configurationfile - Absolute filename for the persistent configuration of # the system setup environment, defaults to -# ${HYBRIS_DATA_DIR}/sapcommercetoolkit/configuration.properties +# ${HYBRIS_DATA_DIR}/cxdevtoolkit/configuration.properties # isdevelopment - Should be set on local development environment. # If set to true, sample and test data is imported # automatically during system initialization @@ -31,24 +31,24 @@ sapcommercetoolkit.impeximport.configuration.defaultlocale=en # importtestdata - If set to true, test data is imported automatically # during system initialization or system update ############################################################################## -sapcommercetoolkit.impeximport.environment.legacysystemsetup=true -sapcommercetoolkit.impeximport.environment.configurationfile=${HYBRIS_DATA_DIR}/sapcommercetoolkit/configuration.properties -sapcommercetoolkit.impeximport.environment.isdevelopment=false -sapcommercetoolkit.impeximport.environment.supportlocalizedfiles=false -sapcommercetoolkit.impeximport.environment.importsampledata=false -sapcommercetoolkit.impeximport.environment.importtestdata=false +cxdevtoolkit.impeximport.environment.legacysystemsetup=true +cxdevtoolkit.impeximport.environment.configurationfile=${HYBRIS_DATA_DIR}/cxdevtoolkit/configuration.properties +cxdevtoolkit.impeximport.environment.isdevelopment=false +cxdevtoolkit.impeximport.environment.supportlocalizedfiles=false +cxdevtoolkit.impeximport.environment.importsampledata=false +cxdevtoolkit.impeximport.environment.importtestdata=false ############################################################################## # ImpEx import filesets # # Import files can be specified in any property file that is considered as a -# SAP CX configuration location, e.g.: +# CX DEV configuration location, e.g.: # - properties area of manifest.json file # - global local.properties file # - extension specific project.properties file # # The pattern needs to apply to the following rule: -# sapcommercetoolkit.impeximport..[.]. +# cxdevtoolkit.impeximport..[.]. # # - must be one of: # elementarydata - only imported during initialization @@ -63,28 +63,28 @@ sapcommercetoolkit.impeximport.environment.importtestdata=false # - identifier for the import (can be any unique number or text) # # Examples: -# sapcommercetoolkit.impeximport.elementarydata.0100.coredata=/path/to/file.impex -# sapcommercetoolkit.impeximport.elementarydata.0500.catalogs=/path/to/file.impex -# sapcommercetoolkit.impeximport.releasepatch.release1x0x0.0001.datamigration=/path/to/file.impex -# sapcommercetoolkit.impeximport.releasepatch.release1x1x0.0001.datamigration=/path/to/file.impex -# sapcommercetoolkit.impeximport.releasepatch.release2x0x0.0001.insertdefaultvalue=/path/to/file.impex -# sapcommercetoolkit.impeximport.essentialdata.0010.userrights=/path/to/file.impex -# sapcommercetoolkit.impeximport.essentialdata.0300.solrconfiguration=/path/to/file.impex -# sapcommercetoolkit.impeximport.essentialdata.5000.cmstemplates=/path/to/file.impex -# sapcommercetoolkit.impeximport.overlay.1000.core-essential=/path/to/file.impex -# sapcommercetoolkit.impeximport.sampledata.0100.categories=/path/to/file.impex -# sapcommercetoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file.impex -# sapcommercetoolkit.impeximport.sampledata.0500.products=/path/to/file.impex -# sapcommercetoolkit.impeximport.sampledata.1000.users=/path/to/file.impex -# sapcommercetoolkit.impeximport.sampledata.5000.cms=/path/to/file.impex -# sapcommercetoolkit.impeximport.testdata.0100.categories=/path/to/file.impex -# sapcommercetoolkit.impeximport.testdata.0500.products=/path/to/file.impex -# sapcommercetoolkit.impeximport.testdata.1000.users=/path/to/file.impex -# sapcommercetoolkit.impeximport.testdata.5000.cms=/path/to/file.impex +# cxdevtoolkit.impeximport.elementarydata.0100.coredata=/path/to/file.impex +# cxdevtoolkit.impeximport.elementarydata.0500.catalogs=/path/to/file.impex +# cxdevtoolkit.impeximport.releasepatch.release1x0x0.0001.datamigration=/path/to/file.impex +# cxdevtoolkit.impeximport.releasepatch.release1x1x0.0001.datamigration=/path/to/file.impex +# cxdevtoolkit.impeximport.releasepatch.release2x0x0.0001.insertdefaultvalue=/path/to/file.impex +# cxdevtoolkit.impeximport.essentialdata.0010.userrights=/path/to/file.impex +# cxdevtoolkit.impeximport.essentialdata.0300.solrconfiguration=/path/to/file.impex +# cxdevtoolkit.impeximport.essentialdata.5000.cmstemplates=/path/to/file.impex +# cxdevtoolkit.impeximport.overlay.1000.core-essential=/path/to/file.impex +# cxdevtoolkit.impeximport.sampledata.0100.categories=/path/to/file.impex +# cxdevtoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file.impex +# cxdevtoolkit.impeximport.sampledata.0500.products=/path/to/file.impex +# cxdevtoolkit.impeximport.sampledata.1000.users=/path/to/file.impex +# cxdevtoolkit.impeximport.sampledata.5000.cms=/path/to/file.impex +# cxdevtoolkit.impeximport.testdata.0100.categories=/path/to/file.impex +# cxdevtoolkit.impeximport.testdata.0500.products=/path/to/file.impex +# cxdevtoolkit.impeximport.testdata.1000.users=/path/to/file.impex +# cxdevtoolkit.impeximport.testdata.5000.cms=/path/to/file.impex # # # For full support, one should activate the project data of this extension, e.g. -# update.executeProjectData.extensionName.list=sapcommercetoolkit +# update.executeProjectData.extensionName.list=cxdevtoolkit ############################################################################## @@ -92,30 +92,30 @@ sapcommercetoolkit.impeximport.environment.importtestdata=false # Html Email Service configuration # # The HtmlEmailService requires all templates to be stored within the following class paths: -# /email-templates/html/** -# /email-templates/text/** +# cxdevtoolkit/email-templates/html/** +# cxdevtoolkit/email-templates/text/** # # For localization of the emails, message bundles are preconfigured. Unfortunately, a message source cannot # hold wildcards and, therefore, this extension has 5 prepared configuration paths that are resolved during # system startup. If you want to contribute to the message bundle for email templates, please take one of the # properties below, and change the path accordingly. The order is important, see note below! # -# Note: You cannot simply add your messages to a file called /email-templates/messages, because the message +# Note: You cannot simply add your messages to a file called cxdevtoolkit/email-templates/messages, because the message # source will stop file resolving, after the first match, ie. a file already existing in a previous message # source will stop the resolver from loading your keys from your local file with the same name. ############################################################################## -sapcommercetoolkit.htmlEmailService.configuration.messagebundle1=classpath:/email-templates/messages -sapcommercetoolkit.htmlEmailService.configuration.messagebundle2=classpath:/email-templates/messages -sapcommercetoolkit.htmlEmailService.configuration.messagebundle3=classpath:/email-templates/messages -sapcommercetoolkit.htmlEmailService.configuration.messagebundle4=classpath:/email-templates/messages -sapcommercetoolkit.htmlEmailService.configuration.messagebundle5=classpath:/email-templates/messages +cxdevtoolkit.htmlEmailService.configuration.messagebundle1=classpath*:cxdevtoolkit/email-templates/messages +cxdevtoolkit.htmlEmailService.configuration.messagebundle2=classpath*:cxdevtoolkit/email-templates/messages +cxdevtoolkit.htmlEmailService.configuration.messagebundle3=classpath*:cxdevtoolkit/email-templates/messages +cxdevtoolkit.htmlEmailService.configuration.messagebundle4=classpath*:cxdevtoolkit/email-templates/messages +cxdevtoolkit.htmlEmailService.configuration.messagebundle5=classpath*:cxdevtoolkit/email-templates/messages ############################################################################## # Html Email Service Fake configuration # # In order to activate the fake, you need to add a spring profile to your configuration: -# spring.profiles.active=sapcommercetools-fake-localmails +# spring.profiles.active=cxdevtoolkit-fake-localmails # # - the method to store mails locally, either file or database # - the directory to which the email files will be stored to @@ -134,9 +134,9 @@ sapcommercetoolkit.htmlEmailService.configuration.messagebundle5=classpath:/emai # - mail.smtp.server (DEFAULT: MISSING!!!) # - mail.from (DEFAULT: test@hybris.de) ############################################################################## -sapcommercetoolkit.fakes.htmlEmailService.localstorage.method=file -sapcommercetoolkit.fakes.htmlEmailService.localstorage.directory=${HYBRIS_LOG_DIR}/mails -sapcommercetoolkit.fakes.htmlEmailService.localstorage.filenamepattern={timestamp}_{subject}.{extension} -sapcommercetoolkit.fakes.htmlEmailService.localstorage.extension=eml -sapcommercetoolkit.fakes.htmlEmailService.localstorage.mediafolder=fake-emails -sapcommercetoolkit.fakes.htmlEmailService.localstorage.daysToKeep=7 +cxdevtoolkit.fakes.htmlEmailService.localstorage.method=file +cxdevtoolkit.fakes.htmlEmailService.localstorage.directory=${HYBRIS_LOG_DIR}/mails +cxdevtoolkit.fakes.htmlEmailService.localstorage.filenamepattern={timestamp}_{subject}.{extension} +cxdevtoolkit.fakes.htmlEmailService.localstorage.extension=eml +cxdevtoolkit.fakes.htmlEmailService.localstorage.mediafolder=fake-emails +cxdevtoolkit.fakes.htmlEmailService.localstorage.daysToKeep=7 diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-config.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-config.xml similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-config.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-config.xml index 3e2c9b62..b19c6f03 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-config.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-config.xml @@ -17,9 +17,9 @@ - - - + + + diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_de.properties new file mode 100644 index 00000000..84e0a389 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_de.properties @@ -0,0 +1,2 @@ +cxdevtools_treenode_main=CX DEV Tools +cxdevtools_treenode_fakemail=Fake Mails \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_en.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_en.properties new file mode 100644 index 00000000..84e0a389 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-labels/labels_en.properties @@ -0,0 +1,2 @@ +cxdevtools_treenode_main=CX DEV Tools +cxdevtools_treenode_fakemail=Fake Mails \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-spring.xml similarity index 55% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-spring.xml index 0d4e1a05..e44adf6a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-backoffice-spring.xml @@ -1,13 +1,11 @@ - + - + diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-items.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-items.xml similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-items.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-items.xml diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-spring.xml new file mode 100644 index 00000000..c9db63e3 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit-spring.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/scss/sapcxreporting-variables.scss b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/email-templates/messages.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/scss/sapcxreporting-variables.scss rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/email-templates/messages.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/models-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/models-spring.xml similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/models-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/models-spring.xml index c0c5c652..74e71794 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/models-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/models-spring.xml @@ -4,10 +4,10 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - + + class="me.cxdev.commerce.toolkit.model.FailureLoggingModelService" /> \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/sessionhandling-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/sessionhandling-spring.xml similarity index 86% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/sessionhandling-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/sessionhandling-spring.xml index c0230c7c..9e8cc533 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/sessionhandling-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/sessionhandling-spring.xml @@ -5,7 +5,7 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/systemsetup-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/systemsetup-spring.xml new file mode 100644 index 00000000..3da18327 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/systemsetup-spring.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-fake-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-fake-spring.xml new file mode 100644 index 00000000..8e4b35a1 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-fake-spring.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-spring.xml b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-spring.xml similarity index 81% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-spring.xml rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-spring.xml index 73d1d280..ea3def5a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-spring.xml +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/cxdevtoolkit/thymeleafemails-spring.xml @@ -5,7 +5,7 @@ - + @@ -55,11 +55,11 @@ - ${sapcommercetoolkit.htmlEmailService.configuration.messagebundle1} - ${sapcommercetoolkit.htmlEmailService.configuration.messagebundle2} - ${sapcommercetoolkit.htmlEmailService.configuration.messagebundle3} - ${sapcommercetoolkit.htmlEmailService.configuration.messagebundle4} - ${sapcommercetoolkit.htmlEmailService.configuration.messagebundle5} + ${cxdevtoolkit.htmlEmailService.configuration.messagebundle1} + ${cxdevtoolkit.htmlEmailService.configuration.messagebundle2} + ${cxdevtoolkit.htmlEmailService.configuration.messagebundle3} + ${cxdevtoolkit.htmlEmailService.configuration.messagebundle4} + ${cxdevtoolkit.htmlEmailService.configuration.messagebundle5} @@ -70,5 +70,5 @@ - + \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales_de.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/localization/cxdevtoolkit-locales_de.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales_de.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/localization/cxdevtoolkit-locales_de.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales.properties b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/localization/cxdevtoolkit-locales_en.properties similarity index 100% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales.properties rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/resources/localization/cxdevtoolkit-locales_en.properties diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/constants/ToolkitConstants.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/constants/ToolkitConstants.java similarity index 69% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/constants/ToolkitConstants.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/constants/ToolkitConstants.java index 329432fb..868b6e1b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/constants/ToolkitConstants.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/constants/ToolkitConstants.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.toolkit.constants; +package me.cxdev.commerce.toolkit.constants; /** * Global class for all constants. This class is required by the platform and * will not been used for any other purpose. */ public final class ToolkitConstants { - public static final String EXTENSIONNAME = "sapcommercetoolkit"; + public static final String EXTENSIONNAME = "cxdevtoolkit"; private ToolkitConstants() { // empty to avoid instantiating this constant class diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailService.java similarity index 73% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailService.java index b592160e..c4c526f5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailService.java @@ -1,7 +1,7 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; public class DefaultHtmlEmailService implements HtmlEmailService { /** diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailAddress.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailAddress.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailAddress.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailAddress.java index 3c445ba9..6c914885 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailAddress.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailAddress.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.toolkit.email; - -import javax.mail.internet.InternetAddress; +package me.cxdev.commerce.toolkit.email; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; +import jakarta.mail.internet.InternetAddress; + public class HtmlEmailAddress { private String name; private String email; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailBuilder.java similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailBuilder.java index b80eb2e4..e223b110 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -10,17 +10,16 @@ import java.util.Map; import java.util.function.Consumer; -import javax.mail.internet.InternetAddress; - import de.hybris.platform.core.model.media.MediaModel; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; -import tools.sapcx.commerce.toolkit.email.attachments.EmailAfterBuildHook; -import tools.sapcx.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilder; -import tools.sapcx.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilders; +import jakarta.mail.internet.InternetAddress; +import me.cxdev.commerce.toolkit.email.attachments.EmailAfterBuildHook; +import me.cxdev.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilder; +import me.cxdev.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilders; public class HtmlEmailBuilder { static HtmlEmailBuilder withHtmlEmailGenerator(HtmlEmailGenerator generator) { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailGenerator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailGenerator.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailGenerator.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailGenerator.java index af5865d8..99216a54 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailGenerator.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailGenerator.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -6,10 +6,10 @@ import java.util.Locale; import java.util.Map; -import javax.mail.internet.InternetAddress; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import jakarta.mail.internet.InternetAddress; /** * The {@link HtmlEmailGenerator} interface introduces a simplified way of generating HTML emails from processes and diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailService.java similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailService.java index 9458de67..a564694e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/HtmlEmailService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/HtmlEmailService.java @@ -1,13 +1,13 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import java.io.UnsupportedEncodingException; -import javax.mail.internet.AddressException; -import javax.mail.internet.InternetAddress; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import jakarta.mail.internet.AddressException; +import jakarta.mail.internet.InternetAddress; /** * The {@link HtmlEmailService} interface introduces a simplified way of sending HTML emails from processes and diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ProxyHtmlEmail.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ProxyHtmlEmail.java similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ProxyHtmlEmail.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ProxyHtmlEmail.java index 559d0955..bb2cd554 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ProxyHtmlEmail.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ProxyHtmlEmail.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import java.io.File; import java.net.URL; @@ -7,21 +7,22 @@ import java.util.List; import java.util.Map; -import javax.activation.DataSource; -import javax.mail.Authenticator; -import javax.mail.BodyPart; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; import javax.naming.NamingException; -import org.apache.commons.mail.Email; -import org.apache.commons.mail.EmailAttachment; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; -import org.apache.commons.mail.MultiPartEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.Email; +import org.apache.commons.mail2.jakarta.EmailAttachment; +import org.apache.commons.mail2.jakarta.HtmlEmail; +import org.apache.commons.mail2.jakarta.MultiPartEmail; + +import jakarta.activation.DataSource; +import jakarta.mail.Authenticator; +import jakarta.mail.BodyPart; +import jakarta.mail.MessagingException; +import jakarta.mail.Session; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; class ProxyHtmlEmail extends HtmlEmail { private static final String UNSUPPORTED_OPERATION_MESSAGE = "This method must not be called on the proxy object!"; @@ -223,12 +224,6 @@ public void setHostName(String aHostName) { proxiedHtmlEmail.setHostName(aHostName); } - @Override - @Deprecated - public void setTLS(boolean withTLS) { - proxiedHtmlEmail.setTLS(withTLS); - } - @Override public Email setStartTLSEnabled(boolean startTlsEnabled) { return proxiedHtmlEmail.setStartTLSEnabled(startTlsEnabled); @@ -474,34 +469,16 @@ public boolean isStartTLSEnabled() { return proxiedHtmlEmail.isStartTLSEnabled(); } - @Override - @Deprecated - public boolean isTLS() { - return proxiedHtmlEmail.isTLS(); - } - @Override public void setPopBeforeSmtp(boolean newPopBeforeSmtp, String newPopHost, String newPopUsername, String newPopPassword) { proxiedHtmlEmail.setPopBeforeSmtp(newPopBeforeSmtp, newPopHost, newPopUsername, newPopPassword); } - @Override - @Deprecated - public boolean isSSL() { - return proxiedHtmlEmail.isSSL(); - } - @Override public boolean isSSLOnConnect() { return proxiedHtmlEmail.isSSLOnConnect(); } - @Override - @Deprecated - public void setSSL(boolean ssl) { - proxiedHtmlEmail.setSSL(ssl); - } - @Override public Email setSSLOnConnect(boolean ssl) { return proxiedHtmlEmail.setSSLOnConnect(ssl); @@ -562,18 +539,8 @@ public int getSocketConnectionTimeout() { return proxiedHtmlEmail.getSocketConnectionTimeout(); } - @Override - public void setSocketConnectionTimeout(int socketConnectionTimeout) { - proxiedHtmlEmail.setSocketConnectionTimeout(socketConnectionTimeout); - } - @Override public int getSocketTimeout() { return proxiedHtmlEmail.getSocketTimeout(); } - - @Override - public void setSocketTimeout(int socketTimeout) { - proxiedHtmlEmail.setSocketTimeout(socketTimeout); - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java index cc24ff35..33f4a124 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGenerator.java @@ -1,12 +1,12 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import java.util.Locale; import java.util.Map; import de.hybris.platform.util.mail.MailUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.assertj.core.util.VisibleForTesting; import org.thymeleaf.ITemplateEngine; import org.thymeleaf.context.Context; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java similarity index 75% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java index 9f11bf46..2c2de1e8 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/AbstractHtmlEmailAttachmentBuilder.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.toolkit.email.attachments; +package me.cxdev.commerce.toolkit.email.attachments; -import javax.activation.DataSource; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import jakarta.activation.DataSource; public abstract class AbstractHtmlEmailAttachmentBuilder implements HtmlEmailAttachmentBuilder { private String name; diff --git a/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/EmailAfterBuildHook.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/EmailAfterBuildHook.java new file mode 100644 index 00000000..6611d3e0 --- /dev/null +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/EmailAfterBuildHook.java @@ -0,0 +1,9 @@ +package me.cxdev.commerce.toolkit.email.attachments; + +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; + +@FunctionalInterface +public interface EmailAfterBuildHook { + void afterBuild(HtmlEmail email) throws EmailException; +} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java similarity index 78% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java index cf193084..4eee6e64 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/FileBasedHtmlEmailAttachmentBuilder.java @@ -1,12 +1,12 @@ -package tools.sapcx.commerce.toolkit.email.attachments; +package me.cxdev.commerce.toolkit.email.attachments; import java.io.File; import java.io.IOException; -import javax.activation.DataSource; -import javax.activation.FileDataSource; +import org.apache.commons.mail2.core.EmailException; -import org.apache.commons.mail.EmailException; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; public class FileBasedHtmlEmailAttachmentBuilder extends AbstractHtmlEmailAttachmentBuilder { private File file; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java similarity index 57% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java index bd4525b7..7d96d12c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilder.java @@ -1,7 +1,7 @@ -package tools.sapcx.commerce.toolkit.email.attachments; +package me.cxdev.commerce.toolkit.email.attachments; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; public interface HtmlEmailAttachmentBuilder { HtmlEmailAttachmentBuilder name(String name); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java index 16a306b7..c7d2e687 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/HtmlEmailAttachmentBuilders.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email.attachments; +package me.cxdev.commerce.toolkit.email.attachments; import java.io.File; import java.net.URL; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java similarity index 83% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java index 9ac50392..070efad9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/MediaBasedHtmlEmailAttachmentBuilder.java @@ -1,14 +1,14 @@ -package tools.sapcx.commerce.toolkit.email.attachments; - -import javax.activation.DataSource; -import javax.mail.util.ByteArrayDataSource; +package me.cxdev.commerce.toolkit.email.attachments; import de.hybris.platform.core.Registry; import de.hybris.platform.core.model.media.MediaModel; import de.hybris.platform.servicelayer.media.MediaService; import de.hybris.platform.servicelayer.media.NoDataAvailableException; -import org.apache.commons.mail.EmailException; +import org.apache.commons.mail2.core.EmailException; + +import jakarta.activation.DataSource; +import jakarta.mail.util.ByteArrayDataSource; public class MediaBasedHtmlEmailAttachmentBuilder extends AbstractHtmlEmailAttachmentBuilder { private MediaModel media; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java similarity index 73% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java index 976f7770..aedf3265 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/attachments/URLBasedHtmlEmailAttachmentBuilder.java @@ -1,13 +1,13 @@ -package tools.sapcx.commerce.toolkit.email.attachments; +package me.cxdev.commerce.toolkit.email.attachments; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import javax.activation.DataSource; -import javax.activation.URLDataSource; +import org.apache.commons.mail2.core.EmailException; -import org.apache.commons.mail.EmailException; +import jakarta.activation.DataSource; +import jakarta.activation.URLDataSource; public class URLBasedHtmlEmailAttachmentBuilder extends AbstractHtmlEmailAttachmentBuilder { private URL url; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java index 34953a06..ff5a455b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email.fake; +package me.cxdev.commerce.toolkit.email.fake; import static org.apache.commons.collections4.ListUtils.emptyIfNull; @@ -13,7 +13,7 @@ import org.joda.time.DateTime; -import tools.sapcx.commerce.toolkit.model.LocallyStoredEmailModel; +import me.cxdev.commerce.toolkit.model.LocallyStoredEmailModel; public class RemoveLocallyHtmlEmailsMaintenanceCleanupStrategy implements MaintenanceCleanupStrategy { private static final String FETCH_QUERY = String.format("SELECT {%s} FROM {%s} WHERE {%s} < ?threshold", diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java index 289688ed..9ede4cfa 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/email/fake/StoreLocallyHtmlEmailServiceFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email.fake; +package me.cxdev.commerce.toolkit.email.fake; import static java.util.stream.Collectors.joining; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -15,28 +15,28 @@ import java.util.Locale; import java.util.Map; -import javax.mail.Address; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMessage; - import de.hybris.platform.core.model.media.MediaFolderModel; import de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException; import de.hybris.platform.servicelayer.media.MediaService; import de.hybris.platform.servicelayer.model.ModelService; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; -import org.apache.log4j.Logger; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.assertj.core.util.VisibleForTesting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import tools.sapcx.commerce.toolkit.email.HtmlEmailService; -import tools.sapcx.commerce.toolkit.model.LocallyStoredEmailModel; +import jakarta.mail.Address; +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; +import me.cxdev.commerce.toolkit.email.HtmlEmailService; +import me.cxdev.commerce.toolkit.model.LocallyStoredEmailModel; public class StoreLocallyHtmlEmailServiceFake implements HtmlEmailService { - private static final Logger LOG = Logger.getLogger(StoreLocallyHtmlEmailServiceFake.class); + private static final Logger LOG = LoggerFactory.getLogger(StoreLocallyHtmlEmailServiceFake.class); private static final String TIMESTAMP_FORMAT = "yyyyMMdd-HHmmssS"; private static final String MEDIACODE_FORMAT = "fake-email_%s"; private static final String DEFAULT_FILENAME_PATTERN = "{timestamp}_{subject}.{extension}"; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/ImpExTasks.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/ImpExTasks.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/ImpExTasks.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/ImpExTasks.java index 7681832e..feffeb80 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/ImpExTasks.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/ImpExTasks.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.impex; +package me.cxdev.commerce.toolkit.impex; import de.hybris.platform.catalog.CatalogVersionService; import de.hybris.platform.catalog.model.CatalogVersionModel; @@ -26,7 +26,7 @@ private ImpExTasks() { * This method is intended to be called by an ImpEx script while code execution is enabled, e.g.: * * - * #%tools.sapcx.commerce.toolkit.impex.ImpExTasks.startFullCatalogSync("ProductCatalog:Staged", "ProductCatalog:Online", "sync (ProductCatalog:Online->Staged)") + * #%me.cxdev.commerce.toolkit.impex.ImpExTasks.startFullCatalogSync("ProductCatalog:Staged", "ProductCatalog:Online", "sync (ProductCatalog:Online->Staged)") * * * One may use it to sync the catalog versions after system update. The action is performed synchronously, so that @@ -65,7 +65,7 @@ public static void startFullCatalogSync(String source, String target, String syn /** * This method is intended to be called by an ImpEx script while code execution is enabled, e.g.: * - * #%tools.sapcx.commerce.toolkit.impex.ImpExTasks.startCronJob("your-cronjob-code"); + * #%me.cxdev.commerce.toolkit.impex.ImpExTasks.startCronJob("your-cronjob-code"); * * One may use it to e.g. trigger a solr indexing after system update. The action is performed synchronously, so that you can rely on * the action was completed before your system update process continues. @@ -79,7 +79,7 @@ public static void startCronJob(String cronJobCode) { /** * This method is intended to be called by an ImpEx script while code execution is enabled, e.g.: * - * #%tools.sapcx.commerce.toolkit.impex.ImpExTasks.startCronJobNonBlocking("your-cronjob-code"); + * #%me.cxdev.commerce.toolkit.impex.ImpExTasks.startCronJobNonBlocking("your-cronjob-code"); * * One may use it to e.g. trigger a solr indexing after system update. The action is performed asynchronously. You cannot rely on * the action being completed before your system update process continues. @@ -93,7 +93,7 @@ public static void startCronJobNonBlocking(String cronJobCode) { /** * This method is intended to be called by an ImpEx script while code execution is enabled, e.g.: * - * #%tools.sapcx.commerce.toolkit.impex.ImpExTasks.startCronJob("your-cronjob-code", true); + * #%me.cxdev.commerce.toolkit.impex.ImpExTasks.startCronJob("your-cronjob-code", true); * * One may use it to e.g. trigger a solr indexing after system update. The second parameter defines whether the job * is performed synchronously (true) or asynchronously (false). diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java similarity index 71% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java index 2cbe22fa..de9ee98e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImportExecutor.java @@ -1,8 +1,8 @@ -package tools.sapcx.commerce.toolkit.impex.executor; +package me.cxdev.commerce.toolkit.impex.executor; import de.hybris.platform.core.initialization.SystemSetupContext; -import org.apache.log4j.Logger; +import org.slf4j.LoggerFactory; @FunctionalInterface public interface ImpExDataImportExecutor { @@ -13,6 +13,6 @@ default void importImpexFile(SystemSetupContext context, String file) { } default ImpExDataImporterLogger getLogger() { - return new ImpExDataImporterLogger(Logger.getLogger(getClass())); + return new ImpExDataImporterLogger(LoggerFactory.getLogger(getClass())); } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java index bbc568b2..18513890 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLogger.java @@ -1,15 +1,16 @@ -package tools.sapcx.commerce.toolkit.impex.executor; +package me.cxdev.commerce.toolkit.impex.executor; import de.hybris.platform.core.initialization.SystemSetupContext; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This logger facade provides simplified access to the logging stack and guarantees that log messages are shown both * in the log files of the system as well as in the JSP context of the triggered system setup process. */ public final class ImpExDataImporterLogger { - static final Logger LOG = Logger.getLogger(ImpExDataImporterLogger.class); + static final Logger LOG = LoggerFactory.getLogger(ImpExDataImporterLogger.class); private final Logger logger; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java similarity index 86% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java index d6b56ccf..b57f8d4b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/impex/executor/SynchronousImpExDataImportExecutor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.impex.executor; +package me.cxdev.commerce.toolkit.impex.executor; import java.io.FileNotFoundException; import java.io.InputStream; @@ -13,12 +13,11 @@ import de.hybris.platform.servicelayer.impex.impl.StreamBasedImpExResource; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Required; +import org.apache.commons.lang3.StringUtils; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; -import tools.sapcx.commerce.toolkit.setup.SystemSetupEnvironment; +import me.cxdev.commerce.toolkit.setup.SystemSetupEnvironment; /** * Implementation of the {@link ImpExDataImportExecutor} interface, importing the given file with the preconfigured @@ -27,11 +26,17 @@ * @see SystemSetupEnvironment */ public class SynchronousImpExDataImportExecutor implements ImpExDataImportExecutor, ResourceLoaderAware { - private ImpExDataImporterLogger logger = new ImpExDataImporterLogger(); + private final ImpExDataImporterLogger logger = new ImpExDataImporterLogger(); + private final SystemSetupEnvironment environment; + private final CommonI18NService commonI18NService; + private final ImportService importService; private ResourceLoader resourceLoader; - private SystemSetupEnvironment environment; - private CommonI18NService commonI18NService; - private ImportService importService; + + public SynchronousImpExDataImportExecutor(SystemSetupEnvironment environment, CommonI18NService commonI18NService, ImportService importService) { + this.environment = environment; + this.commonI18NService = commonI18NService; + this.importService = importService; + } @Override public void importImpexFile(SystemSetupContext context, final String file, final String fileEncoding) { @@ -105,19 +110,4 @@ public ImpExDataImporterLogger getLogger() { public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } - - @Required - public void setEnvironment(SystemSetupEnvironment environment) { - this.environment = environment; - } - - @Required - public void setCommonI18NService(CommonI18NService commonI18NService) { - this.commonI18NService = commonI18NService; - } - - @Required - public void setImportService(ImportService importService) { - this.importService = importService; - } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/model/FailureLoggingModelService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/model/FailureLoggingModelService.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/model/FailureLoggingModelService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/model/FailureLoggingModelService.java index 9faa0b8e..68dd5ba6 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/model/FailureLoggingModelService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/model/FailureLoggingModelService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.model; +package me.cxdev.commerce.toolkit.model; import java.util.Collection; import java.util.Locale; @@ -308,12 +308,6 @@ public void clearTransactionsSettings() { wrapWithLoggingCapabilities(() -> super.clearTransactionsSettings()); } - @Override - @Deprecated(since = "6.1.0", forRemoval = true) - public T getByExample(T t) { - return wrapWithLoggingCapabilities(() -> super.getByExample(t)); - } - @Override public void lock(PK pk) { wrapWithLoggingCapabilities(() -> super.lock(pk)); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/CxLocalViewExecutor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/CxLocalViewExecutor.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/CxLocalViewExecutor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/CxLocalViewExecutor.java index d31d143d..d6fe5663 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/CxLocalViewExecutor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/CxLocalViewExecutor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.session; +package me.cxdev.commerce.toolkit.session; import static org.apache.commons.collections4.MapUtils.emptyIfNull; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutionBody.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutionBody.java similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutionBody.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutionBody.java index 82d70fe0..11ab21a5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutionBody.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutionBody.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.session; +package me.cxdev.commerce.toolkit.session; import de.hybris.platform.servicelayer.session.SessionService; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutor.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutor.java index 9dfd51e6..cc57af72 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/session/LocalViewExecutor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/session/LocalViewExecutor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.session; +package me.cxdev.commerce.toolkit.session; import java.util.Map; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ImpExDataImporter.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ImpExDataImporter.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ImpExDataImporter.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ImpExDataImporter.java index f64fdf7c..5acbb87c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ImpExDataImporter.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ImpExDataImporter.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import java.util.Collections; import java.util.List; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ReliableSystemSetupExecutor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ReliableSystemSetupExecutor.java similarity index 81% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ReliableSystemSetupExecutor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ReliableSystemSetupExecutor.java index 7fc4bc5a..63c799cc 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ReliableSystemSetupExecutor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ReliableSystemSetupExecutor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -15,7 +15,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; -import org.springframework.beans.factory.annotation.Required; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -39,11 +38,24 @@ public final class ReliableSystemSetupExecutor implements ApplicationContextAwar static final String COCKPIT_CONFIGURATION_SERVICE = "cockpitConfigurationService"; private ApplicationContext applicationContext; - private ValidationService validationService; - private ImpExDataImporter elementaryDataImporter; - private ImpExDataImporter releasePatchesImporter; - private ImpExDataImporter essentialDataImporter; - private List projectDataImporters = new ArrayList<>(); + private final ValidationService validationService; + private final ImpExDataImporter elementaryDataImporter; + private final ImpExDataImporter releasePatchesImporter; + private final ImpExDataImporter essentialDataImporter; + private final List projectDataImporters; + + public ReliableSystemSetupExecutor( + ValidationService validationService, + ImpExDataImporter elementaryDataImporter, + ImpExDataImporter releasePatchesImporter, + ImpExDataImporter essentialDataImporter, + List projectDataImporters) { + this.validationService = validationService; + this.elementaryDataImporter = elementaryDataImporter; + this.releasePatchesImporter = releasePatchesImporter; + this.essentialDataImporter = essentialDataImporter; + this.projectDataImporters = projectDataImporters; + } public void reliableSetupPhases(final SystemSetupContext context) { Consumer importData = importer -> importer.importData(context); @@ -94,28 +106,6 @@ private boolean isSystemInitialization(SystemSetupContext context) { return context.getProcess().isInit() && !context.getProcess().isAll(); } - @Required - public void setValidationService(ValidationService validationService) { - this.validationService = validationService; - } - - public void setElementaryDataImporter(ImpExDataImporter elementaryDataImporter) { - this.elementaryDataImporter = elementaryDataImporter; - } - - public void setReleasePatchesImporter(ImpExDataImporter releasePatchesImporter) { - this.releasePatchesImporter = releasePatchesImporter; - } - - public void setEssentialDataImporter(ImpExDataImporter essentialDataImporter) { - this.essentialDataImporter = essentialDataImporter; - } - - public void setProjectDataImporters(List projectDataImporters) { - this.projectDataImporters.clear(); - this.projectDataImporters.addAll(projectDataImporters); - } - @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironment.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironment.java similarity index 55% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironment.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironment.java index f4960d32..9018174e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironment.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironment.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import java.io.File; import java.io.IOException; @@ -9,42 +9,48 @@ import de.hybris.platform.servicelayer.config.ConfigurationService; import de.hybris.platform.servicelayer.impex.ImportConfig; -import org.apache.commons.configuration.BaseConfiguration; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy; -import org.apache.log4j.Logger; +import org.apache.commons.configuration2.PropertiesConfiguration; +import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder; +import org.apache.commons.configuration2.builder.fluent.Parameters; +import org.apache.commons.configuration2.ex.ConfigurationException; import org.assertj.core.util.VisibleForTesting; -import org.springframework.beans.factory.annotation.Required; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This facade handles the access to important properties for the system setup process. It also keeps track of imported * files and verifies the release numbers of the files accordingly. */ public final class SystemSetupEnvironment { - static final Logger LOG = Logger.getLogger(SystemSetupEnvironment.class); + static final Logger LOG = LoggerFactory.getLogger(SystemSetupEnvironment.class); @VisibleForTesting - static final String LEGACYMODEKEY = "sapcommercetoolkit.impeximport.configuration.legacymode"; + static final String LEGACYMODEKEY = "cxdevtoolkit.impeximport.configuration.legacymode"; @VisibleForTesting - static final String ENABLECODEEXECUTIONKEY = "sapcommercetoolkit.impeximport.configuration.enablecodeexecution"; + static final String ENABLECODEEXECUTIONKEY = "cxdevtoolkit.impeximport.configuration.enablecodeexecution"; @VisibleForTesting - static final String VALIDATIONMODEKEY = "sapcommercetoolkit.impeximport.configuration.validationmode"; + static final String VALIDATIONMODEKEY = "cxdevtoolkit.impeximport.configuration.validationmode"; @VisibleForTesting - static final String DEFAULTLOCALEKEY = "sapcommercetoolkit.impeximport.configuration.defaultlocale"; + static final String DEFAULTLOCALEKEY = "cxdevtoolkit.impeximport.configuration.defaultlocale"; @VisibleForTesting - static final String ISDEVELOPMENTKEY = "sapcommercetoolkit.impeximport.environment.isdevelopment"; + static final String ISDEVELOPMENTKEY = "cxdevtoolkit.impeximport.environment.isdevelopment"; @VisibleForTesting - static final String SUPPORTLOCALIZATIONKEY = "sapcommercetoolkit.impeximport.environment.supportlocalizedfiles"; + static final String SUPPORTLOCALIZATIONKEY = "cxdevtoolkit.impeximport.environment.supportlocalizedfiles"; @VisibleForTesting - static final String LASTPROCESSEDRELEASEVERSIONKEY = "sapcommercetoolkit.impeximport.configuration.lastprocessedreleaseversion"; + static final String LASTPROCESSEDRELEASEVERSIONKEY = "cxdevtoolkit.impeximport.configuration.lastprocessedreleaseversion"; @VisibleForTesting - static final String LASTPROCESSEDRELEASEITEMSKEY = "sapcommercetoolkit.impeximport.configuration.lastprocessedreleaseitems"; + static final String LASTPROCESSEDRELEASEITEMSKEY = "cxdevtoolkit.impeximport.configuration.lastprocessedreleaseitems"; @VisibleForTesting - static final String FILE_HEADER = "This file is generated automatically by the sapcommercetoolkit extension. Do not change the file manually!"; + static final String FILE_HEADER = "This file is generated automatically by the cxdevtoolkit extension. Do not change the file manually!"; - private Configuration persistentConfiguration = new BaseConfiguration(); - private ConfigurationService configurationService; + private final String fileName; + private final ConfigurationService configurationService; + private FileBasedConfigurationBuilder persistentConfiguration; + + public SystemSetupEnvironment(String fileName, ConfigurationService configurationService) { + this.fileName = fileName; + this.configurationService = configurationService; + this.updatePersistentConfigurationBuilder(); + } public boolean useLegacyModeForImpEx() { return configurationService.getConfiguration().getBoolean(LEGACYMODEKEY, false); @@ -77,24 +83,38 @@ public boolean supportLocalizedImpExFiles() { public void addProcessedItem(String version, String key) { setLastProcessedReleaseVersion(version); - persistentConfiguration.addProperty(LASTPROCESSEDRELEASEITEMSKEY, key); + getPersistentConfiguration().addProperty(LASTPROCESSEDRELEASEITEMSKEY, key); + } + + private PropertiesConfiguration getPersistentConfiguration() { + try { + if (persistentConfiguration == null) { + throw new ConfigurationException("No persistent configuration found!"); + } + return persistentConfiguration.getConfiguration(); + } catch (ConfigurationException e) { + LOG.error( + "Persistent configuration could not be loaded, any modification will be lost! Please make sure you have configured the file path correctly. Current value is '{}'", + fileName, e); + return new PropertiesConfiguration(); + } } public void setLastProcessedReleaseVersion(String version) { String lastVersion = getLastProcessedReleaseVersion(); if (version.compareToIgnoreCase(lastVersion) > 0) { - persistentConfiguration.clearProperty(LASTPROCESSEDRELEASEITEMSKEY); - persistentConfiguration.setProperty(LASTPROCESSEDRELEASEVERSIONKEY, version); + getPersistentConfiguration().clearProperty(LASTPROCESSEDRELEASEITEMSKEY); + getPersistentConfiguration().setProperty(LASTPROCESSEDRELEASEVERSIONKEY, version); } } public String getLastProcessedReleaseVersion() { - return persistentConfiguration.getString(LASTPROCESSEDRELEASEVERSIONKEY, ""); + return getPersistentConfiguration().getString(LASTPROCESSEDRELEASEVERSIONKEY, ""); } public List getLastProcessedItems() { ArrayList keys = new ArrayList<>(); - persistentConfiguration.getList(LASTPROCESSEDRELEASEITEMSKEY).stream() + getPersistentConfiguration().getList(LASTPROCESSEDRELEASEITEMSKEY).stream() .map(String.class::cast) .forEach(keys::add); return keys; @@ -135,33 +155,27 @@ private Locale getLocaleFromConfig(String key, Locale defaultValue) { return new Locale(locale); } - @Required - public void setConfigurationService(ConfigurationService configurationService) { - this.configurationService = configurationService; - } - - public void setConfigurationFile(String fileName) { + private void updatePersistentConfigurationBuilder() { try { - PropertiesConfiguration configuration = new PropertiesConfiguration(); - configuration.setFileName(fileName); - - File file = configuration.getFile(); + File file = new File(fileName); if (!file.exists()) { file.getParentFile().mkdirs(); if (!file.createNewFile()) { throw new IOException("Cannot create file at: " + fileName); } - configuration.setHeader(FILE_HEADER); - configuration.save(); - } else { - configuration.load(); } - configuration.setAutoSave(true); - configuration.setReloadingStrategy(new FileChangedReloadingStrategy()); - this.persistentConfiguration = configuration; + persistentConfiguration = new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class); + persistentConfiguration.setParameters(new Parameters() + .fileBased() + .setEncoding("UTF-8") + .setFile(file) + .getParameters()); + persistentConfiguration.setAutoSave(true); + persistentConfiguration.getConfiguration().setHeader(FILE_HEADER); } catch (IOException | ConfigurationException e) { LOG.error("Cannot read or create persistent configuration file at: " + fileName + ". Please create the file manually and restart the server.", e); + persistentConfiguration = null; } } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetup.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetup.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetup.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetup.java index ebd823f3..9d3e0575 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetup.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetup.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import java.util.List; @@ -7,7 +7,7 @@ import de.hybris.platform.core.initialization.SystemSetupParameter; import de.hybris.platform.core.initialization.SystemSetupParameterMethod; -import tools.sapcx.commerce.toolkit.constants.ToolkitConstants; +import me.cxdev.commerce.toolkit.constants.ToolkitConstants; /** * System setup class for the toolkit extension. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java similarity index 74% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java index fe124f63..bc3746dd 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/PrefixBasedDataImporter.java @@ -1,15 +1,14 @@ -package tools.sapcx.commerce.toolkit.setup.importer; +package me.cxdev.commerce.toolkit.setup.importer; import java.util.function.Predicate; import de.hybris.platform.core.initialization.SystemSetupContext; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Required; +import org.apache.commons.lang3.StringUtils; -import tools.sapcx.commerce.toolkit.impex.executor.ImpExDataImportExecutor; -import tools.sapcx.commerce.toolkit.setup.ImpExDataImporter; -import tools.sapcx.commerce.toolkit.setup.SystemSetupEnvironment; +import me.cxdev.commerce.toolkit.impex.executor.ImpExDataImportExecutor; +import me.cxdev.commerce.toolkit.setup.ImpExDataImporter; +import me.cxdev.commerce.toolkit.setup.SystemSetupEnvironment; /** * Implementation of the {@link ImpExDataImporter} that retrieves all configuration values from the environment that @@ -19,12 +18,12 @@ * Example: * * - * sapcommercetoolkit.impeximport.sampledata.0100.categories=/path/to/file100.impex - * sapcommercetoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file200.impex - * sapcommercetoolkit.impeximport.sampledata.0150.products=/path/to/file150.impex + * cxdevtoolkit.impeximport.sampledata.0100.categories=/path/to/file100.impex + * cxdevtoolkit.impeximport.sampledata.0200.classificationsystem=/path/to/file200.impex + * cxdevtoolkit.impeximport.sampledata.0150.products=/path/to/file150.impex * * - * In this example, an {@link PrefixBasedDataImporter} with prefix set to `sapcommercetoolkit,impeximport.sampledata` + * In this example, an {@link PrefixBasedDataImporter} with prefix set to `cxdevtoolkit,impeximport.sampledata` * imports the files in the following order: file100.impex, file150.impex and file200.impex * * The order is determined by the configuration keys and not by the loading order of the underlying properties files. @@ -53,7 +52,6 @@ protected Predicate getKeyFilter(SystemSetupContext context) { return StringUtils::isNotBlank; } - @Required public void setEnvironment(SystemSetupEnvironment environment) { this.environment = environment; } @@ -62,7 +60,6 @@ public SystemSetupEnvironment getEnvironment() { return environment; } - @Required public void setImpExDataImportExecutor(ImpExDataImportExecutor impExDataImportExecutor) { this.impExDataImportExecutor = impExDataImportExecutor; } @@ -71,7 +68,6 @@ public ImpExDataImportExecutor getImpExDataImportExecutor() { return impExDataImportExecutor; } - @Required public void setTitle(String title) { this.title = title; } @@ -80,7 +76,6 @@ public String getTitle() { return title; } - @Required public void setPrefix(String prefix) { this.prefix = prefix; } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ProjectDataImporter.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ProjectDataImporter.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ProjectDataImporter.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ProjectDataImporter.java index 5f55970c..0bb3168f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ProjectDataImporter.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ProjectDataImporter.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup.importer; +package me.cxdev.commerce.toolkit.setup.importer; import java.util.Arrays; import java.util.Collections; @@ -8,7 +8,7 @@ import de.hybris.platform.core.initialization.SystemSetupContext; import de.hybris.platform.core.initialization.SystemSetupParameter; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; /** * In addition to the {@link PrefixBasedDataImporter}, this class adds a {@link SystemSetupParameter} for every key. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ReleasePatchesImporter.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ReleasePatchesImporter.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ReleasePatchesImporter.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ReleasePatchesImporter.java index bcbeebfa..959c68a6 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/setup/importer/ReleasePatchesImporter.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/src/me/cxdev/commerce/toolkit/setup/importer/ReleasePatchesImporter.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup.importer; +package me.cxdev.commerce.toolkit.setup.importer; import java.util.List; import java.util.function.Predicate; @@ -7,9 +7,9 @@ import de.hybris.platform.core.initialization.SystemSetupContext; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; -import tools.sapcx.commerce.toolkit.setup.SystemSetupEnvironment; +import me.cxdev.commerce.toolkit.setup.SystemSetupEnvironment; /** * The {@link ReleasePatchesImporter} was created to apply minor changes to essential and initial data, that have diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/config/ExtensionConfigurationTests.java similarity index 59% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/config/ExtensionConfigurationTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/config/ExtensionConfigurationTests.java index ea876810..37f0ac2c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/config/ExtensionConfigurationTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/config/ExtensionConfigurationTests.java @@ -1,17 +1,17 @@ -package tools.sapcx.commerce.toolkit.config; +package me.cxdev.commerce.toolkit.config; import de.hybris.bootstrap.annotations.UnitTest; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; +import me.cxdev.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; @UnitTest public class ExtensionConfigurationTests { @Test public void extensionConfiguration() { InstalledExtensionVerifier.verifier() - .requires("sapcommercetoolkit") + .requires("cxdevtoolkit") .verify(); } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java index 2e2a7f0a..0480da64 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/DefaultHtmlEmailServiceTests.java @@ -1,18 +1,18 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.assertj.core.api.Assertions.assertThat; import java.util.Random; -import javax.mail.internet.InternetAddress; - import de.hybris.bootstrap.annotations.UnitTest; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.Before; import org.junit.Test; +import jakarta.mail.internet.InternetAddress; + @UnitTest public class DefaultHtmlEmailServiceTests { private DefaultHtmlEmailService emailService; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailAddressTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailAddressTests.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailAddressTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailAddressTests.java index f429bbaf..654012eb 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailAddressTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailAddressTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilderTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailBuilderTests.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilderTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailBuilderTests.java index c4586dbb..6b24ea1d 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailBuilderTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailBuilderTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; @@ -9,21 +9,20 @@ import java.nio.file.Path; import java.util.Locale; -import javax.mail.MessagingException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMultipart; - import de.hybris.bootstrap.annotations.UnitTest; import de.hybris.platform.core.model.media.MediaModel; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilders; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; -import tools.sapcx.commerce.toolkit.testing.testdoubles.email.HtmlEmailGeneratorFake; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMultipart; +import me.cxdev.commerce.toolkit.email.attachments.HtmlEmailAttachmentBuilders; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.testdoubles.email.HtmlEmailGeneratorFake; @UnitTest public class HtmlEmailBuilderTests { @@ -168,28 +167,31 @@ public void testAttachments() throws Exception { .build(); htmlEmail.buildMimeMessage(); - assertThat(htmlEmail) .extracting("container") - .flatExtracting("parts") + .extracting("parts") + .asList() .extractingResultOf("getDisposition") .containsExactly(null, "attachment", "attachment"); assertThat(htmlEmail) .extracting("container") - .flatExtracting("parts") + .extracting("parts") + .asList() .extractingResultOf("getContentType") .containsExactly("text/plain", "text/plain", "text/plain"); assertThat(htmlEmail) .extracting("container") - .flatExtracting("parts") + .extracting("parts") + .asList() .extractingResultOf("getFileName") .containsExactly(null, tempFile.getFileName().toString(), "url-attachment.txt"); assertThat(htmlEmail) .extracting("container") - .flatExtracting("parts") + .extracting("parts") + .asList() .extractingResultOf("getDescription") .containsExactly(null, null, "url attachment description"); } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java similarity index 92% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java index 43fc3abc..2246da36 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/HtmlEmailGeneratorDefaultMethodsTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.assertj.core.api.Assertions.assertThat; @@ -8,16 +8,15 @@ import java.util.Locale; import java.util.Map; -import javax.mail.MessagingException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMultipart; - -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.testdoubles.email.HtmlEmailGeneratorFake; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMultipart; +import me.cxdev.commerce.toolkit.testing.testdoubles.email.HtmlEmailGeneratorFake; public class HtmlEmailGeneratorDefaultMethodsTests { private HtmlEmailGenerator htmlEmailGenerator; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java index bf83a00d..f3442f07 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/ThymeleafHtmlEmailGeneratorTests.java @@ -1,7 +1,7 @@ -package tools.sapcx.commerce.toolkit.email; +package me.cxdev.commerce.toolkit.email; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -12,21 +12,21 @@ import java.util.Locale; import java.util.Map; -import javax.mail.MessagingException; -import javax.mail.internet.AddressException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMultipart; - import de.hybris.bootstrap.annotations.UnitTest; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.thymeleaf.ITemplateEngine; import org.thymeleaf.context.IContext; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.AddressException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMultipart; + @UnitTest public class ThymeleafHtmlEmailGeneratorTests { private ITemplateEngine templateEngine; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java index e7f54713..df1ac7ec 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInDatabaseHtmlEmailServiceFakeTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email.fake; +package me.cxdev.commerce.toolkit.email.fake; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -9,22 +9,21 @@ import java.io.OutputStream; import java.util.List; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.internet.MimeMessage; - import de.hybris.bootstrap.annotations.UnitTest; import de.hybris.platform.servicelayer.media.MediaService; import de.hybris.platform.servicelayer.model.ModelService; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; -import tools.sapcx.commerce.toolkit.model.LocallyStoredEmailModel; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import jakarta.mail.MessagingException; +import jakarta.mail.Session; +import jakarta.mail.internet.MimeMessage; +import me.cxdev.commerce.toolkit.model.LocallyStoredEmailModel; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; @UnitTest public class StoreInDatabaseHtmlEmailServiceFakeTests { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java index 716373e5..208c1f28 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/email/fake/StoreInLocalDirectoryHtmlEmailServiceFakeTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.email.fake; +package me.cxdev.commerce.toolkit.email.fake; import static org.assertj.core.api.Assertions.assertThat; @@ -9,19 +9,19 @@ import java.nio.file.Path; import java.util.List; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.internet.MimeMessage; - import de.hybris.bootstrap.annotations.UnitTest; import org.apache.commons.io.FileUtils; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; import org.junit.After; import org.junit.Before; import org.junit.Test; +import jakarta.mail.MessagingException; +import jakarta.mail.Session; +import jakarta.mail.internet.MimeMessage; + @UnitTest public class StoreInLocalDirectoryHtmlEmailServiceFakeTests { private StoreLocallyHtmlEmailServiceFake service; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java similarity index 88% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java index 573cf96e..c4c89d11 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/impex/executor/ImpExDataImporterLoggerTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.impex.executor; +package me.cxdev.commerce.toolkit.impex.executor; import static org.assertj.core.api.Assertions.assertThat; @@ -11,8 +11,6 @@ import de.hybris.platform.util.JspContext; import org.apache.commons.io.output.StringBuilderWriter; -import org.apache.log4j.Level; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockJspWriter; @@ -21,7 +19,6 @@ public class ImpExDataImporterLoggerTests { private SystemSetupContext context; private Writer jspOutWriter = new StringBuilderWriter(); - private Level previousLevel; private ImpExDataImporterLogger logger; @@ -33,12 +30,6 @@ public void setUp() throws Exception { context.setJspContext(new JspContext(new MockJspWriter(jspOutWriter), null, null)); logger = new ImpExDataImporterLogger(); - previousLevel = ImpExDataImporterLogger.LOG.getLevel(); - } - - @After - public void tearDown() throws Exception { - ImpExDataImporterLogger.LOG.setLevel(previousLevel); } @Test @@ -61,16 +52,12 @@ public void verifyDebugWithExceptionDoesNotLogToJspContext() { @Test public void verifyDebugLogsToJspContextIfDebugIsEnabled() { - ImpExDataImporterLogger.LOG.setLevel(Level.DEBUG); - logger.debug(context, "debug text"); assertThat(jspOutWriter.toString()).isEqualTo(coloredTextWithNewline("debug text", "cyan")); } @Test public void verifyDebugWithExceptionLogsToJspContextIfDebugIsEnabled() { - ImpExDataImporterLogger.LOG.setLevel(Level.DEBUG); - logger.debug(context, "debug text"); assertThat(jspOutWriter.toString()).isEqualTo(coloredTextWithNewline("debug text", "cyan")); } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironmentTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironmentTests.java similarity index 82% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironmentTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironmentTests.java index 44bfa8a2..556e3d0b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/SystemSetupEnvironmentTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/SystemSetupEnvironmentTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import static org.assertj.core.api.Assertions.assertThat; @@ -9,22 +9,28 @@ import de.hybris.platform.servicelayer.impex.ImportConfig; import org.apache.commons.io.FileUtils; +import org.junit.After; import org.junit.Before; import org.junit.Test; -import tools.sapcx.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; +import me.cxdev.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; @UnitTest public class SystemSetupEnvironmentTests { private ConfigurationServiceFake configurationServiceFake; private SystemSetupEnvironment environment; + private File tempFile; @Before - public void setUp() { + public void setUp() throws Exception { configurationServiceFake = new ConfigurationServiceFake(); + tempFile = File.createTempFile("configuration", ".properties"); + environment = new SystemSetupEnvironment(tempFile.getAbsolutePath(), configurationServiceFake); + } - environment = new SystemSetupEnvironment(); - environment.setConfigurationService(configurationServiceFake); + @After + public void removeTempFile() throws Exception { + tempFile.delete(); } @Test @@ -111,33 +117,18 @@ public void withConfigurationForPrefix_mapToKeyIsResolved() { @Test public void verifyPersistentConfigurationFileIsCreatedIfAbsent() throws Exception { - File tempFile = null; - try { - tempFile = File.createTempFile("configuration", ".properties"); - tempFile.delete(); - - environment.setConfigurationFile(tempFile.getAbsolutePath()); - - assertThat(tempFile).exists().canRead().canWrite(); - assertThat(tempFile).hasContent("# " + environment.FILE_HEADER + "\n\n"); - } finally { - tempFile.delete(); - } + tempFile.delete(); + environment = new SystemSetupEnvironment(tempFile.getAbsolutePath(), configurationServiceFake); + + assertThat(tempFile).exists().canRead().canWrite(); + assertThat(tempFile).hasContent("# " + environment.FILE_HEADER + "\n\n"); } @Test public void verifyPersistentConfigurationFileIsReadIfAvailable() throws Exception { - File tempFile = null; - try { - tempFile = File.createTempFile("configuration", ".properties"); - FileUtils.writeStringToFile(tempFile, "# " + SystemSetupEnvironment.FILE_HEADER + "\n\n"); - FileUtils.writeStringToFile(tempFile, SystemSetupEnvironment.LASTPROCESSEDRELEASEVERSIONKEY + " = release1x0x0\n"); - - environment.setConfigurationFile(tempFile.getAbsolutePath()); - - assertThat(environment.getLastProcessedReleaseVersion()).isEqualTo("release1x0x0"); - } finally { - tempFile.delete(); - } + FileUtils.writeStringToFile(tempFile, "# " + SystemSetupEnvironment.FILE_HEADER + "\n\n"); + FileUtils.writeStringToFile(tempFile, SystemSetupEnvironment.LASTPROCESSEDRELEASEVERSIONKEY + " = release1x0x0\n"); + + assertThat(environment.getLastProcessedReleaseVersion()).isEqualTo("release1x0x0"); } } diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetupTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetupTests.java similarity index 83% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetupTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetupTests.java index 68d50a5e..e2b8d730 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/setup/ToolkitSystemSetupTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/setup/ToolkitSystemSetupTests.java @@ -1,9 +1,10 @@ -package tools.sapcx.commerce.toolkit.setup; +package me.cxdev.commerce.toolkit.setup; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -16,18 +17,19 @@ import de.hybris.platform.core.initialization.SystemSetupContext; import de.hybris.platform.core.initialization.SystemSetupParameter; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.ApplicationContext; -import tools.sapcx.commerce.toolkit.constants.ToolkitConstants; -import tools.sapcx.commerce.toolkit.impex.executor.ImpExDataImportExecutor; -import tools.sapcx.commerce.toolkit.setup.importer.PrefixBasedDataImporter; -import tools.sapcx.commerce.toolkit.setup.importer.ProjectDataImporter; -import tools.sapcx.commerce.toolkit.setup.importer.ReleasePatchesImporter; -import tools.sapcx.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.ValidationServiceSpy; +import me.cxdev.commerce.toolkit.constants.ToolkitConstants; +import me.cxdev.commerce.toolkit.impex.executor.ImpExDataImportExecutor; +import me.cxdev.commerce.toolkit.setup.importer.PrefixBasedDataImporter; +import me.cxdev.commerce.toolkit.setup.importer.ProjectDataImporter; +import me.cxdev.commerce.toolkit.setup.importer.ReleasePatchesImporter; +import me.cxdev.commerce.toolkit.testing.testdoubles.config.ConfigurationServiceFake; +import me.cxdev.commerce.toolkit.testing.testdoubles.core.ValidationServiceSpy; @UnitTest public class ToolkitSystemSetupTests { @@ -46,31 +48,37 @@ public class ToolkitSystemSetupTests { private ProjectDataImporter releasePatchReRunImporter; private ToolkitSystemSetup systemSetup; + private File tempFile; @Before public void setUp() throws Exception { + tempFile = File.createTempFile("configuration", ".properties"); + applicationContext = mock(ApplicationContext.class); when(applicationContext.getBean(ReliableSystemSetupExecutor.COCKPIT_CONFIGURATION_SERVICE)).thenThrow(new NoSuchBeanDefinitionException("Bean not found!")); validationService = new ValidationServiceSpy(); - environment = new SystemSetupEnvironment(); - configurationServiceFake = new ConfigurationServiceFake(); - environment.setConfigurationService(configurationServiceFake); + environment = new SystemSetupEnvironment("", configurationServiceFake); setupImpexDataImporterForTesting(environment); addEnvironmentConfiguration(false, false, false); - ReliableSystemSetupExecutor executor = new ReliableSystemSetupExecutor(); + ReliableSystemSetupExecutor executor = new ReliableSystemSetupExecutor( + validationService, + elementaryDataImporter, + essentialDataImporter, + releasePatchesImporter, + Arrays.asList(sampleDataImporter, testDataImporter, releasePatchReRunImporter)); executor.setApplicationContext(applicationContext); - executor.setValidationService(validationService); - executor.setElementaryDataImporter(elementaryDataImporter); - executor.setEssentialDataImporter(essentialDataImporter); - executor.setReleasePatchesImporter(releasePatchesImporter); - executor.setProjectDataImporters(Arrays.asList(sampleDataImporter, testDataImporter, releasePatchReRunImporter)); systemSetup = new ToolkitSystemSetup(executor, true); } + @After + public void removeTempFile() throws Exception { + tempFile.delete(); + } + @Test public void whenInit_verifyValidationEngineIsReloaded() { addEnvironmentConfiguration(false, false, false); @@ -268,8 +276,8 @@ public void whenIncrementalUpdate_verifyOnlyNewerReleasePatchesArePerformed() { addConfigurationForImpExFiles(); performSilently(SystemSetup.Process.UPDATE); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x1.0003", "/releasepatches/release2x1-0003.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x1.0004", "/releasepatches/release2x1-0004.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x1.0003", "/releasepatches/release2x1-0003.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x1.0004", "/releasepatches/release2x1-0004.impex"); SystemSetupContext contextForSecondRun = contextFor(SystemSetup.Process.UPDATE, SystemSetup.Type.ALL); systemSetup.reliableSetupPhases(contextForSecondRun); @@ -311,9 +319,9 @@ public void whenSystemSetupParametersIsCalled_itContainsAllSystemSetupParameters List systemSetupParameters = systemSetup.getSystemSetupParameters(); assertThat(systemSetupParameters.stream().map(SystemSetupParameter::getKey)).containsExactlyInAnyOrder( - "sapcxtoolkit.impeximport.sampledata", - "sapcxtoolkit.impeximport.testdata", - "sapcxtoolkit.impeximport.releasepatch"); + "cxdevtoolkit.impeximport.sampledata", + "cxdevtoolkit.impeximport.testdata", + "cxdevtoolkit.impeximport.releasepatch"); assertThat(systemSetupParameters.stream().map(SystemSetupParameter::isMultiSelect).allMatch(Boolean.TRUE::equals)).isTrue(); } @@ -355,75 +363,75 @@ private void setupImpexDataImporterForTesting(SystemSetupEnvironment environment elementaryDataImporter.setEnvironment(environment); elementaryDataImporter.setImpExDataImportExecutor(executor); elementaryDataImporter.setTitle("Elementary Data"); - elementaryDataImporter.setPrefix("sapcxtoolkit.impeximport.elementarydata"); + elementaryDataImporter.setPrefix("cxdevtoolkit.impeximport.elementarydata"); essentialDataImporter = new PrefixBasedDataImporter(); essentialDataImporter.setEnvironment(environment); essentialDataImporter.setImpExDataImportExecutor(executor); essentialDataImporter.setTitle("Essential Data"); - essentialDataImporter.setPrefix("sapcxtoolkit.impeximport.essentialdata"); + essentialDataImporter.setPrefix("cxdevtoolkit.impeximport.essentialdata"); releasePatchesImporter = new ReleasePatchesImporter(); releasePatchesImporter.setEnvironment(environment); releasePatchesImporter.setImpExDataImportExecutor(executor); releasePatchesImporter.setTitle("Release Patches (automatically)"); - releasePatchesImporter.setPrefix("sapcxtoolkit.impeximport.releasepatch"); + releasePatchesImporter.setPrefix("cxdevtoolkit.impeximport.releasepatch"); overlayDataImporter = new ProjectDataImporter(); overlayDataImporter.setEnvironment(environment); overlayDataImporter.setImpExDataImportExecutor(executor); overlayDataImporter.setTitle("Overlays"); - overlayDataImporter.setPrefix("sapcxtoolkit.impeximport.overlay"); + overlayDataImporter.setPrefix("cxdevtoolkit.impeximport.overlay"); sampleDataImporter = new ProjectDataImporter(); sampleDataImporter.setEnvironment(environment); sampleDataImporter.setImpExDataImportExecutor(executor); sampleDataImporter.setTitle("Sample Data"); - sampleDataImporter.setPrefix("sapcxtoolkit.impeximport.sampledata"); + sampleDataImporter.setPrefix("cxdevtoolkit.impeximport.sampledata"); testDataImporter = new ProjectDataImporter(); testDataImporter.setEnvironment(environment); testDataImporter.setImpExDataImportExecutor(executor); testDataImporter.setTitle("Test Data"); - testDataImporter.setPrefix("sapcxtoolkit.impeximport.testdata"); + testDataImporter.setPrefix("cxdevtoolkit.impeximport.testdata"); releasePatchReRunImporter = new ProjectDataImporter(); releasePatchReRunImporter.setEnvironment(environment); releasePatchReRunImporter.setImpExDataImportExecutor(executor); releasePatchReRunImporter.setTitle("Release Patches (manual)"); - releasePatchReRunImporter.setPrefix("sapcxtoolkit.impeximport.releasepatch"); + releasePatchReRunImporter.setPrefix("cxdevtoolkit.impeximport.releasepatch"); } private void addEnvironmentConfiguration(boolean isDevelopment, boolean shouldImportSampleData, boolean shouldImportTestData) { configurationServiceFake.setProperty(SystemSetupEnvironment.ISDEVELOPMENTKEY, isDevelopment); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.environment.importsampledata", shouldImportSampleData); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.environment.importsampledata", shouldImportSampleData); sampleDataImporter.setImportOnInitialization(isDevelopment || shouldImportSampleData); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.environment.importtestdata", shouldImportTestData); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.environment.importtestdata", shouldImportTestData); testDataImporter.setImportOnInitialization(isDevelopment || shouldImportTestData); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.environment.importtestdata", shouldImportTestData); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.environment.importtestdata", shouldImportTestData); } private void addConfigurationForImpExFiles() { - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.elementarydata.0001.optionaltext", "/elementary/file0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.elementarydata.0002", "/elementary/file0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.elementarydata.0003.optionaltext", "/elementary/file0003.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.essentialdata.0002.something", "/essential/file0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.essentialdata.0001.something", "/essential/file0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.essentialdata.0003.something", "/essential/file0003.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.overlay.0001.overlay1", "/overlay/file0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.overlay.0002.overlay2", "/overlay/file0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.testdata.0001.optionaltext", "/testdata/file0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.testdata.0003", "/testdata/file0003.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.testdata.0002", "/testdata/file0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.sampledata.0003", "/sampledata/file0003.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.sampledata.0002.optionaltext", "/sampledata/file0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.sampledata.0001", "/sampledata/file0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release1x0.0001.optionaltext", "/releasepatches/release1x0-0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release1x0.0002", "/releasepatches/release1x0-0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x1.0002", "/releasepatches/release2x1-0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x1.0001", "/releasepatches/release2x1-0001.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x0.0002", "/releasepatches/release2x0-0002.impex"); - configurationServiceFake.setProperty("sapcxtoolkit.impeximport.releasepatch.release2x0.0001", "/releasepatches/release2x0-0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.elementarydata.0001.optionaltext", "/elementary/file0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.elementarydata.0002", "/elementary/file0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.elementarydata.0003.optionaltext", "/elementary/file0003.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.essentialdata.0002.something", "/essential/file0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.essentialdata.0001.something", "/essential/file0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.essentialdata.0003.something", "/essential/file0003.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.overlay.0001.overlay1", "/overlay/file0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.overlay.0002.overlay2", "/overlay/file0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.testdata.0001.optionaltext", "/testdata/file0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.testdata.0003", "/testdata/file0003.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.testdata.0002", "/testdata/file0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.sampledata.0003", "/sampledata/file0003.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.sampledata.0002.optionaltext", "/sampledata/file0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.sampledata.0001", "/sampledata/file0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release1x0.0001.optionaltext", "/releasepatches/release1x0-0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release1x0.0002", "/releasepatches/release1x0-0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x1.0002", "/releasepatches/release2x1-0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x1.0001", "/releasepatches/release2x1-0001.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x0.0002", "/releasepatches/release2x0-0002.impex"); + configurationServiceFake.setProperty("cxdevtoolkit.impeximport.releasepatch.release2x0.0001", "/releasepatches/release2x0-0001.impex"); } private void performSilently(SystemSetup.Process process) { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java index dbeb3e7d..d158d62f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ExceptionThrowingItemModelAttribute.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import java.util.Locale; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java index 2b0a5efd..8aa08f42 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicAttributeHandler.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import de.hybris.platform.servicelayer.model.AbstractItemModel; import de.hybris.platform.servicelayer.model.attribute.DynamicAttributeHandler; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java index 3d6b1c58..06870990 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryDynamicItemModelAttribute.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import java.util.*; import java.util.function.Function; @@ -7,7 +7,7 @@ import de.hybris.platform.servicelayer.model.attribute.DynamicAttributeHandler; import de.hybris.platform.servicelayer.model.attribute.DynamicLocalizedAttributeHandler; -import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; public class InMemoryDynamicItemModelAttribute implements ItemModelAttribute, InMemoryItemAwareAttribute { /** diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java similarity index 75% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java index 0338a449..007e631e 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemAwareAttribute.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import de.hybris.platform.servicelayer.model.AbstractItemModel; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java index 74102655..1940a7df 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelAttribute.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import java.util.*; import java.util.function.Function; -import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; class InMemoryItemModelAttribute implements ItemModelAttribute { /** diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java index d7abd301..e17d2f92 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContext.java @@ -1,7 +1,7 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.attributeFor; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.localizedAttributeFor; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.attributeFor; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.localizedAttributeFor; import java.io.ObjectStreamException; import java.util.*; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java similarity index 69% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java index 30072ce9..7e776aa2 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryItemModelContextAccessor.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; public interface InMemoryItemModelContextAccessor { void save(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java index b9d0cc54..194ece75 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryLocalizedItemModelAttribute.java @@ -1,12 +1,12 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.getDefaultLocale; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.getDefaultLocale; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; -import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; class InMemoryLocalizedItemModelAttribute implements ItemModelAttribute { /** diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java index 89d4bbd4..8f3949dd 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/InMemoryModelFactory.java @@ -1,6 +1,6 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryItemModelContext.contextWithAttributes; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryItemModelContext.contextWithAttributes; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java similarity index 89% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java index 3dca93b5..4e98078f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/itemmodel/ItemModelAttribute.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.itemmodel; +package me.cxdev.commerce.toolkit.testing.itemmodel; import java.util.List; import java.util.Locale; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java index 754c0c85..0a5b1c3b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/CatalogVersionServiceFake.java @@ -1,6 +1,6 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.catalog; +package me.cxdev.commerce.toolkit.testing.testdoubles.catalog; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; import java.util.Collection; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java index ac8f2305..d065a3f5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/catalog/ClassificationServiceFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.catalog; +package me.cxdev.commerce.toolkit.testing.testdoubles.catalog; import static org.apache.commons.collections4.ListUtils.emptyIfNull; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java similarity index 72% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java index 60d800e8..6ae10542 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/ConfigurationServiceFake.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.config; +package me.cxdev.commerce.toolkit.testing.testdoubles.config; import de.hybris.platform.servicelayer.config.ConfigurationService; -import org.apache.commons.configuration.BaseConfiguration; -import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration2.BaseConfiguration; +import org.apache.commons.configuration2.Configuration; public class ConfigurationServiceFake implements ConfigurationService { private BaseConfiguration configuration = new BaseConfiguration(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java index 5478aa2f..76130ddb 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/config/MessageSourceStub.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.config; +package me.cxdev.commerce.toolkit.testing.testdoubles.config; import java.util.Arrays; import java.util.HashMap; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java index d5704d89..1ef2369a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/DummyTypeService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import java.util.Collection; import java.util.Map; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java index 2300b3fe..ffbf8f45 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/I18NServiceStubForLocales.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import java.util.ArrayList; import java.util.Currency; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java index d2115a46..3021f535 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelService.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -13,7 +13,7 @@ import de.hybris.platform.servicelayer.model.AbstractItemModel; import de.hybris.platform.servicelayer.model.ModelService; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class InMemoryModelService implements ModelService { private List removedItemModels = new ArrayList<>(); diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java index d4f94d1e..ce3137d9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InMemoryModelServiceTests.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java index adbe3638..9b4b6940 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/InterceptorContextStub.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import java.util.ArrayList; import java.util.List; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java index b62c8222..c05be458 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceFake.java @@ -1,6 +1,6 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; +import static me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; import java.util.Collection; import java.util.HashMap; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java index 2b61367a..3aa9d8d1 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ModelServiceSpy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java index 611ef298..9bd9da2b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/core/ValidationServiceSpy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.core; +package me.cxdev.commerce.toolkit.testing.testdoubles.core; import java.util.Collection; import java.util.Set; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java index 54a72a72..afbecae1 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.dao; +package me.cxdev.commerce.toolkit.testing.testdoubles.dao; import java.util.ArrayList; import java.util.List; @@ -9,7 +9,7 @@ import de.hybris.platform.servicelayer.internal.dao.GenericDao; import de.hybris.platform.servicelayer.internal.dao.SortParameters; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class GenericDaoFake implements GenericDao { public static GenericDao throwingException(Class exceptionToThrow) { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java similarity index 86% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java index fb077782..18cdd659 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/dao/GenericDaoFakeThrowingException.java @@ -1,6 +1,6 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.dao; +package me.cxdev.commerce.toolkit.testing.testdoubles.dao; -import static tools.sapcx.commerce.toolkit.testing.utils.ReflectionUtils.throwException; +import static me.cxdev.commerce.toolkit.testing.utils.ReflectionUtils.throwException; import java.util.List; import java.util.Map; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java index 6db25702..d264fb1c 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/datamapping/ConverterSpy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.datamapping; +package me.cxdev.commerce.toolkit.testing.testdoubles.datamapping; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java similarity index 77% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java index ed2321dc..e1876734 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/email/HtmlEmailGeneratorFake.java @@ -1,15 +1,14 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.email; +package me.cxdev.commerce.toolkit.testing.testdoubles.email; import java.util.Collection; import java.util.Locale; import java.util.Map; -import javax.mail.internet.InternetAddress; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; - -import tools.sapcx.commerce.toolkit.email.HtmlEmailGenerator; +import jakarta.mail.internet.InternetAddress; +import me.cxdev.commerce.toolkit.email.HtmlEmailGenerator; public class HtmlEmailGeneratorFake implements HtmlEmailGenerator { @Override diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java similarity index 93% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java index d32c6a55..556cf0e5 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.event; +package me.cxdev.commerce.toolkit.testing.testdoubles.event; import java.util.HashSet; import java.util.Set; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java index a1a88294..68c042ae 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/event/EventServiceSpy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.event; +package me.cxdev.commerce.toolkit.testing.testdoubles.event; import java.util.ArrayList; import java.util.HashSet; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java index dce8c42f..cb783a39 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/AddressBuilder.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.models; +package me.cxdev.commerce.toolkit.testing.testdoubles.models; import de.hybris.platform.core.model.c2l.CountryModel; import de.hybris.platform.core.model.c2l.RegionModel; import de.hybris.platform.core.model.user.AddressModel; import de.hybris.platform.core.model.user.TitleModel; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class AddressBuilder { public static AddressBuilder emptyAddress() { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java similarity index 96% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java index b979239d..0b1d514a 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.models; +package me.cxdev.commerce.toolkit.testing.testdoubles.models; import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; @@ -12,7 +12,7 @@ import de.hybris.platform.core.model.product.ProductModel; import de.hybris.platform.servicelayer.model.attribute.DynamicAttributeHandler; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class CategoryBuilder { public static CategoryBuilder category(String code) { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java similarity index 91% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java index e94ea4aa..4820a750 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CategoryTreeBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.models; +package me.cxdev.commerce.toolkit.testing.testdoubles.models; import java.util.ArrayList; import java.util.List; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java similarity index 74% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java index 7298830d..f09adbf1 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/CustomPropertyBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.models; +package me.cxdev.commerce.toolkit.testing.testdoubles.models; import de.hybris.platform.core.model.ItemModel; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java similarity index 94% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java index 6b2d4774..c051a71f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/models/ProductBuilder.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.models; +package me.cxdev.commerce.toolkit.testing.testdoubles.models; import static org.apache.commons.collections4.MapUtils.emptyIfNull; @@ -10,7 +10,7 @@ import de.hybris.platform.core.model.product.ProductModel; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class ProductBuilder { public static ProductBuilder product(String code) { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java index 7d077ca2..b490c35f 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/search/FlexibleSearchServiceStub.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.search; +package me.cxdev.commerce.toolkit.testing.testdoubles.search; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java index 8545251a..af86d378 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/SessionServiceFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.user; +package me.cxdev.commerce.toolkit.testing.testdoubles.user; import java.util.Map; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/TenantDummy.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/TenantDummy.java similarity index 99% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/TenantDummy.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/TenantDummy.java index f20f4d5b..534f2b13 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/TenantDummy.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/TenantDummy.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.user; +package me.cxdev.commerce.toolkit.testing.testdoubles.user; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java similarity index 98% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java index 22372268..c7fb4b1b 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/testdoubles/user/UserServiceFake.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.testdoubles.user; +package me.cxdev.commerce.toolkit.testing.testdoubles.user; import static org.apache.commons.collections4.SetUtils.emptyIfNull; @@ -22,7 +22,7 @@ import de.hybris.platform.servicelayer.user.exceptions.CannotDecodePasswordException; import de.hybris.platform.servicelayer.user.exceptions.PasswordEncoderNotFoundException; -import tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; +import me.cxdev.commerce.toolkit.testing.itemmodel.InMemoryModelFactory; public class UserServiceFake implements UserService { diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/MockingUtils.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/MockingUtils.java similarity index 95% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/MockingUtils.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/MockingUtils.java index e10a6f1c..591979d7 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/MockingUtils.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/MockingUtils.java @@ -1,9 +1,9 @@ -package tools.sapcx.commerce.toolkit.testing.utils; +package me.cxdev.commerce.toolkit.testing.utils; +import static me.cxdev.commerce.toolkit.testing.utils.ReflectionUtils.isVoid; +import static me.cxdev.commerce.toolkit.testing.utils.ReflectionUtils.isVoidMethod; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import static tools.sapcx.commerce.toolkit.testing.utils.ReflectionUtils.isVoid; -import static tools.sapcx.commerce.toolkit.testing.utils.ReflectionUtils.isVoidMethod; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/ReflectionUtils.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/ReflectionUtils.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/ReflectionUtils.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/ReflectionUtils.java index 0470fc6c..35aea682 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/utils/ReflectionUtils.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/utils/ReflectionUtils.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.utils; +package me.cxdev.commerce.toolkit.testing.utils; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java similarity index 90% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java index fe59c463..65b98eb9 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/DelegationPatternVerifier.java @@ -1,11 +1,11 @@ -package tools.sapcx.commerce.toolkit.testing.verifier; +package me.cxdev.commerce.toolkit.testing.verifier; +import static me.cxdev.commerce.toolkit.testing.utils.MockingUtils.injectDelegateMock; +import static me.cxdev.commerce.toolkit.testing.utils.MockingUtils.invokeWithParameterStubs; +import static me.cxdev.commerce.toolkit.testing.utils.MockingUtils.prepareMethodInvocationOnMock; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockingDetails; -import static tools.sapcx.commerce.toolkit.testing.utils.MockingUtils.injectDelegateMock; -import static tools.sapcx.commerce.toolkit.testing.utils.MockingUtils.invokeWithParameterStubs; -import static tools.sapcx.commerce.toolkit.testing.utils.MockingUtils.prepareMethodInvocationOnMock; import java.lang.reflect.Method; import java.util.Arrays; @@ -15,7 +15,7 @@ import org.mockito.exceptions.base.MockitoException; import org.mockito.invocation.Invocation; -import tools.sapcx.commerce.toolkit.testing.utils.MockingUtils; +import me.cxdev.commerce.toolkit.testing.utils.MockingUtils; public class DelegationPatternVerifier { private T instanceUnderTest; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java similarity index 97% rename from core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java rename to core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java index e7d4be38..d6f6c818 100644 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/testsrc/tools/sapcx/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java +++ b/core-customize/hybris/bin/custom/cxdevtools/cxdevtoolkit/testsrc/me/cxdev/commerce/toolkit/testing/verifier/InstalledExtensionVerifier.java @@ -1,4 +1,4 @@ -package tools.sapcx.commerce.toolkit.testing.verifier; +package me.cxdev.commerce.toolkit.testing.verifier; import static org.apache.commons.collections4.SetUtils.emptyIfNull; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales_en.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales_en.properties deleted file mode 100644 index 4b5b9a74..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/localization/sapcommercetoolkit-locales_en.properties +++ /dev/null @@ -1,4 +0,0 @@ -type.LocallyStoredEmail.name=Local Email -type.LocallyStoredEmail.description=Email stored locally by a fake service instead of sending them via SMTP. -type.LocallyStoredEmail.sender.name=Sender -type.LocallyStoredEmail.recipients.name=Recipients \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels.properties deleted file mode 100644 index edd7abee..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels.properties +++ /dev/null @@ -1,2 +0,0 @@ -sapcxtools_treenode_main=SAP CX Tools -sapcxtools_treenode_fakemail=Fake Mails \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_de.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_de.properties deleted file mode 100644 index edd7abee..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -sapcxtools_treenode_main=SAP CX Tools -sapcxtools_treenode_fakemail=Fake Mails \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_en.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_en.properties deleted file mode 100644 index edd7abee..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-backoffice-labels/labels_en.properties +++ /dev/null @@ -1,2 +0,0 @@ -sapcxtools_treenode_main=SAP CX Tools -sapcxtools_treenode_fakemail=Fake Mails \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-spring.xml deleted file mode 100644 index 6630d95c..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit-spring.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/systemsetup-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/systemsetup-spring.xml deleted file mode 100644 index fef24ae2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/systemsetup-spring.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-fake-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-fake-spring.xml deleted file mode 100644 index 8fd768b2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/resources/sapcommercetoolkit/thymeleafemails-fake-spring.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/EmailAfterBuildHook.java b/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/EmailAfterBuildHook.java deleted file mode 100644 index 5af7f8fd..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcommercetoolkit/src/tools/sapcx/commerce/toolkit/email/attachments/EmailAfterBuildHook.java +++ /dev/null @@ -1,9 +0,0 @@ -package tools.sapcx.commerce.toolkit.email.attachments; - -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; - -@FunctionalInterface -public interface EmailAfterBuildHook { - void afterBuild(HtmlEmail email) throws EmailException; -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/.project b/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/.project deleted file mode 100644 index 83e275d6..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - sapcxbackoffice - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - - - - 1642058460820 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/buildcallbacks.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/buildcallbacks.xml deleted file mode 100644 index 63e297db..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/buildcallbacks.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/external-dependencies.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/external-dependencies.xml deleted file mode 100644 index f1b57acb..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxbackoffice/external-dependencies.xml +++ /dev/null @@ -1,10 +0,0 @@ - - 4.0.0 - tools.sapcx - sapcxbackoffice - 4.4.0 - jar - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxenvconfig/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels.properties deleted file mode 100644 index 06a5b78f..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/executereport/labels/labels.properties +++ /dev/null @@ -1,4 +0,0 @@ -executereport.confirmation=Do you want to execute the query and download the report? -executereport.errors.search=Execution of your query resulted in an error: {0} -executereport.errors.create=The report was not generated. -executereport.errors.fileread=The generated file was corrupted. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels.properties deleted file mode 100644 index 1686cb36..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/backoffice/resources/widgets/actions/validatereport/labels/labels.properties +++ /dev/null @@ -1,2 +0,0 @@ -validatereport.successful=The query was executed successfully and returned {0} results. -validatereport.errors.query=The query encountered errors: {0} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/project.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/project.properties deleted file mode 100644 index 724cd41c..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/project.properties +++ /dev/null @@ -1,26 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools -# ---------------------------------------------------------------------------- - -# Location of the file for the global platform spring application context -sapcxreporting.application-context=sapcxreporting-spring.xml - -# Report job config -sapcxreporting.report.job.code=reportGeneratorJobPerformable - -# CSV format settings -sapcxreporting.report.format.csv.encoding=UTF-8 -sapcxreporting.report.format.csv.commentchar=# -sapcxreporting.report.format.csv.fieldseparator=; -sapcxreporting.report.format.csv.textseparator=" -sapcxreporting.report.format.csv.linebreak=\n - -# Excel format settings -sapcxreporting.report.format.excel.highlightheader=false -sapcxreporting.report.format.excel.alternatinglines=false -sapcxreporting.report.format.excel.freezeheader=true -sapcxreporting.report.format.excel.activatefilter=true -sapcxreporting.report.format.excel.autosizecolumns=true - -# Sample data -sapcommercetoolkit.impeximport.sampledata.8100.reports=/sapcxreporting/sampledata/default-reports.impex \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales.properties deleted file mode 100644 index 0a9fec5b..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/localization/sapcxreporting-locales.properties +++ /dev/null @@ -1,44 +0,0 @@ -type.ReportGenerationSchedule.name=Report Schedule -type.ReportGenerationSchedule.reports.name=Reports - -type.QueryReportConfiguration.name=Query Report -type.QueryReportConfiguration.searchQuery.name=Query -type.QueryReportConfiguration.searchQuery.description=Enter the query in FlexibleSearch Syntax -type.QueryReportConfiguration.id.name=ID -type.QueryReportConfiguration.title.name=Title -type.QueryReportConfiguration.description.name=Description -type.QueryReportConfiguration.emailRecipients.name=E-Mail recipients -type.QueryReportConfiguration.emailRecipients.description=E-Mail addresses of the recipients -type.QueryReportConfiguration.exportFormat.name=Export format -type.QueryReportConfiguration.compress.name=Compress Report? -type.QueryReportConfiguration.compress.description=If set to true, reports are compressed for sending via e-mail. -type.QueryReportConfiguration.emailEmptyResult.name=Email empty result? -type.QueryReportConfiguration.emailEmptyResult.description=If set to true, reports are sent even if result is empty. -type.QueryReportConfiguration.parameters.name=Parameters -type.QueryReportConfiguration.csvEncoding.name=Encoding -type.QueryReportConfiguration.csvCommentChar.name=Comment -type.QueryReportConfiguration.csvFieldSeparator.name=Separator -type.QueryReportConfiguration.csvTextSeparator.name=Quote -type.QueryReportConfiguration.csvLineBreak.name=Line break -type.QueryReportConfiguration.excelHighlightHeader.name=Highlight header -type.QueryReportConfiguration.excelFreezeHeader.name=Freeze header -type.QueryReportConfiguration.excelActivateFilter.name=Activate filter -type.QueryReportConfiguration.excelAutosizeColumns.name=Autosize columns -type.QueryReportConfiguration.excelAlternatingLines.name=Alternating lines -type.QueryReportConfiguration.schedules.name=Schedules - -type.QueryReportConfigurationParameter.name=Configuration Parameter -type.QueryReportConfigurationParameter.name.name=Name -type.QueryReportConfigurationParameter.item.name=Item -type.QueryReportConfigurationParameter.itemList.name=Item List - -type.CatalogVersionConfigurationParameter.name=CatalogVersion Parameter -type.CategoryConfigurationParameter.name=Category Parameter -type.ProductConfigurationParameter.name=Product Parameter -type.PrincipalConfigurationParameter.name=Principal Parameter -type.PropertyConfigurationParameter.name=Property Parameter - -type.ConfigurationPropertyAccessor.name=Property Accessor -type.ConfigurationPropertyAccessor.description=Allow to inject configuration properties into flexible search queries. -type.ConfigurationPropertyAccessor.key.name=Key -type.ConfigurationPropertyAccessor.value.name=Value \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels.properties deleted file mode 100644 index b487b68a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels.properties +++ /dev/null @@ -1,11 +0,0 @@ -sapcxreporting.treenode.reporting=Reporting -sapcxreporting.treenode.reporting.parameters=Parameter -sapcxreporting.backoffice.tab.report=Report -sapcxreporting.backoffice.section.report=Configuration -sapcxreporting.backoffice.panel.general=General -sapcxreporting.backoffice.panel.query=Query -sapcxreporting.backoffice.tab.reportformat=Format -sapcxreporting.backoffice.section.reportformat.csv=CSV settings -sapcxreporting.backoffice.section.reportformat.excel=Excel settings -sapcxreporting.backoffice.tab.reportschedules=Schedules -sapcxreporting.backoffice.section.reportschedules=Settings diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_de.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_de.properties deleted file mode 100644 index 6ac517f2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_de.properties +++ /dev/null @@ -1,11 +0,0 @@ -sapcxreporting.treenode.reporting=Reporting -sapcxreporting.treenode.reporting.parameters=Parameter -sapcxreporting.backoffice.tab.report=Bericht -sapcxreporting.backoffice.section.report=Konfiguration -sapcxreporting.backoffice.panel.general=Allgemein -sapcxreporting.backoffice.panel.query=Anfrage -sapcxreporting.backoffice.tab.reportformat=Formatierung -sapcxreporting.backoffice.section.reportformat.csv=CSV Einstellungen -sapcxreporting.backoffice.section.reportformat.excel=Excel Einstellungen -sapcxreporting.backoffice.tab.reportschedules=Zeitplan -sapcxreporting.backoffice.section.reportschedules=Einstellungen \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_en.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_en.properties deleted file mode 100644 index e13492d3..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-backoffice-labels/labels_en.properties +++ /dev/null @@ -1,11 +0,0 @@ -sapcxreporting.treenode.reporting=Reporting -sapcxreporting.treenode.reporting.parameters=Parameter -sapcxreporting.backoffice.tab.report=Report -sapcxreporting.backoffice.section.report=Configuration -sapcxreporting.backoffice.panel.general=General -sapcxreporting.backoffice.panel.query=Query -sapcxreporting.backoffice.tab.reportformat=Format -sapcxreporting.backoffice.section.reportformat.csv=CSV settings -sapcxreporting.backoffice.section.reportformat.excel=Excel settings -sapcxreporting.backoffice.tab.reportschedules=Schedules -sapcxreporting.backoffice.section.reportschedules=Settings \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-spring.xml deleted file mode 100644 index e3ec2b24..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/resources/sapcxreporting-spring.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGenerator.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGenerator.java deleted file mode 100644 index 6dfa96b9..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxreporting/src/tools/sapcx/commerce/reporting/generator/ReportGenerator.java +++ /dev/null @@ -1,12 +0,0 @@ -package tools.sapcx.commerce.reporting.generator; - -import java.io.File; - -import tools.sapcx.commerce.reporting.report.data.QueryFileConfigurationData; -import tools.sapcx.commerce.reporting.search.GenericSearchResult; - -public interface ReportGenerator { - boolean createReport(QueryFileConfigurationData report, GenericSearchResult searchResult, File file); - - String getExtension(); -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/README.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/README.md deleted file mode 100644 index ce5f02b7..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# SAP CX Search - -The `sapcxsearch` extension improves the solr facet search functions. - -## FEATURE DESCRIPTION - -- Configurable version of Solr Indexer Job allowing to specify the indexed type -- A `CxIndexer` interface that can be used to trigger the indexing process -- A `CxIndexerService` that can be used to resolve indexers and trigger the indexing process -- A list of different search providers and resolvers that can be used for indexing - -### How to activate and use - -- the configurable version of the solr indexer job can be used within the backoffice -- add a bean configuration for the providers and resolvers within your project -- the `CxIndexerService` and `CxIndexer`can be used to trigger the indexing process - -## License - -_Licensed under the Apache License, Version 2.0, January 2004_ - -_Copyright 2025, SAP CX Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/scss/sapcxsearch-variables.scss b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/scss/sapcxsearch-variables.scss deleted file mode 100644 index 8b137891..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/scss/sapcxsearch-variables.scss +++ /dev/null @@ -1 +0,0 @@ - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/definition.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/definition.xml deleted file mode 100644 index e1b174d5..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/definition.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Configurable Index - Configurable Index - Phil - 1.0 - tools.sapcx.commerce.search.backoffice.action.SolrIndexerConfigurableOperationsAction - de.hybris.platform.solrfacetsearch.model.config.SolrFacetSearchConfigModel - java.lang.Object - - - - - - icons/indexer_conf_operations_wizard_default.png - icons/indexer_conf_operations_wizard_hover.png - icons/indexer_conf_operations_wizard_disabled.png - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_default.png b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_default.png deleted file mode 100644 index 81783a8a..00000000 Binary files a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_default.png and /dev/null differ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_disabled.png b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_disabled.png deleted file mode 100644 index 9d614224..00000000 Binary files a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_disabled.png and /dev/null differ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_hover.png b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_hover.png deleted file mode 100644 index 0d11edf0..00000000 Binary files a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/icons/indexer_conf_operations_wizard_hover.png and /dev/null differ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_de.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_de.properties deleted file mode 100644 index 7b83bdf4..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_de.properties +++ /dev/null @@ -1 +0,0 @@ -tools.sapcx.commerce.search.backoffice.action.solrindexerconfigurableoperations.action.name=Konfigurierbarer Index diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_en.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_en.properties deleted file mode 100644 index 6c1246b1..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/labels/labels_en.properties +++ /dev/null @@ -1 +0,0 @@ -tools.sapcx.commerce.search.backoffice.action.solrindexerconfigurableoperations.action.name=Configurable Index diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/solrindexerconfigurableoperations.scss b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/solrindexerconfigurableoperations.scss deleted file mode 100644 index 6060d579..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/resources/widgets/actions/solrindexerconfigurableoperations/solrindexerconfigurableoperations.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import "cockpitng-globals.scss"; - -.ya-tools_sapcx_commerce_search_backoffice_action_solrindexerconfigurableoperations { - &:hover { - background: $white none repeat scroll 0 0; - color: $blue__default; - transition: background-color 0.3s ease 0s; - box-shadow: inset 0 0 0 $editor-defaults__action-button--border-width $editor-defaults__action-button-hover--border-color; - .cng-action-icon { - box-shadow: none !important; - - &, &:hover, &:focus { - background: transparent; - } - } - } - - .z-hbox-separator { - display: none; - } - - .cng-action-text { - padding-right: 5px; - padding-top: 3px; - padding-bottom: 0; - line-height: 24px; - } -} \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/action/SolrIndexerConfigurableOperationsAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/action/SolrIndexerConfigurableOperationsAction.java deleted file mode 100644 index ffa21d1d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/action/SolrIndexerConfigurableOperationsAction.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.sapcx.commerce.search.backoffice.action; - -import java.util.Map; - -import com.google.common.collect.Maps; -import com.hybris.cockpitng.actions.ActionContext; -import com.hybris.cockpitng.actions.ActionResult; -import com.hybris.cockpitng.actions.CockpitAction; -import com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware; -import com.hybris.cockpitng.widgets.configurableflow.ConfigurableFlowContextParameterNames; - -import de.hybris.platform.solrfacetsearch.model.config.SolrFacetSearchConfigModel; - -public class SolrIndexerConfigurableOperationsAction extends AbstractComponentWidgetAdapterAware implements CockpitAction { - @Override - public ActionResult perform(ActionContext actionContext) { - Map parametersMap = Maps.newHashMap(); - parametersMap.put(ConfigurableFlowContextParameterNames.TYPE_CODE.getName(), "SolrIndexerConfigurableOperationWizard"); - parametersMap.put("facetSearchConfig", actionContext.getData()); - this.sendOutput("operationWizard", parametersMap); - return new ActionResult("success", (Object) null); - } - - @Override - public boolean canPerform(ActionContext ctx) { - return CockpitAction.super.canPerform(ctx); - } - - @Override - public boolean needsConfirmation(ActionContext ctx) { - return CockpitAction.super.needsConfirmation(ctx); - } - - @Override - public String getConfirmationMessage(ActionContext ctx) { - return CockpitAction.super.getConfirmationMessage(ctx); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/wizard/SolrIndexerConfigurableOperationStep.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/wizard/SolrIndexerConfigurableOperationStep.java deleted file mode 100644 index eb427074..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/backoffice/src/tools/sapcx/commerce/search/backoffice/wizard/SolrIndexerConfigurableOperationStep.java +++ /dev/null @@ -1,115 +0,0 @@ -package tools.sapcx.commerce.search.backoffice.wizard; - -import java.util.*; - -import com.hybris.cockpitng.config.jaxb.wizard.ViewType; -import com.hybris.cockpitng.dataaccess.facades.type.DataType; -import com.hybris.cockpitng.engine.WidgetInstanceManager; - -import de.hybris.platform.servicelayer.cronjob.CronJobService; -import de.hybris.platform.solrfacetsearch.enums.IndexerOperationValues; -import de.hybris.platform.solrfacetsearch.model.config.SolrIndexedTypeModel; -import de.hybris.platform.solrfacetsearch.model.indexer.cron.SolrIndexerCronJobModel; -import de.hybris.platform.solrfacetsearchbackoffice.wizards.BaseSolrIndexerWizardStep; - -import org.zkoss.util.resource.Labels; -import org.zkoss.zk.ui.Component; -import org.zkoss.zul.*; - -import tools.sapcx.commerce.search.model.SolrIndexerConfigurableCronJobModel; - -public class SolrIndexerConfigurableOperationStep extends BaseSolrIndexerWizardStep { - private CronJobService cronJobService; - private String jobDefinitionCode; - - @Override - public void render(Component component, ViewType viewType, Map map, DataType dataType, WidgetInstanceManager widgetInstanceManager) { - this.setWidgetController(widgetInstanceManager); - this.initCustomView(component); - } - - private void initCustomView(final Component component) { - // Create Components - Combobox operationsCombo = initOperationsCombo(); - Combobox indexedTypesCombo = initIndexedTypesCombo(component); - Button startButton = initStartButton(component, operationsCombo, indexedTypesCombo); - - // Layout - Vlayout vlayout = new Vlayout(); - - // Second Row - Div firstRow = new Div(); - vlayout.appendChild(firstRow); - firstRow.appendChild(new Label(this.getLabelService().getObjectLabel("IndexerOperationValues"))); - firstRow.appendChild(operationsCombo); - - // Seperator - Separator separator = new Separator(); - separator.setBar(true); - vlayout.appendChild(separator); - - // Third Row - Div secondRow = new Div(); - vlayout.appendChild(secondRow); - secondRow.appendChild(new Label(this.getLabelService().getObjectLabel("SolrIndexedType"))); - secondRow.appendChild(indexedTypesCombo); - - Div forthRow = new Div(); - vlayout.appendChild(forthRow); - forthRow.appendChild(startButton); - component.appendChild(vlayout); - } - - private Button initStartButton(Component component, Combobox operationsCombo, Combobox indexedTypesCombo) { - Button startButton = new Button(); - startButton.setLabel(Labels.getLabel("com.hybris.cockpitng.widgets.configurableflow.create.solrindexer.cronjob.start")); - startButton.addEventListener("onClick", event -> { - SolrIndexerConfigurableCronJobModel cronJob = SolrIndexerConfigurableOperationStep.this.getCronJob(component); - cronJob.setIndexerOperation(operationsCombo.getSelectedItem().getValue()); - cronJob.setIndexedTypes(List.of(indexedTypesCombo.getSelectedItem().getValue())); - SolrIndexerConfigurableOperationStep.this.startCronJob(SolrIndexerConfigurableOperationStep.this.getWidgetController(), cronJob); - }); - return startButton; - } - - private Combobox initIndexedTypesCombo(Component component) { - final Combobox indexedTypesCombo = new Combobox(); - SolrIndexerCronJobModel solrIndexerCronJobModel = getCronJob(component); - indexedTypesCombo.setModel(new ListModelList<>(solrIndexerCronJobModel.getFacetSearchConfig().getSolrIndexedTypes())); - indexedTypesCombo.setItemRenderer((ComboitemRenderer) (comboItem, solrIndexedType, index) -> { - comboItem.setLabel(solrIndexedType.getType().getName()); - comboItem.setValue(solrIndexedType); - }); - return indexedTypesCombo; - } - - private Combobox initOperationsCombo() { - final Combobox operationsCombo = new Combobox(); - operationsCombo.setModel(new ListModelList<>(IndexerOperationValues.values())); - operationsCombo.setItemRenderer((radio, entity, index) -> { - IndexerOperationValues indexerOperation = (IndexerOperationValues) entity; - radio.setLabel(SolrIndexerConfigurableOperationStep.this.getLabelService().getObjectLabel(indexerOperation)); - radio.setValue(entity); - if (IndexerOperationValues.PARTIAL_UPDATE.equals(indexerOperation)) { - radio.setDisabled(true); - radio.setVisible(false); - } - }); - return operationsCombo; - } - - private SolrIndexerConfigurableCronJobModel getCronJob(Component component) { - SolrIndexerConfigurableCronJobModel job = this.getCurrentObject(component, SolrIndexerConfigurableCronJobModel.class); - job.setJob(cronJobService.getJob(jobDefinitionCode)); - return job; - } - - public void setCronJobService(CronJobService cronJobService) { - super.setCronJobService(cronJobService); - this.cronJobService = cronJobService; - } - - public void setJobDefinitionCode(String jobDefinitionCode) { - this.jobDefinitionCode = jobDefinitionCode; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/buildcallbacks.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/buildcallbacks.xml deleted file mode 100644 index b5ecfe6e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/buildcallbacks.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/extensioninfo.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/extensioninfo.xml deleted file mode 100644 index feef8873..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/extensioninfo.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/project.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/project.properties deleted file mode 100644 index 102f315d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/project.properties +++ /dev/null @@ -1,6 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools -# ---------------------------------------------------------------------------- - -# Location of the file for the global platform spring application context -sapcxsearch.application-context=sapcxsearch-spring.xml diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_de.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_de.properties deleted file mode 100644 index b60c531e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -type.SolrIndexerConfigurableCronJob.name=Solr Indexer Cron Job (konfigurierbar) -type.SolrIndexerConfigurableCronJob.indexedTypes.name=Indizierte Typen \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_en.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_en.properties deleted file mode 100644 index eababd6a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/localization/sapcxsearch-locales_en.properties +++ /dev/null @@ -1,2 +0,0 @@ -type.SolrIndexerConfigurableCronJob.name=Solr Indexer Cron Job (configurable) -type.SolrIndexerConfigurableCronJob.indexedTypes.name=Indexed types \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-config.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-config.xml deleted file mode 100644 index 78c9bc57..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-config.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-spring.xml deleted file mode 100644 index 58e1a306..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-spring.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-widgets.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-widgets.xml deleted file mode 100644 index bf194753..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-backoffice-widgets.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-items.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-items.xml deleted file mode 100644 index c42fad75..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-items.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-spring.xml deleted file mode 100644 index 29667c55..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/resources/sapcxsearch-spring.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/constants/CxSearchConstants.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/constants/CxSearchConstants.java deleted file mode 100644 index 1378ef83..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/constants/CxSearchConstants.java +++ /dev/null @@ -1,10 +0,0 @@ -package tools.sapcx.commerce.search.constants; - -@SuppressWarnings({ "deprecation", "squid:CallToDeprecatedMethod" }) -public class CxSearchConstants extends GeneratedCxSearchConstants { - public static final String EXTENSIONNAME = "sapcxsearch"; - - private CxSearchConstants() { - // empty - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformable.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformable.java deleted file mode 100644 index ca11b707..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformable.java +++ /dev/null @@ -1,74 +0,0 @@ -package tools.sapcx.commerce.search.jobs; - -import static org.slf4j.LoggerFactory.getLogger; - -import java.util.List; -import java.util.stream.Collectors; - -import de.hybris.platform.cronjob.enums.CronJobResult; -import de.hybris.platform.cronjob.enums.CronJobStatus; -import de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable; -import de.hybris.platform.servicelayer.cronjob.PerformResult; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfigService; -import de.hybris.platform.solrfacetsearch.config.IndexOperation; -import de.hybris.platform.solrfacetsearch.config.exceptions.FacetConfigServiceException; -import de.hybris.platform.solrfacetsearch.enums.IndexerOperationValues; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; -import de.hybris.platform.solrfacetsearch.model.config.SolrIndexedTypeModel; - -import org.slf4j.Logger; - -import tools.sapcx.commerce.search.model.SolrIndexerConfigurableCronJobModel; -import tools.sapcx.commerce.search.service.CxIndexerService; - -public class SolrIndexerConfigurableJobPerformable extends AbstractJobPerformable { - private static final Logger LOG = getLogger(SolrIndexerConfigurableJobPerformable.class); - - private CxIndexerService cxIndexerService; - private FacetSearchConfigService facetSearchConfigService; - - public SolrIndexerConfigurableJobPerformable(CxIndexerService cxIndexerService, FacetSearchConfigService facetSearchConfigService) { - this.cxIndexerService = cxIndexerService; - this.facetSearchConfigService = facetSearchConfigService; - } - - @Override - public PerformResult perform(SolrIndexerConfigurableCronJobModel jobModel) { - try { - FacetSearchConfig facetSearchConfig = getFacetSearchConfig(jobModel); - List indexedTypeNameList = getIndexedTypeNameList(jobModel); - IndexOperation indexOperation = getIndexerOperation(jobModel); - - cxIndexerService.performIndexForIndexedTypes(facetSearchConfig, indexOperation, indexedTypeNameList, jobModel.getIndexerHints()); - } catch (FacetConfigServiceException | IndexerException e) { - LOG.error(e.getMessage(), e); - return new PerformResult(CronJobResult.ERROR, CronJobStatus.ABORTED); - } - - return new PerformResult(CronJobResult.SUCCESS, CronJobStatus.FINISHED); - } - - private FacetSearchConfig getFacetSearchConfig(SolrIndexerConfigurableCronJobModel jobModel) throws FacetConfigServiceException { - return facetSearchConfigService.getConfiguration(jobModel.getFacetSearchConfig().getName()); - } - - private List getIndexedTypeNameList(SolrIndexerConfigurableCronJobModel jobModel) { - return jobModel.getIndexedTypes().stream() - .map(SolrIndexedTypeModel::getIdentifier) - .collect(Collectors.toList()); - } - - private IndexOperation getIndexerOperation(SolrIndexerConfigurableCronJobModel jobModel) { - if (jobModel.getIndexerOperation() == IndexerOperationValues.FULL) { - return IndexOperation.FULL; - } else if (jobModel.getIndexerOperation() == IndexerOperationValues.UPDATE) { - return IndexOperation.UPDATE; - } else if (jobModel.getIndexerOperation() == IndexerOperationValues.DELETE) { - return IndexOperation.DELETE; - } else if (jobModel.getIndexerOperation() == IndexerOperationValues.PARTIAL_UPDATE) { - return IndexOperation.PARTIAL_UPDATE; - } - return IndexOperation.FULL; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetDisplayNameProvider.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetDisplayNameProvider.java deleted file mode 100644 index b393e3db..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetDisplayNameProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -package tools.sapcx.commerce.search.provider; - -import java.util.Locale; - -import de.hybris.platform.core.model.c2l.LanguageModel; -import de.hybris.platform.core.model.enumeration.EnumerationValueModel; -import de.hybris.platform.servicelayer.i18n.CommonI18NService; -import de.hybris.platform.servicelayer.type.TypeService; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.provider.FacetDisplayNameProvider; -import de.hybris.platform.solrfacetsearch.provider.FacetValueDisplayNameProvider; -import de.hybris.platform.solrfacetsearch.search.SearchQuery; - -public class CxHybrisEnumFacetDisplayNameProvider implements FacetDisplayNameProvider, FacetValueDisplayNameProvider { - private String enumType; - private TypeService typeService; - private CommonI18NService commonI18NService; - - public CxHybrisEnumFacetDisplayNameProvider(String enumType, TypeService typeService, CommonI18NService commonI18NService) { - this.enumType = enumType; - this.typeService = typeService; - this.commonI18NService = commonI18NService; - } - - @Override - public String getDisplayName(SearchQuery searchQuery, String value) { - try { - EnumerationValueModel enumValue = typeService.getEnumerationValue(enumType, value); - LanguageModel language = commonI18NService.getLanguage(searchQuery.getLanguage()); - Locale locale = commonI18NService.getLocaleForLanguage(language); - return enumValue.getName(locale); - } catch (RuntimeException e) { - return value; - } - } - - @Override - public String getDisplayName(SearchQuery searchQuery, IndexedProperty indexedProperty, String value) { - return getDisplayName(searchQuery, value); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetSortProvider.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetSortProvider.java deleted file mode 100644 index d5a20ccd..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxHybrisEnumFacetSortProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -package tools.sapcx.commerce.search.provider; - -import java.util.Comparator; - -import de.hybris.platform.core.model.enumeration.EnumerationValueModel; -import de.hybris.platform.servicelayer.type.TypeService; -import de.hybris.platform.solrfacetsearch.config.FacetSortProvider; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.config.IndexedType; -import de.hybris.platform.solrfacetsearch.search.FacetValue; - -public class CxHybrisEnumFacetSortProvider implements FacetSortProvider { - private String enumType; - private TypeService typeService; - private Comparator comparator; - - public CxHybrisEnumFacetSortProvider(String enumType, TypeService typeService) { - this.enumType = enumType; - this.typeService = typeService; - this.comparator = (o1, o2) -> { - EnumerationValueModel enum1 = this.typeService.getEnumerationValue(this.enumType, o1.getName()); - EnumerationValueModel enum2 = this.typeService.getEnumerationValue(this.enumType, o2.getName()); - return enum1.getSequenceNumber().compareTo(enum2.getSequenceNumber()); - }; - } - - @Override - public Comparator getComparatorForTypeAndProperty(IndexedType indexedType, IndexedProperty indexedProperty) { - return comparator; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxInheritanceValueProvider.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxInheritanceValueProvider.java deleted file mode 100644 index 56fcc4bc..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxInheritanceValueProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -package tools.sapcx.commerce.search.provider; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import de.hybris.platform.core.model.product.ProductModel; -import de.hybris.platform.solrfacetsearch.config.IndexConfig; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.config.exceptions.FieldValueProviderException; -import de.hybris.platform.solrfacetsearch.provider.FieldNameProvider; -import de.hybris.platform.solrfacetsearch.provider.FieldValue; -import de.hybris.platform.solrfacetsearch.provider.FieldValueProvider; -import de.hybris.platform.variants.model.VariantProductModel; - -public class CxInheritanceValueProvider implements FieldValueProvider { - private FieldNameProvider fieldNameProvider; - - @Override - public Collection getFieldValues(IndexConfig indexConfig, IndexedProperty indexedProperty, Object o) throws FieldValueProviderException { - if (o instanceof ProductModel) { - Object value = getInheritedValue(indexedProperty, (ProductModel) o); - if (value != null) { - return createFieldValues(indexedProperty, value); - } - } - return Collections.EMPTY_LIST; - } - - protected List createFieldValues(IndexedProperty indexedProperty, Object value) { - List fieldValues = new ArrayList<>(); - final Collection fieldNames = fieldNameProvider.getFieldNames(indexedProperty, null); - for (final String fieldName : fieldNames) { - fieldValues.add(new FieldValue(fieldName, value)); - } - return fieldValues; - } - - protected Object getInheritedValue(IndexedProperty indexedProperty, ProductModel product) { - String propertyName = indexedProperty.getName(); - Object value = product.getProperty(propertyName); - if (value != null) { - return value; - } - - if (product instanceof VariantProductModel) { - return getInheritedValue(indexedProperty, ((VariantProductModel) product).getBaseProduct()); - } - return null; - } - - public void setFieldNameProvider(FieldNameProvider fieldNameProvider) { - this.fieldNameProvider = fieldNameProvider; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxReferencedItemDelegatingFieldValueProvider.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxReferencedItemDelegatingFieldValueProvider.java deleted file mode 100644 index abf973c7..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/provider/CxReferencedItemDelegatingFieldValueProvider.java +++ /dev/null @@ -1,90 +0,0 @@ -package tools.sapcx.commerce.search.provider; - -import static org.apache.commons.collections4.MapUtils.emptyIfNull; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.servicelayer.model.ModelService; -import de.hybris.platform.solrfacetsearch.config.IndexConfig; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.config.exceptions.FieldValueProviderException; -import de.hybris.platform.solrfacetsearch.provider.FieldValue; -import de.hybris.platform.solrfacetsearch.provider.FieldValueProvider; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -public class CxReferencedItemDelegatingFieldValueProvider implements FieldValueProvider, ApplicationContextAware { - private static final String MISSING_VALUEPROVIDERPARAMETER_EXCEPTION = "Missing required value provider parameter '%s', please check configuration of indexed property '%s'!"; - private static final String MISSING_VALUEPROVIDERBEAN_EXCEPTION = "Could not find delegated FieldValueProvider with ID '%s', please check configuration of indexed property '%s'!"; - - private static final String REFERENCE_ATTRIBUTE_KEY = "referenceAttribute"; - private static final String DELEGATE_KEY = "delegate"; - - private ApplicationContext applicationContext; - private ModelService modelService; - - public CxReferencedItemDelegatingFieldValueProvider(ModelService modelService) { - this.modelService = modelService; - } - - @Override - public Collection getFieldValues(IndexConfig indexConfig, IndexedProperty indexedProperty, Object object) throws FieldValueProviderException { - final FieldValueProvider delegate = getDelegate(indexedProperty); - final String referencedAttributeName = getRequiredValueProviderParameter(indexedProperty, REFERENCE_ATTRIBUTE_KEY); - - if (object instanceof ItemModel) { - final ItemModel item = (ItemModel) object; - final Object referencedObject = modelService.getAttributeValue(item, referencedAttributeName); - if (referencedObject instanceof ItemModel) { - final ItemModel referencedItem = (ItemModel) referencedObject; - return getFieldValuesFromDelegate(indexConfig, indexedProperty, referencedItem, delegate); - } else if (referencedObject instanceof Collection) { - final Collection elements = (Collection) referencedObject; - final Collection fieldValues = new ArrayList<>(); - for (Object element : elements) { - fieldValues.addAll(getFieldValuesFromDelegate(indexConfig, indexedProperty, element, delegate)); - } - return fieldValues; - } - } - - return List.of(); - } - - private Collection getFieldValuesFromDelegate(IndexConfig indexConfig, IndexedProperty indexedProperty, Object referencedObject, FieldValueProvider delegate) - throws FieldValueProviderException { - return delegate.getFieldValues(indexConfig, indexedProperty, referencedObject); - } - - private FieldValueProvider getDelegate(IndexedProperty indexedProperty) throws FieldValueProviderException { - final String delegateBeanId = getRequiredValueProviderParameter(indexedProperty, DELEGATE_KEY); - try { - return applicationContext.getBean(delegateBeanId, FieldValueProvider.class); - } catch (BeansException e) { - final String msg = String.format(MISSING_VALUEPROVIDERBEAN_EXCEPTION, delegateBeanId, indexedProperty.getName()); - throw new FieldValueProviderException(msg, e); - } - } - - private String getRequiredValueProviderParameter(final IndexedProperty indexedProperty, final String key) throws FieldValueProviderException { - final Map valueProviderParameters = emptyIfNull(indexedProperty.getValueProviderParameters()); - final String parameterValue = valueProviderParameters.get(key); - return Optional.ofNullable(parameterValue) - .orElseThrow(() -> { - final String msg = String.format(MISSING_VALUEPROVIDERPARAMETER_EXCEPTION, DELEGATE_KEY, indexedProperty.getName()); - return new FieldValueProviderException(msg); - }); - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxHybrisEnumOrdinalValueResolver.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxHybrisEnumOrdinalValueResolver.java deleted file mode 100644 index 76df9add..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxHybrisEnumOrdinalValueResolver.java +++ /dev/null @@ -1,56 +0,0 @@ -package tools.sapcx.commerce.search.resolver; - -import static org.apache.commons.collections4.MapUtils.emptyIfNull; - -import java.util.HashMap; -import java.util.Map; - -import de.hybris.platform.core.HybrisEnumValue; -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.config.exceptions.FieldValueProviderException; -import de.hybris.platform.solrfacetsearch.indexer.IndexerBatchContext; -import de.hybris.platform.solrfacetsearch.indexer.spi.InputDocument; -import de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver; - -import org.apache.commons.lang3.StringUtils; - -public class CxHybrisEnumOrdinalValueResolver extends AbstractValueResolver { - private static final int DEFAULT_FALLBACK_VALUE = 9999; - - private Map enumValuesOrdinalMap = new HashMap<>(); - private int fallbackValue; - - public CxHybrisEnumOrdinalValueResolver(Map enumValuesOrdinalMap) { - this(enumValuesOrdinalMap, DEFAULT_FALLBACK_VALUE); - } - - public CxHybrisEnumOrdinalValueResolver(Map enumValuesOrdinalMap, int fallbackValue) { - this.enumValuesOrdinalMap.putAll(emptyIfNull(enumValuesOrdinalMap)); - this.fallbackValue = fallbackValue; - } - - @Override - protected void addFieldValues(InputDocument inputDocument, IndexerBatchContext indexerContext, IndexedProperty indexedProperty, ItemModel item, - ValueResolverContext resolverContext) throws FieldValueProviderException { - String propertyName = getPropertyName(indexedProperty); - HybrisEnumValue enumValue = item.getProperty(propertyName); - int enumOrdinal = mapEnumValueToOrdinal(enumValue); - inputDocument.addField(indexedProperty, enumOrdinal); - } - - private String getPropertyName(IndexedProperty indexedProperty) { - String providerParameter = indexedProperty.getValueProviderParameter(); - String indexedPropertyName = indexedProperty.getName(); - return StringUtils.defaultIfBlank(providerParameter, indexedPropertyName); - } - - private int mapEnumValueToOrdinal(HybrisEnumValue enumValue) { - if (enumValue == null) { - return fallbackValue; - } - - String code = enumValue.getCode(); - return enumValuesOrdinalMap.getOrDefault(code, fallbackValue); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxReferencedItemDelegatingValueResolver.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxReferencedItemDelegatingValueResolver.java deleted file mode 100644 index 15fc8e14..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/resolver/CxReferencedItemDelegatingValueResolver.java +++ /dev/null @@ -1,84 +0,0 @@ -package tools.sapcx.commerce.search.resolver; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.servicelayer.model.ModelService; -import de.hybris.platform.solrfacetsearch.config.IndexedProperty; -import de.hybris.platform.solrfacetsearch.config.exceptions.FieldValueProviderException; -import de.hybris.platform.solrfacetsearch.indexer.IndexerBatchContext; -import de.hybris.platform.solrfacetsearch.indexer.spi.InputDocument; -import de.hybris.platform.solrfacetsearch.provider.ValueResolver; - -import org.apache.commons.collections4.MapUtils; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -public class CxReferencedItemDelegatingValueResolver implements ValueResolver, ApplicationContextAware { - private static final String MISSING_VALUERESOLVERPARAMETER_EXCEPTION = "Missing required value resolver parameter '%s', please check configuration of indexed property '%s'!"; - private static final String MISSING_VALUERESOLVERBEAN_EXCEPTION = "Could not find delegated ValueResolver with ID '%s', please check configuration of indexed property '%s'!"; - - private static final String REFERENCE_ATTRIBUTE_KEY = "referenceAttribute"; - private static final String DELEGATE_KEY = "delegate"; - - private ApplicationContext applicationContext; - private ModelService modelService; - - public CxReferencedItemDelegatingValueResolver(ModelService modelService) { - this.modelService = modelService; - } - - @Override - public void resolve(InputDocument inputDocument, IndexerBatchContext indexerBatchContext, Collection indexedProperties, ItemModel item) - throws FieldValueProviderException { - for (IndexedProperty indexedProperty : indexedProperties) { - final ValueResolver delegate = getDelegate(indexedProperty); - final String referencedAttributeName = getRequiredValueProviderParameter(indexedProperty, REFERENCE_ATTRIBUTE_KEY); - final Object referencedObject = modelService.getAttributeValue(item, referencedAttributeName); - if (referencedObject instanceof ItemModel) { - final ItemModel referencedItem = (ItemModel) referencedObject; - resolveWithDelegate(inputDocument, indexerBatchContext, indexedProperty, referencedItem, delegate); - } else if (referencedObject instanceof Collection) { - for (Object element : (Collection) referencedObject) { - if (element instanceof ItemModel) { - resolveWithDelegate(inputDocument, indexerBatchContext, indexedProperty, (ItemModel) element, delegate); - } - } - } - } - } - - private void resolveWithDelegate(InputDocument inputDocument, IndexerBatchContext indexerBatchContext, IndexedProperty indexedProperty, ItemModel referencedItem, - ValueResolver delegate) throws FieldValueProviderException { - delegate.resolve(inputDocument, indexerBatchContext, List.of(indexedProperty), referencedItem); - } - - private ValueResolver getDelegate(IndexedProperty indexedProperty) throws FieldValueProviderException { - final String delegateBeanId = getRequiredValueProviderParameter(indexedProperty, DELEGATE_KEY); - try { - return applicationContext.getBean(delegateBeanId, ValueResolver.class); - } catch (BeansException e) { - final String msg = String.format(MISSING_VALUERESOLVERBEAN_EXCEPTION, delegateBeanId, indexedProperty.getName()); - throw new FieldValueProviderException(msg, e); - } - } - - private String getRequiredValueProviderParameter(final IndexedProperty indexedProperty, final String key) throws FieldValueProviderException { - final Map valueProviderParameters = MapUtils.emptyIfNull(indexedProperty.getValueProviderParameters()); - final String parameterValue = valueProviderParameters.get(key); - return Optional.ofNullable(parameterValue) - .orElseThrow(() -> { - final String msg = String.format(MISSING_VALUERESOLVERPARAMETER_EXCEPTION, DELEGATE_KEY, indexedProperty.getName()); - return new FieldValueProviderException(msg); - }); - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexer.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexer.java deleted file mode 100644 index cc8088c2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexer.java +++ /dev/null @@ -1,87 +0,0 @@ -package tools.sapcx.commerce.search.service; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import de.hybris.platform.core.PK; -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; - -/** - * Indexer interface to perform indexing operations against the underlying search index. - *

- * The indexer can be used to add or remove items to/from the index. The items can be - * provided as a list or by performing the queries defined in the search configuration. - */ -public interface CxIndexer { - /** - * Add a single item to the index. - * - * @param item item to add - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - default void addItem(T item) throws IndexerException { - addItems(List.of(item)); - } - - /** - * Add a list of items to the index. - * - * @param items items to add - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - void addItems(List items) throws IndexerException; - - /** - * Add items to the index by using the configured query. - * - * @throws IndexerException if indexer exception occurs - */ - void addItemsByQuery() throws IndexerException; - - /** - * Remove a single item from the index. - * - * @param item item to add - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - default void removeItem(T item) throws IndexerException { - removeItems(List.of(item)); - } - - /** - * Remove a list of items from the index. - * - * @param items items to remove - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - void removeItems(List items) throws IndexerException; - - /** - * Remove items from the index by using the configured query. - * - * @throws IndexerException if indexer exception occurs - */ - void removeItemsByQuery() throws IndexerException; - - /** - * Get a list of primary keys from a list of items. - * - * @param items list of items - * @return list of primary keys - * @param type of item - */ - default List getPks(List items) { - return emptyIfNull(items).stream() - .map(ItemModel::getPk) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexerService.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexerService.java deleted file mode 100644 index 2e0bfeae..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/CxIndexerService.java +++ /dev/null @@ -1,105 +0,0 @@ -package tools.sapcx.commerce.search.service; - -import java.util.List; -import java.util.Map; - -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.IndexOperation; -import de.hybris.platform.solrfacetsearch.config.exceptions.FacetConfigServiceException; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; - -/** - * Cx Indexer Service with custom indexer operation functions. - */ -public interface CxIndexerService { - /** - * Get the search indexer for given search config and indexed type. - * - * @param searchConfig search config code - * @param indexedType indexed type code - * @return search indexer - * @throws FacetConfigServiceException if no indexer was found - */ - CxIndexer getSearchIndexer(String searchConfig, String indexedType) throws FacetConfigServiceException; - - /** - * Add a single item to the index. - * - * @param searchConfig search config to use - * @param indexedType indexed type to use - * @param item item to add - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - default void addItemToIndex(String searchConfig, String indexedType, T item) throws FacetConfigServiceException, IndexerException { - getSearchIndexer(searchConfig, indexedType).addItem(item); - } - - /** - * Add a list of items to the index. - * - * @param searchConfig search config to use - * @param indexedType indexed type to use - * @param items items to add - * @param type of items - * @throws IndexerException if indexer exception occurs - */ - default void addItemsToIndex(String searchConfig, String indexedType, List items) throws FacetConfigServiceException, IndexerException { - getSearchIndexer(searchConfig, indexedType).addItems(items); - } - - /** - * Remove a single item from the index. - * - * @param searchConfig search config to use - * @param indexedType indexed type to use - * @param item item to remove - * @param type of item - * @throws IndexerException if indexer exception occurs - */ - default void removeItemFromIndex(String searchConfig, String indexedType, T item) throws FacetConfigServiceException, IndexerException { - getSearchIndexer(searchConfig, indexedType).removeItem(item); - } - - /** - * Remove a list of items from the index. - * - * @param searchConfig search config to use - * @param indexedType indexed type to use - * @param items items to remove - * @param type of items - * @throws IndexerException if indexer exception occurs - */ - default void removeItemsFromIndex(String searchConfig, String indexedType, List items) throws FacetConfigServiceException, IndexerException { - getSearchIndexer(searchConfig, indexedType).removeItems(items); - } - - /** - * Perform index operation for given search config, index operation and a list of indexed types. - * - * @param facetSearchConfig facet search config to use - * @param indexOperation index operation to perform - * @param indexedTypeNameList list of indexed types to be indexed - * @throws IndexerException if indexer exception occurs - */ - void performIndexForIndexedTypes( - FacetSearchConfig facetSearchConfig, - IndexOperation indexOperation, - List indexedTypeNameList) throws IndexerException; - - /** - * Perform index Operation for given search config, index operation, list of indexed types and map of hints. - * - * @param facetSearchConfig facet search config to use - * @param indexOperation index operation to perform - * @param indexedTypeNameList list of indexed types to be indexed - * @param indexerHints map of indexer hints to be included - * @throws IndexerException if indexer exception occurs - */ - void performIndexForIndexedTypes( - FacetSearchConfig facetSearchConfig, - IndexOperation indexOperation, - List indexedTypeNameList, - Map indexerHints) throws IndexerException; -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexer.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexer.java deleted file mode 100644 index bbe230ea..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexer.java +++ /dev/null @@ -1,41 +0,0 @@ -package tools.sapcx.commerce.search.service; - -import java.util.List; - -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.IndexedType; -import de.hybris.platform.solrfacetsearch.indexer.IndexerService; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; - -class DefaultCxIndexer implements CxIndexer { - private IndexerService indexerService; - private FacetSearchConfig searchConfig; - private IndexedType indexedType; - - public DefaultCxIndexer(IndexerService indexerService, FacetSearchConfig searchConfig, IndexedType indexedType) { - this.indexerService = indexerService; - this.searchConfig = searchConfig; - this.indexedType = indexedType; - } - - @Override - public void addItemsByQuery() throws IndexerException { - indexerService.updateTypeIndex(searchConfig, indexedType); - } - - @Override - public void addItems(List items) throws IndexerException { - indexerService.updateTypeIndex(searchConfig, indexedType, getPks(items)); - } - - @Override - public void removeItemsByQuery() throws IndexerException { - indexerService.deleteTypeIndex(searchConfig, indexedType); - } - - @Override - public void removeItems(List items) throws IndexerException { - indexerService.deleteTypeIndex(searchConfig, indexedType, getPks(items)); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexerService.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexerService.java deleted file mode 100644 index 4fc9fbba..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/service/DefaultCxIndexerService.java +++ /dev/null @@ -1,77 +0,0 @@ -package tools.sapcx.commerce.search.service; - -import static org.slf4j.LoggerFactory.getLogger; - -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfigService; -import de.hybris.platform.solrfacetsearch.config.IndexOperation; -import de.hybris.platform.solrfacetsearch.config.IndexedType; -import de.hybris.platform.solrfacetsearch.config.exceptions.FacetConfigServiceException; -import de.hybris.platform.solrfacetsearch.indexer.IndexerService; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; -import de.hybris.platform.solrfacetsearch.indexer.strategies.IndexerStrategy; -import de.hybris.platform.solrfacetsearch.indexer.strategies.IndexerStrategyFactory; - -import org.slf4j.Logger; - -public class DefaultCxIndexerService implements CxIndexerService { - private static final Logger LOG = getLogger(DefaultCxIndexerService.class); - - private final IndexerStrategyFactory indexerStrategyFactory; - private final FacetSearchConfigService facetSearchConfigService; - private final IndexerService indexerService; - - public DefaultCxIndexerService( - IndexerStrategyFactory indexerStrategyFactory, - FacetSearchConfigService facetSearchConfigService, - IndexerService indexerService) { - this.indexerStrategyFactory = indexerStrategyFactory; - this.facetSearchConfigService = facetSearchConfigService; - this.indexerService = indexerService; - } - - @Override - public CxIndexer getSearchIndexer(String searchConfig, String indexedType) throws FacetConfigServiceException { - FacetSearchConfig config = facetSearchConfigService.getConfiguration(searchConfig); - IndexedType type = facetSearchConfigService.resolveIndexedType(config, indexedType); - return new DefaultCxIndexer(indexerService, config, type); - } - - @Override - public void performIndexForIndexedTypes(FacetSearchConfig facetSearchConfig, IndexOperation indexOperation, List indexedTypeNameList) throws IndexerException { - performIndexForIndexedTypes(facetSearchConfig, indexOperation, indexedTypeNameList, Collections.emptyMap()); - } - - @Override - public void performIndexForIndexedTypes( - FacetSearchConfig facetSearchConfig, - IndexOperation indexOperation, - List indexedTypeNameList, - Map indexerHints) throws IndexerException { - List indexedTypeList = getTypesToIndex(facetSearchConfig, indexedTypeNameList); - for (IndexedType indexedType : indexedTypeList) { - LOG.info(String.format("Perform index operation '%s' for indexed type '%s'", indexOperation, indexedType.getIdentifier())); - IndexerStrategy indexerStrategy = createIndexerStrategy(facetSearchConfig); - indexerStrategy.setIndexOperation(indexOperation); - indexerStrategy.setFacetSearchConfig(facetSearchConfig); - indexerStrategy.setIndexedType(indexedType); - indexerStrategy.setIndexerHints(indexerHints); - indexerStrategy.execute(); - } - } - - private List getTypesToIndex(FacetSearchConfig facetSearchConfig, List indexedTypeNameList) { - return facetSearchConfig.getIndexConfig().getIndexedTypes().values().stream() - .filter(indexedType -> indexedTypeNameList.contains(indexedType.getIdentifier())) - .collect(Collectors.toList()); - } - - private IndexerStrategy createIndexerStrategy(FacetSearchConfig facetSearchConfig) throws IndexerException { - return indexerStrategyFactory.createIndexerStrategy(facetSearchConfig); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SearchQueryCodec.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SearchQueryCodec.java deleted file mode 100644 index bdc0ef05..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SearchQueryCodec.java +++ /dev/null @@ -1,12 +0,0 @@ -package tools.sapcx.commerce.search.util; - -/** - * INFO: This interface is an exact copy of de.hybris.platform.commercewebservices.core.util.ws.SearchQueryCodec - * This was done so that we have this interface accessible to our Facade Layer classes (while the Original - * is placed in the WebContext and hence is not reachable from Facade Layer) - */ -public interface SearchQueryCodec { - QUERY decodeQuery(String query); - - String encodeQuery(QUERY query); -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SolrSearchQueryCodec.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SolrSearchQueryCodec.java deleted file mode 100644 index daca4582..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/src/tools/sapcx/commerce/search/util/SolrSearchQueryCodec.java +++ /dev/null @@ -1,74 +0,0 @@ -package tools.sapcx.commerce.search.util; - -import java.util.ArrayList; -import java.util.List; - -import de.hybris.platform.commerceservices.search.solrfacetsearch.data.SolrSearchQueryData; -import de.hybris.platform.commerceservices.search.solrfacetsearch.data.SolrSearchQueryTermData; - -/** - * INFO: This class is an exact copy of de.hybris.platform.commercewebservices.core.util.ws.impl.DefaultSearchQueryCodec - * This was done so that we have this class accessible to our Facade Layer classes (while the Original Class - * stays in the WebContext and hence is not reachable from Facade Layer) - */ -public class SolrSearchQueryCodec implements SearchQueryCodec { - protected static final int NEXT_TERM = 2; - - @Override - public SolrSearchQueryData decodeQuery(final String queryString) { - final SolrSearchQueryData searchQuery = new SolrSearchQueryData(); - final List filters = new ArrayList(); - - if (queryString == null) { - return searchQuery; - } - - final String[] parts = queryString.split(":"); - - if (parts.length > 0) { - searchQuery.setFreeTextSearch(parts[0]); - if (parts.length > 1) { - searchQuery.setSort(parts[1]); - } - } - - for (int i = NEXT_TERM; i < parts.length; i = i + NEXT_TERM) { - final SolrSearchQueryTermData term = new SolrSearchQueryTermData(); - term.setKey(parts[i]); - term.setValue(parts[i + 1]); - filters.add(term); - } - searchQuery.setFilterTerms(filters); - - return searchQuery; - } - - @Override - public String encodeQuery(final SolrSearchQueryData searchQueryData) { - if (searchQueryData == null) { - return null; - } - - final StringBuilder builder = new StringBuilder(); - builder.append((searchQueryData.getFreeTextSearch() == null) ? "" : searchQueryData.getFreeTextSearch()); - - if (searchQueryData.getSort() != null // - || (searchQueryData.getFilterTerms() != null && !searchQueryData.getFilterTerms().isEmpty())) { - builder.append(":"); - builder.append((searchQueryData.getSort() == null) ? "" : searchQueryData.getSort()); - } - - final List terms = searchQueryData.getFilterTerms(); - if (terms != null && !terms.isEmpty()) { - for (final SolrSearchQueryTermData term : searchQueryData.getFilterTerms()) { - builder.append(":"); - builder.append(term.getKey()); - builder.append(":"); - builder.append(term.getValue()); - } - } - - // URLEncode? - return builder.toString(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/config/ExtensionConfigurationTests.java deleted file mode 100644 index 1e9be2c9..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/config/ExtensionConfigurationTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package tools.sapcx.commerce.search.config; - -import de.hybris.bootstrap.annotations.UnitTest; - -import org.junit.Test; - -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; - -@UnitTest -public class ExtensionConfigurationTests { - @Test - public void extensionConfiguration() { - InstalledExtensionVerifier.verifier() - .requires("sapcommercetoolkit") - .requires("backoffice") - .requires("solrfacetsearch") - .requires("solrfacetsearchbackoffice") - .verify(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformableTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformableTests.java deleted file mode 100644 index 7408b1bc..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/jobs/SolrIndexerConfigurableJobPerformableTests.java +++ /dev/null @@ -1,86 +0,0 @@ -package tools.sapcx.commerce.search.jobs; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.*; -import static tools.sapcx.commerce.toolkit.testing.itemmodel.InMemoryModelFactory.createTestableItemModel; - -import java.util.List; - -import de.hybris.bootstrap.annotations.UnitTest; -import de.hybris.platform.cronjob.enums.CronJobResult; -import de.hybris.platform.cronjob.enums.CronJobStatus; -import de.hybris.platform.servicelayer.cronjob.PerformResult; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfigService; -import de.hybris.platform.solrfacetsearch.config.IndexOperation; -import de.hybris.platform.solrfacetsearch.config.exceptions.FacetConfigServiceException; -import de.hybris.platform.solrfacetsearch.enums.IndexerOperationValues; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; -import de.hybris.platform.solrfacetsearch.model.config.SolrFacetSearchConfigModel; -import de.hybris.platform.solrfacetsearch.model.config.SolrIndexedTypeModel; - -import org.junit.Before; -import org.junit.Test; - -import tools.sapcx.commerce.search.model.SolrIndexerConfigurableCronJobModel; -import tools.sapcx.commerce.search.service.CxIndexerService; - -@UnitTest -public class SolrIndexerConfigurableJobPerformableTests { - private SolrIndexerConfigurableJobPerformable jobPerformable; - private CxIndexerService cxIndexerService; - private FacetSearchConfigService facetSearchConfigService; - private SolrIndexerConfigurableCronJobModel jobModel; - private SolrFacetSearchConfigModel configModel; - private FacetSearchConfig facetSearchConfig; - - @Before - public void setUp() throws Exception { - cxIndexerService = mock(CxIndexerService.class); - facetSearchConfigService = mock(FacetSearchConfigService.class); - jobPerformable = new SolrIndexerConfigurableJobPerformable(cxIndexerService, facetSearchConfigService); - - jobModel = createTestableItemModel(SolrIndexerConfigurableCronJobModel.class); - configModel = createTestableItemModel(SolrFacetSearchConfigModel.class); - configModel.setName("test-config"); - - SolrIndexedTypeModel solrIndexedTypeModelA = createTestableItemModel(SolrIndexedTypeModel.class); - solrIndexedTypeModelA.setIdentifier("type-a"); - - SolrIndexedTypeModel solrIndexedTypeModelB = createTestableItemModel(SolrIndexedTypeModel.class); - solrIndexedTypeModelB.setIdentifier("type-b"); - - jobModel.setFacetSearchConfig(configModel); - jobModel.setIndexedTypes(List.of(solrIndexedTypeModelA, solrIndexedTypeModelB)); - jobModel.setIndexerOperation(IndexerOperationValues.FULL); - - facetSearchConfig = new FacetSearchConfig(); - } - - @Test - public void verifyPerform() throws FacetConfigServiceException { - when(facetSearchConfigService.getConfiguration("test-config")).thenReturn(facetSearchConfig); - PerformResult result = jobPerformable.perform(jobModel); - assertThat(result.getResult()).isEqualTo(CronJobResult.SUCCESS); - assertThat(result.getStatus()).isEqualTo(CronJobStatus.FINISHED); - } - - @Test() - public void verifyPerformWithConfigError() throws FacetConfigServiceException { - when(facetSearchConfigService.getConfiguration("test-config")).thenThrow(FacetConfigServiceException.class); - PerformResult result = jobPerformable.perform(jobModel); - assertThat(result.getResult()).isEqualTo(CronJobResult.ERROR); - assertThat(result.getStatus()).isEqualTo(CronJobStatus.ABORTED); - } - - @Test() - public void verifyPerformWithIndexerError() throws FacetConfigServiceException, IndexerException { - when(facetSearchConfigService.getConfiguration("test-config")).thenReturn(facetSearchConfig); - - doThrow(IndexerException.class).doNothing().when(cxIndexerService).performIndexForIndexedTypes(facetSearchConfig, IndexOperation.FULL, List.of("type-a", "type-b"), null); - - PerformResult result = jobPerformable.perform(jobModel); - assertThat(result.getResult()).isEqualTo(CronJobResult.ERROR); - assertThat(result.getStatus()).isEqualTo(CronJobStatus.ABORTED); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/service/DefaultCxIndexerServiceTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/service/DefaultCxIndexerServiceTests.java deleted file mode 100644 index 37ad4f44..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsearch/testsrc/tools/sapcx/commerce/search/service/DefaultCxIndexerServiceTests.java +++ /dev/null @@ -1,134 +0,0 @@ -package tools.sapcx.commerce.search.service; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.*; - -import java.util.List; -import java.util.Map; - -import de.hybris.bootstrap.annotations.UnitTest; -import de.hybris.platform.core.model.ItemModel; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfig; -import de.hybris.platform.solrfacetsearch.config.FacetSearchConfigService; -import de.hybris.platform.solrfacetsearch.config.IndexConfig; -import de.hybris.platform.solrfacetsearch.config.IndexOperation; -import de.hybris.platform.solrfacetsearch.config.IndexedType; -import de.hybris.platform.solrfacetsearch.indexer.IndexerService; -import de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException; -import de.hybris.platform.solrfacetsearch.indexer.strategies.IndexerStrategy; -import de.hybris.platform.solrfacetsearch.indexer.strategies.IndexerStrategyFactory; - -import org.junit.Before; -import org.junit.Test; - -import tools.sapcx.commerce.toolkit.testing.testdoubles.core.InMemoryModelService; - -@UnitTest -public class DefaultCxIndexerServiceTests { - private DefaultCxIndexerService defaultCxIndexerService; - private IndexerStrategyFactory indexerStrategyFactoryMock; - private IndexerStrategy indexerStrategyMock; - private FacetSearchConfigService facetSearchConfigServiceMock; - private IndexerService indexerServiceMock; - private FacetSearchConfig facetSearchConfig; - private InMemoryModelService modelService; - private IndexConfig indexConfig; - - @Before - public void setUp() throws Exception { - indexerStrategyFactoryMock = mock(IndexerStrategyFactory.class); - indexerStrategyMock = spy(IndexerStrategy.class); - facetSearchConfigServiceMock = spy(FacetSearchConfigService.class); - indexerServiceMock = spy(IndexerService.class); - modelService = new InMemoryModelService(); - - defaultCxIndexerService = new DefaultCxIndexerService(indexerStrategyFactoryMock, facetSearchConfigServiceMock, indexerServiceMock); - - IndexedType indexedTypeA = new IndexedType(); - indexedTypeA.setIdentifier("type-a"); - - IndexedType indexedTypeB = new IndexedType(); - indexedTypeB.setIdentifier("type-b"); - - IndexedType indexedTypeC = new IndexedType(); - indexedTypeC.setIdentifier("type-c"); - - indexConfig = new IndexConfig(); - indexConfig.setIndexedTypes(Map.of("type-a", indexedTypeA, "type-b", indexedTypeB, "type-c", indexedTypeC)); - - facetSearchConfig = new FacetSearchConfig(); - facetSearchConfig.setName("searchConfig"); - facetSearchConfig.setIndexConfig(indexConfig); - - when(facetSearchConfigServiceMock.getConfiguration("searchConfig")).thenReturn(facetSearchConfig); - when(facetSearchConfigServiceMock.resolveIndexedType(facetSearchConfig, "type-a")).thenReturn(indexedTypeA); - when(facetSearchConfigServiceMock.resolveIndexedType(facetSearchConfig, "type-b")).thenReturn(indexedTypeB); - when(facetSearchConfigServiceMock.resolveIndexedType(facetSearchConfig, "type-c")).thenReturn(indexedTypeC); - } - - @Test - public void verifyIndexerIsCreated() throws Exception { - CxIndexer searchIndexer = defaultCxIndexerService.getSearchIndexer("searchConfig", "type-a"); - assertThat(searchIndexer).isNotNull(); - } - - @Test - public void verifyIndexerAddsItemToIndex() throws Exception { - ItemModel item = modelService.create(ItemModel.class); - modelService.save(item); - - defaultCxIndexerService.addItemToIndex("searchConfig", "type-a", item); - verify(indexerServiceMock).updateTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a"), List.of(item.getPk())); - } - - @Test - public void verifyIndexerAddsItemsToIndex() throws Exception { - ItemModel item1 = modelService.create(ItemModel.class); - ItemModel item2 = modelService.create(ItemModel.class); - modelService.saveAll(item1, item2); - - defaultCxIndexerService.addItemsToIndex("searchConfig", "type-a", List.of(item1, item2)); - verify(indexerServiceMock).updateTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a"), List.of(item1.getPk(), item2.getPk())); - } - - @Test - public void verifyIndexerAddsItemsByQueryToIndex() throws Exception { - CxIndexer searchIndexer = defaultCxIndexerService.getSearchIndexer("searchConfig", "type-a"); - searchIndexer.addItemsByQuery(); - verify(indexerServiceMock).updateTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a")); - } - - @Test - public void verifyIndexerRemovesItemFromIndex() throws Exception { - ItemModel item = modelService.create(ItemModel.class); - modelService.save(item); - - defaultCxIndexerService.removeItemFromIndex("searchConfig", "type-a", item); - verify(indexerServiceMock).deleteTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a"), List.of(item.getPk())); - } - - @Test - public void verifyIndexerRemovesItemsFromIndex() throws Exception { - ItemModel item1 = modelService.create(ItemModel.class); - ItemModel item2 = modelService.create(ItemModel.class); - modelService.saveAll(item1, item2); - - defaultCxIndexerService.removeItemsFromIndex("searchConfig", "type-a", List.of(item1, item2)); - verify(indexerServiceMock).deleteTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a"), List.of(item1.getPk(), item2.getPk())); - } - - @Test - public void verifyIndexerRemovesItemsByQueryFromIndex() throws Exception { - CxIndexer searchIndexer = defaultCxIndexerService.getSearchIndexer("searchConfig", "type-a"); - searchIndexer.removeItemsByQuery(); - verify(indexerServiceMock).deleteTypeIndex(facetSearchConfig, indexConfig.getIndexedTypes().get("type-a")); - } - - @Test - public void verifyPerformIndexForIndexedTypes() throws IndexerException { - when(indexerStrategyFactoryMock.createIndexerStrategy(facetSearchConfig)).thenReturn(indexerStrategyMock); - - defaultCxIndexerService.performIndexForIndexedTypes(facetSearchConfig, IndexOperation.FULL, List.of("type-a", "type-b")); - verify(indexerStrategyMock, times(2)).execute(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.gitignore b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.gitignore deleted file mode 100644 index bd0966d2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Folders to ignore, whatever the place they are -.DS_Store -.metadata -.settings -classes -testclasses -eclipsebin -gensrc - -# .classpath files and lib folder in sapcxtools to ignore -.classpath -lib/ - -# Filename patterns to ignore -*.class -build.xml -Generated*.java -platformhome.properties -*testclasses.xml -extensioninfo.xsd -*hmc.jar -hmc.xsd -items.xsd -beans.xsd -ruleset.xml -*.log -.pmd -*build.number -base.properties - -# Addon specific copy folders -**/_ui/addons -**/views/addons -**/tld/addons -**/tags/addons -**/messages/addons -**/lib/addons -**/web/addonsrc -**/_ui-src/addons -**/web/addontestsrc -**/web/commonwebsrc/*/ -**/web/webroot/WEB-INF/lib/addon-* -wro_addons.xml - -# Backoffice artifacts -*_bof.jar diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.project b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.project deleted file mode 100644 index c94914c7..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - sapcxsinglesignon - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - - - - 1642058460820 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/LICENSE.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/LICENSE.md deleted file mode 100644 index 9776fe0d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [2025] [SAP CX Tools] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/README.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/README.md deleted file mode 100644 index 3524aee9..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/README.md +++ /dev/null @@ -1,159 +0,0 @@ -# SAP CX Single-Sign-On - -The `sapcxsinglesignon` extension provides core implementations for SSO integration with external -service and identity providers, such as Auth0 by Okta. - -## FEATURE DESCRIPTION - -The functionality covers a filter for the OCC layer, that handles the validation of the access tokens. -The filter will be executed before the actual spring security chain of the OCC extension, creating a -valid token in the local token storage for the authenticated user. - -### How to activate and use - -To activate the functionality, one needs to set the configuration parameters accordingly for each environment, -especially the flag `sapcxsinglesignon.filter.enabled`, which is set to `false` by default. - -Also, the IDP should be configured to use the SAP Commerce OCC endpoint as audience, and provide the following -information within the access token, as they are required by the filter: - -- email and/or username (whatever field is configured as `idfield`) -- given_name (first name for customer creation) -- family_name (last name for customer creation) - -For example, using Auth0, the following post login handler is required: - -``` -/** -* Handler that will be called during the execution of a PostLogin flow. -* -* @param {Event} event - Details about the user and the context in which they are logging in. -* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login. -*/ -exports.onExecutePostLogin = async (event, api) => { - api.accessToken.setCustomClaim('email', event.user.email); - api.accessToken.setCustomClaim('username', event.user.username); - api.accessToken.setCustomClaim('given_name', event.user.given_name); - api.accessToken.setCustomClaim('family_name', event.user.family_name); -}; -``` - -In addition to the IDP and backend configuration, the composable storefront needs to be extended with -configuration settings as within the following example: - -```typescript -export const authCodeFlowConfig: AuthConfig = { - authentication: { - client_id: '', - client_secret: '', - baseUrl: 'https://', - tokenEndpoint: '/oauth/token', - loginUrl: '/authorize', - revokeEndpoint: '/oauth/revoke', - logoutUrl: '/oidc/logout', - userinfoEndpoint: '/userinfo', - OAuthLibConfig: { - redirectUri: 'https://www..com', - postLogoutRedirectUri: 'https://www..com', - responseType: 'code', - scope: 'openid profile email', - showDebugInformation: true, - disablePKCE: false, - customQueryParams: { - audience: 'https://api..com/occ/v2/' - } - }, - }, -}; -``` - -To avoid failing requests during the logout sequence, we also strongly recommend to overlay the standard logout -guard from the Spartacus project, with an implementation as follows here: - -```typescript -import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { Router, UrlTree } from '@angular/router'; -import { - AuthRedirectService, - AuthService, - CmsService, - OccEndpointsService, - ProtectedRoutesService, - SemanticPathService, -} from '@spartacus/core'; -import { LogoutGuard } from '@spartacus/storefront'; -import { Observable, of } from 'rxjs'; -import { catchError, map, switchMap, take } from 'rxjs/operators'; - -@Injectable() -export class CustomLogoutGuard extends LogoutGuard { - constructor( - protected auth: AuthService, - protected cms: CmsService, - protected semanticPathService: SemanticPathService, - protected protectedRoutes: ProtectedRoutesService, - protected router: Router, - protected http: HttpClient, - protected endpointsService: OccEndpointsService - ) { - super(auth, cms, semanticPathService, protectedRoutes, router); - } - - canActivate(): Observable { - /** - * Note: - * We must wait until the access token was revoked from the backend before - * performing the call to this.logout(), otherwise racing conditions may - * terminate the call before the backend took note of it. - * - * But we do not care whether the action was successful or not, because the - * user shall walk through the logout process in any case. - * - * In rare situations, it may occur that a token was not successfully - * removed from the backend, but those cases all have in common, that the - * accesss token is not longer valid, e.g. has expired, or already replaced - * by a different one. - */ - return this.revokeAccessToken().pipe( - take(1), // wait until call finished - switchMap(() => this.logout()), // perform standard oauth2 logout - map(() => true) - ); - } - - revokeAccessToken(): Observable { - let endpoint = this.getRevocationEndpoint(); - return this.http.post(endpoint, '').pipe( - map(() => of(true)), - catchError((err: HttpErrorResponse) => { - return of(false); - }) - ); - } - - getRevocationEndpoint(): string { - return this.endpointsService.buildUrl('/users/current/revokeAccessToken'); - } -} -``` - -### Configuration parameters - -| Parameter | Type | Description | -|--------------------------------------------------------------|------|------------------------------------------------------------------------------------------| -| sapcxsinglesignon.filter.enabled | Boolean | specifies whether the filter is active or not (default: false) | -| sapcxsinglesignon.filter.login.userClientId | String | the SAP Commerce client ID for your single page application (required) | -| sapcxsinglesignon.filter.idp.issuer | String | the registered issuer, eg. https://dev-1234.eu.auth0.com/ (required) | -| sapcxsinglesignon.filter.idp.jwksUrl | String | if issuer is non-OIDC conform, use this URL for JWKS (optional) | -| sapcxsinglesignon.filter.idp.audience | String | the registered API, eg. https://localhost:9002/occ/v2/ (required) | -| sapcxsinglesignon.filter.idp.scope | String | the required scopeof the API, if any, eg. shop (optional) | -| sapcxsinglesignon.filter.idp.requiredClaims | String | comma-separated list of required claims for a valid token (optional) | -| sapcxsinglesignon.filter.idp.clientid | String | the client ID of the application (required) | -| sapcxsinglesignon.filter.idp.claim.id | String | claim name used for user ID mapping (default: email) | - -## License - -_Licensed under the Apache License, Version 2.0, January 2004_ - -_Copyright 2025, SAP CX Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/extensioninfo.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/extensioninfo.xml deleted file mode 100644 index 0d955150..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/extensioninfo.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/external-dependencies.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/external-dependencies.xml deleted file mode 100644 index 942dc9b8..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/external-dependencies.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - tools.sapcx - sapcxsinglesignon - 4.4.0 - jar - - - org.springframework.security - spring-security-saml2-service-provider - 5.8.16 - - - org.springframework.security - spring-security-oauth2-core - 5.8.16 - - - org.springframework.security - spring-security-oauth2-jose - 5.8.16 - - - com.nimbusds - nimbus-jose-jwt - 10.6 - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/project.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/project.properties deleted file mode 100644 index cd102395..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/project.properties +++ /dev/null @@ -1,36 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools -# ---------------------------------------------------------------------------- - -# Location of the file for the global platform spring application context -sapcxsinglesignon.application-context=sapcxsinglesignon-spring.xml - -# Enhance samlsinglesignon web context -samlsinglesignon.additionalWebSpringConfigs.sapcxsinglesignon=classpath:/samlsinglesignon/web/spring/idp-initiated-login-spring.xml - -############################################################################## -# General settings -# -# filter.enabled - specifies whether the filter is active or not (default: false) -# login.userClientId - the SAP Commerce client ID for your single page application (required) -# -# filter.idp.issuer - the issuer, eg. https://dev-1234.eu.auth0.com/ (required) -# filter.idp.jwksUrl - the URL pointing to the JWKS, eg. https://dev-1234.eu.auth0.com/ (optional) -# filter.idp.audience - the audience of the API, eg. https://localhost:9002/occ/v2/ (required) -# filter.idp.scope - the required scope of the API, if any, eg. shop (optional) -# filter.idp.requiredClaims - comma-separated list of required claims for a valid token (optional) -# filter.idp.clientid - the client ID of the application (required) -# filter.idp.claim.id - claim name used for user ID mapping (default: email) -############################################################################## -sapcxsinglesignon.filter.enabled=false -sapcxsinglesignon.filter.login.userClientId= - -sapcxsinglesignon.filter.idp.issuer= -sapcxsinglesignon.filter.idp.jwksUrl= -sapcxsinglesignon.filter.idp.audience= -sapcxsinglesignon.filter.idp.scope= -sapcxsinglesignon.filter.idp.requiredClaims= -sapcxsinglesignon.filter.idp.clientid= -sapcxsinglesignon.filter.idp.claim.id=email - -sapcxsinglesignon.backoffice.defaulturl=/ diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/occ/v2/sapcxsinglesignonocc/web/spring/sapcxsinglesignon-web-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/occ/v2/sapcxsinglesignonocc/web/spring/sapcxsinglesignon-web-spring.xml deleted file mode 100644 index 378a28b0..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/occ/v2/sapcxsinglesignonocc/web/spring/sapcxsinglesignon-web-spring.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/samlsinglesignon/web/spring/idp-initiated-login-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/samlsinglesignon/web/spring/idp-initiated-login-spring.xml deleted file mode 100644 index 903a1d05..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/samlsinglesignon/web/spring/idp-initiated-login-spring.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/sapcxsinglesignon-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/sapcxsinglesignon-spring.xml deleted file mode 100644 index f40f3ed6..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/resources/sapcxsinglesignon-spring.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/constants/CxSingleSignOnConstants.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/constants/CxSingleSignOnConstants.java deleted file mode 100644 index ca296f32..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/constants/CxSingleSignOnConstants.java +++ /dev/null @@ -1,11 +0,0 @@ -package tools.sapcx.commerce.sso.constants; - -@SuppressWarnings({ "deprecation", "squid:CallToDeprecatedMethod" }) -public class CxSingleSignOnConstants extends GeneratedCxSingleSignOnConstants { - public static final String EXTENSIONNAME = "sapcxsinglesignon"; - - private CxSingleSignOnConstants() { - // empty - } - -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/controller/AccessTokenRevocationController.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/controller/AccessTokenRevocationController.java deleted file mode 100644 index 2b45eba5..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/controller/AccessTokenRevocationController.java +++ /dev/null @@ -1,57 +0,0 @@ -package tools.sapcx.commerce.sso.controller; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.security.access.annotation.Secured; -import org.springframework.security.core.Authentication; -import org.springframework.security.oauth2.common.OAuth2AccessToken; -import org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor; -import org.springframework.security.oauth2.provider.authentication.TokenExtractor; -import org.springframework.security.oauth2.provider.token.TokenStore; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseStatus; - -@Controller -@RequestMapping(value = "/{baseSiteId}/users/{userId}/revokeAccessToken") -public class AccessTokenRevocationController { - private static final Logger LOG = LoggerFactory.getLogger(AccessTokenRevocationController.class); - - @Resource(name = "oauthTokenStore") - private TokenStore tokenStore; - @Value("${sapcxsinglesignon.filter.enabled}") - private boolean enabled; - private TokenExtractor tokenExtractor; - - public AccessTokenRevocationController() { - this.tokenExtractor = new BearerTokenExtractor(); - } - - @Secured({ "ROLE_CUSTOMERGROUP", "ROLE_TRUSTED_CLIENT" }) - @RequestMapping(method = RequestMethod.POST) - @ResponseStatus(HttpStatus.ACCEPTED) - public void revokeAccessToken(HttpServletRequest request) { - Authentication accessToken = tokenExtractor.extract(request); - - if (enabled && accessToken != null) { - String accessTokenValue = accessToken.getPrincipal().toString(); - LOG.debug("Access token extracted from request: {}", accessTokenValue); - - OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(accessTokenValue); - LOG.debug("OAuth2 AccessToken found in token store: {}", oAuth2AccessToken != null ? "yes" : "no"); - - if (oAuth2AccessToken != null) { - synchronized (accessTokenValue.intern()) { - tokenStore.removeAccessToken(oAuth2AccessToken); - LOG.debug("Access token removed from store: {}", accessTokenValue); - } - } - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/AudienceValidator.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/AudienceValidator.java deleted file mode 100644 index 68830c3a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/AudienceValidator.java +++ /dev/null @@ -1,24 +0,0 @@ -package tools.sapcx.commerce.sso.filter; - -import org.springframework.security.oauth2.core.OAuth2Error; -import org.springframework.security.oauth2.core.OAuth2TokenValidator; -import org.springframework.security.oauth2.core.OAuth2TokenValidatorResult; -import org.springframework.security.oauth2.jwt.Jwt; - -class AudienceValidator implements OAuth2TokenValidator { - private String audience; - - public AudienceValidator(String audience) { - this.audience = audience; - } - - @Override - public OAuth2TokenValidatorResult validate(Jwt token) { - if (token.getAudience().contains(audience)) { - return OAuth2TokenValidatorResult.success(); - } - - OAuth2Error error = new OAuth2Error("invalid_token", "The required audience is missing", null); - return OAuth2TokenValidatorResult.failure(error); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/JwtAccessTokenVerificationFilter.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/JwtAccessTokenVerificationFilter.java deleted file mode 100644 index d90541aa..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/filter/JwtAccessTokenVerificationFilter.java +++ /dev/null @@ -1,272 +0,0 @@ -package tools.sapcx.commerce.sso.filter; - -import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import java.io.IOException; -import java.util.*; -import java.util.stream.Stream; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.authentication.BadCredentialsException; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; -import org.springframework.security.oauth2.common.OAuth2AccessToken; -import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; -import org.springframework.security.oauth2.core.OAuth2TokenValidator; -import org.springframework.security.oauth2.jwt.*; -import org.springframework.security.oauth2.provider.ClientDetails; -import org.springframework.security.oauth2.provider.ClientDetailsService; -import org.springframework.security.oauth2.provider.OAuth2Authentication; -import org.springframework.security.oauth2.provider.OAuth2Request; -import org.springframework.security.oauth2.provider.OAuth2RequestFactory; -import org.springframework.security.oauth2.provider.TokenRequest; -import org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor; -import org.springframework.security.oauth2.provider.authentication.TokenExtractor; -import org.springframework.security.oauth2.provider.token.TokenStore; -import org.springframework.web.filter.OncePerRequestFilter; - -import tools.sapcx.commerce.sso.user.UpdateUserFromTokenStrategy; - -/** - * This filter performs verification of an external access token. - * - * If enabled, it will extract the access token from the request, and asks a - * concrete implementation to fetch the user details. - * - * If valid, the user details will be used to create a local OAuth2 - * Authentication for the user and stored in the token store. - * - * Later in the filter chain, the Spring security chain will verify the access - * token against the token store and use this token to authenticate the user. - */ -public class JwtAccessTokenVerificationFilter extends OncePerRequestFilter { - private static final Logger LOG = LoggerFactory.getLogger(JwtAccessTokenVerificationFilter.class); - public static final String AUTHORIZED_PARTY_CLAIM = "azp"; - public static final String SCOPE_CLAIM = "scope"; - - private OAuth2RequestFactory oAuth2RequestFactory; - private ClientDetailsService clientDetailsService; - private UserDetailsService userDetailsService; - private UpdateUserFromTokenStrategy updateUserFromTokenStrategy; - private TokenStore tokenStore; - private String occClientId; - private boolean enabled; - private String jwksUrl; - private String issuer; - private String audience; - private String scope; - private List requiredClaims; - private String clientId; - private String customerIdField; - private TokenExtractor tokenExtractor; - private JwtDecoder jwtDecoder = null; - - public JwtAccessTokenVerificationFilter( - OAuth2RequestFactory oAuth2RequestFactory, - ClientDetailsService clientDetailsService, - UserDetailsService userDetailsService, - UpdateUserFromTokenStrategy updateUserFromTokenStrategy, - TokenStore tokenStore, - String occClientId, - boolean enabled, - String jwksUrl, - String issuer, - String audience, - String scope, - String requiredClaims, - String clientId, - String customerIdField) { - this.oAuth2RequestFactory = oAuth2RequestFactory; - this.clientDetailsService = clientDetailsService; - this.userDetailsService = userDetailsService; - this.updateUserFromTokenStrategy = updateUserFromTokenStrategy; - this.tokenStore = tokenStore; - this.occClientId = occClientId; - this.enabled = enabled; - this.jwksUrl = jwksUrl; - this.issuer = issuer; - this.audience = audience; - this.scope = scope; - this.requiredClaims = new ArrayList<>(); - if (isNotBlank(requiredClaims)) { - Stream.of(StringUtils.split(requiredClaims, ',')) - .map(StringUtils::trimToEmpty) - .filter(StringUtils::isNotBlank) - .forEach(this.requiredClaims::add); - } - this.clientId = clientId; - this.customerIdField = customerIdField; - } - - @Override - public void afterPropertiesSet() throws ServletException { - super.afterPropertiesSet(); - this.tokenExtractor = new BearerTokenExtractor(); - } - - @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { - Authentication accessToken = tokenExtractor.extract(request); - if (enabled && accessToken != null) { - String accessTokenValue = accessToken.getPrincipal().toString().intern(); - LOG.debug("Access token extracted from request: {}", accessTokenValue); - - OAuth2AccessToken oAuth2AccessToken = fetchFromTokenStore(accessTokenValue, false); - LOG.debug("OAuth2 AccessToken from token store (1st attempt, without lock): {} (expired? => {})", oAuth2AccessToken, - oAuth2AccessToken != null ? oAuth2AccessToken.isExpired() : false); - - if (oAuth2AccessToken == null || oAuth2AccessToken.isExpired()) { - synchronized (accessTokenValue) { - oAuth2AccessToken = fetchFromTokenStore(accessTokenValue, true); - LOG.debug("OAuth2 AccessToken from token store (2nd attempt, with lock): {} (expired? => {})", oAuth2AccessToken, - oAuth2AccessToken != null ? oAuth2AccessToken.isExpired() : false); - } - } - } - - filterChain.doFilter(request, response); - } - - private OAuth2AccessToken fetchFromTokenStore(String accessTokenValue, boolean createIfMissing) { - OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(accessTokenValue); - if (oAuth2AccessToken != null && !oAuth2AccessToken.isExpired()) { - return oAuth2AccessToken; - } else if (oAuth2AccessToken != null && oAuth2AccessToken.isExpired()) { - tokenStore.removeAccessToken(oAuth2AccessToken); - oAuth2AccessToken = null; - } - - if (createIfMissing) { - try { - Jwt decodedToken = decodeAccessToken(accessTokenValue); - String userId = decodedToken.getClaimAsString(customerIdField); - if (userId != null) { - LOG.debug("Mapped user ID using field '{}': '{}'", customerIdField, userId); - updateUserFromTokenStrategy.updateUserFromToken(userId, decodedToken); - oAuth2AccessToken = storeAuthenticationForUser(userId, occClientId, decodedToken); - } else { - LOG.warn("No user ID found in access token for field: '{}' and the configured authorized party. Make sure your IDP configuration is correct!", customerIdField); - } - } catch (Exception e) { - LOG.debug(String.format("Invalid access token '%s'!", accessTokenValue), e); - } - } - - return oAuth2AccessToken; - } - - protected Jwt decodeAccessToken(String accessTokenValue) throws JwtException { - if (jwtDecoder == null) { - initJwtDecoder(); - } - - try { - return jwtDecoder.decode(accessTokenValue); - } catch (JwtException e) { - LOG.debug("Retry with reinitialized decoder"); - initJwtDecoder(); - return jwtDecoder.decode(accessTokenValue); - } - } - - private OAuth2AccessToken storeAuthenticationForUser(String userId, String oAuth2ClientId, Jwt decodedToken) { - assert isNotBlank(oAuth2ClientId); - assert isNotBlank(userId); - assert Objects.nonNull(decodedToken); - - // OAuth2 Request - ClientDetails clientDetails = clientDetailsService.loadClientByClientId(oAuth2ClientId); - TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(Collections.emptyMap(), clientDetails); - OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(clientDetails); - - try { - // Username Password Auth Token - UsernamePasswordAuthenticationToken userToken = createUsernamePasswordAuthenticationToken(userId); - - // Create access token and authentication for user - DefaultOAuth2AccessToken oAuth2AccessToken = new DefaultOAuth2AccessToken(decodedToken.getTokenValue()); - oAuth2AccessToken.setExpiration(Date.from(decodedToken.getExpiresAt())); - OAuth2Authentication authentication = new OAuth2Authentication(oAuth2Request, userToken); - - // Remove existing access token for same authentication - OAuth2AccessToken existingToken = tokenStore.getAccessToken(authentication); - if (existingToken != null) { - LOG.debug("Found another access token '{}' for the authentication, removing it from the token store.", existingToken.getValue()); - tokenStore.removeAccessToken(existingToken); - } - - // Create the new access token for the user - tokenStore.storeAccessToken(oAuth2AccessToken, authentication); - LOG.debug("New access token has been created successfully!"); - - return oAuth2AccessToken; - } catch (BadCredentialsException e) { - throw e; - } - } - - private UsernamePasswordAuthenticationToken createUsernamePasswordAuthenticationToken(String userId) { - try { - UserDetails userDetails = userDetailsService.loadUserByUsername(userId); - Collection authorities = userDetails.getAuthorities(); - return new UsernamePasswordAuthenticationToken(userId, null, authorities); - } catch (UsernameNotFoundException e) { - LOG.warn("Login attempt for unknown user '{}'!", userId); - throw new BadCredentialsException("Invalid credentials!"); - } - } - - private synchronized void initJwtDecoder() { - if (isNotBlank(jwksUrl)) { - LOG.info("Initializing JWT decoder with JwkSetUri '{}'", jwksUrl); - this.jwtDecoder = NimbusJwtDecoder.withJwkSetUri(jwksUrl).build(); - } else { - LOG.info("Initializing JWT decoder with OIDC issuer location '{}'", issuer); - this.jwtDecoder = JwtDecoders.fromOidcIssuerLocation(issuer); - } - - if (this.jwtDecoder instanceof NimbusJwtDecoder) { - configureValidatorsForJwtDecoder((NimbusJwtDecoder) this.jwtDecoder); - } - } - - private void configureValidatorsForJwtDecoder(NimbusJwtDecoder decoder) { - List> validators = new ArrayList<>(); - - validators.add(new JwtTimestampValidator()); - - if (isNotBlank(this.issuer)) { - validators.add(new JwtIssuerValidator(this.issuer)); - } - - if (isNotBlank(this.audience)) { - validators.add(new AudienceValidator(this.audience)); - } - - if (isNotBlank(this.clientId)) { - validators.add(new JwtClaimValidator<>(AUTHORIZED_PARTY_CLAIM, this.clientId::equalsIgnoreCase)); - } - - if (isNotBlank(this.scope)) { - validators.add(new JwtClaimValidator<>(SCOPE_CLAIM, this.scope::equalsIgnoreCase)); - } - - for (String requiredClaim : this.requiredClaims) { - validators.add(new JwtClaimValidator<>(requiredClaim, Objects::nonNull)); - } - - decoder.setJwtValidator(new DelegatingOAuth2TokenValidator<>(validators)); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/saml/IdpInitiatedSamlAuthenticationSuccessHandler.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/saml/IdpInitiatedSamlAuthenticationSuccessHandler.java deleted file mode 100644 index 6d7110ad..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/saml/IdpInitiatedSamlAuthenticationSuccessHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -package tools.sapcx.commerce.sso.saml; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.core.Authentication; -import org.springframework.security.saml2.provider.service.authentication.Saml2Authentication; -import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; - -public class IdpInitiatedSamlAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { - private static final Logger LOG = LoggerFactory.getLogger(IdpInitiatedSamlAuthenticationSuccessHandler.class); - - @Override - public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException { - if (authentication instanceof Saml2Authentication) { - String relayStateURL = request.getParameter("RelayState"); - if (StringUtils.isNotBlank(relayStateURL)) { - LOG.debug("Redirecting to RelayState Url: " + relayStateURL); - getRedirectStrategy().sendRedirect(request, response, relayStateURL); - return; - } - } - super.onAuthenticationSuccess(request, response, authentication); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/NoUpdateUserFromTokenStrategy.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/NoUpdateUserFromTokenStrategy.java deleted file mode 100644 index 372868bb..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/NoUpdateUserFromTokenStrategy.java +++ /dev/null @@ -1,9 +0,0 @@ -package tools.sapcx.commerce.sso.user; - -import org.springframework.security.oauth2.jwt.Jwt; - -public class NoUpdateUserFromTokenStrategy implements UpdateUserFromTokenStrategy { - @Override - public void updateUserFromToken(String userId, Jwt token) { - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/UpdateUserFromTokenStrategy.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/UpdateUserFromTokenStrategy.java deleted file mode 100644 index ed7d08c7..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/src/tools/sapcx/commerce/sso/user/UpdateUserFromTokenStrategy.java +++ /dev/null @@ -1,7 +0,0 @@ -package tools.sapcx.commerce.sso.user; - -import org.springframework.security.oauth2.jwt.Jwt; - -public interface UpdateUserFromTokenStrategy { - void updateUserFromToken(String userId, Jwt token); -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java deleted file mode 100644 index 1526972c..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxsinglesignon/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -package tools.sapcx.commerce.sso.config; - -import de.hybris.bootstrap.annotations.UnitTest; - -import org.junit.Test; - -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; - -@UnitTest -public class ExtensionConfigurationTests { - @Test - public void extensionConfiguration() { - InstalledExtensionVerifier.verifier() - .requires("sapcxsinglesignon") - .requires("sapcommercetoolkit") - .requires("commercewebservices") - .requires("samlsinglesignon") - .requires("oauth2") - .verify(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.project b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.project deleted file mode 100644 index 0588f6c4..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - sapcxssoauth0 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - - - - 1642058460820 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/LICENSE.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/LICENSE.md deleted file mode 100644 index 9776fe0d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [2025] [SAP CX Tools] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/README.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/README.md deleted file mode 100644 index c8010c20..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# SAP CX Single-Sign-On (Auth0 Replication) - -The `sapcxssoauth0` extension provides core replication mechanism for synchronizing customer data with -external service and identity providers, in this case Auth0 by Okta. - -## FEATURE DESCRIPTION - -The extension ships a customer replication strategy, that can be activated to create users within -Auth0, whenever a customer object is created or changed within SAP commerce cloud. - -### How to activate and use - -To activate the functionality, one needs to set the configuration parameters accordingly for each environment, -especially the flags `sapcxsinglesignon.replicate.creation.enabled`, and -`sapcxsinglesignon.replicate.removal.enabled` which are set to `false` by default. - -For the customer replication, one can add additional populators to the `auth0CustomerConverter` converter bean. -This can be easily done using the `modifyPopulatorList` bean notation: - -```xml - - - - - -``` - -### Configuration parameters - -| Parameter | Type | Description | -|--------------------------------------------------------------|------|------------------------------------------------------------------------------------------| -| sapcxsinglesignon.replicate.enabled | Boolean | specifies whether the replication is active or not (default: false) | -| sapcxsinglesignon.replicate.creation.enabled | Boolean | specifies whether the user creation is enabled or not (default: false) | -| sapcxsinglesignon.replicate.removal.enabled | Boolean | specifies whether the user removal is enabled or not (default: false) | -| sapcxsinglesignon.auth0.management.api.audience | String | the audience for your machine-to-machine application (required) | -| sapcxsinglesignon.auth0.management.api.clientid | String | the auth0 client ID for your machine-to-machine application (required) | -| sapcxsinglesignon.auth0.management.api.clientsecret | String | the auth0 client secret for your machine-to-machine application (required) | -| sapcxsinglesignon.auth0.customer.connection | String | the authentication connection for customers (default: "Username-Password-Authentication") | -| customer.metadata.prefix | String | the prefix for application metadata for customers (required, default: commerce) | -| sapcxsinglesignon.auth0.customer.role | String | the role to assign to newly created customer accounts | -| sapcxsinglesignon.auth0.customer.requireemailverification | String | specifies if the user needs to verify their email (default: false) | -| sapcxsinglesignon.auth0.customer.requirepasswordverification | String | specifies if the user needs to verify their password (default: false) | -| sapcxsinglesignon.auth0.customer.useblockedstatus | Boolean | specifies if the user shall be blocked when disabled in SAP Commerce (default: false) | - -## License - -_Licensed under the Apache License, Version 2.0, January 2004_ - -_Copyright 2025, SAP CX Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/extensioninfo.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/extensioninfo.xml deleted file mode 100644 index a8bc8288..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/extensioninfo.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/external-dependencies.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/external-dependencies.xml deleted file mode 100644 index 7679f464..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/external-dependencies.xml +++ /dev/null @@ -1,61 +0,0 @@ - - 4.0.0 - tools.sapcx - sapcxssoauth0 - 4.4.0 - jar - - - com.auth0 - auth0 - 2.9.0 - - - com.auth0 - java-jwt - 4.4.0 - - - com.squareup.okhttp3 - okhttp - 4.12.0 - - - com.squareup.okhttp3 - logging-interceptor - 4.12.0 - - - com.squareup.okio - okio - 3.7.0 - - - com.squareup.okio - okio-jvm - 3.7.0 - runtime - - - org.jetbrains.kotlin - kotlin-stdlib - 1.9.21 - - - org.jetbrains.kotlin - kotlin-stdlib-common - 1.9.21 - - - org.jetbrains - annotations - 24.1.0 - - - net.jodah - failsafe - 2.4.4 - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/project.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/project.properties deleted file mode 100644 index 06ea34f2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/project.properties +++ /dev/null @@ -1,45 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools -# ---------------------------------------------------------------------------- - -# Location of the file for the global platform spring application context -sapcxssoauth0.application-context=sapcxssoauth0-spring.xml - -############################################################################## -# General settings -# -# replicate.enabled - specifies whether the user replication is enabled or not (default: false) -# replicate.creation.enabled - specifies whether the user creation is enabled or not (default: false) -# replicate.removal.enabled - specifies whether the user removal is enabled or not (default: false) -############################################################################## -sapcxssoauth0.replicate.enabled=false -sapcxssoauth0.replicate.creation.enabled=false -sapcxssoauth0.replicate.removal.enabled=false - -############################################################################## -# Auth0 settings -# -# management.api.domain - the domain for your machine-to-machine application (required) -# management.api.audience - the audience for your machine-to-machine application (required) -# management.api.clientid - the auth0 client ID for your machine-to-machine application (required) -# management.api.clientsecret - the auth0 client secret for your machine-to-machine application (required) -# -# customer.connection - the authentication connection for customers (required) -# (default: "Username-Password-Authentication") -# customer.metadata.prefix - the prefix for application metadata for customers (required, default: commerce) -# customer.role - the role to assign to newly created customer accounts (optional) -# customer.requireemailverification - specifies if the user needs to verify their email (default: false) -# customer.requirepasswordverification - specifies if the user needs to verify their password (default: false) -# customer.useblockedstatus - specifies if the user shall be blocked when disabled in SAP Commerce (default: false) -############################################################################## -sapcxssoauth0.auth0.management.api.domain= -sapcxssoauth0.auth0.management.api.audience= -sapcxssoauth0.auth0.management.api.clientid= -sapcxssoauth0.auth0.management.api.clientsecret= - -sapcxssoauth0.auth0.customer.connection=Username-Password-Authentication -sapcxssoauth0.auth0.customer.metadata.prefix=commerce -sapcxssoauth0.auth0.customer.role= -sapcxssoauth0.auth0.customer.requireemailverification=false -sapcxssoauth0.auth0.customer.requirepasswordverification=false -sapcxssoauth0.auth0.customer.useblockedstatus=false diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/resources/sapcxssoauth0-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/resources/sapcxssoauth0-spring.xml deleted file mode 100644 index 26704c7e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/resources/sapcxssoauth0-spring.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/Actions.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/Actions.java deleted file mode 100644 index 335b73b9..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/Actions.java +++ /dev/null @@ -1,45 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; - -public interface Actions { - static Role getRole(String roleName) throws Auth0Exception { - return FetchRoleAction.getRole(roleName); - } - - static void assignRole(Role role, User user) throws Auth0Exception { - AssignRoleAction.assignRole(role, user); - } - - static void removeRole(Role role, User user) throws Auth0Exception { - RemoveRoleAction.removeRole(role, user); - } - - static User getUser(String email) throws Auth0Exception { - return FetchUserAction.getUser(email); - } - - static User createUser(CustomerModel customer) throws Auth0Exception { - return CreateUserAction.createUser(customer); - } - - static User updateUser(User user, CustomerModel customer) throws Auth0Exception { - return UpdateUserAction.updateUser(user, customer); - } - - static void removeUser(User user, String customerId) throws Auth0Exception { - RemoveUserAction.removeUser(user, customerId); - } - - static String getPasswordResetUrl(User user) throws Auth0Exception { - return getPasswordResetUrl(user, false); - } - - static String getPasswordResetUrl(User user, boolean markEmailAsVerified) throws Auth0Exception { - return PasswordResetUrlAction.getPasswordResetUrl(user, markEmailAsVerified); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/AssignRoleAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/AssignRoleAction.java deleted file mode 100644 index f8728719..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/AssignRoleAction.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.List; -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.users.User; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class AssignRoleAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(AssignRoleAction.class); - - static void assignRole(Role role, User user) throws Auth0Exception { - new AssignRoleAction().execute(Map.of("role", role, "user", user)); - } - - private AssignRoleAction() { - // Avoid instantiation - } - - @Override - public Void execute(Map parameter) throws Auth0Exception { - Role role = getWithType(parameter, "role", Role.class); - User user = getWithType(parameter, "user", User.class); - - try { - submit(managementAPI().users().addRoles(user.getId(), List.of(role.getId()))); - LOG.debug("Assigned role with name '{}' to user with email '{}'.", role.getName(), user.getEmail()); - return null; - } catch (Auth0Exception exception) { - LOG.warn(String.format("Could not assign role '%s' to user with email '%s'. ", role.getName(), user.getEmail()), exception); - throw exception; - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/CreateUserAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/CreateUserAction.java deleted file mode 100644 index 6504a6eb..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/CreateUserAction.java +++ /dev/null @@ -1,82 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.dto.converter.Converter; - -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class CreateUserAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(CreateUserAction.class); - - static User createUser(CustomerModel customer) throws Auth0Exception { - return new CreateUserAction().execute(Map.of("customer", customer)); - } - - private CreateUserAction() { - // Avoid instantiation - } - - @Override - public User execute(Map parameter) throws Auth0Exception { - CustomerModel customer = getWithType(parameter, "customer", CustomerModel.class); - String customerId = customer.getUid(); - - User user = null; - try { - Converter customerConverter = getCustomerConverter(); - User userInfo = customerConverter.convert(customer); - - if (requireEmailVerification()) { - userInfo.setEmailVerified(false); - userInfo.setVerifyEmail(true); - } - - if (useBlockedStatusForDisabledCustomers()) { - userInfo.setBlocked(BooleanUtils.isNotFalse(customer.isLoginDisabled())); - } - - // Add one time information for creation process - userInfo.setConnection(getCustomerConnection()); - userInfo.setPassword(getRandomPassword()); - if (requirePasswordVerification()) { - userInfo.setVerifyPassword(true); - } - - user = fetch(managementAPI().users().create(userInfo)); - return user; - } catch (Auth0Exception exception) { - LOG.debug(String.format("Create user with ID '%s' failed!", customerId), exception); - throw exception; - } finally { - LOG.debug("Create user with ID '{}' resulted in: '{}'.", customerId, user != null ? user.getId() : "-error-"); - } - } - - private char[] getRandomPassword() { - List passwordCharacters = new ArrayList<>(32); - - String alphaNumericChars = RandomStringUtils.randomAlphanumeric(26); - for (int i = 0; i < alphaNumericChars.length(); i++) { - passwordCharacters.add(String.valueOf(alphaNumericChars.charAt(i))); - } - - String specialChars = RandomStringUtils.random(6, '!', '@', '#', '$', '%', '^', '&', '*'); - for (int i = 0; i < specialChars.length(); i++) { - passwordCharacters.add(String.valueOf(specialChars.charAt(i))); - } - - Collections.shuffle(passwordCharacters); - return String.join("", passwordCharacters).toCharArray(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchRoleAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchRoleAction.java deleted file mode 100644 index f787168b..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchRoleAction.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.client.mgmt.filter.RolesFilter; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.roles.Role; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class FetchRoleAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(FetchRoleAction.class); - - static Role getRole(String roleName) throws Auth0Exception { - return new FetchRoleAction().execute(Map.of("role", roleName)); - } - - private FetchRoleAction() { - // Avoid instantiation - } - - @Override - public Role execute(Map parameter) throws Auth0Exception { - String roleName = getWithType(parameter, "role", String.class); - Role role = null; - try { - RolesFilter roleByName = new RolesFilter().withName(roleName); - role = fetchFirst(managementAPI().roles().list(roleByName)); - return role; - } catch (Auth0Exception exception) { - LOG.debug(String.format("Search for role with name '%s' could not be executed!", roleName), exception); - throw exception; - } finally { - LOG.debug("Lookup for existing role with name '{}' resulted in: '{}'", roleName, role != null ? role.getId() : "-not found-"); - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchUserAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchUserAction.java deleted file mode 100644 index a40428ac..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/FetchUserAction.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.client.mgmt.filter.UserFilter; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.users.User; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class FetchUserAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(FetchUserAction.class); - - static User getUser(String id) throws Auth0Exception { - return new FetchUserAction().execute(Map.of("id", id)); - } - - private FetchUserAction() { - // Avoid instantiation - } - - @Override - public User execute(Map parameter) throws Auth0Exception { - String userId = getWithType(parameter, "id", String.class); - User user = null; - try { - UserFilter userById = new UserFilter().withQuery(userId); - user = fetchFirst(managementAPI().users().list(userById)); - return user; - } catch (Auth0Exception exception) { - LOG.debug(String.format("Search for user with ID '%s' could not be executed!", userId), exception); - throw exception; - } finally { - LOG.debug("Lookup for existing user with ID '{}' resulted in: '{}'", userId, user != null ? user.getId() : "-not found-"); - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/PasswordResetUrlAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/PasswordResetUrlAction.java deleted file mode 100644 index 3e58a69c..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/PasswordResetUrlAction.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.tickets.PasswordChangeTicket; -import com.auth0.json.mgmt.users.User; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class PasswordResetUrlAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(PasswordResetUrlAction.class); - - static String getPasswordResetUrl(User user, boolean markEmailAsVerified) throws Auth0Exception { - return new PasswordResetUrlAction().execute(Map.of("user", user, "markEmailAsVerified", markEmailAsVerified)); - } - - private PasswordResetUrlAction() { - // Avoid instantiation - } - - @Override - public String execute(Map parameter) throws Auth0Exception { - User user = getWithType(parameter, "user", User.class); - Boolean markEmailAsVerified = getWithType(parameter, "markEmailAsVerified", Boolean.class); - try { - PasswordChangeTicket ticket = new PasswordChangeTicket(user.getId()); - ticket.setMarkEmailAsVerified(markEmailAsVerified); - - PasswordChangeTicket passwordChangeTicket = fetch(managementAPI().tickets().requestPasswordChange(ticket)); - return passwordChangeTicket.getTicket(); - } catch (Auth0Exception exception) { - LOG.debug(String.format("Get password reset token for existing user with ID '{}' failed!", user.getEmail()), exception); - throw exception; - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveRoleAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveRoleAction.java deleted file mode 100644 index f461a6a6..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveRoleAction.java +++ /dev/null @@ -1,39 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.List; -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.users.User; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class RemoveRoleAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(RemoveRoleAction.class); - - static void removeRole(Role role, User user) throws Auth0Exception { - new RemoveRoleAction().execute(Map.of("role", role, "user", user)); - } - - private RemoveRoleAction() { - // Avoid instantiation - } - - @Override - public Void execute(Map parameter) throws Auth0Exception { - Role role = getWithType(parameter, "role", Role.class); - User user = getWithType(parameter, "user", User.class); - - try { - submit(managementAPI().users().removeRoles(user.getId(), List.of(role.getId()))); - LOG.debug("Remove role with name '{}' from user with email '{}'.", role.getName(), user.getEmail()); - return null; - } catch (Auth0Exception exception) { - LOG.warn(String.format("Could not remove role '%s' from user with email '%s'. ", role.getName(), user.getEmail()), exception); - throw exception; - } - } - -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveUserAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveUserAction.java deleted file mode 100644 index d9be1e25..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/RemoveUserAction.java +++ /dev/null @@ -1,35 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.users.User; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class RemoveUserAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(RemoveUserAction.class); - - static void removeUser(User user, String customerId) throws Auth0Exception { - new RemoveUserAction().execute(Map.of("user", user, "customerId", customerId)); - } - - private RemoveUserAction() { - // Avoid instantiation - } - - @Override - public Void execute(Map parameter) throws Auth0Exception { - User user = getWithType(parameter, "user", User.class); - String customerId = getWithType(parameter, "customerId", String.class); - try { - fetch(managementAPI().users().delete(user.getId())); - LOG.debug("Delete user with ID '{}' was successful.", customerId); - return null; - } catch (Auth0Exception exception) { - LOG.debug(String.format("Delete user with ID '%s' failed!", customerId), exception); - throw exception; - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkAction.java deleted file mode 100644 index 147e60d9..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkAction.java +++ /dev/null @@ -1,76 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.client.mgmt.ManagementAPI; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.Page; -import com.auth0.json.mgmt.users.User; -import com.auth0.net.Request; - -import de.hybris.platform.core.Registry; -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.dto.converter.Converter; - -/** - * Performs an action on the Auth0 SDK. - * - * @param response type of the action - */ -@FunctionalInterface -interface SdkAction { - R execute(Map requestParameter) throws Auth0Exception; - - default ManagementAPI managementAPI() throws Auth0Exception { - return getConfigurationService().getManagementAPI(); - } - - default void submit(Request request) throws Auth0Exception { - request.execute(); - } - - default T fetch(Request request) throws Auth0Exception { - return request.execute().getBody(); - } - - default T fetchFirst(Request> request) throws Auth0Exception { - return request.execute().getBody().getItems().stream().findFirst().orElse(null); - } - - default T getWithType(Map requestParameter, String parameterName, Class returnType) { - Object value = requestParameter.get(parameterName); - return (returnType.isInstance(value)) ? returnType.cast(value) : null; - } - - default String getCustomerIdField() { - return getConfigurationService().getCustomerIdField(); - } - - default String getCustomerConnection() { - return getConfigurationService().getCustomerConnection(); - } - - default Converter getCustomerConverter() { - return getConfigurationService().getCustomerConverter(); - } - - default boolean requireEmailVerification() { - return getConfigurationService().requireEmailVerification(); - } - - default boolean requirePasswordVerification() { - return getConfigurationService().requirePasswordVerification(); - } - - default boolean useBlockedStatusForDisabledCustomers() { - return getConfigurationService().useBlockedStatusForDisabledCustomers(); - } - - default String getAuthClientId() { - return getConfigurationService().getAuthClientId(); - } - - private SdkConfigurationService getConfigurationService() { - return Registry.getApplicationContext().getBean(SdkConfigurationService.class); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkConfigurationService.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkConfigurationService.java deleted file mode 100644 index d4714d2e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/SdkConfigurationService.java +++ /dev/null @@ -1,90 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import com.auth0.client.auth.AuthAPI; -import com.auth0.client.mgmt.ManagementAPI; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.config.ConfigurationService; -import de.hybris.platform.servicelayer.dto.converter.Converter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdkConfigurationService { - private static final Logger LOG = LoggerFactory.getLogger(SdkConfigurationService.class); - private static final String AUTH0_MANAGEMENT_API_DOMAIN = "sapcxsinglesignon.auth0.management.api.domain"; - private static final String AUTH0_MANAGEMENT_API_AUDIENCE = "sapcxsinglesignon.auth0.management.api.audience"; - private static final String AUTH0_AUTH_API_CLIENTID = "sapcxsinglesignon.auth0.auth.api.clientid"; - private static final String AUTH0_MANAGEMENT_API_CLIENTID = "sapcxsinglesignon.auth0.management.api.clientid"; - private static final String AUTH0_MANAGEMENT_API_CLIENTSECRET = "sapcxsinglesignon.auth0.management.api.clientsecret"; - private static final String AUTH0_CUSTOMER_CONNECTION = "sapcxsinglesignon.auth0.customer.connection"; - private static final String AUTH0_CUSTOMER_ID_FIELD = "sapcxsinglesignon.auth0.customer.idfield"; - private static final String AUTH0_REQUIRE_EMAIL_VERIFICATION = "sapcxsinglesignon.auth0.customer.requireemailverification"; - private static final String AUTH0_REQUIRE_PASSWORD_VERIFICATION = "sapcxsinglesignon.auth0.customer.requirepasswordverification"; - private static final String AUTH0_USE_BLOCKEDSTATUS = "sapcxsinglesignon.auth0.customer.useblockedstatus"; - - private ConfigurationService configurationService; - private Converter customerConverter; - - public SdkConfigurationService(ConfigurationService configurationService, Converter customerConverter) { - this.configurationService = configurationService; - this.customerConverter = customerConverter; - } - - public ManagementAPI getManagementAPI() throws Auth0Exception { - LOG.debug("Create new Auth0 ManagementAPI.", getAudience()); - return ManagementAPI.newBuilder(getDomain(), getManagementAccessToken()).build(); - } - - private String getManagementAccessToken() throws Auth0Exception { - LOG.debug("Fetch access token for management API for audience: {}", getAudience()); - AuthAPI authAPI = AuthAPI.newBuilder(getDomain(), getManagementClientId(), getManagementClientSecret()).build(); - return authAPI.requestToken(getAudience()).execute().getBody().getAccessToken(); - } - - private String getAudience() { - return configurationService.getConfiguration().getString(AUTH0_MANAGEMENT_API_AUDIENCE); - } - - private String getDomain() { - return configurationService.getConfiguration().getString(AUTH0_MANAGEMENT_API_DOMAIN); - } - - public String getManagementClientId() { - return configurationService.getConfiguration().getString(AUTH0_MANAGEMENT_API_CLIENTID); - } - - public String getManagementClientSecret() { - return configurationService.getConfiguration().getString(AUTH0_MANAGEMENT_API_CLIENTSECRET); - } - - public String getCustomerConnection() { - return configurationService.getConfiguration().getString(AUTH0_CUSTOMER_CONNECTION); - } - - public String getCustomerIdField() { - return configurationService.getConfiguration().getString(AUTH0_CUSTOMER_ID_FIELD); - } - - public Converter getCustomerConverter() { - return customerConverter; - } - - public boolean requireEmailVerification() { - return configurationService.getConfiguration().getBoolean(AUTH0_REQUIRE_EMAIL_VERIFICATION, false); - } - - public boolean requirePasswordVerification() { - return configurationService.getConfiguration().getBoolean(AUTH0_REQUIRE_PASSWORD_VERIFICATION, false); - } - - public boolean useBlockedStatusForDisabledCustomers() { - return configurationService.getConfiguration().getBoolean(AUTH0_USE_BLOCKEDSTATUS, false); - } - - public String getAuthClientId() { - return configurationService.getConfiguration().getString(AUTH0_AUTH_API_CLIENTID, null); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/UpdateUserAction.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/UpdateUserAction.java deleted file mode 100644 index 6a5b7a9e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/actions/UpdateUserAction.java +++ /dev/null @@ -1,54 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.actions; - -import java.util.Map; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.dto.converter.Converter; - -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class UpdateUserAction implements SdkAction { - private static final Logger LOG = LoggerFactory.getLogger(UpdateUserAction.class); - - static User updateUser(User user, CustomerModel customer) throws Auth0Exception { - return new UpdateUserAction().execute(Map.of("user", user, "customer", customer)); - } - - private UpdateUserAction() { - // Avoid instantiation - } - - @Override - public User execute(Map parameter) throws Auth0Exception { - User user = getWithType(parameter, "user", User.class); - CustomerModel customer = getWithType(parameter, "customer", CustomerModel.class); - String customerId = customer.getUid(); - try { - Converter customerConverter = getCustomerConverter(); - User userInfo = customerConverter.convert(customer); - - if (requireEmailVerification() && !StringUtils.equals(user.getEmail(), userInfo.getEmail())) { - userInfo.setEmailVerified(false); - userInfo.setVerifyEmail(true); - } - - if (useBlockedStatusForDisabledCustomers()) { - userInfo.setBlocked(BooleanUtils.isNotFalse(customer.isLoginDisabled())); - } - - user = fetch(managementAPI().users().update(user.getId(), userInfo)); - return user; - } catch (Auth0Exception exception) { - LOG.debug(String.format("Search for user with ID '%s' failed!", customer.getUid()), exception); - throw exception; - } finally { - LOG.debug("Update information for existing user with ID '{}' resulted in: '{}'", customerId, user != null ? user.getId() : "-error-"); - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerMetadataPopulator.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerMetadataPopulator.java deleted file mode 100644 index 6692d2b5..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerMetadataPopulator.java +++ /dev/null @@ -1,111 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.replication; - -import static java.lang.String.format; -import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; -import static org.apache.commons.lang3.BooleanUtils.isTrue; -import static org.apache.commons.lang3.StringUtils.isBlank; - -import java.util.HashMap; -import java.util.Map; - -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.converters.Populator; -import de.hybris.platform.core.model.user.AddressModel; -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.dto.converter.ConversionException; - -public class Auth0CustomerMetadataPopulator implements Populator { - private String metadataPrefix; - private String metadataKeyFormat; - - public Auth0CustomerMetadataPopulator(String metadataPrefix) { - this.metadataPrefix = metadataPrefix; - this.metadataKeyFormat = isBlank(metadataPrefix) ? "%1$s" : "%0$s_%1$s"; - } - - @Override - public void populate(CustomerModel source, User target) throws ConversionException { - emptyIfNull(source.getAddresses()).stream() - .filter(this::isContactAddress) - .findFirst() - .map(this::convertAddressToMetadata) - .ifPresent(target::setAppMetadata); - } - - protected boolean isContactAddress(AddressModel address) { - return isTrue(address.getContactAddress()); - } - - private Map convertAddressToMetadata(AddressModel address) { - Map metadata = new HashMap<>(16); - addStandardContactFields(address, metadata); - addStandardAddressFields(address, metadata); - addStandardTelecommunicationFields(address, metadata); - return metadata; - } - - protected void addStandardContactFields(AddressModel address, Map metadata) { - if (address.getTitle() != null) { - metadata.put(getKey("contact_title"), address.getTitle().getCode()); - } - if (address.getCompany() != null) { - metadata.put(getKey("contact_company"), address.getCompany()); - } - if (address.getDepartment() != null) { - metadata.put(getKey("contact_department"), address.getDepartment()); - } - } - - protected void addStandardAddressFields(AddressModel address, Map metadata) { - if (address.getLine1() != null) { - metadata.put(getKey("contact_streetname"), address.getLine1()); - } - if (address.getLine2() != null) { - metadata.put(getKey("contact_streetnumber"), address.getLine2()); - } - if (address.getBuilding() != null) { - metadata.put(getKey("contact_building"), address.getBuilding()); - } - if (address.getAppartment() != null) { - metadata.put(getKey("contact_appartment"), address.getAppartment()); - } - if (address.getPostalcode() != null) { - metadata.put(getKey("contact_postalcode"), address.getPostalcode()); - } - if (address.getTown() != null) { - metadata.put(getKey("contact_city"), address.getTown()); - } - if (address.getDistrict() != null) { - metadata.put(getKey("contact_district"), address.getDepartment()); - } - if (address.getRegion() != null) { - metadata.put(getKey("contact_region"), address.getRegion().getIsocodeShort()); - } - if (address.getCountry() != null) { - metadata.put(getKey("contact_country"), address.getCountry().getIsocode()); - } - if (address.getPobox() != null) { - metadata.put(getKey("contact_pobox"), address.getPobox()); - } - } - - protected void addStandardTelecommunicationFields(AddressModel address, Map metadata) { - if (address.getCellphone() != null) { - metadata.put(getKey("contact_cellphone"), address.getCellphone()); - } - if (address.getPhone1() != null) { - metadata.put(getKey("contact_phone1"), address.getPhone1()); - } - if (address.getPhone2() != null) { - metadata.put(getKey("contact_phone2"), address.getPhone2()); - } - if (address.getFax() != null) { - metadata.put(getKey("contact_fax"), address.getFax()); - } - } - - private String getKey(String fieldName) { - return format(metadataKeyFormat, metadataPrefix, fieldName); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerPopulator.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerPopulator.java deleted file mode 100644 index 47880274..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerPopulator.java +++ /dev/null @@ -1,35 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.replication; - -import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.commerceservices.strategies.CustomerNameStrategy; -import de.hybris.platform.converters.Populator; -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.dto.converter.ConversionException; - -public class Auth0CustomerPopulator implements Populator { - private CustomerNameStrategy customerNameStrategy; - - public Auth0CustomerPopulator(CustomerNameStrategy customerNameStrategy) { - this.customerNameStrategy = customerNameStrategy; - } - - @Override - public void populate(CustomerModel source, User target) throws ConversionException { - target.setEmail(source.getContactEmail()); - target.setNickname(source.getCustomerID()); - target.setName(source.getName()); - - String[] nameParts = customerNameStrategy.splitName(source.getName()); - if (nameParts.length == 2) { - if (isNotBlank(nameParts[0])) { - target.setGivenName(nameParts[0]); - } - if (isNotBlank(nameParts[1])) { - target.setFamilyName(nameParts[1]); - } - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerReplicationStrategy.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerReplicationStrategy.java deleted file mode 100644 index 539037e5..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/auth0/replication/Auth0CustomerReplicationStrategy.java +++ /dev/null @@ -1,132 +0,0 @@ -package tools.sapcx.commerce.sso.auth0.replication; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -import java.util.List; - -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.user.UserService; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import tools.sapcx.commerce.sso.auth0.actions.Actions; -import tools.sapcx.commerce.sso.replication.CustomerReplicationException; -import tools.sapcx.commerce.sso.replication.CustomerReplicationHook; -import tools.sapcx.commerce.sso.replication.CustomerReplicationStrategy; - -public class Auth0CustomerReplicationStrategy implements CustomerReplicationStrategy { - private static final Logger LOG = LoggerFactory.getLogger(Auth0CustomerReplicationStrategy.class); - - private UserService userService; - private List customerReplicationHooks; - private String auth0RoleForCustomers; - private boolean isCreationEnabled; - private boolean isRemovalEnabled; - - public Auth0CustomerReplicationStrategy( - UserService userService, - List customerReplicationHooks, - String auth0RoleForCustomers, - boolean isCreationEnabled, - boolean isRemovalEnabled) { - this.userService = userService; - this.customerReplicationHooks = emptyIfNull(customerReplicationHooks); - this.auth0RoleForCustomers = auth0RoleForCustomers; - this.isCreationEnabled = isCreationEnabled; - this.isRemovalEnabled = isRemovalEnabled; - } - - @Override - public void replicate(CustomerModel customer) { - if (userService.isAnonymousUser(customer)) { - LOG.debug("Anonymous user replication is disabled by convention."); - return; - } - - User user = createOrUpdateUser(customer); - if (user != null) { - updateUserRoles(user, !customer.isLoginDisabled()); - } - } - - private User createOrUpdateUser(CustomerModel customer) { - String customerId = customer.getUid(); - try { - User user = Actions.getUser(customerId); - if (user != null) { - LOG.debug("User for provided customer ID '{}' exists: '{}'.", customerId, user.getId()); - User updatedUser = Actions.updateUser(user, customer); - customerReplicationHooks.forEach(hook -> hook.customerSuccessfullyUpdated(customer, updatedUser)); - return updatedUser; - } else if (!isCreationEnabled) { - LOG.debug("Customer creation is disabled by configuration."); - return null; - } else { - LOG.debug("User for provided customer ID '{}' does not exist.", customerId); - User createdUser = Actions.createUser(customer); - customerReplicationHooks.forEach(hook -> hook.customerSuccessfullyCreated(customer, createdUser)); - return createdUser; - } - } catch (Auth0Exception exception) { - LOG.debug("Could not replicate customer with ID '{}'. Data may no be in sync and needs to be corrected manually!", customerId); - throw new CustomerReplicationException("Could not replicate customer to Auth0!", exception); - } - } - - private Role updateUserRoles(User user, boolean isLoginEnabled) { - try { - if (StringUtils.isBlank(auth0RoleForCustomers)) { - return null; - } - - Role role = Actions.getRole(auth0RoleForCustomers); - if (role == null) { - return null; - } - - if (isLoginEnabled) { - Actions.assignRole(role, user); - } else { - Actions.removeRole(role, user); - } - return role; - } catch (Auth0Exception exception) { - LOG.debug("Could not synchronize roles for customer ID '{}'. Data may no be in sync and needs to be corrected manually!", user.getEmail()); - throw new CustomerReplicationException("Could not synchronize customer roles to Auth0!", exception); - } - } - - @Override - public void remove(String customerId) { - if (userService.isUserExisting(customerId) && userService.isAnonymousUser(userService.getUserForUID(customerId))) { - LOG.debug("Anonymous user removal is disabled by convention."); - return; - } - - try { - User user = Actions.getUser(customerId); - if (!isRemovalEnabled) { - LOG.debug("Customer removal is disabled by configuration."); - updateUserRoles(user, false); - return; - } - - if (user == null) { - LOG.debug("User for provided customer ID '{}' does not exist! Removal not necessary.", customerId); - } else { - LOG.debug("User for provided customer ID '{}' exists: '{}'. Trigger user removal.", customerId, user.getId()); - Actions.removeUser(user, customerId); - customerReplicationHooks.forEach(hook -> hook.customerSuccessfullyRemoved(customerId)); - } - } catch (Auth0Exception exception) { - LOG.debug("Could not remove customer with ID '{}'! Account needs to be removed manually!", customerId); - throw new CustomerReplicationException("Could not remove customer on Auth0 side!", exception); - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/constants/CxSsoAuth0Constants.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/constants/CxSsoAuth0Constants.java deleted file mode 100644 index ab8028b3..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/constants/CxSsoAuth0Constants.java +++ /dev/null @@ -1,11 +0,0 @@ -package tools.sapcx.commerce.sso.constants; - -@SuppressWarnings({ "deprecation", "squid:CallToDeprecatedMethod" }) -public class CxSsoAuth0Constants extends GeneratedCxSsoAuth0Constants { - public static final String EXTENSIONNAME = "sapcxssoauth0"; - - private CxSsoAuth0Constants() { - // empty - } - -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/AllCustomerReplicationFilter.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/AllCustomerReplicationFilter.java deleted file mode 100644 index 88f7e51a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/AllCustomerReplicationFilter.java +++ /dev/null @@ -1,12 +0,0 @@ -package tools.sapcx.commerce.sso.replication; - -import java.util.function.Predicate; - -import de.hybris.platform.core.model.user.CustomerModel; - -public class AllCustomerReplicationFilter implements Predicate { - @Override - public boolean test(CustomerModel customerModel) { - return true; - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationException.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationException.java deleted file mode 100644 index ded0bd0d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationException.java +++ /dev/null @@ -1,22 +0,0 @@ -package tools.sapcx.commerce.sso.replication; - -public class CustomerReplicationException extends RuntimeException { - public CustomerReplicationException() { - } - - public CustomerReplicationException(String message) { - super(message); - } - - public CustomerReplicationException(String message, Throwable cause) { - super(message, cause); - } - - public CustomerReplicationException(Throwable cause) { - super(cause); - } - - public CustomerReplicationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationHook.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationHook.java deleted file mode 100644 index 58aa6b23..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationHook.java +++ /dev/null @@ -1,16 +0,0 @@ -package tools.sapcx.commerce.sso.replication; - -import com.auth0.json.mgmt.users.User; - -import de.hybris.platform.core.model.user.CustomerModel; - -public interface CustomerReplicationHook { - default void customerSuccessfullyCreated(CustomerModel customer, User createdUser) { - } - - default void customerSuccessfullyUpdated(CustomerModel customer, User updatedUser) { - } - - default void customerSuccessfullyRemoved(String customer) { - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationInterceptor.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationInterceptor.java deleted file mode 100644 index 39e8356a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationInterceptor.java +++ /dev/null @@ -1,55 +0,0 @@ -package tools.sapcx.commerce.sso.replication; - -import java.util.function.Predicate; - -import de.hybris.platform.core.model.user.CustomerModel; -import de.hybris.platform.servicelayer.interceptor.InterceptorContext; -import de.hybris.platform.servicelayer.interceptor.InterceptorException; -import de.hybris.platform.servicelayer.interceptor.RemoveInterceptor; -import de.hybris.platform.servicelayer.interceptor.ValidateInterceptor; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CustomerReplicationInterceptor implements ValidateInterceptor, RemoveInterceptor { - private static final Logger LOG = LoggerFactory.getLogger(CustomerReplicationInterceptor.class); - - private CustomerReplicationStrategy customerReplicationStrategy; - private Predicate customerReplicationFilter; - private boolean enabled; - - public CustomerReplicationInterceptor( - CustomerReplicationStrategy customerReplicationStrategy, - Predicate customerReplicationFilter, - boolean enabled) { - this.customerReplicationStrategy = customerReplicationStrategy; - this.customerReplicationFilter = customerReplicationFilter; - this.enabled = enabled; - } - - @Override - public void onValidate(CustomerModel customer, InterceptorContext interceptorContext) { - if (enabled && customer != null) { - try { - if (customerReplicationFilter.test(customer)) { - customerReplicationStrategy.replicate(customer); - } - } catch (RuntimeException e) { - LOG.warn(String.format("Could not replicate customer with ID '%s'. Data may no be in sync and needs to be corrected manually!", customer.getUid()), e); - } - } - } - - @Override - public void onRemove(CustomerModel customer, InterceptorContext interceptorContext) throws InterceptorException { - if (enabled && customer != null) { - try { - if (customerReplicationFilter.test(customer)) { - customerReplicationStrategy.remove(customer.getUid()); - } - } catch (RuntimeException e) { - LOG.warn(String.format("Could not remove customer with ID '%s'! Account needs to be removed manually!", customer.getUid()), e); - } - } - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationStrategy.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationStrategy.java deleted file mode 100644 index 31390bc5..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/src/tools/sapcx/commerce/sso/replication/CustomerReplicationStrategy.java +++ /dev/null @@ -1,11 +0,0 @@ -package tools.sapcx.commerce.sso.replication; - -import javax.annotation.Nonnull; - -import de.hybris.platform.core.model.user.CustomerModel; - -public interface CustomerReplicationStrategy { - void replicate(@Nonnull CustomerModel customer); - - void remove(@Nonnull String customerId); -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java deleted file mode 100644 index 6e5ccc97..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxssoauth0/testsrc/tools/sapcx/commerce/sso/config/ExtensionConfigurationTests.java +++ /dev/null @@ -1,18 +0,0 @@ -package tools.sapcx.commerce.sso.config; - -import de.hybris.bootstrap.annotations.UnitTest; - -import org.junit.Test; - -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; - -@UnitTest -public class ExtensionConfigurationTests { - @Test - public void extensionConfiguration() { - InstalledExtensionVerifier.verifier() - .requires("sapcxssoauth0") - .requires("sapcxsinglesignon") - .verify(); - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.gitignore b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.gitignore deleted file mode 100644 index bd0966d2..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Folders to ignore, whatever the place they are -.DS_Store -.metadata -.settings -classes -testclasses -eclipsebin -gensrc - -# .classpath files and lib folder in sapcxtools to ignore -.classpath -lib/ - -# Filename patterns to ignore -*.class -build.xml -Generated*.java -platformhome.properties -*testclasses.xml -extensioninfo.xsd -*hmc.jar -hmc.xsd -items.xsd -beans.xsd -ruleset.xml -*.log -.pmd -*build.number -base.properties - -# Addon specific copy folders -**/_ui/addons -**/views/addons -**/tld/addons -**/tags/addons -**/messages/addons -**/lib/addons -**/web/addonsrc -**/_ui-src/addons -**/web/addontestsrc -**/web/commonwebsrc/*/ -**/web/webroot/WEB-INF/lib/addon-* -wro_addons.xml - -# Backoffice artifacts -*_bof.jar diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.project b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.project deleted file mode 100644 index 67082239..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - sapcxtemplate - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - - - - 1642058460820 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/CONTRIBUTING.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/CONTRIBUTING.md deleted file mode 100644 index 572289da..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -This repository has a special setup for contributing. - -Please read the [CONTRIBUTING.md from the extensions repository](https://github.com/sapcxtools/workspace/blob/main/CONTRIBUTING.md) which -will guide you through the process. diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/LICENSE.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/LICENSE.md deleted file mode 100644 index 9776fe0d..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [2025] [SAP CX Tools] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/README.md b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/README.md deleted file mode 100644 index dbff9e1e..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# SAP CX Template - -The `sapcxtemplate` extension improves ... - -## FEATURE DESCRIPTION - -COPY-TEXT INTRODUCTION - -### How to activate and use - -COPY-TEXT ACTIVATION / SETTINGS - -### Configuration parameters - -| Parameter | Type | Description | -|-----------|------|-------------| -| | | | - - - -## License - -_Licensed under the Apache License, Version 2.0, January 2004_ - -_Copyright 2025, SAP CX Tools_ \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/extensioninfo.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/extensioninfo.xml deleted file mode 100644 index 37b8de86..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/extensioninfo.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/external-dependencies.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/external-dependencies.xml deleted file mode 100644 index 63f5a35a..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/external-dependencies.xml +++ /dev/null @@ -1,10 +0,0 @@ - - 4.0.0 - tools.sapcx - sapcxtemplate - 4.4.0 - jar - - - diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/project.properties b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/project.properties deleted file mode 100644 index 156bc225..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/project.properties +++ /dev/null @@ -1,6 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2025 SAP CX Tools -# ---------------------------------------------------------------------------- - -# Location of the file for the global platform spring application context -sapcxtemplate.application-context=sapcxtemplate-spring.xml diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/resources/sapcxtemplate-spring.xml b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/resources/sapcxtemplate-spring.xml deleted file mode 100644 index 109dd219..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/resources/sapcxtemplate-spring.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/src/tools/sapcx/commerce/template/constants/CxTemplateConstants.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/src/tools/sapcx/commerce/template/constants/CxTemplateConstants.java deleted file mode 100644 index 24188001..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/src/tools/sapcx/commerce/template/constants/CxTemplateConstants.java +++ /dev/null @@ -1,13 +0,0 @@ -package tools.sapcx.commerce.template.constants; - -/** - * Global class for all constants. This class is required by the platform and - * will not been used for any other purpose. - */ -public final class CxTemplateConstants { - public static final String EXTENSIONNAME = "sapcxtemplate"; - - private CxTemplateConstants() { - // empty to avoid instantiating this constant class - } -} diff --git a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/testsrc/tools/sapcx/commerce/template/config/ExtensionConfigurationTests.java b/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/testsrc/tools/sapcx/commerce/template/config/ExtensionConfigurationTests.java deleted file mode 100644 index 94f50b22..00000000 --- a/core-customize/hybris/bin/custom/sapcxtools/sapcxtemplate/testsrc/tools/sapcx/commerce/template/config/ExtensionConfigurationTests.java +++ /dev/null @@ -1,18 +0,0 @@ -package tools.sapcx.commerce.template.config; - -import de.hybris.bootstrap.annotations.UnitTest; - -import org.junit.Test; - -import tools.sapcx.commerce.toolkit.testing.verifier.InstalledExtensionVerifier; - -@UnitTest -public class ExtensionConfigurationTests { - @Test - public void extensionConfiguration() { - InstalledExtensionVerifier.verifier() - .requires("sapcxtemplate") - .requires("sapcommercetoolkit") - .verify(); - } -} diff --git a/core-customize/hybris/config/cloud/aspect/admin.properties b/core-customize/hybris/config/cloud/aspect/admin.properties deleted file mode 100644 index 61775783..00000000 --- a/core-customize/hybris/config/cloud/aspect/admin.properties +++ /dev/null @@ -1 +0,0 @@ -# cloud/aspect/admin.properties \ No newline at end of file diff --git a/core-customize/hybris/config/cloud/common.properties b/core-customize/hybris/config/cloud/common.properties index 70de6a84..8f361947 100644 --- a/core-customize/hybris/config/cloud/common.properties +++ b/core-customize/hybris/config/cloud/common.properties @@ -67,4 +67,4 @@ update.localizeTypes.enabled=true update.rebuildLucenesearchIndexes.enabled=false # Import localized impex files automatically -sapcommercetoolkit.impeximport.environment.supportlocalizedfiles=true +cxdevtoolkit.impeximport.environment.supportlocalizedfiles=true diff --git a/core-customize/hybris/config/cloud/local-dev.properties b/core-customize/hybris/config/cloud/local-dev.properties new file mode 100644 index 00000000..2d647225 --- /dev/null +++ b/core-customize/hybris/config/cloud/local-dev.properties @@ -0,0 +1,4 @@ +# cloud/local-dev.properties + +# Enable CxDev Proxy +cxdevproxy.enabled=true \ No newline at end of file diff --git a/core-customize/hybris/config/cloud/persona/development.properties b/core-customize/hybris/config/cloud/persona/development.properties index 3304a3f0..bde55aec 100644 --- a/core-customize/hybris/config/cloud/persona/development.properties +++ b/core-customize/hybris/config/cloud/persona/development.properties @@ -1,8 +1,8 @@ # cloud/persona/development.properties # Avoid sending outbound emails by storing them in the database -spring.profiles.active=sapcommercetools-fake-localmails,sapcommercetools-modelservice-failurelogging -sapcommercetoolkit.fakes.htmlEmailService.localstorage.method=database +spring.profiles.active=cxdevtoolkit-fake-localmails,cxdevtoolkit-modelservice-failurelogging +cxdevtoolkit.fakes.htmlEmailService.localstorage.method=database # Mock Payment provider sop.post.url=${ccv2.services.api.url.0}/acceleratorservices/sop-mock/process @@ -11,13 +11,13 @@ sop.post.url=${ccv2.services.api.url.0}/acceleratorservices/sop-mock/process disable.login.for.imported.user.interceptor.enabled=false # Sample & Test data -sapcommercetoolkit.impeximport.environment.importsampledata=true -sapcommercetoolkit.impeximport.environment.importtestdata=true +cxdevtoolkit.impeximport.environment.importsampledata=true +cxdevtoolkit.impeximport.environment.importtestdata=true #*****************************************************************************# # Testing -testclasses.extensions=sapcommercetoolkit,sapcxbackoffice,sapcxreporting,sapcxenvconfig,sapcxsearch,sapcxsinglesignon,sapcxssoauth0 -testclasses.packages=tools.sapcx.commerce.* +testclasses.extensions=cxdevtoolkit,cxdevbackoffice,cxdevreporting,cxdevenvconfig +testclasses.packages=me.cxdev.* testclasses.suppress.junit.tenant=true testclasses.reportdir=${HYBRIS_LOG_DIR}/junit/test-results diff --git a/core-customize/hybris/config/cloud/persona/production.properties b/core-customize/hybris/config/cloud/persona/production.properties index 8a8a2774..7de027e7 100644 --- a/core-customize/hybris/config/cloud/persona/production.properties +++ b/core-customize/hybris/config/cloud/persona/production.properties @@ -4,5 +4,5 @@ disable.login.for.imported.user.interceptor.enabled=true # Sample & Test data -sapcommercetoolkit.impeximport.environment.importsampledata=false -sapcommercetoolkit.impeximport.environment.importtestdata=false +cxdevtoolkit.impeximport.environment.importsampledata=false +cxdevtoolkit.impeximport.environment.importtestdata=false diff --git a/core-customize/hybris/config/cloud/persona/staging.properties b/core-customize/hybris/config/cloud/persona/staging.properties index 1302a616..05108bfe 100644 --- a/core-customize/hybris/config/cloud/persona/staging.properties +++ b/core-customize/hybris/config/cloud/persona/staging.properties @@ -1,12 +1,12 @@ # cloud/persona/staging.properties # Avoid sending outbound emails by storing them in the database -spring.profiles.active=sapcommercetools-fake-localmails,sapcommercetools-modelservice-failurelogging -sapcommercetoolkit.fakes.htmlEmailService.localstorage.method=database +spring.profiles.active=cxdevtoolkit-fake-localmails,cxdevtoolkit-modelservice-failurelogging +cxdevtoolkit.fakes.htmlEmailService.localstorage.method=database # Deactivate DisableLoginForImportedUserInterceptor for staging purposes disable.login.for.imported.user.interceptor.enabled=false # Sample & Test data -sapcommercetoolkit.impeximport.environment.importsampledata=true -sapcommercetoolkit.impeximport.environment.importtestdata=false +cxdevtoolkit.impeximport.environment.importsampledata=true +cxdevtoolkit.impeximport.environment.importtestdata=false diff --git a/core-customize/hybris/config/localextensions.xml b/core-customize/hybris/config/localextensions.xml index 20b3b71f..7f15afb7 100644 --- a/core-customize/hybris/config/localextensions.xml +++ b/core-customize/hybris/config/localextensions.xml @@ -3,18 +3,14 @@ - - - + + + + + + - - - - - - - - - + + diff --git a/core-customize/hybris/config/solr/instances/cloud/configsets b/core-customize/hybris/config/solr/instances/cloud/configsets new file mode 120000 index 00000000..c477a0ed --- /dev/null +++ b/core-customize/hybris/config/solr/instances/cloud/configsets @@ -0,0 +1 @@ +../../../../../solr/server/solr/configsets \ No newline at end of file diff --git a/core-customize/hybris/config/solr/instances/cloud/log4j2.xml b/core-customize/hybris/config/solr/instances/cloud/log4j2.xml new file mode 100644 index 00000000..a53f2f32 --- /dev/null +++ b/core-customize/hybris/config/solr/instances/cloud/log4j2.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}%notEmpty{ t:%X{trace_id}}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}%notEmpty{ t:%X{trace_id}}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}%notEmpty{ t:%X{trace_id}}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core-customize/hybris/config/solr/instances/cloud/security.json b/core-customize/hybris/config/solr/instances/cloud/security.json new file mode 100644 index 00000000..110273ff --- /dev/null +++ b/core-customize/hybris/config/solr/instances/cloud/security.json @@ -0,0 +1,156 @@ +{ + "authentication": { + "class": "solr.BasicAuthPlugin", + "blockUnknown": true, + "credentials": { + "solrclient": "2NtmibBImstZ5S07bQ2TdRkNdNEsXkv/JCkp8YeiwIU= riWS4qMkR+caBGL1uuUToIIYEz/bxDN5LycQ44BprNs=", + "solrindexingclient": "Op+mSXqBgJlMEixH25vTnCgC8KayBgKNGRP3i3bLr/4= uFXwaAKtYXjwy32QfkKL/ASA3X3Vlq1XW4DykYexNTw=", + "solrserver": "E7h3Zq+hgRyA+1Nx28jL+AArUlf6JbJRR+6cOAqfQHA= 481lwUYp4qmY6Li+oakSVnXwYoXy0mWYN/1sWE5YNdc=", + "solradmin": "Hbs0wnLz1WErQHXQUzm5AHrvc2ZkWPl5iHXPeJOgp8I= Lz4KoANtWA/UqKy8yAVZmapQ3UJPlg0MjlBZEJT/kak=" + } + }, + "authorization": { + "class": "solr.RuleBasedAuthorizationPlugin", + "permissions": [ + { + "path": "read", + "role": "index-read" + }, + { + "name": "read", + "role": "index-read" + }, + { + "name": "update", + "role": "index-write" + }, + { + "name": "core-admin-read", + "role": "index-write" + }, + { + "name": "core-admin-edit", + "role": "index-write" + }, + { + "name": "collection-admin-read", + "role": "index-write" + }, + { + "name": "collection-admin-edit", + "role": "index-write" + }, + { + "name": "schema-read", + "role": "index-write" + }, + { + "name": "schema-edit", + "role": "index-write" + }, + { + "collection": "*", + "path": "/schema/managed/*", + "role": "index-write" + }, + { + "collection": "*", + "path": "/schema/analysis/*", + "role": "index-write" + }, + { + "collection": "*", + "path": "/admin/luke", + "role": "index-write" + }, + { + "collection": null, + "path": "/admin/cores", + "params": { + "action": [ + "STATUS" + ] + }, + "role": "index-write" + }, + { + "collection": null, + "path": "/admin/collections", + "params": { + "action": [ + "LIST" + ] + }, + "role": "index-write" + }, + { + "collection": null, + "path": "/admin/info/system", + "method": "GET", + "role": "system-info-read" + }, + { + "name": "config-read", + "role": "admin" + }, + { + "name": "config-edit", + "role": "admin" + }, + { + "name": "security-read", + "role": "admin" + }, + { + "name": "security-edit", + "role": "admin" + }, + { + "path": "/", + "role": null + }, + { + "path": "/libs/*", + "role": null + }, + { + "path": "/js/*", + "role": null + }, + { + "path": "/img/*", + "role": null + }, + { + "path": "/css/*", + "role": null + }, + { + "name": "all", + "role": "admin" + } + ], + "user-role": { + "solrclient": [ + "index-read" + ], + "solrindexingclient": [ + "index-read", + "index-write", + "system-info-read" + ], + "solrserver": [ + "index-read", + "index-write", + "system-info-read", + "admin" + ], + "solradmin": [ + "index-read", + "index-write", + "system-info-read", + "admin" + ] + } + } +} diff --git a/core-customize/hybris/config/solr/instances/cloud/solr.p12 b/core-customize/hybris/config/solr/instances/cloud/solr.p12 new file mode 100644 index 00000000..122abe46 Binary files /dev/null and b/core-customize/hybris/config/solr/instances/cloud/solr.p12 differ diff --git a/core-customize/hybris/config/solr/instances/cloud/solr.xml b/core-customize/hybris/config/solr/instances/cloud/solr.xml new file mode 100644 index 00000000..ff7215a7 --- /dev/null +++ b/core-customize/hybris/config/solr/instances/cloud/solr.xml @@ -0,0 +1,40 @@ + + + + ${solr.data.home:./} + ${solr.modules:analysis-extras,hybris} + + + ${host:} + ${jetty.port:8983} + ${hostContext:solr} + + ${genericCoreNodeNames:true} + + ${zkClientTimeout:30000} + ${distribUpdateSoTimeout:600000} + ${distribUpdateConnTimeout:60000} + + + ${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider} + ${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider} + ${zkCredentialsInjector:org.apache.solr.common.cloud.DefaultZkCredentialsInjector} + + + + + + ${distributedClusterStateUpdates:true} + ${distributedCollectionConfigSetExecution:true} + ${minStateByteLenForCompression:-1} + ${stateCompressor:org.apache.solr.common.util.ZLibCompressor} + + + + ${socketTimeout:600000} + ${connTimeout:60000} + + + + + diff --git a/core-customize/hybris/config/solr/instances/cloud/solr_client.p12 b/core-customize/hybris/config/solr/instances/cloud/solr_client.p12 new file mode 100644 index 00000000..ba8edf8b Binary files /dev/null and b/core-customize/hybris/config/solr/instances/cloud/solr_client.p12 differ diff --git a/core-customize/hybris/config/solr/instances/cloud/zoo.cfg b/core-customize/hybris/config/solr/instances/cloud/zoo.cfg new file mode 100644 index 00000000..621506c6 --- /dev/null +++ b/core-customize/hybris/config/solr/instances/cloud/zoo.cfg @@ -0,0 +1,34 @@ +# The number of milliseconds of each tick +tickTime=2000 +# The number of ticks that the initial +# synchronization phase can take +initLimit=10 +# The number of ticks that can pass between +# sending a request and getting an acknowledgement +syncLimit=5 + +# the directory where the snapshot is stored. +# dataDir=/opt/zookeeper/data +# NOTE: Solr defaults the dataDir to /zoo_data + +# the port at which the clients will connect +# clientPort=2181 +# NOTE: Solr sets this based on zkRun / zkHost params + +# the maximum number of client connections. +# increase this if you need to handle more clients +#maxClientCnxns=60 +# +# Be sure to read the maintenance section of the +# administrator guide before turning on autopurge. +# +# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance +# +# The number of snapshots to retain in dataDir +#autopurge.snapRetainCount=3 +# Purge task interval in hours +# Set to "0" to disable auto purge feature +#autopurge.purgeInterval=1 + +# Disable ZK AdminServer since we do not use it +admin.enableServer=false diff --git a/core-customize/hybris/config/tomcat/conf/server-minimal.xml b/core-customize/hybris/config/tomcat/conf/server-minimal.xml index 9704e54a..cb4011a8 100644 --- a/core-customize/hybris/config/tomcat/conf/server-minimal.xml +++ b/core-customize/hybris/config/tomcat/conf/server-minimal.xml @@ -1,8 +1,6 @@ - - @@ -73,13 +71,13 @@ URIEncoding="UTF-8" SSLEnabled="true" scheme="https" - secure="true" - clientAuth="false" - sslProtocol = "TLS" - keyAlias="${tomcat.ssl.keystore.alias}" - keystoreFile="${tomcat.ssl.keystore.path}" - keystorePass="${tomcat.ssl.keystore.password}" - /> + secure="true"> + + + + - @@ -76,13 +72,13 @@ URIEncoding="UTF-8" SSLEnabled="true" scheme="https" - secure="true" - clientAuth="false" - sslProtocol = "TLS" - keyAlias="${tomcat.ssl.keystore.alias}" - keystoreFile="${tomcat.ssl.keystore.path}" - keystorePass="${tomcat.ssl.keystore.password}" - /> + secure="true"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + diff --git a/core-customize/solr/server/solr/configsets/default/conf/solrconfig.xml b/core-customize/solr/server/solr/configsets/default/conf/solrconfig.xml new file mode 100644 index 00000000..cede9e64 --- /dev/null +++ b/core-customize/solr/server/solr/configsets/default/conf/solrconfig.xml @@ -0,0 +1,620 @@ + + + + + 9.12 + + + + de.hybris.platform.solr.rest.IndexAwareStorageIO + ${solr.core.collection:} + ${solr.core.instanceDir} + + + + + + + + ${solr.lock.type:native} + + + + + ${solr.ulog.dir:} + + + + ${solr.autoCommit.maxDocs:25000} + ${solr.autoCommit.maxTime:-1} + false + + + + ${solr.autoSoftCommit.maxDocs:-1} + ${solr.autoSoftCommit.maxTime:-1} + + + + + 1024 + + + + + + + true + + 20 + 200 + + false + + + + + + + + + explicit + 10 + true + + + spellcheck + + + + + + + + true + default + true + 5 + true + 5 + + + suggest + + + + + text_spell + + default + solr.DirectSolrSpellChecker + spellcheck + + + en + solr.DirectSolrSpellChecker + spellcheck_en + + + cs + solr.DirectSolrSpellChecker + spellcheck_cs + + + de + solr.DirectSolrSpellChecker + spellcheck_de + + + es + solr.DirectSolrSpellChecker + spellcheck_es + + + es_CO + solr.DirectSolrSpellChecker + spellcheck_es_co + + + fr + solr.DirectSolrSpellChecker + spellcheck_fr + + + hi + solr.DirectSolrSpellChecker + spellcheck_hi + + + hu + solr.DirectSolrSpellChecker + spellcheck_hu + + + id + solr.DirectSolrSpellChecker + spellcheck_id + + + it + solr.DirectSolrSpellChecker + spellcheck_it + + + ja + solr.DirectSolrSpellChecker + spellcheck_ja + + + ko + solr.DirectSolrSpellChecker + spellcheck_ko + + + pl + solr.DirectSolrSpellChecker + spellcheck_pl + + + pt + solr.DirectSolrSpellChecker + spellcheck_pt + + + ru + solr.DirectSolrSpellChecker + spellcheck_ru + + + zh + solr.DirectSolrSpellChecker + spellcheck_zh + + + zh_TW + solr.DirectSolrSpellChecker + spellcheck_zh_tw + + + + + + + text_spell + + default + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest + true + true + 0.35 + + + en + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_en + true + true + 0.35 + + + cs + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_cs + true + true + 0.35 + + + de + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_de + true + true + 0.35 + + + es + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_es + true + true + 0.35 + + + es_CO + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_es_co + true + true + 0.35 + + + fr + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_fr + true + true + 0.35 + + + hi + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_hi + true + true + 0.35 + + + hu + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_hu + true + true + 0.35 + + + id + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_id + true + true + 0.35 + + + it + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_it + true + true + 0.35 + + + ja + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_ja + true + true + 0.35 + + + ko + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_ko + true + true + 0.35 + + + pl + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_pl + true + true + 0.35 + + + pt + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_pt + true + true + 0.35 + + + ru + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_ru + true + true + 0.35 + + + zh + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_zh + true + true + 0.35 + + + zh_TW + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookup + autosuggest_zh_tw + true + true + 0.35 + + + + + + + + + + + + + diff --git a/core-customize/solr/server/solr/configsets/default/conf/stopwords.txt b/core-customize/solr/server/solr/configsets/default/conf/stopwords.txt new file mode 100644 index 00000000..535d20a7 --- /dev/null +++ b/core-customize/solr/server/solr/configsets/default/conf/stopwords.txt @@ -0,0 +1,3 @@ +# some examples: +# and +# or diff --git a/core-customize/solr/server/solr/configsets/default/conf/synonyms.txt b/core-customize/solr/server/solr/configsets/default/conf/synonyms.txt new file mode 100644 index 00000000..dd2fa7f8 --- /dev/null +++ b/core-customize/solr/server/solr/configsets/default/conf/synonyms.txt @@ -0,0 +1,3 @@ +# some examples: +# TV => Television +# GB,gib,gigabyte,gigabytes diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a..1b33c55b 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d706aba6..5f38436f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c7873..23d15a93 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -133,22 +133,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,18 +200,28 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32..db3a6ac2 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,32 +59,34 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/js-storefront/main/.editorconfig b/js-storefront/main/.editorconfig new file mode 100644 index 00000000..59d9a3a3 --- /dev/null +++ b/js-storefront/main/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/js-storefront/main/.gitignore b/js-storefront/main/.gitignore new file mode 100644 index 00000000..af5e14ba --- /dev/null +++ b/js-storefront/main/.gitignore @@ -0,0 +1,51 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc +# Only exists if Bazel was run +/bazel-out + +# dependencies +/node_modules + +# profiling files +chrome-profiler-events*.json + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# misc +/.angular/cache +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db +cypress/videos +cypress/screenshots + +# Cypress +/cypress/downloads diff --git a/js-storefront/main/.prettierignore b/js-storefront/main/.prettierignore new file mode 100644 index 00000000..de056073 --- /dev/null +++ b/js-storefront/main/.prettierignore @@ -0,0 +1 @@ +**/*.md diff --git a/js-storefront/main/.prettierrc b/js-storefront/main/.prettierrc new file mode 100644 index 00000000..b67b1532 --- /dev/null +++ b/js-storefront/main/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 120, + "singleQuote": true, + "useTabs": true, + "semi": true, + "bracketSameLine": true +} diff --git a/js-storefront/main/.vscode/extensions.json b/js-storefront/main/.vscode/extensions.json new file mode 100644 index 00000000..f96ffb75 --- /dev/null +++ b/js-storefront/main/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + "recommendations": [ + // Angular Language Service + "Angular.ng-template", + // Debugger for Chrome + "msjsdiag.debugger-for-chrome", + // The ng lint command uses TSLint under the hood. + "ms-vscode.vscode-typescript-tslint-plugin", + // Prettier - Code formatter + "esbenp.prettier-vscode" + ] +} diff --git a/js-storefront/main/.vscode/launch.json b/js-storefront/main/.vscode/launch.json new file mode 100644 index 00000000..6431f4e4 --- /dev/null +++ b/js-storefront/main/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "https://localhost:4200", + "webRoot": "${workspaceFolder}" + } + ] +} diff --git a/js-storefront/main/.vscode/settings.json b/js-storefront/main/.vscode/settings.json new file mode 100644 index 00000000..636a4c47 --- /dev/null +++ b/js-storefront/main/.vscode/settings.json @@ -0,0 +1,27 @@ +{ + // Prettify on save + "editor.formatOnSave": true, + // organize imports on save + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, + // Uses the project specific typescript version. + "typescript.tsdk": "node_modules/typescript/lib", + "prettier.configPath": ".prettierrc", + "editor.defaultFormatter": "esbenp.prettier-vscode", + + //SonarLint + "sonarlint.connectedMode.project": { + "projectKey": "mynetzsch-spartacus" + }, + "sonarlint.disableTelemetry": true, + "[xml]": { + "editor.defaultFormatter": "DotJoshJohnson.xml" + }, + "[scss]": { + "editor.defaultFormatter": "vscode.css-language-features" + }, + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + } +} diff --git a/settings.gradle b/settings.gradle index 56f4c3e0..64543689 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'sapcxtools-workspace' +rootProject.name = 'cxdevtools-workspace' include 'core-customize' \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties index 60be04b8..bd02abff 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,18 +1,18 @@ -sonar.projectKey=sapcxtools_workspace -sonar.organization=sapcxtools +sonar.projectKey=cxdevtools_workspace +sonar.organization=cxdevtools # This is the name and version displayed in the SonarCloud UI. -sonar.projectName=sapcxtools-workspace -sonar.projectVersion=4.4.0 +sonar.projectName=cxdevtools-workspace +sonar.projectVersion=5.0.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=core-customize/hybris/bin/custom/sapcxtools -sonar.java.binaries=core-customize/hybris/bin/custom/sapcxtools/**/classes +sonar.sources=core-customize/hybris/bin/custom/cxdevtools +sonar.java.binaries=core-customize/hybris/bin/custom/cxdevtools/**/classes # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.java.source=17 +sonar.java.source=21 sonar.extensions=${testclasses.extensions} sonar.exclusions=file\:**/gensrc/**,file\:**/*Constants.java,file\:**/jalo/**,file\:**/de/hybris/**,file\:**/com/hybris/**,file\:**/*.py,file\:**/testsrc/**