diff --git a/.gitignore b/.gitignore index c672c3de..607afad1 100644 --- a/.gitignore +++ b/.gitignore @@ -263,4 +263,7 @@ __pycache__/ *.pyc # Generated by build.cmd -/deploy \ No newline at end of file +/deploy + +# Java/Maven build output +**/target/ \ No newline at end of file diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/.mvn/wrapper/maven-wrapper.properties b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..ffcab66a --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,3 @@ +wrapperVersion=3.3.4 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw new file mode 100755 index 00000000..bd8896bf --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw @@ -0,0 +1,295 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.4 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +scriptDir="$(dirname "$0")" +scriptName="$(basename "$0")" + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +actualDistributionDir="" + +# First try the expected directory name (for regular distributions) +if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then + if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then + actualDistributionDir="$distributionUrlNameMain" + fi +fi + +# If not found, search for any directory with the Maven executable (for snapshots) +if [ -z "$actualDistributionDir" ]; then + # enable globbing to iterate over items + set +f + for dir in "$TMP_DOWNLOAD_DIR"/*; do + if [ -d "$dir" ]; then + if [ -f "$dir/bin/$MVN_CMD" ]; then + actualDistributionDir="$(basename "$dir")" + break + fi + fi + done + set -f +fi + +if [ -z "$actualDistributionDir" ]; then + verbose "Contents of $TMP_DOWNLOAD_DIR:" + verbose "$(ls -la "$TMP_DOWNLOAD_DIR")" + die "Could not find Maven distribution directory in extracted archive" +fi + +verbose "Found extracted Maven distribution directory: $actualDistributionDir" +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw.cmd b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw.cmd new file mode 100644 index 00000000..92450f93 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/mvnw.cmd @@ -0,0 +1,189 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.4 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' + +$MAVEN_M2_PATH = "$HOME/.m2" +if ($env:MAVEN_USER_HOME) { + $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" +} + +if (-not (Test-Path -Path $MAVEN_M2_PATH)) { + New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null +} + +$MAVEN_WRAPPER_DISTS = $null +if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { + $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" +} else { + $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists" +} + +$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +$actualDistributionDir = "" + +# First try the expected directory name (for regular distributions) +$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" +$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" +if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { + $actualDistributionDir = $distributionUrlNameMain +} + +# If not found, search for any directory with the Maven executable (for snapshots) +if (!$actualDistributionDir) { + Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { + $testPath = Join-Path $_.FullName "bin/$MVN_CMD" + if (Test-Path -Path $testPath -PathType Leaf) { + $actualDistributionDir = $_.Name + } + } +} + +if (!$actualDistributionDir) { + Write-Error "Could not find Maven distribution directory in extracted archive" +} + +Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/pom.xml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/pom.xml new file mode 100644 index 00000000..d6e8ac9e --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/pom.xml @@ -0,0 +1,128 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.5.0 + + + + com.eshop + eshop-legacy-webforms + 1.0.0-SNAPSHOT + eShopLegacyWebForms + eShop Legacy WebForms migrated to Spring Boot + + + 21 + 3.4.0 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + nz.net.ultraq.thymeleaf + thymeleaf-layout-dialect + ${thymeleaf-layout-dialect.version} + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.h2database + h2 + runtime + + + + + com.microsoft.sqlserver + mssql-jdbc + runtime + + + + + org.flywaydb + flyway-core + + + org.flywaydb + flyway-sqlserver + runtime + + + + + io.micrometer + micrometer-registry-prometheus + runtime + + + + + org.webjars + bootstrap + 4.6.2 + + + org.webjars + webjars-locator-core + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + 21 + 21 + + + + + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/EShopApplication.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/EShopApplication.java new file mode 100644 index 00000000..bc49260d --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/EShopApplication.java @@ -0,0 +1,12 @@ +package com.eshop.webforms; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class EShopApplication { + + public static void main(String[] args) { + SpringApplication.run(EShopApplication.class, args); + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/AppProperties.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/AppProperties.java new file mode 100644 index 00000000..fb0bff2f --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/AppProperties.java @@ -0,0 +1,28 @@ +package com.eshop.webforms.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "app") +public class AppProperties { + + private boolean useMockData; + private boolean useCustomizationData; + + public boolean isUseMockData() { + return useMockData; + } + + public void setUseMockData(boolean useMockData) { + this.useMockData = useMockData; + } + + public boolean isUseCustomizationData() { + return useCustomizationData; + } + + public void setUseCustomizationData(boolean useCustomizationData) { + this.useCustomizationData = useCustomizationData; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/PreconfiguredData.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/PreconfiguredData.java new file mode 100644 index 00000000..671ce414 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/config/PreconfiguredData.java @@ -0,0 +1,78 @@ +package com.eshop.webforms.config; + +import com.eshop.webforms.model.CatalogBrand; +import com.eshop.webforms.model.CatalogItem; +import com.eshop.webforms.model.CatalogType; +import java.math.BigDecimal; +import java.util.List; + +public final class PreconfiguredData { + + private PreconfiguredData() { + } + + public static List getCatalogBrands() { + return List.of( + createBrand(1, "Azure"), + createBrand(2, ".NET"), + createBrand(3, "Visual Studio"), + createBrand(4, "SQL Server"), + createBrand(5, "Other") + ); + } + + public static List getCatalogTypes() { + return List.of( + createType(1, "Mug"), + createType(2, "T-Shirt"), + createType(3, "Sheet"), + createType(4, "USB Memory Stick") + ); + } + + public static List getCatalogItems() { + return List.of( + createItem(1, 2, 2, ".NET Bot Black Hoodie", ".NET Bot Black Hoodie", new BigDecimal("19.50"), "1.png", 100), + createItem(2, 1, 2, ".NET Black & White Mug", ".NET Black & White Mug", new BigDecimal("8.50"), "2.png", 100), + createItem(3, 2, 5, "Prism White T-Shirt", "Prism White T-Shirt", new BigDecimal("12"), "3.png", 100), + createItem(4, 2, 2, ".NET Foundation T-shirt", ".NET Foundation T-shirt", new BigDecimal("12"), "4.png", 100), + createItem(5, 3, 5, "Roslyn Red Sheet", "Roslyn Red Sheet", new BigDecimal("8.50"), "5.png", 100), + createItem(6, 2, 2, ".NET Blue Hoodie", ".NET Blue Hoodie", new BigDecimal("12"), "6.png", 100), + createItem(7, 2, 5, "Roslyn Red T-Shirt", "Roslyn Red T-Shirt", new BigDecimal("12"), "7.png", 100), + createItem(8, 2, 5, "Kudu Purple Hoodie", "Kudu Purple Hoodie", new BigDecimal("8.50"), "8.png", 100), + createItem(9, 1, 5, "Cup White Mug", "Cup White Mug", new BigDecimal("12"), "9.png", 100), + createItem(10, 3, 2, ".NET Foundation Sheet", ".NET Foundation Sheet", new BigDecimal("12"), "10.png", 100), + createItem(11, 3, 2, "Cup Sheet", "Cup Sheet", new BigDecimal("8.50"), "11.png", 100), + createItem(12, 2, 5, "Prism White TShirt", "Prism White TShirt", new BigDecimal("12"), "12.png", 100) + ); + } + + private static CatalogBrand createBrand(int id, String brand) { + CatalogBrand b = new CatalogBrand(); + b.setId(id); + b.setBrand(brand); + return b; + } + + private static CatalogType createType(int id, String type) { + CatalogType t = new CatalogType(); + t.setId(id); + t.setType(type); + return t; + } + + private static CatalogItem createItem(int id, int typeId, int brandId, String name, + String description, BigDecimal price, + String pictureFileName, int stock) { + CatalogItem item = new CatalogItem(); + item.setId(id); + item.setCatalogTypeId(typeId); + item.setCatalogBrandId(brandId); + item.setName(name); + item.setDescription(description); + item.setPrice(price); + item.setPictureFileName(pictureFileName); + item.setAvailableStock(stock); + return item; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/controller/CatalogController.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/controller/CatalogController.java new file mode 100644 index 00000000..69cf76f4 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/controller/CatalogController.java @@ -0,0 +1,110 @@ +package com.eshop.webforms.controller; + +import com.eshop.webforms.dto.PaginatedItemsViewModel; +import com.eshop.webforms.model.CatalogItem; +import com.eshop.webforms.service.CatalogService; +import jakarta.validation.Valid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; + +@Controller +public class CatalogController { + + private static final Logger log = LoggerFactory.getLogger(CatalogController.class); + private static final int DEFAULT_PAGE_SIZE = 10; + private static final int DEFAULT_PAGE_INDEX = 0; + + private final CatalogService catalogService; + + public CatalogController(CatalogService catalogService) { + this.catalogService = catalogService; + } + + @GetMapping("/") + public String index(@RequestParam(defaultValue = "0") int pageIndex, + @RequestParam(defaultValue = "10") int pageSize, + Model model) { + log.info("Now loading... /?pageSize={}&pageIndex={}", pageSize, pageIndex); + PaginatedItemsViewModel paginatedItems = + catalogService.getCatalogItemsPaginated(pageSize, pageIndex); + model.addAttribute("model", paginatedItems); + return "catalog/index"; + } + + @GetMapping("/catalog/details/{id}") + public String details(@PathVariable int id, Model model) { + log.info("Now loading... /catalog/details/{}", id); + CatalogItem item = catalogService.findCatalogItem(id); + model.addAttribute("item", item); + return "catalog/details"; + } + + @GetMapping("/catalog/create") + public String createForm(Model model) { + log.info("Now loading... /catalog/create"); + model.addAttribute("catalogItem", new CatalogItem()); + model.addAttribute("brands", catalogService.getCatalogBrands()); + model.addAttribute("types", catalogService.getCatalogTypes()); + return "catalog/create"; + } + + @PostMapping("/catalog/create") + public String create(@Valid @ModelAttribute CatalogItem catalogItem, + BindingResult result, Model model) { + if (result.hasErrors()) { + model.addAttribute("brands", catalogService.getCatalogBrands()); + model.addAttribute("types", catalogService.getCatalogTypes()); + return "catalog/create"; + } + catalogService.createCatalogItem(catalogItem); + return "redirect:/"; + } + + @GetMapping("/catalog/edit/{id}") + public String editForm(@PathVariable int id, Model model) { + log.info("Now loading... /catalog/edit/{}", id); + CatalogItem item = catalogService.findCatalogItem(id); + model.addAttribute("catalogItem", item); + model.addAttribute("brands", catalogService.getCatalogBrands()); + model.addAttribute("types", catalogService.getCatalogTypes()); + return "catalog/edit"; + } + + @PostMapping("/catalog/edit/{id}") + public String edit(@PathVariable int id, + @Valid @ModelAttribute CatalogItem catalogItem, + BindingResult result, Model model) { + if (result.hasErrors()) { + model.addAttribute("brands", catalogService.getCatalogBrands()); + model.addAttribute("types", catalogService.getCatalogTypes()); + return "catalog/edit"; + } + catalogItem.setId(id); + catalogService.updateCatalogItem(catalogItem); + return "redirect:/"; + } + + @GetMapping("/catalog/delete/{id}") + public String deleteForm(@PathVariable int id, Model model) { + log.info("Now loading... /catalog/delete/{}", id); + CatalogItem item = catalogService.findCatalogItem(id); + model.addAttribute("item", item); + return "catalog/delete"; + } + + @PostMapping("/catalog/delete/{id}") + public String delete(@PathVariable int id) { + log.info("Now deleting... /catalog/delete/{}", id); + CatalogItem item = catalogService.findCatalogItem(id); + catalogService.removeCatalogItem(item); + return "redirect:/"; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/dto/PaginatedItemsViewModel.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/dto/PaginatedItemsViewModel.java new file mode 100644 index 00000000..cb6eaafc --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/dto/PaginatedItemsViewModel.java @@ -0,0 +1,40 @@ +package com.eshop.webforms.dto; + +import java.util.List; + +public class PaginatedItemsViewModel { + + private final int actualPage; + private final int itemsPerPage; + private final long totalItems; + private final int totalPages; + private final List data; + + public PaginatedItemsViewModel(int pageIndex, int pageSize, long count, List data) { + this.actualPage = pageIndex; + this.itemsPerPage = pageSize; + this.totalItems = count; + this.totalPages = (int) Math.ceil((double) count / pageSize); + this.data = data; + } + + public int getActualPage() { + return actualPage; + } + + public int getItemsPerPage() { + return itemsPerPage; + } + + public long getTotalItems() { + return totalItems; + } + + public int getTotalPages() { + return totalPages; + } + + public List getData() { + return data; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogBrand.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogBrand.java new file mode 100644 index 00000000..1f9dd3ee --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogBrand.java @@ -0,0 +1,45 @@ +package com.eshop.webforms.model; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +@Entity +@Table(name = "CatalogBrand") +public class CatalogBrand { + + @Id + @Column(name = "Id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + + @Column(name = "Brand", nullable = false, length = 100) + private String brand; + + public CatalogBrand() { + } + + public CatalogBrand(int id, String brand) { + this.id = id; + this.brand = brand; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogItem.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogItem.java new file mode 100644 index 00000000..f4be5163 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogItem.java @@ -0,0 +1,198 @@ +package com.eshop.webforms.model; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import java.math.BigDecimal; + +@Entity +@Table(name = "Catalog") +public class CatalogItem { + + public static final String DEFAULT_PICTURE_NAME = "dummy.png"; + + @Id + @Column(name = "Id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + + @NotBlank(message = "The Name field is required.") + @Column(name = "Name", nullable = false, length = 50) + private String name; + + @Column(name = "Description", length = 2048) + private String description; + + @NotNull + @DecimalMin(value = "0", message = "The Price must be a positive number.") + @DecimalMax(value = "1000000", message = "The Price must be less than 1 million.") + @Column(name = "Price", precision = 18, scale = 2) + private BigDecimal price; + + @Column(name = "PictureFileName") + private String pictureFileName = DEFAULT_PICTURE_NAME; + + @Transient + private String pictureUri; + + @Column(name = "CatalogTypeId") + private int catalogTypeId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "CatalogTypeId", insertable = false, updatable = false) + private CatalogType catalogType; + + @Column(name = "CatalogBrandId") + private int catalogBrandId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "CatalogBrandId", insertable = false, updatable = false) + private CatalogBrand catalogBrand; + + @Min(value = 0, message = "The field Stock must be between 0 and 10 million.") + @Max(value = 10000000, message = "The field Stock must be between 0 and 10 million.") + @Column(name = "AvailableStock") + private int availableStock; + + @Min(value = 0, message = "The field Restock must be between 0 and 10 million.") + @Max(value = 10000000, message = "The field Restock must be between 0 and 10 million.") + @Column(name = "RestockThreshold") + private int restockThreshold; + + @Min(value = 0, message = "The field Max stock must be between 0 and 10 million.") + @Max(value = 10000000, message = "The field Max stock must be between 0 and 10 million.") + @Column(name = "MaxStockThreshold") + private int maxStockThreshold; + + @Column(name = "OnReorder") + private boolean onReorder; + + public CatalogItem() { + this.pictureFileName = DEFAULT_PICTURE_NAME; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getPictureFileName() { + return pictureFileName; + } + + public void setPictureFileName(String pictureFileName) { + this.pictureFileName = pictureFileName; + } + + public String getPictureUri() { + return pictureUri; + } + + public void setPictureUri(String pictureUri) { + this.pictureUri = pictureUri; + } + + public int getCatalogTypeId() { + return catalogTypeId; + } + + public void setCatalogTypeId(int catalogTypeId) { + this.catalogTypeId = catalogTypeId; + } + + public CatalogType getCatalogType() { + return catalogType; + } + + public void setCatalogType(CatalogType catalogType) { + this.catalogType = catalogType; + } + + public int getCatalogBrandId() { + return catalogBrandId; + } + + public void setCatalogBrandId(int catalogBrandId) { + this.catalogBrandId = catalogBrandId; + } + + public CatalogBrand getCatalogBrand() { + return catalogBrand; + } + + public void setCatalogBrand(CatalogBrand catalogBrand) { + this.catalogBrand = catalogBrand; + } + + public int getAvailableStock() { + return availableStock; + } + + public void setAvailableStock(int availableStock) { + this.availableStock = availableStock; + } + + public int getRestockThreshold() { + return restockThreshold; + } + + public void setRestockThreshold(int restockThreshold) { + this.restockThreshold = restockThreshold; + } + + public int getMaxStockThreshold() { + return maxStockThreshold; + } + + public void setMaxStockThreshold(int maxStockThreshold) { + this.maxStockThreshold = maxStockThreshold; + } + + public boolean isOnReorder() { + return onReorder; + } + + public void setOnReorder(boolean onReorder) { + this.onReorder = onReorder; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogType.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogType.java new file mode 100644 index 00000000..b0503e7f --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/model/CatalogType.java @@ -0,0 +1,45 @@ +package com.eshop.webforms.model; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +@Entity +@Table(name = "CatalogType") +public class CatalogType { + + @Id + @Column(name = "Id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + + @Column(name = "Type", nullable = false, length = 100) + private String type; + + public CatalogType() { + } + + public CatalogType(int id, String type) { + this.id = id; + this.type = type; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogBrandRepository.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogBrandRepository.java new file mode 100644 index 00000000..2dd146a4 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogBrandRepository.java @@ -0,0 +1,7 @@ +package com.eshop.webforms.repository; + +import com.eshop.webforms.model.CatalogBrand; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CatalogBrandRepository extends JpaRepository { +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogItemRepository.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogItemRepository.java new file mode 100644 index 00000000..91888cd5 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogItemRepository.java @@ -0,0 +1,18 @@ +package com.eshop.webforms.repository; + +import com.eshop.webforms.model.CatalogItem; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +public interface CatalogItemRepository extends JpaRepository { + + @Query("SELECT ci FROM CatalogItem ci JOIN FETCH ci.catalogBrand JOIN FETCH ci.catalogType ORDER BY ci.id") + Page findAllWithBrandAndType(Pageable pageable); + + @Query("SELECT ci FROM CatalogItem ci JOIN FETCH ci.catalogBrand JOIN FETCH ci.catalogType WHERE ci.id = :id") + Optional findByIdWithBrandAndType(@Param("id") int id); +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogTypeRepository.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogTypeRepository.java new file mode 100644 index 00000000..1fd40b05 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/repository/CatalogTypeRepository.java @@ -0,0 +1,7 @@ +package com.eshop.webforms.repository; + +import com.eshop.webforms.model.CatalogType; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CatalogTypeRepository extends JpaRepository { +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogService.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogService.java new file mode 100644 index 00000000..41689fa0 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogService.java @@ -0,0 +1,25 @@ +package com.eshop.webforms.service; + +import com.eshop.webforms.dto.PaginatedItemsViewModel; +import com.eshop.webforms.model.CatalogBrand; +import com.eshop.webforms.model.CatalogItem; +import com.eshop.webforms.model.CatalogType; + +import java.util.List; + +public interface CatalogService { + + PaginatedItemsViewModel getCatalogItemsPaginated(int pageSize, int pageIndex); + + CatalogItem findCatalogItem(int id); + + List getCatalogTypes(); + + List getCatalogBrands(); + + void createCatalogItem(CatalogItem catalogItem); + + void updateCatalogItem(CatalogItem catalogItem); + + void removeCatalogItem(CatalogItem catalogItem); +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceImpl.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceImpl.java new file mode 100644 index 00000000..272d047d --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceImpl.java @@ -0,0 +1,87 @@ +package com.eshop.webforms.service; + +import com.eshop.webforms.dto.PaginatedItemsViewModel; +import com.eshop.webforms.model.CatalogBrand; +import com.eshop.webforms.model.CatalogItem; +import com.eshop.webforms.model.CatalogType; +import com.eshop.webforms.repository.CatalogBrandRepository; +import com.eshop.webforms.repository.CatalogItemRepository; +import com.eshop.webforms.repository.CatalogTypeRepository; +import org.springframework.context.annotation.Profile; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.server.ResponseStatusException; + +import java.util.List; + +@Service +@Profile("!mock") +public class CatalogServiceImpl implements CatalogService { + + private final CatalogItemRepository catalogItemRepository; + private final CatalogBrandRepository catalogBrandRepository; + private final CatalogTypeRepository catalogTypeRepository; + + public CatalogServiceImpl(CatalogItemRepository catalogItemRepository, + CatalogBrandRepository catalogBrandRepository, + CatalogTypeRepository catalogTypeRepository) { + this.catalogItemRepository = catalogItemRepository; + this.catalogBrandRepository = catalogBrandRepository; + this.catalogTypeRepository = catalogTypeRepository; + } + + @Override + @Transactional(readOnly = true) + public PaginatedItemsViewModel getCatalogItemsPaginated(int pageSize, int pageIndex) { + Page page = catalogItemRepository.findAllWithBrandAndType( + PageRequest.of(pageIndex, pageSize, Sort.by("id"))); + + return new PaginatedItemsViewModel<>( + pageIndex, + pageSize, + page.getTotalElements(), + page.getContent()); + } + + @Override + @Transactional(readOnly = true) + public CatalogItem findCatalogItem(int id) { + return catalogItemRepository.findByIdWithBrandAndType(id) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, + "Catalog item with id " + id + " not found")); + } + + @Override + @Transactional(readOnly = true) + public List getCatalogTypes() { + return catalogTypeRepository.findAll(); + } + + @Override + @Transactional(readOnly = true) + public List getCatalogBrands() { + return catalogBrandRepository.findAll(); + } + + @Override + @Transactional + public void createCatalogItem(CatalogItem catalogItem) { + catalogItemRepository.save(catalogItem); + } + + @Override + @Transactional + public void updateCatalogItem(CatalogItem catalogItem) { + catalogItemRepository.save(catalogItem); + } + + @Override + @Transactional + public void removeCatalogItem(CatalogItem catalogItem) { + catalogItemRepository.delete(catalogItem); + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceMock.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceMock.java new file mode 100644 index 00000000..e2fa69ca --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/java/com/eshop/webforms/service/CatalogServiceMock.java @@ -0,0 +1,104 @@ +package com.eshop.webforms.service; + +import com.eshop.webforms.config.PreconfiguredData; +import com.eshop.webforms.dto.PaginatedItemsViewModel; +import com.eshop.webforms.model.CatalogBrand; +import com.eshop.webforms.model.CatalogItem; +import com.eshop.webforms.model.CatalogType; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Service; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +@Service +@Profile("mock") +public class CatalogServiceMock implements CatalogService { + + private final List catalogItems; + + public CatalogServiceMock() { + this.catalogItems = new CopyOnWriteArrayList<>(PreconfiguredData.getCatalogItems()); + } + + @Override + public PaginatedItemsViewModel getCatalogItemsPaginated(int pageSize, int pageIndex) { + List composed = composeCatalogItems(catalogItems); + + List itemsOnPage = composed.stream() + .sorted(Comparator.comparingInt(CatalogItem::getId)) + .skip((long) pageSize * pageIndex) + .limit(pageSize) + .toList(); + + return new PaginatedItemsViewModel<>(pageIndex, pageSize, composed.size(), itemsOnPage); + } + + @Override + public CatalogItem findCatalogItem(int id) { + CatalogItem item = catalogItems.stream() + .filter(i -> i.getId() == id) + .findFirst() + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, + "Catalog item with id " + id + " not found")); + composeCatalogItems(List.of(item)); + return item; + } + + @Override + public List getCatalogTypes() { + return PreconfiguredData.getCatalogTypes(); + } + + @Override + public List getCatalogBrands() { + return PreconfiguredData.getCatalogBrands(); + } + + @Override + public synchronized void createCatalogItem(CatalogItem catalogItem) { + int maxId = catalogItems.stream() + .mapToInt(CatalogItem::getId) + .max() + .orElse(0); + catalogItem.setId(maxId + 1); + catalogItems.add(catalogItem); + } + + @Override + public synchronized void updateCatalogItem(CatalogItem modifiedItem) { + for (int i = 0; i < catalogItems.size(); i++) { + if (catalogItems.get(i).getId() == modifiedItem.getId()) { + catalogItems.set(i, modifiedItem); + return; + } + } + } + + @Override + public void removeCatalogItem(CatalogItem catalogItem) { + catalogItems.removeIf(item -> item.getId() == catalogItem.getId()); + } + + private List composeCatalogItems(List items) { + List catalogTypes = PreconfiguredData.getCatalogTypes(); + List catalogBrands = PreconfiguredData.getCatalogBrands(); + + for (CatalogItem item : items) { + catalogBrands.stream() + .filter(b -> b.getId() == item.getCatalogBrandId()) + .findFirst() + .ifPresent(item::setCatalogBrand); + catalogTypes.stream() + .filter(t -> t.getId() == item.getCatalogTypeId()) + .findFirst() + .ifPresent(item::setCatalogType); + } + + return items; + } +} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-dev.yml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-dev.yml new file mode 100644 index 00000000..3cec6d78 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-dev.yml @@ -0,0 +1,24 @@ +spring: + datasource: + url: jdbc:h2:mem:catalogdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + driver-class-name: org.h2.Driver + username: sa + password: + + h2: + console: + enabled: true + path: /h2-console + + jpa: + database-platform: org.hibernate.dialect.H2Dialect + hibernate: + ddl-auto: none + + flyway: + locations: classpath:db/migration/h2 + +logging: + level: + com.eshop.webforms: DEBUG + org.hibernate.SQL: DEBUG diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-mock.yml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-mock.yml new file mode 100644 index 00000000..be8aa65f --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-mock.yml @@ -0,0 +1,16 @@ +app: + use-mock-data: true + +spring: + flyway: + enabled: false + + jpa: + hibernate: + ddl-auto: none + + autoconfigure: + exclude: + - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration + - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + - org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-prod.yml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-prod.yml new file mode 100644 index 00000000..f1d497ba --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application-prod.yml @@ -0,0 +1,25 @@ +spring: + datasource: + url: ${SPRING_DATASOURCE_URL:jdbc:sqlserver://sql.data;database=Microsoft.eShopOnContainers.Services.CatalogDb;TrustServerCertificate=True} + username: ${SPRING_DATASOURCE_USERNAME:sa} + password: ${SPRING_DATASOURCE_PASSWORD:} + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + + jpa: + database-platform: org.hibernate.dialect.SQLServerDialect + hibernate: + ddl-auto: validate + + flyway: + locations: classpath:db/migration/sqlserver + + thymeleaf: + cache: true + +app: + use-mock-data: false + +logging: + level: + com.eshop.webforms: INFO + org.hibernate.SQL: WARN diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application.yml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application.yml new file mode 100644 index 00000000..e8ff62c9 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/application.yml @@ -0,0 +1,39 @@ +spring: + application: + name: eshop-legacy-webforms + + profiles: + active: dev + + jpa: + hibernate: + ddl-auto: validate + naming: + physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + open-in-view: false + properties: + hibernate: + format_sql: true + + flyway: + enabled: true + locations: classpath:db/migration + + thymeleaf: + cache: false + +app: + use-mock-data: ${USE_MOCK_DATA:true} + use-customization-data: ${USE_CUSTOMIZATION_DATA:false} + +management: + endpoints: + web: + exposure: + include: health,metrics,info,prometheus + endpoint: + health: + show-details: when-authorized + +server: + port: ${SERVER_PORT:8080} diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V1__create_schema.sql b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V1__create_schema.sql new file mode 100644 index 00000000..0ac233b1 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V1__create_schema.sql @@ -0,0 +1,29 @@ +CREATE TABLE CatalogBrand ( + Id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + Brand VARCHAR(100) NOT NULL +); + +CREATE TABLE CatalogType ( + Id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + Type VARCHAR(100) NOT NULL +); + +CREATE TABLE Catalog ( + Id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + Name VARCHAR(50) NOT NULL, + Description VARCHAR(2048), + Price DECIMAL(18,2) NOT NULL, + PictureFileName VARCHAR(255) NOT NULL, + CatalogTypeId INT NOT NULL, + CatalogBrandId INT NOT NULL, + AvailableStock INT NOT NULL DEFAULT 0, + RestockThreshold INT NOT NULL DEFAULT 0, + MaxStockThreshold INT NOT NULL DEFAULT 0, + OnReorder BOOLEAN NOT NULL DEFAULT FALSE, + FOREIGN KEY (CatalogTypeId) REFERENCES CatalogType(Id), + FOREIGN KEY (CatalogBrandId) REFERENCES CatalogBrand(Id) +); + +CREATE SEQUENCE catalog_hilo START WITH 1 INCREMENT BY 10; +CREATE SEQUENCE catalog_brand_hilo START WITH 1 INCREMENT BY 10; +CREATE SEQUENCE catalog_type_hilo START WITH 1 INCREMENT BY 10; diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V2__seed_data.sql b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V2__seed_data.sql new file mode 100644 index 00000000..232328b7 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/db/migration/h2/V2__seed_data.sql @@ -0,0 +1,27 @@ +INSERT INTO CatalogBrand (Id, Brand) VALUES (1, 'Azure'); +INSERT INTO CatalogBrand (Id, Brand) VALUES (2, '.NET'); +INSERT INTO CatalogBrand (Id, Brand) VALUES (3, 'Visual Studio'); +INSERT INTO CatalogBrand (Id, Brand) VALUES (4, 'SQL Server'); +INSERT INTO CatalogBrand (Id, Brand) VALUES (5, 'Other'); + +INSERT INTO CatalogType (Id, Type) VALUES (1, 'Mug'); +INSERT INTO CatalogType (Id, Type) VALUES (2, 'T-Shirt'); +INSERT INTO CatalogType (Id, Type) VALUES (3, 'Sheet'); +INSERT INTO CatalogType (Id, Type) VALUES (4, 'USB Memory Stick'); + +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (1, '.NET Bot Black Hoodie', '.NET Bot Black Hoodie', 19.50, '1.png', 2, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (2, '.NET Black & White Mug', '.NET Black & White Mug', 8.50, '2.png', 1, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (3, 'Prism White T-Shirt', 'Prism White T-Shirt', 12.00, '3.png', 2, 5, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (4, '.NET Foundation T-shirt', '.NET Foundation T-shirt', 12.00, '4.png', 2, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (5, 'Roslyn Red Sheet', 'Roslyn Red Sheet', 8.50, '5.png', 3, 5, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (6, '.NET Blue Hoodie', '.NET Blue Hoodie', 12.00, '6.png', 2, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (7, 'Roslyn Red T-Shirt', 'Roslyn Red T-Shirt', 12.00, '7.png', 2, 5, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (8, 'Kudu Purple Hoodie', 'Kudu Purple Hoodie', 8.50, '8.png', 2, 5, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (9, 'Cup White Mug', 'Cup White Mug', 12.00, '9.png', 1, 5, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (10, '.NET Foundation Sheet', '.NET Foundation Sheet', 12.00, '10.png', 3, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (11, 'Cup Sheet', 'Cup Sheet', 8.50, '11.png', 3, 2, 100, 0, 0, FALSE); +INSERT INTO Catalog (Id, Name, Description, Price, PictureFileName, CatalogTypeId, CatalogBrandId, AvailableStock, RestockThreshold, MaxStockThreshold, OnReorder) VALUES (12, 'Prism White TShirt', 'Prism White TShirt', 12.00, '12.png', 2, 5, 100, 0, 0, FALSE); + +ALTER TABLE CatalogBrand ALTER COLUMN Id RESTART WITH 6; +ALTER TABLE CatalogType ALTER COLUMN Id RESTART WITH 5; +ALTER TABLE Catalog ALTER COLUMN Id RESTART WITH 13; diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/logback-spring.xml b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..b1d4e513 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/logback-spring.xml @@ -0,0 +1,38 @@ + + + + + + + logFiles/eshop.log + + logFiles/eshop.%d{yyyy-MM-dd}.%i.log + 10MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{activityId}] %-5level %logger{36} - %X{requestInfo}%n%msg%n%n + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/base.css b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/base.css new file mode 100644 index 00000000..00f66201 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/base.css @@ -0,0 +1,29 @@ +@font-face { + font-family: Montserrat; + font-weight: 400; + src: url("../fonts/Montserrat-Regular.eot?") format("eot"), url("../fonts/Montserrat-Regular.woff") format("woff"), url("../fonts/Montserrat-Regular.ttf") format("truetype"), url("../fonts/Montserrat-Regular.svg#Montserrat") format("svg"); +} + +@font-face { + font-family: Montserrat; + font-weight: 700; + src: url("../fonts/Montserrat-Bold.eot?") format("eot"), url("../fonts/Montserrat-Bold.woff") format("woff"), url("../fonts/Montserrat-Bold.ttf") format("truetype"), url("../fonts/Montserrat-Bold.svg#Montserrat") format("svg"); +} + +html, body { + font-size: 16px; + font-family: Montserrat, sans-serif; +} + +body { + padding-top: 10px; + padding-bottom: 20px; + font-weight: 300; + z-index: 10; +} + +/* Set padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} \ No newline at end of file diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/custom.css b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/custom.css new file mode 100644 index 00000000..166669d6 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/custom.css @@ -0,0 +1,22 @@ +/* Override the default bootstrap behavior where horizontal description lists + will truncate terms that are too long to fit in the left column +*/ +.dl-horizontal dt { + white-space: normal; +} + +/* Tables */ +.table thead > tr > th, +.table tbody > tr > th, +.table tfoot > tr > th, +.table thead > tr > td, +.table tbody > tr > td, +.table tfoot > tr > td { + border: none; + white-space: nowrap; +} + +.table tbody tr > td { + vertical-align: middle; + border-bottom: 1px solid #eee; +} \ No newline at end of file diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/site.css b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/site.css new file mode 100644 index 00000000..ad422464 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/css/site.css @@ -0,0 +1,245 @@ +/* Slider */ +.esh-app-hero { + background-image: url("../images/main_banner.png"); + background-size: cover; + height: 12.5vw; + width: 100%; +} + +/* Header */ +.esh-header { + height: 100%; +} + +.esh-header:before { + content: ''; + display: inline-block; + vertical-align: middle; + height: 100%; +} + +.esh-header-brand { + max-width: 1440px; + margin-left: auto; + margin-right: auto; +} + +.esh-header-title { + font-family: Montserrat, sans-serif; + position: relative; + font-size: 4vw; + font-weight: 600; + color: #FFFFFF; + display: inline-block; + vertical-align: middle; +} + +.esh-header-title > span { + font-weight: 300; +} + +/* Footer */ +.esh-app-footer { + background-color: #000000; + border-top: 1px solid #EEEEEE; + margin-top: 2.5rem; + padding-bottom: 2.5rem; + padding-top: 2.5rem; + width: 100%; + float: left; +} + +.esh-app-footer-brand { + height: 50px; + width: 230px; +} + +/* Body */ +.esh-body-title { + font-family: Montserrat, sans-serif; + padding-left: 3rem; + padding-top: 1rem; + padding-bottom: 1.5rem; + margin: 0px; + margin-bottom: 2rem; + background-color: #00A69C; + font-size: 3rem; + color: #FFFFFF; +} + +/*Price*/ +.esh-price:before { + content: '$'; +} + +/* Table */ +.esh-table { + max-width: 1440px; + padding-top: 10px; + margin-left: auto; + margin-right: auto; +} + +.esh-table-header { + border-bottom: none; +} + +.esh-table th { + font-size: 1rem; + text-transform: uppercase; +} + +.esh-table td { + font-size: 1rem; + font-weight: 300; +} + +.esh-table-price { + font-size: 1em; + font-weight: 600; +} + +.esh-table-link { + color: inherit; + font-weight: 600; + cursor: pointer; + transition: color 0.35s; +} + +.esh-table-link:hover { + color: #75b918; + transition: color 0.35s; +} + +.esh-thumbnail { + max-width: 120px; + height: auto; +} + +.esh-picture { + max-width: 370px; + height: auto; + width: 100%; +} + +.esh-link-wrapper { + line-height: 3rem; + position: relative; + text-align: left; +} + +.esh-link-item { + color: inherit; + font-size: 2rem; + font-weight: 600; + cursor: pointer; + transition: color 0.35s; +} + + .esh-link-item:hover { + color: #75b918; + transition: color 0.35s; + } + +.esh-link-item--margin { + margin-left: 1rem; +} + +.esh-link-list { + font-size: 2rem; + margin-left: 1rem; +} + +.esh-button-actions .esh-button + .esh-button { + margin-left: 1rem; +} + +.esh-button { + border: 0; + border-radius: 0; + color: #FFFFFF; + display: inline-block; + font-size: 1rem; + font-weight: 400; + margin-top: 1rem; + padding: 1rem 1.5rem; + text-align: center; + text-transform: uppercase; + transition: all 0.35s; +} + +.esh-button-primary { + background-color: #83D01B; +} + +.esh-button-primary:hover { + background-color: #4A760f; + color: white; +} + +.esh-button-secondary { + background-color: #E52638; +} + +.esh-button-secondary:hover { + background-color: #b20000; + color: white; +} + +.esh-button-primary:hover { + background-color: #4a760f; + transition: all 0.35s; +} + +.esh-form-information { + padding-top: 7px; + color: #888888; +} + +/*Pager*/ +.esh-pager-wrapper { + padding-top: 1rem; + text-align: center; +} + +.esh-pager-item { + margin: 0 5vw; + color: #333333; +} + +.esh-pager-item--hidden { + opacity: 0; + pointer-events: none; +} + +.esh-pager-item--navigable { + cursor: pointer; + display: inline-block; +} + +.esh-pager-item--navigable:hover { + color: #83D01B; +} + +@media screen and (max-width: 1280px) { + .esh-pager-item { + font-size: 0.85rem; + } +} + +@media screen and (max-width: 1024px) { + .esh-pager-item { + margin: 0 2.5vw; + } + + .esh-app-hero { + height: 20vw; + } +} + +@media screen and (min-width: 1800px) { + .esh-header-title { + font-size:4rem; + } +} + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.eot b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.eot new file mode 100644 index 00000000..1c57e5d9 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.eot differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.svg b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.svg new file mode 100644 index 00000000..b0cb0aeb --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.svg @@ -0,0 +1,1933 @@ + + + + +Created by FontForge 20120731 at Mon Sep 12 19:08:28 2016 + By ,,, +Copyright (c) 2011-2012, Julieta Ulanovsky (julieta.ulanovsky@gmail.com), with Reserved Font Names 'Montserrat' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.ttf b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.ttf new file mode 100644 index 00000000..ae33a453 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.ttf differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff new file mode 100644 index 00000000..8ce1effc Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff2 b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff2 new file mode 100644 index 00000000..16cf34a7 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Bold.woff2 differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.eot b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.eot new file mode 100644 index 00000000..64912c70 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.eot differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.svg b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.svg new file mode 100644 index 00000000..8f2b72f1 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.svg @@ -0,0 +1,1743 @@ + + + + +Created by FontForge 20120731 at Mon Sep 12 19:08:52 2016 + By ,,, +Copyright (c) 2011-2012, Julieta Ulanovsky (julieta.ulanovsky@gmail.com), with Reserved Font Names 'Montserrat' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.ttf b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.ttf new file mode 100644 index 00000000..5b4b5afe Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.ttf differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff new file mode 100644 index 00000000..930c783d Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff2 b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff2 new file mode 100644 index 00000000..136ab68e Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/fonts/Montserrat-Regular.woff2 differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand.png new file mode 100644 index 00000000..4f7b8a84 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand_dark.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand_dark.png new file mode 100644 index 00000000..04626dcf Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/brand_dark.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_banner.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_banner.png new file mode 100644 index 00000000..bba30331 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_banner.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_footer_text.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_footer_text.png new file mode 100644 index 00000000..d8f90a20 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/images/main_footer_text.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/1.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/1.png new file mode 100644 index 00000000..2db4977f Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/1.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/10.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/10.png new file mode 100644 index 00000000..f3f411c9 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/10.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/11.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/11.png new file mode 100644 index 00000000..2b8c5206 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/11.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/12.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/12.png new file mode 100644 index 00000000..73da17e8 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/12.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/2.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/2.png new file mode 100644 index 00000000..8446fad1 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/2.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/3.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/3.png new file mode 100644 index 00000000..7f91f6fb Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/3.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/4.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/4.png new file mode 100644 index 00000000..d6bd6220 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/4.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/5.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/5.png new file mode 100644 index 00000000..ed2940d2 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/5.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/6.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/6.png new file mode 100644 index 00000000..f9ed57d6 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/6.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/7.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/7.png new file mode 100644 index 00000000..9ed499fc Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/7.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/8.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/8.png new file mode 100644 index 00000000..08d60e14 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/8.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/9.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/9.png new file mode 100644 index 00000000..1f33c47e Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/9.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/dummy.png b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/dummy.png new file mode 100644 index 00000000..6e4dc042 Binary files /dev/null and b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/static/pics/dummy.png differ diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/create.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/create.html new file mode 100644 index 00000000..f715b807 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/create.html @@ -0,0 +1,110 @@ + + + + Create + + +
+ +

Create

+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ Uploading images not allowed for this version. +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+
+ [ Cancel ] + +
+
+ +
+
+ +
+ + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/delete.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/delete.html new file mode 100644 index 00000000..88eafedf --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/delete.html @@ -0,0 +1,61 @@ + + + + Delete + + +
+ +

Delete

+ +
+

Are you sure you want to delete this?

+
+ product image +
+
Name
+
+ +
Description
+
+ +
Brand
+
+ +
Type
+
+ +
Price
+
+ +
+ +
Picture name
+
+ +
Stock
+
+ +
Restock
+
+ +
Max stock
+
+ +
+
+ [ Cancel ] +
+ +
+
+
+
+
+ +
+ + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/details.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/details.html new file mode 100644 index 00000000..a5d8dbf4 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/details.html @@ -0,0 +1,58 @@ + + + + Details + + +
+ +

Details

+ +
+
+ product image +
+
Name
+
+ +
Description
+
+ +
Brand
+
+ +
Type
+
+ +
Price
+
+ +
+ +
Picture name
+
+ +
Stock
+
+ +
Restock
+
+ +
Max stock
+
+
+
+ + +
+ +
+ + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/edit.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/edit.html new file mode 100644 index 00000000..d48693db --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/edit.html @@ -0,0 +1,119 @@ + + + + Edit + + +
+ +

Edit

+ +
+
+ product image +
+ +
+ + + +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+
+ [ Cancel ] + +
+
+ +
+
+
+
+ +
+ + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/index.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/index.html new file mode 100644 index 00000000..72099e67 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/catalog/index.html @@ -0,0 +1,120 @@ + + + + Home Page + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionBrandTypePricePicture nameStockRestockMax stock
+ product image + +

+
+

+
+

+
+

+
+

+ +

+
+

+
+

+
+

+
+

+
+ + Edit + + | + + Details + + | + + Delete + +
+ + + + + +
No data was returned.
+
+ +
+
+ +
+
+ +
+ + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/layout/default.html b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/layout/default.html new file mode 100644 index 00000000..eca162f0 --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/main/resources/templates/layout/default.html @@ -0,0 +1,42 @@ + + + + + + Catalog manager + + + + + + + +
+
+

Catalog manager (Spring Boot)

+
+
+
+
+
+
+
+ brand +
+
+ +
+
+
+
+ + + diff --git a/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/test/java/com/eshop/webforms/EShopApplicationTests.java b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/test/java/com/eshop/webforms/EShopApplicationTests.java new file mode 100644 index 00000000..e8548b8c --- /dev/null +++ b/eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot/src/test/java/com/eshop/webforms/EShopApplicationTests.java @@ -0,0 +1,14 @@ +package com.eshop.webforms; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; + +@SpringBootTest +@ActiveProfiles("mock") +class EShopApplicationTests { + + @Test + void contextLoads() { + } +}