This commit is contained in:
Abderrahmane 2026-07-26 13:39:10 +01:00
commit 53305f854a
1146 changed files with 687440 additions and 0 deletions

46
.gitAttributes Normal file
View File

@ -0,0 +1,46 @@
# Ensure all text files use LF in the repository
*.java text eol=lf
*.xml text eol=lf
*.xhtml text eol=lf
*.properties text eol=lf
*.sql text eol=lf
*.txt text eol=lf
*.js text eol=lf
*.css text eol=lf
*.jrxml text eol=lf
*.jsf text eol=lf
*.yml text eol=lf
*.json text eol=lf
*.md text eol=lf
# Treat common binary files as binary to avoid line ending issues
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.bmp binary
*.ico binary
*.pdf binary
*.docx binary
*.xlsx binary
*.ttf binary
*.jar binary
*.bak binary
*.jasper binary
*.exe binary
*.dll binary
*.zip binary
# Catch-all for unknown binary files
*.*bin binary
*.exe binary
*.dll binary
#git pull
#git config --global core.autocrlf true
#git ls-files --eol
#git rm --cached -r .
#git reset --hard
#git add --renormalize .
#git commit -m "Apply correct line endings based on .gitattributes"

46
.gitignore vendored Normal file
View File

@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/target
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
nb-configuration.xml
nbactions.xml
ultima.iml
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# System Files
.DS_Store
Thumbs.db
# Created by https://www.toptal.com/developers/gitignore/api/netbeans
# Edit at https://www.toptal.com/developers/gitignore?templates=netbeans
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
database.properties
# End of https://www.toptal.com/developers/gitignore/api/netbeans
/target/
/node_modules/

209
CHANGELOG.md Normal file
View File

@ -0,0 +1,209 @@
# Changelog
## 6.0.0
**Migration Guide**
- Update all files
**Implemented New Features and Enhancements:**
- Remastered Ultima Layout
## 5.0.0
**Migration Guide**
- Update layout.js and layout css files
- Update theme scss files
- Replace theme jar with new jar
- Update primeflex.min.css file
- Update invoice page
- Update all widgets on pages due to PrimeFlex 3.x
**Implemented New Features and Enhancements:**
- Update PrimeFlex to 3.x
- Theme designer enhancements included
## 4.1.0
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
**Implemented New Features and Enhancements:**
- Add support for PrimeFaces 11 with jakarta
- Update PrimeIcons to 5.0.0
- Theme designer enhancements included
## 4.0.0
**Migration Guide**
- Update layout.js and layout css files
- Replace layout files with new files
- Replace theme jar with new jar
**Implemented New Features and Enhancements:**
- Add support for PrimeFaces 11
- New demos added
- Theme designer enhancements included
## 3.0.0
**Migration Guide**
- Update layout.js file
- Replace layout files with new files
- Replace theme jar with new jar
**Implemented New Features and Enhancements:**
- Add support for Primefaces X
- New demos added
- New material theme
- Theme designer included
- Primeflex updated
- Primeicons updated
**Fixed bugs:**
- Minor fixes
## 2.1.1
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 2.1.0
**Migration Guide**
- Added configurator panel
- Update layout.js and layout css files.
- Replace theme jar with new jar
## 2.0.2
**Migration Guide**
- Update layout css files
## 2.0.1
**Migration Guide**
- Added sample invoice, help and payment wizard pages.
## 2.0.0
**Migration Guide**
- Update UltimaMenu*.java file
- Replace theme jar with new jar
## 1.1.6
**Migration Guide**
- Update layout.js, UltimaMenu*.java and layout css files
- Replace theme jar with new jar
## 1.1.5
**Migration Guide**
- Update layout.js, UltimaMenu*.java and taglib files
- Replace theme jar with new jar
## 1.1.4
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 1.1.3
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 1.1.2
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 1.1.1
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 1.0.9
**Migration Guide**
- Update layout css files
- Replace theme jar with new jar
## 1.0.8
**Migration Guide**
- Update layout.js and layout css files
- Replace theme jar with new jar
## 1.0.7
**Migration Guide**
- Update theme jar, layout css files and layout.js. (<a href="https://github.com/primefaces/ultima/issues?q=is%3Aissue+is%3Aclosed+milestone%3A1.0.7">Full Changelog</a>)
## 1.0.6
**Migration Guide**
- Update theme jar and layout.js.
## 1.0.5
**Migration Guide**
- Update theme jar, layout-{color}.css and layout.js.
## 1.0.4
**Migration Guide**
- Update theme jar and layout.js
## 1.0.3
**Migration Guide**
- Update theme jar
## 1.0.2
**Migration Guide**
- Update theme jar
## 1.0.1
**Migration Guide**
- Update layout-*.css files
- Update theme jar

2
LICENSE Normal file
View File

@ -0,0 +1,2 @@
Layout Licenses
https://www.primefaces.org/layouts/licenses

27
README.md Normal file
View File

@ -0,0 +1,27 @@
## Ultima PrimeFaces
#### Getting Started
First of all, you'd need SASS to compile CSS, proceed to [SASS Installation](https://sass-lang.com/install) before beginning if you do not have SASS available in your command line.
Demo project has an integrated jetty plugin so running the sample is easy as building the css first followed by the ``mvn jetty:run`` command.
```
sass --update src/main/webapp/resources:src/main/webapp/resources --no-source-map
mvn clean jetty:run
```
<sup>\*Note: The sass command above is supported by **Dart Sass**. Please use [Dart Sass](https://sass-lang.com/install) instead of [Ruby Sass](https://sass-lang.com/ruby-sass). </sup>
Navigate to http://localhost:8080/ultima to view the demos which is exactly same as the live version.
#### Migration Guide
Every change is included in **CHANGELOG.md** file at the root folder of the distribution along with the instructions to update.
#### Support
See [Ultima PrimeFaces Forum](https://forum.primefaces.org/viewforum.php?f=42) to get support about this layout.
#### License
See [Layout License](https://www.primefaces.org/layouts/licenses).

Binary file not shown.

6
faces-config.NavData Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project"/>
<Scope Scope="All Faces Configurations"/>
</Scene>

490
package-lock.json generated Normal file
View File

@ -0,0 +1,490 @@
{
"name": "TrizService",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"devDependencies": {
"sass": "^1.86.3"
}
},
"node_modules/@parcel/watcher": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz",
"integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"dependencies": {
"detect-libc": "^1.0.3",
"is-glob": "^4.0.3",
"micromatch": "^4.0.5",
"node-addon-api": "^7.0.0"
},
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"optionalDependencies": {
"@parcel/watcher-android-arm64": "2.5.1",
"@parcel/watcher-darwin-arm64": "2.5.1",
"@parcel/watcher-darwin-x64": "2.5.1",
"@parcel/watcher-freebsd-x64": "2.5.1",
"@parcel/watcher-linux-arm-glibc": "2.5.1",
"@parcel/watcher-linux-arm-musl": "2.5.1",
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
"@parcel/watcher-linux-arm64-musl": "2.5.1",
"@parcel/watcher-linux-x64-glibc": "2.5.1",
"@parcel/watcher-linux-x64-musl": "2.5.1",
"@parcel/watcher-win32-arm64": "2.5.1",
"@parcel/watcher-win32-ia32": "2.5.1",
"@parcel/watcher-win32-x64": "2.5.1"
}
},
"node_modules/@parcel/watcher-android-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz",
"integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-darwin-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz",
"integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-darwin-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz",
"integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-freebsd-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz",
"integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz",
"integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz",
"integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm64-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz",
"integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm64-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz",
"integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-x64-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz",
"integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-x64-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz",
"integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz",
"integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-ia32": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz",
"integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz",
"integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"optional": true,
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
"dev": true,
"dependencies": {
"readdirp": "^4.0.1"
},
"engines": {
"node": ">= 14.16.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/detect-libc": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
"integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==",
"dev": true,
"optional": true,
"bin": {
"detect-libc": "bin/detect-libc.js"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"optional": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/immutable": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.1.tgz",
"integrity": "sha512-3jatXi9ObIsPGr3N5hGw/vWWcTkq6hUYhpQz4k0wLC+owqWi/LiugIw9x0EdNZ2yGedKN/HzePiBvaJRXa0Ujg==",
"dev": true
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"optional": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"optional": true,
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/node-addon-api": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
"dev": true,
"optional": true
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"optional": true,
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/readdirp": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
"integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
"dev": true,
"engines": {
"node": ">= 14.18.0"
},
"funding": {
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/sass": {
"version": "1.86.3",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.3.tgz",
"integrity": "sha512-iGtg8kus4GrsGLRDLRBRHY9dNVA78ZaS7xr01cWnS7PEMQyFtTqBiyCrfpTYTZXRWM94akzckYjh8oADfFNTzw==",
"dev": true,
"dependencies": {
"chokidar": "^4.0.0",
"immutable": "^5.0.2",
"source-map-js": ">=0.6.2 <2.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=14.0.0"
},
"optionalDependencies": {
"@parcel/watcher": "^2.4.1"
}
},
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"optional": true,
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
}
}
}

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"devDependencies": {
"sass": "^1.86.3"
}
}

611
pom.xml Normal file
View File

@ -0,0 +1,611 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.primefaces</groupId>
<artifactId>Triz</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Triz</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>16</java.version>
<servlet.version>3.1.0</servlet.version>
<jsf.version>2.2.15</jsf.version>
<primefaces.version>13.0.2</primefaces.version>
<spring.version>4.3.30.RELEASE</spring.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<owb.version>2.0.27</owb.version>
<open-pdf.version>1.3.24</open-pdf.version>
<poi.version>5.0.0</poi.version>
<jetty.version>9.4.48.v20220622</jetty.version>
</properties>
<dependencies>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>13.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>13.0.2</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.15</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.15</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.29.1</version>
</dependency>
<!-- Required only when you are using JAX-RS Client -->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.29.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.31</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>mailapi</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>smtp</artifactId>
<version>1.5.5</version>
</dependency>
<!-- CDI required APIs -->
<!-- <dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-interceptor_1.2_spec</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-annotation_1.3_spec</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-validation_2.0_spec</artifactId>
<version>1.1</version>
</dependency> -->
<!-- CDI Impl -->
<!--<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-jsf</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-web</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<version>${owb.version}</version>
</dependency>-->
<!-- Export Demo Impl -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-all</artifactId>
</exclusion>
<exclusion>
<groupId>de.rototor.pdfbox</groupId>
<artifactId>graphics2d</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>${open-pdf.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>jakarta.persistence</artifactId>
<version>2.2.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.30.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.2.4.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.4.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-faces</artifactId>
<version>2.5.0.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId >org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.30.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.30.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.15.Final</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.4.15.Final</version>
<!-- will come with Hibernate core-->
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency>
<dependency>
<groupId>com.github.v-ladynev</groupId>
<artifactId>fluent-hibernate-core</artifactId>
<version>0.3.1</version>
</dependency>
<!--sqlJDBC-->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.5</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>kernel</artifactId>
<version>7.1.15</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>layout</artifactId>
<version>7.1.15</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.20.6</version>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>23.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/e-iceblue/spire.xls.free -->
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls.free</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>net.glxn</groupId>
<artifactId>qrgen</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-light</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<!--<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
</repository>
</repositories>-->
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://releases.aspose.com/java/repo/</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<includes>
<include>web.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<release>16</release>
<source>16</source>
<target>16</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppConfig>
<contextPath>/ultima</contextPath>
</webAppConfig>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webXml>${project.build.directory}/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>9.20.0</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>distribute</id>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>build-theme</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assemble/theme.xml</descriptor>
</descriptors>
<finalName>${project.name}-theme-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deploy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<webResources>
<resource>
<filtering>true</filtering>
<directory>src/main/webapp</directory>
<includes>
<include>**/web.xml</include>
</includes>
</resource>
</webResources>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<webXml>${project.build.directory}/web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

22
src/assemble/theme.xml Normal file
View File

@ -0,0 +1,22 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>theme</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/webapp/resources</directory>
<outputDirectory>/META-INF/resources</outputDirectory>
<includes>
<include>primefaces-*/theme.css</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@ -0,0 +1,178 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import com.triz.util.UtilControleAccess;
import com.triz.util.UtilGetParametre;
import com.triz.util.UtilURL;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author FORCE TECH
*/
@Component("choixEtablissementBean")
@Scope("session")
public class ChoixEtablissementBean {
private static final long serialVersionUID = 1L;
private Etablissement etablissementSelected;
private String URL = "/view/telephone/listActif.xhtml?faces-redirect=true";
private String STOCK_URL = "/accueil.xhtml?faces-redirect=true";
private String STOCK_URL_TB = "/accueil.xhtml?faces-redirect=true";
private String TABLEAU_URL = "/view/vente/listEtab.xhtml?faces-redirect=true";
private String STOCK_URL_VENTECOMPTOIRE = "/view/venteSuperette/list.xhtml?faces-redirect=true";
public String Multi_Etablissement_URL = "/view/choixEtablissement/list.xhtml";
public String URL_PRODUCTION = "/view/production/list.xhtml?faces-redirect=true";
public String URL_SAV = "/view/SAV/list.xhtml?faces-redirect=true";
private boolean useDistribution;
private boolean voirTableau;
private List<Etablissement> listeEtablissement;
@Autowired
public transient TransactionService service;
@Autowired
private transient UtilControleAccess utilControleAccess;
@Autowired
public transient UtilContext context;
private ServiceUser user;
@PostConstruct
public void init() {
System.out.println("//--------------init()choixEtablissementBean ");
// useDistribution = UtilGetParametre.useTrizDistribution();
user = context.getCurrentUser();
// voirTableau = false;
// if ("true".equals(user.getShowTableauDeBord())) {
// voirTableau = true;
// }
listeEtablissement = service.getAllStockEtablissementFromUsersEtablissementByUser(user);
// for (Etablissement etab : listeEtablissement) {
//// if (etab.getCodeUsine() == null) {
//// etab.setCodeUsine(etab.getId());
//// service.save(etab);
//// continue;
//// }
// if (etab.getCodeUsine().isEmpty()) {
// etab.setCodeUsine(etab.getId());
// service.save(etab);
// continue;
// }
// }
// context.setAllFonctionByUser(null);
}
public List<Etablissement> getListeEtablissement() {
return listeEtablissement;
}
public void setListeEtablissement(List<Etablissement> listeEtablissement) {
this.listeEtablissement = listeEtablissement;
}
public Etablissement getEtablissementSelected() {
return etablissementSelected;
}
public void setEtablissementSelected(Etablissement etablissementSelected) {
this.etablissementSelected = etablissementSelected;
}
public String etablissementIsSelected(FiltreBean filtre) {
UtilURL.resetSession();
// context.setAllFonctionByUser(null);
// context.setEtablissementSelect(null);
// context.setUserSelect(null);
if (filtre != null) {
filtre.remiseAZero();
}
// UtilURL.setIsTableauDeBord(false);
// if (voirTableau) {
// if (etablissementSelected == null) {
// UtilURL.setIsTableauDeBord(true);
// UtilURL.setIdEtablissement(null);
// UtilURL.setFonctionnaliteServer(serviceSuite.getFonctionServerByUsers(context.getCurrentUser()));
// UtilURL.setIsProuction(false);
// saveConnection("true", etablissementSelected);
// return TABLEAU_URL;
// }
// }
UtilURL.setIdEtablissement(etablissementSelected.getIdEtabStock());
UtilURL.setFonctionnalite(service.getFonctionServerByUsersByEtablissement(context.getCurrentUser(), etablissementSelected));
ServiceEtablissementUser userEtablissement = service.getAllUserEtablissementByEtablissementByUser(etablissementSelected, user);
// if(etablissementSelected.gettypeetab)
//getListeModeleEdition(etablissementSelected);
saveConnection(etablissementSelected);
// if (("true".equals(userEtablissement.getUseSuperette()))) {
// UtilURL.setIsProuction(false);
// return STOCK_URL_VENTECOMPTOIRE;
// }
// if (etablissementSelected.getType_etablissemnt() != null) {
// if (etablissementSelected.getType_etablissemnt().equals("sav")) {
// return URL_SAV;
// }
//
// if (etablissementSelected.getType_etablissemnt().equals("production")) {
// UtilURL.setIsProuction(true);
// return URL_PRODUCTION;
// } else {
// UtilURL.setIsProuction(false);
// if (context.getUseTB() && utilControleAccess.isshow1("Acceuil")) {
// return STOCK_URL_TB;
// }
// return STOCK_URL;
// }
// }
// UtilURL.setIsProuction(false);
// if (context.getUseTB() && utilControleAccess.isshow1("Acceuil")) {
// return STOCK_URL_TB;
// }
return STOCK_URL;
}
private void saveConnection(Etablissement etablissement) {
ServicehistoriqueConnection his = new ServicehistoriqueConnection();
his.setFkUser(user);
his.setFkEtablissement(etablissement);
his.setDate(new Date());
his.setHeur(new Date());
his.setAdresseIp("");
service.save(his);
}
//
// public String production() {
// return "/view/production/productionList.xhtml?faces-redirect=true";
// }
//
// public boolean isVoirTableau() {
// return voirTableau;
// }
//
// public void setVoirTableau(boolean voirTableau) {
// this.voirTableau = voirTableau;
// }
public String voirUser() {
return "/views/user/form.xhtml?faces-redirect=true&user1=" + user.getUserid();
}
}

View File

@ -0,0 +1,309 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServiceWilaya;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import com.triz.util.UtilFile;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author FORCE TECH
*/
@Component("filtreBean")
@Scope("session")
public class FiltreBean {
private ServiceUser user;
// private Users userDist;
private Etablissement etablissement;
private Etablissement etablissementPrincipal;
// private Etablissement etablissementDisPrincipal;
// private Etablissement etablissementDist;
private List<String> listeZone;
private List<Etablissement> listeEtablissement;
//private List<Etablissement> listeEtablissementDist;
//private List<Camion> listeCamion;
// private List<StockCommune> listeCommunes;
private List<ServiceWilaya> listeWilaya;
// private List<StockTypeActivitieClient> listeTypeActivitie;
// private List<StockTypeClient> listeTypeClient;
// private List<RaisonNonVente> listeRaisonNonVente;
// private List<TBEvaluationDistance> listeEvaluationDistance;
private List<String> listeConfirmer;
private List<String> listeDoubleFiltre;
// @Autowired
// public TransactionServiceSuite serviceDistributionSuite;
@Autowired
public TransactionService service;
// @Autowired
// public TransactionServiceStockSuite serviceSuite;
//
// @Autowired
// public TransactionService serviceDistribution;
@Autowired
public UtilContext context;
@Autowired
public UtilFile utilFile;
// @Autowired
// private TransactionServiceTBNew serviceTbNew;
//
// @Autowired
// public TransactionServiceTB serviceTB;
@PostConstruct
public void init() {
user = context.getCurrentUser();
etablissement = context.getCurrentEtablissement();
// etablissementDist = serviceDistribution.getEtablissementById(etablissement.getFkEtablissementDistribution());
listeEtablissement = new ArrayList<>();
listeEtablissement.add(etablissement);
// listeCamion = new ArrayList<>();
// listeEtablissementDist = new ArrayList<>();
// for (Etablissement etab : listeEtablissement) {
// if ("true".equals(etab.getIsPrincipal())) {
// etablissementPrincipal = etab;
// }
//// if (etab.getFkEtablissementDistribution() != null) {
//// Etablissement etabDist = serviceDistribution.getEtablissementById(etab.getFkEtablissementDistribution());
//// listeCamion.addAll(serviceDistribution.getAllCamionsActifByEtablissement(etabDist));
//// listeEtablissementDist.add(etabDist);
//// if ("true".equals(etab.getIsPrincipal())) {
//// etablissementDisPrincipal = etabDist;
//// }
//// }
//
// }
if (etablissementPrincipal == null) {
etablissementPrincipal = listeEtablissement.get(0);
//etablissementDisPrincipal = serviceDistribution.getEtablissementById(etablissementPrincipal.getFkEtablissementDistribution());
}
listeWilaya = service.getAllWilaya();
///listeCommunes = service.getAllCommune();
// listeEvaluationDistance = serviceTB.getAllTBEvaluationDistance();
// listeTypeActivitie = service.getTypeActivitieClientByEtablissement(etablissementPrincipal);
// listeTypeClient = service.getAllTypeClientsByEtablissement(etablissementPrincipal);
// if (etablissementDisPrincipal != null) {
// listeRaisonNonVente = serviceDistributionSuite.getAllRaisonNonVenteActifByEtablissement(etablissementDist);
// }
listeConfirmer = new ArrayList<>();
listeConfirmer.add("Oui");
listeConfirmer.add("Non");
listeDoubleFiltre = new ArrayList<>();
listeDoubleFiltre.add("=");
listeDoubleFiltre.add("<=");
listeDoubleFiltre.add(">=");
listeDoubleFiltre.add("<");
listeDoubleFiltre.add(">");
}
public void remiseAZero() {
System.out.println("FiltreBean remiseAZero");
user = null;
// userDist = null;
etablissement = null;
etablissementPrincipal = null;
// etablissementDist = null;
listeZone = null;
listeEtablissement = null;
// listeEtablissementDist = null;
// listeCamion = null;
// listeCommunes = null;
listeWilaya = null;
// listeTypeActivitie = null;
// listeTypeClient = null;
// listeEvaluationDistance = null;
listeConfirmer = null;
}
public ServiceUser getUser() {
if (user == null) {
init();
}
return user;
}
public void setUser(ServiceUser user) {
this.user = user;
}
// public Users getUserDist() {
// if (userDist == null) {
// init();
// }
// return userDist;
// }
// public void setUserDist(Users userDist) {
// this.userDist = userDist;
// }
public Etablissement getEtablissement() {
if (etablissement == null) {
init();
}
return etablissement;
}
public void setEtablissement(Etablissement etablissement) {
this.etablissement = etablissement;
}
// public Etablissement getEtablissementDist() {
// if (etablissementDist == null) {
// init();
// }
// return etablissementDist;
// }
// public void setEtablissementDist(Etablissement etablissementDist) {
// this.etablissementDist = etablissementDist;
// }
public List<String> getListeZone() {
if (listeZone == null) {
init();
}
return listeZone;
}
public void setListeZone(List<String> listeZone) {
this.listeZone = listeZone;
}
public List<Etablissement> getListeEtablissement() {
if (listeEtablissement == null) {
init();
}
return listeEtablissement;
}
public void setListeEtablissement(List<Etablissement> listeEtablissement) {
this.listeEtablissement = listeEtablissement;
}
// public List<Etablissement> getListeEtablissementDist() {
// if (listeEtablissementDist == null) {
// init();
// }
// return listeEtablissementDist;
// }
//
// public void setListeEtablissementDist(List<Etablissement> listeEtablissementDist) {
// this.listeEtablissementDist = listeEtablissementDist;
// }
//
// public List<Camion> getListeCamion() {
// if (listeCamion == null) {
// init();
// }
// return listeCamion;
// }
//
// public void setListeCamion(List<Camion> listeCamion) {
// this.listeCamion = listeCamion;
// }
//
// public List<StockCommune> getListeCommunes() {
// if (listeCommunes == null) {
// init();
// }
// return listeCommunes;
// }
//
// public void setListeCommunes(List<StockCommune> listeCommunes) {
// this.listeCommunes = listeCommunes;
// }
public List<ServiceWilaya> getListeWilaya() {
if (listeWilaya == null) {
init();
}
return listeWilaya;
}
public void setListeWilaya(List<ServiceWilaya> listeWilaya) {
this.listeWilaya = listeWilaya;
}
// public List<StockTypeActivitieClient> getListeTypeActivitie() {
// if (listeTypeActivitie == null) {
// init();
// }
// return listeTypeActivitie;
// }
//
// public void setListeTypeActivitie(List<StockTypeActivitieClient> listeTypeActivitie) {
// this.listeTypeActivitie = listeTypeActivitie;
// }
//
// public List<StockTypeClient> getListeTypeClient() {
// if (listeTypeClient == null) {
// init();
// }
// return listeTypeClient;
// }
//
// public void setListeTypeClient(List<StockTypeClient> listeTypeClient) {
// this.listeTypeClient = listeTypeClient;
// }
//
// public List<TBEvaluationDistance> getListeEvaluationDistance() {
// if (listeEvaluationDistance == null) {
// init();
// }
// return listeEvaluationDistance;
// }
//
// public void setListeEvaluationDistance(List<TBEvaluationDistance> listeEvaluationDistance) {
// this.listeEvaluationDistance = listeEvaluationDistance;
// }
public List<String> getListeConfirmer() {
if (listeConfirmer == null) {
init();
}
return listeConfirmer;
}
public void setListeConfirmer(List<String> listeConfirmer) {
this.listeConfirmer = listeConfirmer;
}
// public List<RaisonNonVente> getListeRaisonNonVente() {
// return listeRaisonNonVente;
// }
//
// public void setListeRaisonNonVente(List<RaisonNonVente> listeRaisonNonVente) {
// this.listeRaisonNonVente = listeRaisonNonVente;
// }
public List<String> getListeDoubleFiltre() {
return listeDoubleFiltre;
}
public void setListeDoubleFiltre(List<String> listeDoubleFiltre) {
this.listeDoubleFiltre = listeDoubleFiltre;
}
}

View File

@ -0,0 +1,305 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.object.GenerateIDObject;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author Asma
*/
@Component("formGroupBean")
@Scope("view")
public class FormGroupBean {
private boolean canEdit;
private boolean isNew;
private boolean isActif;
private String groupe;
private String modifier;
private ServiceUser user;
private ServiceGroupe groupeSelected;
private ServiceFonctiongroupe fonctionSelected;
private List<ServiceFonctionnaliter> listeAllFonctionnalite;
private List<ServiceFonctiongroupe> listeFonctionnalite;
private List<ServiceFonctiongroupe> listeFonctionsASupprimer = new ArrayList<>();
private List<ServiceFonctionnaliter> Source;
private List<ServiceFonctionnaliter> Target;
@Autowired
public TransactionService service;
@Autowired
public UtilContext context;
@PostConstruct
public void init() {
System.out.println("//--------------init()FormGroupBean ");
Source = new ArrayList<>();
Target = new ArrayList<>();
user = context.getCurrentUser();
if (modifier != null) {
if (modifier.equals("true")) {
canEdit = true;
}
}
if (groupe != null) {
System.out.println("hello 1");
groupeSelected = service.getGroupsById(groupe);
} else {
System.out.println("hello 2");
if (canEdit) {
System.out.println("hello 3");
isNew = true;
}
groupeSelected = new ServiceGroupe();
}
if (modifier != null) {
listeAllFonctionnalite = service.getAllFonctionalite();
for (ServiceFonctionnaliter f : listeAllFonctionnalite) {
Source.add(f);
}
if (groupe != null) {
listeAllFonctionnalite = service.getFonctionServerByGroups(groupeSelected);
} else {
listeAllFonctionnalite = new ArrayList<>();
}
for (ServiceFonctionnaliter f : listeAllFonctionnalite) {
Target.add(f);
}
for (ServiceFonctionnaliter s : Target) {
if (Source.contains(s)) {
Source.remove(s);
}
}
}
if (groupe != null) {
listeFonctionnalite = service.getAllFonctionsGroupesByGroupe(groupeSelected);
}
}
public void ajouterFonctionnalitesAuGroupe() {
if (Target != null && !Target.isEmpty()) {
if (listeFonctionnalite == null) {
listeFonctionnalite = new ArrayList<>();
}
for (ServiceFonctionnaliter f : Target) {
boolean existe = false;
for (ServiceFonctiongroupe fg : listeFonctionnalite) {
if (fg.getFkFonction().getId().equals(f.getId())) {
existe = true;
break;
}
}
if (!existe) {
ServiceFonctiongroupe newFg = new ServiceFonctiongroupe();
// newFg.setId(groupeSelected.getId() + f.getId());
newFg.setFkFonction(f);
newFg.setFkGroupe(groupeSelected);
newFg.setCanCreate("true");
newFg.setCanUpdate("true");
newFg.setCanDelete("true");
newFg.setCanUpdateDate("true");
listeFonctionnalite.add(newFg);
}
}
Source.removeAll(Target);
Target.clear();
}
}
public void deletefonction() {
if (fonctionSelected != null && listeFonctionnalite != null) {
listeFonctionnalite.remove(fonctionSelected);
listeFonctionsASupprimer.add(fonctionSelected); // Marquer pour suppression
if (!Source.contains(fonctionSelected.getFkFonction())) {
Source.add(fonctionSelected.getFkFonction());
}
fonctionSelected = null;
}
}
public String saveGroupe() {
if (isNew) {
System.out.println("hello from save 1");
String id = GenerateIDObject.genererIdGroups(service);
while (service.getGroupsById(id) != null) {
id = GenerateIDObject.genererIdGroups(service);
}
groupeSelected.setId(id);
groupeSelected.setActif("true");
service.save(groupeSelected);
context.saveNewManipulation("Groupe", groupeSelected.getId(), "Ajouter Groupe", new Date(), new Date(), user, 0d, 0d);
}else{
System.out.println("hello from save 2");
service.save(groupeSelected);
}
// Sauvegarde des fonctionnalités (ajoutées ou modifiées)
if (listeFonctionnalite != null) {
for (ServiceFonctiongroupe fg : listeFonctionnalite) {
service.saveFonctionsGroupes(fg);
}
}
// Suppression des fonctionnalités supprimées
if (listeFonctionsASupprimer != null) {
for (ServiceFonctiongroupe fg : listeFonctionsASupprimer) {
service.removeFonctionsGroupes(fg);
}
listeFonctionsASupprimer.clear(); // Nettoyage
}
return consulterGroups();
}
public String voirGroupe() {
if (!isNew) {
if (!canEdit) {
return "list.xhtml?faces-redirect=true";
} else {
return "form.xhtml?faces-redirect=true&groupe=" + groupeSelected.getId();
}
} else {
return "list.xhtml?faces-redirect=true";
}
}
public String consulterGroups() {
return "form.xhtml?faces-redirect=true&canEdit=false&groupe=" + groupeSelected.getId();
}
public String editGroupe() {
return "form.xhtml?faces-redirect=true&canEdit=true&groupe=" + groupeSelected.getId();
}
public String supprimeGroupe() {
System.out.println("Hi ");
groupeSelected.setActif("false");
service.save(groupeSelected);
return listeGroupe();
}
public String listeGroupe() {
return "list.xhtml?faces-redirect=true";
}
public boolean isCanEdit() {
return canEdit;
}
public void setCanEdit(boolean canEdit) {
this.canEdit = canEdit;
}
public boolean isIsNew() {
return isNew;
}
public void setIsNew(boolean isNew) {
this.isNew = isNew;
}
public boolean isIsActif() {
return isActif;
}
public void setIsActif(boolean isActif) {
this.isActif = isActif;
}
public String getGroupe() {
return groupe;
}
public void setGroupe(String groupe) {
this.groupe = groupe;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public ServiceUser getUser() {
return user;
}
public void setUser(ServiceUser user) {
this.user = user;
}
public ServiceGroupe getGroupeSelected() {
return groupeSelected;
}
public void setGroupeSelected(ServiceGroupe groupeSelected) {
this.groupeSelected = groupeSelected;
}
public List<ServiceFonctionnaliter> getListeAllFonctionnalite() {
return listeAllFonctionnalite;
}
public void setListeAllFonctionnalite(List<ServiceFonctionnaliter> listeAllFonctionnalite) {
this.listeAllFonctionnalite = listeAllFonctionnalite;
}
public List<ServiceFonctiongroupe> getListeFonctionnalite() {
return listeFonctionnalite;
}
public void setListeFonctionnalite(List<ServiceFonctiongroupe> listeFonctionnalite) {
this.listeFonctionnalite = listeFonctionnalite;
}
public ServiceFonctiongroupe getFonctionSelected() {
return fonctionSelected;
}
public void setFonctionSelected(ServiceFonctiongroupe fonctionSelected) {
this.fonctionSelected = fonctionSelected;
}
public List<ServiceFonctionnaliter> getSource() {
return Source;
}
public void setSource(List<ServiceFonctionnaliter> Source) {
this.Source = Source;
}
public List<ServiceFonctionnaliter> getTarget() {
return Target;
}
public void setTarget(List<ServiceFonctionnaliter> Target) {
this.Target = Target;
}
}

View File

@ -0,0 +1,191 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author Asma
*/
@Component("formUserBean")
@Scope("view")
public class FormUserBean {
private boolean canEdit;
private boolean isNew;
private String user1;
private String modifier;
private ServiceUser user;
private ServiceUser userSelected;
private ServiceIncrementation incrementationSelected;
private List<ServicehistoriqueConnection> listeHistCnx = new ArrayList<>();
private List<ServiceHistoriqueManipulation> listehistManipulation = new ArrayList<>();
private List<ServiceGroupe> listeGroups;
private ServiceMember member;
@Autowired
public TransactionService service;
@Autowired
public UtilContext context;
@PostConstruct
public void init() {
System.out.println("//--------------init()FormUserBean ");
user = context.getCurrentUser();
listeGroups = service.getAllGroups();
if (modifier != null) {
if (modifier.equals("true")) {
canEdit = true;
}
}
System.out.println("Utilisateur" + user1);
if (user1 != null) {
userSelected = service.getUserById(user1);
member = service.getGroupByUser(userSelected);
System.out.println("Utilisateur" + userSelected);
listeHistCnx = service.getListHistoriqueConnectionByUsers(userSelected);
listehistManipulation = service.getListHistoriqueManipulationByUsersByEntreprise(userSelected);
} else {
if (canEdit) {
isNew = true;
}
incrementationSelected = new ServiceIncrementation();
userSelected = new ServiceUser();
member = new ServiceMember();
}
}
public ServiceGroupe getGroupeOfUser(ServiceUser user) {
member = service.getGroupByUser(user);
return member.getFkGroupe();
}
public String saveUser() {
service.saveUser(userSelected);
member.setFkUser(userSelected);
service.saveMembership(member);
return voirUser();
}
public String voirUser() {
if (!isNew) {
if (!canEdit) {
return "list.xhtml?faces-redirect=true";
} else {
return "form.xhtml?faces-redirect=true&user1=" + userSelected.getUserid();
}
} else {
return "list.xhtml?faces-redirect=true";
}
}
public String editUser() {
return "form.xhtml?faces-redirect=true&canEdit=true&user1=" + userSelected.getUserid();
}
public boolean isCanEdit() {
return canEdit;
}
public void setCanEdit(boolean canEdit) {
this.canEdit = canEdit;
}
public boolean isIsNew() {
return isNew;
}
public void setIsNew(boolean isNew) {
this.isNew = isNew;
}
public String getUser1() {
return user1;
}
public void setUser1(String user1) {
this.user1 = user1;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public ServiceUser getUser() {
return user;
}
public void setUser(ServiceUser user) {
this.user = user;
}
public ServiceUser getUserSelected() {
return userSelected;
}
public void setUserSelected(ServiceUser userSelected) {
this.userSelected = userSelected;
}
public ServiceIncrementation getIncrementationSelected() {
return incrementationSelected;
}
public void setIncrementationSelected(ServiceIncrementation incrementationSelected) {
this.incrementationSelected = incrementationSelected;
}
public List<ServicehistoriqueConnection> getListeHistCnx() {
return listeHistCnx;
}
public void setListeHistCnx(List<ServicehistoriqueConnection> listeHistCnx) {
this.listeHistCnx = listeHistCnx;
}
public List<ServiceHistoriqueManipulation> getListehistManipulation() {
return listehistManipulation;
}
public void setListehistManipulation(List<ServiceHistoriqueManipulation> listehistManipulation) {
this.listehistManipulation = listehistManipulation;
}
public List<ServiceGroupe> getListeGroups() {
return listeGroups;
}
public void setListeGroups(List<ServiceGroupe> listeGroups) {
this.listeGroups = listeGroups;
}
public ServiceMember getMember() {
return member;
}
public void setMember(ServiceMember member) {
this.member = member;
}
}

View File

@ -0,0 +1,85 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author Asma
*/
@Component("groupBean")
@Scope("view")
public class GroupBean {
private ServiceUser user;
private ServiceGroupe groupeSelected;
private List<ServiceFonctionnaliter> listeFonctionnalite;
private List<ServiceGroupe> listeGroupe;
@Autowired
public TransactionService service;
@Autowired
public UtilContext context;
@PostConstruct
public void init() {
System.out.println("//--------------init()GroupBean ");
user = context.getCurrentUser();
listeGroupe = service.getAllGroups();
listeFonctionnalite = service.getAllFonctionalite();
}
public String ajouterGroupe() {
return "form.xhtml?faces-redirect=true&canEdit=true";
}
public String voirGroupe(ServiceGroupe groupe) {
return "form.xhtml?faces-redirect=true&groupe=" + groupe.getId();
}
public ServiceUser getUser() {
return user;
}
public void setUser(ServiceUser user) {
this.user = user;
}
public ServiceGroupe getGroupeSelected() {
return groupeSelected;
}
public void setGroupeSelected(ServiceGroupe groupeSelected) {
this.groupeSelected = groupeSelected;
}
public List<ServiceFonctionnaliter> getListeFonctionnalite() {
return listeFonctionnalite;
}
public void setListeFonctionnalite(List<ServiceFonctionnaliter> listeFonctionnalite) {
this.listeFonctionnalite = listeFonctionnalite;
}
public List<ServiceGroupe> getListeGroupe() {
return listeGroupe;
}
public void setListeGroupe(List<ServiceGroupe> listeGroupe) {
this.listeGroupe = listeGroupe;
}
}

View File

@ -0,0 +1,160 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.bean;
import java.io.IOException;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.web.WebAttributes;
import org.springframework.stereotype.Component;
/**
*
* @author abdrrahim.touaibia
*/
@Component("loginBean")
@Scope("session")
public class LoginBean implements PhaseListener {
public LoginBean(){
}
private Logger logger = LoggerFactory.getLogger(LoginBean.class);
private String user;
private String pw;
/**
*
* Redirects the login request directly to spring security check. Leave this
* method as it is to properly support spring security.
*
* @return
* @throws ServletException
* @throws IOException
*/
public String doLogin() throws ServletException, IOException {
System.out.println("--------------------------- doLogin -------------------------");
logger.error("//log--------------------------- doLogin -------------------------");
logger.info("//log--------------------------- doLogin -------------------------");
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())
.getRequestDispatcher("/j_spring_security_check");
dispatcher.forward((ServletRequest) context.getRequest(),
(ServletResponse) context.getResponse());
FacesContext.getCurrentInstance().responseComplete();
return null;
}
public String doLogout() throws ServletException, IOException {
System.out.println("--------------------------- doLogout -------------------------");
logger.error("//log--------------------------- doLogout -------------------------");
logger.info("//log--------------------------- doLogout -------------------------");
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())
.getRequestDispatcher("/j_spring_security_logout");
dispatcher.forward((ServletRequest) context.getRequest(),
(ServletResponse) context.getResponse());
FacesContext.getCurrentInstance().responseComplete();
return null;
}
@Override
public void afterPhase(PhaseEvent event) {
System.out.println("--------------------------- afterPhase -------------------------");
logger.error("//log--------------------------- afterPhase -------------------------");
logger.info("//log--------------------------- afterPhase -------------------------");
}
/* (non-Javadoc)
* @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
*
* Do something before rendering phase.
*/
@Override
public void beforePhase(PhaseEvent event) {
System.out.println("--------------------------- beforePhase -------------------------");
logger.error("//log--------------------------- beforePhase -------------------------");
logger.info("//log--------------------------- beforePhase -------------------------");
Exception e = (Exception) FacesContext.getCurrentInstance().
getExternalContext().getSessionMap().get(WebAttributes.AUTHENTICATION_EXCEPTION);
if (e instanceof BadCredentialsException) {
// logger.debug("Found exception in session map: "+e);
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(
WebAttributes.AUTHENTICATION_EXCEPTION, null);
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Username or password not valid.", "Username or password not valid"));
}
}
/* (non-Javadoc)
* @see javax.faces.event.PhaseListener#getPhaseId()
*
* In which phase you want to interfere?
*/
@Override
public PhaseId getPhaseId() {
System.out.println("--------------------------- getPhaseId -------------------------");
logger.error("//log--------------------------- getPhaseId -------------------------");
logger.info("//log--------------------------- getPhaseId -------------------------");
return PhaseId.RENDER_RESPONSE;
}
public void updateMessages(boolean update) throws Exception {
System.out.println("--------------------------- updateMessages -------------------------");
logger.error("//log--------------------------- updateMessages -------------------------");
logger.info("//log--------------------------- updateMessages -------------------------");
Exception ex = (Exception) FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
.get(WebAttributes.AUTHENTICATION_EXCEPTION);
if (ex != null) {
logger.error("Authentication Failed! ", ex);
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_ERROR, ex.getMessage(), ex.getMessage()));
}
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getPw() {
return pw;
}
public void setPw(String pw) {
this.pw = pw;
}
}

View File

@ -0,0 +1,72 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author Asma
*/
@Component("userBean")
@Scope("view")
public class UserBean {
private ServiceUser user;
private ServiceUser userSelected;
private List<ServiceUser> listeUser;
@Autowired
public TransactionService service;
@Autowired
public UtilContext context;
public void init() {
System.out.println("//--------------init()ClientBean ");
user = context.getCurrentUser();
listeUser = service.getAllUsers();
System.out.println("listeClient: "+listeUser);
}
public String ajouterUser() {
return "form.xhtml?faces-redirect=true&canEdit=true";
}
public String voirUser() {
return "form.xhtml?faces-redirect=true&user1=" + userSelected.getUserid();
}
public ServiceUser getUser() {
return user;
}
public void setUser(ServiceUser user) {
this.user = user;
}
public ServiceUser getUserSelected() {
return userSelected;
}
public void setUserSelected(ServiceUser userSelected) {
this.userSelected = userSelected;
}
public List<ServiceUser> getListeUser() {
return listeUser;
}
public void setListeUser(List<ServiceUser> listeUser) {
this.listeUser = listeUser;
}
}

View File

@ -0,0 +1,48 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean.converter;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.service.TransactionService;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* @author FORCE TECH
*/
@FacesConverter("etablissementConverter")
@Component
public class EtablissementConverter implements Converter{
@Autowired
protected transient TransactionService service;
@Override
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
try {
return service.getEtablissementById(value);
} catch (NumberFormatException e)
{
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Etablissement n'existe pas.");
}
return null;
}
@Override
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
if (object != null) {
return String.valueOf(((Etablissement) object).getIdEtabStock());
} else {
return null;
}
}
}

View File

@ -0,0 +1,47 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.bean.converter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.service.TransactionService;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* @author Asma
*/
@FacesConverter("groupeConverter")
@Component
public class GroupeConverter implements Converter{
@Autowired
protected transient TransactionService service;
@Override
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
try {
System.out.println("service "+ service);
return service.getGroupsById(value);
} catch (NumberFormatException e) {
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Entreprise n'existe pas.");
}
return null;
}
@Override
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
if (object != null) {
return String.valueOf(((ServiceGroupe) object).getId());
} else {
return null;
}
}
}

View File

@ -0,0 +1,135 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "agence", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Agence.findAll", query = "SELECT a FROM Agence a"),
@NamedQuery(name = "Agence.findById", query = "SELECT a FROM Agence a WHERE a.id = :id"),
@NamedQuery(name = "Agence.findByCode", query = "SELECT a FROM Agence a WHERE a.code = :code"),
@NamedQuery(name = "Agence.findByDesignation", query = "SELECT a FROM Agence a WHERE a.designation = :designation")})
public class Agence implements Serializable {
@Size(max = 10)
@Column(name = "code")
private String code;
@Size(max = 50)
@Column(name = "designation")
private String designation;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@JoinColumn(name = "fk_banque", referencedColumnName = "id")
@ManyToOne
private Banque fkBanque;
@OneToMany(mappedBy = "fkAgence")
private List<Tresorie> tresorieList;
public Agence() {
}
public Agence(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Banque getFkBanque() {
return fkBanque;
}
public void setFkBanque(Banque fkBanque) {
this.fkBanque = fkBanque;
}
@XmlTransient
public List<Tresorie> getTresorieList() {
return tresorieList;
}
public void setTresorieList(List<Tresorie> tresorieList) {
this.tresorieList = tresorieList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Agence)) {
return false;
}
Agence other = (Agence) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Agence[ id=" + id + " ]";
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
}

View File

@ -0,0 +1,157 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "alerte")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Alerte.findAll", query = "SELECT a FROM Alerte a"),
@NamedQuery(name = "Alerte.findById", query = "SELECT a FROM Alerte a WHERE a.id = :id"),
@NamedQuery(name = "Alerte.findByReference", query = "SELECT a FROM Alerte a WHERE a.reference = :reference"),
@NamedQuery(name = "Alerte.findByMontant", query = "SELECT a FROM Alerte a WHERE a.montant = :montant"),
@NamedQuery(name = "Alerte.findByDate", query = "SELECT a FROM Alerte a WHERE a.date = :date"),
@NamedQuery(name = "Alerte.findByObservation", query = "SELECT a FROM Alerte a WHERE a.observation = :observation")})
public class Alerte implements Serializable {
@Size(max = 50)
@Column(name = "reference")
private String reference;
@Size(max = 255)
@Column(name = "observation")
private String observation;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "montant")
private Double montant;
@Column(name = "date")
@Temporal(TemporalType.DATE)
private Date date;
@JoinColumn(name = "fk_mouvement", referencedColumnName = "id")
@ManyToOne
private Mouvement fkMouvement;
@JoinColumn(name = "fk_type_mouvement", referencedColumnName = "id")
@ManyToOne
private TypeMouvement fkTypeMouvement;
public Alerte() {
}
public Alerte(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getMontant() {
return montant;
}
public void setMontant(Double montant) {
this.montant = montant;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Mouvement getFkMouvement() {
return fkMouvement;
}
public void setFkMouvement(Mouvement fkMouvement) {
this.fkMouvement = fkMouvement;
}
public TypeMouvement getFkTypeMouvement() {
return fkTypeMouvement;
}
public void setFkTypeMouvement(TypeMouvement fkTypeMouvement) {
this.fkTypeMouvement = fkTypeMouvement;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Alerte)) {
return false;
}
Alerte other = (Alerte) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Alerte[ id=" + id + " ]";
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getObservation() {
return observation;
}
public void setObservation(String observation) {
this.observation = observation;
}
}

View File

@ -0,0 +1,153 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "annee_fiscale")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "AnneeFiscale.findAll", query = "SELECT a FROM AnneeFiscale a"),
@NamedQuery(name = "AnneeFiscale.findByAnnee", query = "SELECT a FROM AnneeFiscale a WHERE a.annee = :annee"),
@NamedQuery(name = "AnneeFiscale.findByCloture", query = "SELECT a FROM AnneeFiscale a WHERE a.cloture = :cloture"),
@NamedQuery(name = "AnneeFiscale.findByActif", query = "SELECT a FROM AnneeFiscale a WHERE a.actif = :actif"),
@NamedQuery(name = "AnneeFiscale.findByCodeLetterage", query = "SELECT a FROM AnneeFiscale a WHERE a.codeLetterage = :codeLetterage")})
public class AnneeFiscale implements Serializable {
@Size(max = 255)
@Column(name = "code_letterage")
private String codeLetterage;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "annee")
private Integer annee;
@Column(name = "cloture")
private Boolean cloture;
@Column(name = "actif")
private Boolean actif;
@JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
@OneToMany(mappedBy = "fkAnneeFiscale")
private List<MouvementTier> mouvementTierList;
@OneToMany(mappedBy = "fkAnneeFiscale")
private List<Mouvement> mouvementList;
public AnneeFiscale() {
}
public AnneeFiscale(Integer annee) {
this.annee = annee;
}
public Integer getAnnee() {
return annee;
}
public void setAnnee(Integer annee) {
this.annee = annee;
}
public Boolean getCloture() {
return cloture;
}
public void setCloture(Boolean cloture) {
this.cloture = cloture;
}
public Boolean getActif() {
return actif;
}
public void setActif(Boolean actif) {
this.actif = actif;
}
public String getCodeLetterage() {
return codeLetterage;
}
public void setCodeLetterage(String codeLetterage) {
this.codeLetterage = codeLetterage;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
@XmlTransient
public List<MouvementTier> getMouvementTierList() {
return mouvementTierList;
}
public void setMouvementTierList(List<MouvementTier> mouvementTierList) {
this.mouvementTierList = mouvementTierList;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (annee != null ? annee.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof AnneeFiscale)) {
return false;
}
AnneeFiscale other = (AnneeFiscale) object;
if ((this.annee == null && other.annee != null) || (this.annee != null && !this.annee.equals(other.annee))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.AnneeFiscale[ annee=" + annee + " ]";
}
}

View File

@ -0,0 +1,130 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "banque")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Banque.findAll", query = "SELECT b FROM Banque b"),
@NamedQuery(name = "Banque.findById", query = "SELECT b FROM Banque b WHERE b.id = :id"),
@NamedQuery(name = "Banque.findByNom", query = "SELECT b FROM Banque b WHERE b.nom = :nom"),
@NamedQuery(name = "Banque.findByAbreviation", query = "SELECT b FROM Banque b WHERE b.abreviation = :abreviation")})
public class Banque implements Serializable {
@Size(max = 50)
@Column(name = "nom")
private String nom;
@Size(max = 10)
@Column(name = "abreviation")
private String abreviation;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@OneToMany(mappedBy = "fkBanque")
private List<Agence> agenceList;
@OneToMany(mappedBy = "fkBanque")
private List<CompteComptable> compteComptableList;
public Banque() {
}
public Banque(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlTransient
public List<Agence> getAgenceList() {
return agenceList;
}
public void setAgenceList(List<Agence> agenceList) {
this.agenceList = agenceList;
}
@XmlTransient
public List<CompteComptable> getCompteComptableList() {
return compteComptableList;
}
public void setCompteComptableList(List<CompteComptable> compteComptableList) {
this.compteComptableList = compteComptableList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Banque)) {
return false;
}
Banque other = (Banque) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Banque_1[ id=" + id + " ]";
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getAbreviation() {
return abreviation;
}
public void setAbreviation(String abreviation) {
this.abreviation = abreviation;
}
}

View File

@ -0,0 +1,159 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "cheque")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Cheque.findAll", query = "SELECT c FROM Cheque c"),
@NamedQuery(name = "Cheque.findById", query = "SELECT c FROM Cheque c WHERE c.id = :id"),
@NamedQuery(name = "Cheque.findByReference", query = "SELECT c FROM Cheque c WHERE c.reference = :reference"),
@NamedQuery(name = "Cheque.findByMontant", query = "SELECT c FROM Cheque c WHERE c.montant = :montant"),
@NamedQuery(name = "Cheque.findByDateEmission", query = "SELECT c FROM Cheque c WHERE c.dateEmission = :dateEmission"),
@NamedQuery(name = "Cheque.findByDateRemise", query = "SELECT c FROM Cheque c WHERE c.dateRemise = :dateRemise")})
public class Cheque implements Serializable {
@Size(max = 50)
@Column(name = "reference")
private String reference;
@Column(name = "date_remise")
@Temporal(TemporalType.DATE)
private Date dateRemise;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "montant")
private Double montant;
@Column(name = "date_emission")
@Temporal(TemporalType.DATE)
private Date dateEmission;
@JoinColumn(name = "fk_chequier", referencedColumnName = "id")
@ManyToOne
private Chequier fkChequier;
@OneToMany(mappedBy = "fkCheque")
private List<Mouvement> mouvementList;
public Cheque() {
}
public Cheque(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getMontant() {
return montant;
}
public void setMontant(Double montant) {
this.montant = montant;
}
public Date getDateEmission() {
return dateEmission;
}
public void setDateEmission(Date dateEmission) {
this.dateEmission = dateEmission;
}
public Date getDateRemise() {
return dateRemise;
}
public void setDateRemise(Date dateRemise) {
this.dateRemise = dateRemise;
}
public Chequier getFkChequier() {
return fkChequier;
}
public void setFkChequier(Chequier fkChequier) {
this.fkChequier = fkChequier;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Cheque)) {
return false;
}
Cheque other = (Cheque) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Cheque[ id=" + id + " ]";
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}

View File

@ -0,0 +1,146 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "chequier")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Chequier.findAll", query = "SELECT c FROM Chequier c"),
@NamedQuery(name = "Chequier.findById", query = "SELECT c FROM Chequier c WHERE c.id = :id"),
@NamedQuery(name = "Chequier.findBySerie", query = "SELECT c FROM Chequier c WHERE c.serie = :serie"),
@NamedQuery(name = "Chequier.findByRefInitiale", query = "SELECT c FROM Chequier c WHERE c.refInitiale = :refInitiale"),
@NamedQuery(name = "Chequier.findByRefFinale", query = "SELECT c FROM Chequier c WHERE c.refFinale = :refFinale")})
public class Chequier implements Serializable {
@Size(max = 10)
@Column(name = "serie")
private String serie;
@Size(max = 10)
@Column(name = "ref_initiale")
private String refInitiale;
@Size(max = 10)
@Column(name = "ref_finale")
private String refFinale;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@JoinColumn(name = "fk_tresorie", referencedColumnName = "id")
@ManyToOne
private Tresorie fkTresorie;
@OneToMany(mappedBy = "fkChequier")
private List<Cheque> chequeList;
public Chequier() {
}
public Chequier(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRefInitiale() {
return refInitiale;
}
public void setRefInitiale(String refInitiale) {
this.refInitiale = refInitiale;
}
public String getRefFinale() {
return refFinale;
}
public void setRefFinale(String refFinale) {
this.refFinale = refFinale;
}
public Tresorie getFkTresorie() {
return fkTresorie;
}
public void setFkTresorie(Tresorie fkTresorie) {
this.fkTresorie = fkTresorie;
}
@XmlTransient
public List<Cheque> getChequeList() {
return chequeList;
}
public void setChequeList(List<Cheque> chequeList) {
this.chequeList = chequeList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Chequier)) {
return false;
}
Chequier other = (Chequier) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Chequier[ id=" + id + " ]";
}
public String getSerie() {
return serie;
}
public void setSerie(String serie) {
this.serie = serie;
}
}

View File

@ -0,0 +1,93 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "class")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Class.findAll", query = "SELECT c FROM Class c"),
@NamedQuery(name = "Class.findById", query = "SELECT c FROM Class c WHERE c.id = :id"),
@NamedQuery(name = "Class.findByCode", query = "SELECT c FROM Class c WHERE c.code = :code")})
public class Class implements Serializable {
@Size(max = 5)
@Column(name = "code")
private String code;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
public Class() {
}
public Class(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Class)) {
return false;
}
Class other = (Class) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Class[ id=" + id + " ]";
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,153 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "compte_comptable", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "CompteComptable.findAll", query = "SELECT c FROM CompteComptable c"),
@NamedQuery(name = "CompteComptable.findById", query = "SELECT c FROM CompteComptable c WHERE c.id = :id"),
@NamedQuery(name = "CompteComptable.findByCode", query = "SELECT c FROM CompteComptable c WHERE c.code = :code"),
@NamedQuery(name = "CompteComptable.findByNumCompteComptable", query = "SELECT c FROM CompteComptable c WHERE c.numCompteComptable = :numCompteComptable"),
@NamedQuery(name = "CompteComptable.findByAccepterTier", query = "SELECT c FROM CompteComptable c WHERE c.accepterTier = :accepterTier")})
public class CompteComptable implements Serializable {
@Size(max = 255)
@Column(name = "code")
private String code;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "num_compte_comptable")
private Integer numCompteComptable;
@Column(name = "accepter_tier")
private Boolean accepterTier;
@OneToMany(mappedBy = "fkCompteComptable")
private List<Tier> tierList;
@JoinColumn(name = "fk_banque", referencedColumnName = "id")
@ManyToOne
private Banque fkBanque;
@OneToMany(mappedBy = "fkCompteComptable")
private List<Tresorie> tresorieList;
public CompteComptable() {
}
public CompteComptable(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getNumCompteComptable() {
return numCompteComptable;
}
public void setNumCompteComptable(Integer numCompteComptable) {
this.numCompteComptable = numCompteComptable;
}
public Boolean getAccepterTier() {
return accepterTier;
}
public void setAccepterTier(Boolean accepterTier) {
this.accepterTier = accepterTier;
}
@XmlTransient
public List<Tier> getTierList() {
return tierList;
}
public void setTierList(List<Tier> tierList) {
this.tierList = tierList;
}
public Banque getFkBanque() {
return fkBanque;
}
public void setFkBanque(Banque fkBanque) {
this.fkBanque = fkBanque;
}
@XmlTransient
public List<Tresorie> getTresorieList() {
return tresorieList;
}
public void setTresorieList(List<Tresorie> tresorieList) {
this.tresorieList = tresorieList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompteComptable)) {
return false;
}
CompteComptable other = (CompteComptable) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.CompteComptable[ id=" + id + " ]";
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,130 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "controle_tresorie")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ControleTresorie.findAll", query = "SELECT c FROM ControleTresorie c"),
@NamedQuery(name = "ControleTresorie.findById", query = "SELECT c FROM ControleTresorie c WHERE c.id = :id"),
@NamedQuery(name = "ControleTresorie.findByDateControle", query = "SELECT c FROM ControleTresorie c WHERE c.dateControle = :dateControle"),
@NamedQuery(name = "ControleTresorie.findByHeure", query = "SELECT c FROM ControleTresorie c WHERE c.heure = :heure"),
@NamedQuery(name = "ControleTresorie.findByMontant", query = "SELECT c FROM ControleTresorie c WHERE c.montant = :montant")})
public class ControleTresorie implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "date_controle")
@Temporal(TemporalType.DATE)
private Date dateControle;
@Column(name = "heure")
@Temporal(TemporalType.TIME)
private Date heure;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "montant")
private Double montant;
@JoinColumn(name = "fk_tresorie", referencedColumnName = "id")
@ManyToOne
private Tresorie fkTresorie;
public ControleTresorie() {
}
public ControleTresorie(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getDateControle() {
return dateControle;
}
public void setDateControle(Date dateControle) {
this.dateControle = dateControle;
}
public Date getHeure() {
return heure;
}
public void setHeure(Date heure) {
this.heure = heure;
}
public Double getMontant() {
return montant;
}
public void setMontant(Double montant) {
this.montant = montant;
}
public Tresorie getFkTresorie() {
return fkTresorie;
}
public void setFkTresorie(Tresorie fkTresorie) {
this.fkTresorie = fkTresorie;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ControleTresorie)) {
return false;
}
ControleTresorie other = (ControleTresorie) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ControleTresorie[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,171 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "etablissement", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Etablissement.findAll", query = "SELECT e FROM Etablissement e"),
@NamedQuery(name = "Etablissement.findByIdEtabStock", query = "SELECT e FROM Etablissement e WHERE e.idEtabStock = :idEtabStock"),
@NamedQuery(name = "Etablissement.findByNom", query = "SELECT e FROM Etablissement e WHERE e.nom = :nom"),
@NamedQuery(name = "Etablissement.findByActif", query = "SELECT e FROM Etablissement e WHERE e.actif = :actif")})
public class Etablissement implements Serializable {
@Size(max = 50)
@Column(name = "nom")
private String nom;
@Size(max = 5)
@Column(name = "actif")
private String actif;
@Id()
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "id_etab_stock")
private String idEtabStock;
@OneToMany(mappedBy = "fkEtablissement")
private List<Tier> tierList;
@OneToMany(mappedBy = "fkEtablissement")
private List<AnneeFiscale> anneeFiscaleList;
@OneToMany(mappedBy = "fkEtablissement")
private List<ServiceEtablissementUser> serviceEtablissementUserList;
@OneToMany(mappedBy = "fkEtablissement")
private List<ServicehistoriqueConnection> servicehistoriqueConnectionList;
private static final long serialVersionUID = 1L;
@OneToMany(mappedBy = "fkEtablissement")
private List<Tresorie> tresorieList;
public Etablissement() {
}
public Etablissement(String idEtabStock) {
this.idEtabStock = idEtabStock;
}
public String getIdEtabStock() {
return idEtabStock;
}
public void setIdEtabStock(String idEtabStock) {
this.idEtabStock = idEtabStock;
}
@XmlTransient
public List<Tier> getTierList() {
return tierList;
}
public void setTierList(List<Tier> tierList) {
this.tierList = tierList;
}
@XmlTransient
public List<AnneeFiscale> getAnneeFiscaleList() {
return anneeFiscaleList;
}
public void setAnneeFiscaleList(List<AnneeFiscale> anneeFiscaleList) {
this.anneeFiscaleList = anneeFiscaleList;
}
@XmlTransient
public List<Tresorie> getTresorieList() {
return tresorieList;
}
public void setTresorieList(List<Tresorie> tresorieList) {
this.tresorieList = tresorieList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idEtabStock != null ? idEtabStock.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Etablissement)) {
return false;
}
Etablissement other = (Etablissement) object;
if ((this.idEtabStock == null && other.idEtabStock != null) || (this.idEtabStock != null && !this.idEtabStock.equals(other.idEtabStock))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Etablissement[ idEtabStock=" + idEtabStock + " ]";
}
@XmlTransient
public List<ServiceEtablissementUser> getServiceEtablissementUserList() {
return serviceEtablissementUserList;
}
public void setServiceEtablissementUserList(List<ServiceEtablissementUser> serviceEtablissementUserList) {
this.serviceEtablissementUserList = serviceEtablissementUserList;
}
@XmlTransient
public List<ServicehistoriqueConnection> getServicehistoriqueConnectionList() {
return servicehistoriqueConnectionList;
}
public void setServicehistoriqueConnectionList(List<ServicehistoriqueConnection> servicehistoriqueConnectionList) {
this.servicehistoriqueConnectionList = servicehistoriqueConnectionList;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getActif() {
return actif;
}
public void setActif(String actif) {
this.actif = actif;
}
}

View File

@ -0,0 +1,299 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "mouvement")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Mouvement.findAll", query = "SELECT m FROM Mouvement m"),
@NamedQuery(name = "Mouvement.findById", query = "SELECT m FROM Mouvement m WHERE m.id = :id"),
@NamedQuery(name = "Mouvement.findByReference", query = "SELECT m FROM Mouvement m WHERE m.reference = :reference"),
@NamedQuery(name = "Mouvement.findByMontant", query = "SELECT m FROM Mouvement m WHERE m.montant = :montant"),
@NamedQuery(name = "Mouvement.findByDate", query = "SELECT m FROM Mouvement m WHERE m.date = :date"),
@NamedQuery(name = "Mouvement.findByDesignation", query = "SELECT m FROM Mouvement m WHERE m.designation = :designation"),
@NamedQuery(name = "Mouvement.findByBeneficier", query = "SELECT m FROM Mouvement m WHERE m.beneficier = :beneficier"),
@NamedQuery(name = "Mouvement.findByIsDeleted", query = "SELECT m FROM Mouvement m WHERE m.isDeleted = :isDeleted"),
@NamedQuery(name = "Mouvement.findByStockId", query = "SELECT m FROM Mouvement m WHERE m.stockId = :stockId"),
@NamedQuery(name = "Mouvement.findByHeure", query = "SELECT m FROM Mouvement m WHERE m.heure = :heure")})
public class Mouvement implements Serializable {
@Size(max = 50)
@Column(name = "reference")
private String reference;
@Size(max = 50)
@Column(name = "designation")
private String designation;
@Size(max = 50)
@Column(name = "beneficier")
private String beneficier;
@Size(max = 5)
@Column(name = "is_deleted")
private String isDeleted;
@Size(max = 50)
@Column(name = "stock_id")
private String stockId;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "montant")
private Double montant;
@Column(name = "date")
@Temporal(TemporalType.DATE)
private Date date;
@Column(name = "heure")
@Temporal(TemporalType.TIME)
private Date heure;
@OneToMany(mappedBy = "fkMouvement")
private List<Alerte> alerteList;
@JoinColumn(name = "fk_annee_fiscale", referencedColumnName = "annee")
@ManyToOne
private AnneeFiscale fkAnneeFiscale;
@JoinColumn(name = "fk_cheque", referencedColumnName = "id")
@ManyToOne
private Cheque fkCheque;
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkUser;
@JoinColumn(name = "fk_sort", referencedColumnName = "id")
@ManyToOne
private Sort fkSort;
@JoinColumn(name = "fk_type_destinataire", referencedColumnName = "id")
@ManyToOne
private StockTypeDestinataire fkTypeDestinataire;
@JoinColumn(name = "fk_tier", referencedColumnName = "id")
@ManyToOne
private Tier fkTier;
@JoinColumn(name = "fk_tresorie_source", referencedColumnName = "id")
@ManyToOne
private Tresorie fkTresorieSource;
@JoinColumn(name = "fk_tresorie_destinataire", referencedColumnName = "id")
@ManyToOne
private Tresorie fkTresorieDestinataire;
@JoinColumn(name = "fk_type_mouvement", referencedColumnName = "id")
@ManyToOne
private TypeMouvement fkTypeMouvement;
public Mouvement() {
}
public Mouvement(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getMontant() {
return montant;
}
public void setMontant(Double montant) {
this.montant = montant;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public String getStockId() {
return stockId;
}
public void setStockId(String stockId) {
this.stockId = stockId;
}
public Date getHeure() {
return heure;
}
public void setHeure(Date heure) {
this.heure = heure;
}
@XmlTransient
public List<Alerte> getAlerteList() {
return alerteList;
}
public void setAlerteList(List<Alerte> alerteList) {
this.alerteList = alerteList;
}
public AnneeFiscale getFkAnneeFiscale() {
return fkAnneeFiscale;
}
public void setFkAnneeFiscale(AnneeFiscale fkAnneeFiscale) {
this.fkAnneeFiscale = fkAnneeFiscale;
}
public Cheque getFkCheque() {
return fkCheque;
}
public void setFkCheque(Cheque fkCheque) {
this.fkCheque = fkCheque;
}
public ServiceUser getFkUser() {
return fkUser;
}
public void setFkUser(ServiceUser fkUser) {
this.fkUser = fkUser;
}
public Sort getFkSort() {
return fkSort;
}
public void setFkSort(Sort fkSort) {
this.fkSort = fkSort;
}
public StockTypeDestinataire getFkTypeDestinataire() {
return fkTypeDestinataire;
}
public void setFkTypeDestinataire(StockTypeDestinataire fkTypeDestinataire) {
this.fkTypeDestinataire = fkTypeDestinataire;
}
public Tier getFkTier() {
return fkTier;
}
public void setFkTier(Tier fkTier) {
this.fkTier = fkTier;
}
public Tresorie getFkTresorieSource() {
return fkTresorieSource;
}
public void setFkTresorieSource(Tresorie fkTresorieSource) {
this.fkTresorieSource = fkTresorieSource;
}
public Tresorie getFkTresorieDestinataire() {
return fkTresorieDestinataire;
}
public void setFkTresorieDestinataire(Tresorie fkTresorieDestinataire) {
this.fkTresorieDestinataire = fkTresorieDestinataire;
}
public TypeMouvement getFkTypeMouvement() {
return fkTypeMouvement;
}
public void setFkTypeMouvement(TypeMouvement fkTypeMouvement) {
this.fkTypeMouvement = fkTypeMouvement;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Mouvement)) {
return false;
}
Mouvement other = (Mouvement) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Mouvement[ id=" + id + " ]";
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public String getBeneficier() {
return beneficier;
}
public void setBeneficier(String beneficier) {
this.beneficier = beneficier;
}
}

View File

@ -0,0 +1,182 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "mouvement_tier")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "MouvementTier.findAll", query = "SELECT m FROM MouvementTier m"),
@NamedQuery(name = "MouvementTier.findById", query = "SELECT m FROM MouvementTier m WHERE m.id = :id"),
@NamedQuery(name = "MouvementTier.findByReference", query = "SELECT m FROM MouvementTier m WHERE m.reference = :reference"),
@NamedQuery(name = "MouvementTier.findByMontant", query = "SELECT m FROM MouvementTier m WHERE m.montant = :montant"),
@NamedQuery(name = "MouvementTier.findByDate", query = "SELECT m FROM MouvementTier m WHERE m.date = :date"),
@NamedQuery(name = "MouvementTier.findByCodeLetterage", query = "SELECT m FROM MouvementTier m WHERE m.codeLetterage = :codeLetterage"),
@NamedQuery(name = "MouvementTier.findByHeure", query = "SELECT m FROM MouvementTier m WHERE m.heure = :heure")})
public class MouvementTier implements Serializable {
@Size(max = 50)
@Column(name = "reference")
private String reference;
@Size(max = 50)
@Column(name = "code_letterage")
private String codeLetterage;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "montant")
private Double montant;
@Column(name = "date")
@Temporal(TemporalType.DATE)
private Date date;
@Column(name = "heure")
@Temporal(TemporalType.TIME)
private Date heure;
@JoinColumn(name = "fk_annee_fiscale", referencedColumnName = "annee")
@ManyToOne
private AnneeFiscale fkAnneeFiscale;
@JoinColumn(name = "fk_tier", referencedColumnName = "id")
@ManyToOne
private Tier fkTier;
@JoinColumn(name = "fk_type_mouvement", referencedColumnName = "id")
@ManyToOne
private TypeMouvement fkTypeMouvement;
public MouvementTier() {
}
public MouvementTier(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getMontant() {
return montant;
}
public void setMontant(Double montant) {
this.montant = montant;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getCodeLetterage() {
return codeLetterage;
}
public void setCodeLetterage(String codeLetterage) {
this.codeLetterage = codeLetterage;
}
public Date getHeure() {
return heure;
}
public void setHeure(Date heure) {
this.heure = heure;
}
public AnneeFiscale getFkAnneeFiscale() {
return fkAnneeFiscale;
}
public void setFkAnneeFiscale(AnneeFiscale fkAnneeFiscale) {
this.fkAnneeFiscale = fkAnneeFiscale;
}
public Tier getFkTier() {
return fkTier;
}
public void setFkTier(Tier fkTier) {
this.fkTier = fkTier;
}
public TypeMouvement getFkTypeMouvement() {
return fkTypeMouvement;
}
public void setFkTypeMouvement(TypeMouvement fkTypeMouvement) {
this.fkTypeMouvement = fkTypeMouvement;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof MouvementTier)) {
return false;
}
MouvementTier other = (MouvementTier) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.MouvementTier[ id=" + id + " ]";
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}

View File

@ -0,0 +1,101 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_etablissement_user")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceEtablissementUser.findAll", query = "SELECT s FROM ServiceEtablissementUser s"),
@NamedQuery(name = "ServiceEtablissementUser.findById", query = "SELECT s FROM ServiceEtablissementUser s WHERE s.id = :id")})
public class ServiceEtablissementUser implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "id")
private Integer id;
@JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkUser;
public ServiceEtablissementUser() {
}
public ServiceEtablissementUser(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
public ServiceUser getFkUser() {
return fkUser;
}
public void setFkUser(ServiceUser fkUser) {
this.fkUser = fkUser;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceEtablissementUser)) {
return false;
}
ServiceEtablissementUser other = (ServiceEtablissementUser) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceEtablissementUser[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,160 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_fonctiongroupe")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceFonctiongroupe.findAll", query = "SELECT s FROM ServiceFonctiongroupe s"),
@NamedQuery(name = "ServiceFonctiongroupe.findById", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.id = :id"),
@NamedQuery(name = "ServiceFonctiongroupe.findByFkGroupe", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.fkGroupe = :fkGroupe"),
@NamedQuery(name = "ServiceFonctiongroupe.findByCanCreate", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.canCreate = :canCreate"),
@NamedQuery(name = "ServiceFonctiongroupe.findByCanUpdate", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.canUpdate = :canUpdate"),
@NamedQuery(name = "ServiceFonctiongroupe.findByCanUpdateDate", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.canUpdateDate = :canUpdateDate"),
@NamedQuery(name = "ServiceFonctiongroupe.findByCanDelete", query = "SELECT s FROM ServiceFonctiongroupe s WHERE s.canDelete = :canDelete")})
public class ServiceFonctiongroupe implements Serializable {
@Size(max = 5)
@Column(name = "can_create")
private String canCreate;
@Size(max = 5)
@Column(name = "can_update")
private String canUpdate;
@Size(max = 5)
@Column(name = "can_update_date")
private String canUpdateDate;
@Size(max = 5)
@Column(name = "can_delete")
private String canDelete;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@JoinColumn(name = "fk_groupe", referencedColumnName = "id")
@ManyToOne
private ServiceGroupe fkGroupe;
@JoinColumn(name = "fk_fonction", referencedColumnName = "id")
@ManyToOne
private ServiceFonctionnaliter fkFonction;
public ServiceFonctiongroupe() {
}
public ServiceFonctiongroupe(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public ServiceGroupe getFkGroupe() {
return fkGroupe;
}
public void setFkGroupe(ServiceGroupe fkGroupe) {
this.fkGroupe = fkGroupe;
}
public String getCanCreate() {
return canCreate;
}
public void setCanCreate(String canCreate) {
this.canCreate = canCreate;
}
public String getCanUpdate() {
return canUpdate;
}
public void setCanUpdate(String canUpdate) {
this.canUpdate = canUpdate;
}
public String getCanUpdateDate() {
return canUpdateDate;
}
public void setCanUpdateDate(String canUpdateDate) {
this.canUpdateDate = canUpdateDate;
}
public String getCanDelete() {
return canDelete;
}
public void setCanDelete(String canDelete) {
this.canDelete = canDelete;
}
public ServiceFonctionnaliter getFkFonction() {
return fkFonction;
}
public void setFkFonction(ServiceFonctionnaliter fkFonction) {
this.fkFonction = fkFonction;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceFonctiongroupe)) {
return false;
}
ServiceFonctiongroupe other = (ServiceFonctiongroupe) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceFonctiongroupe[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,107 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_fonctionnaliter")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceFonctionnaliter.findAll", query = "SELECT s FROM ServiceFonctionnaliter s"),
@NamedQuery(name = "ServiceFonctionnaliter.findById", query = "SELECT s FROM ServiceFonctionnaliter s WHERE s.id = :id"),
@NamedQuery(name = "ServiceFonctionnaliter.findByNom", query = "SELECT s FROM ServiceFonctionnaliter s WHERE s.nom = :nom")})
public class ServiceFonctionnaliter implements Serializable {
@Size(max = 2147483647)
@Column(name = "nom")
private String nom;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "id")
private String id;
@OneToMany(mappedBy = "fkFonction")
private List<ServiceFonctiongroupe> serviceFonctiongroupeList;
public ServiceFonctionnaliter() {
}
public ServiceFonctionnaliter(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@XmlTransient
public List<ServiceFonctiongroupe> getServiceFonctiongroupeList() {
return serviceFonctiongroupeList;
}
public void setServiceFonctiongroupeList(List<ServiceFonctiongroupe> serviceFonctiongroupeList) {
this.serviceFonctiongroupeList = serviceFonctiongroupeList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceFonctionnaliter)) {
return false;
}
ServiceFonctionnaliter other = (ServiceFonctionnaliter) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceFonctionnaliter[ id=" + id + " ]";
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
}

View File

@ -0,0 +1,129 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_groupe")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceGroupe.findAll", query = "SELECT s FROM ServiceGroupe s"),
@NamedQuery(name = "ServiceGroupe.findById", query = "SELECT s FROM ServiceGroupe s WHERE s.id = :id"),
@NamedQuery(name = "ServiceGroupe.findByNomGroupe", query = "SELECT s FROM ServiceGroupe s WHERE s.nomGroupe = :nomGroupe"),
@NamedQuery(name = "ServiceGroupe.findByActif", query = "SELECT s FROM ServiceGroupe s WHERE s.actif = :actif")})
public class ServiceGroupe implements Serializable {
@Size(max = 2147483647)
@Column(name = "nom_groupe")
private String nomGroupe;
@Size(max = 2147483647)
@Column(name = "actif")
private String actif;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "id")
private String id;
@JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
public ServiceGroupe() {
}
public ServiceGroupe(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getNomGroupe() {
return nomGroupe;
}
public void setNomGroupe(String nomGroupe) {
this.nomGroupe = nomGroupe;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceGroupe)) {
return false;
}
ServiceGroupe other = (ServiceGroupe) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceGroupe[ id=" + id + " ]";
}
public String getActif() {
return actif;
}
public void setActif(String actif) {
this.actif = actif;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
}

View File

@ -0,0 +1,177 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_historique_manipulation")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceHistoriqueManipulation.findAll", query = "SELECT s FROM ServiceHistoriqueManipulation s"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findById", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.id = :id"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByNomTable", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.nomTable = :nomTable"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByIdLigne", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.idLigne = :idLigne"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByTypeManipumation", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.typeManipumation = :typeManipumation"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByDateManipulation", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.dateManipulation = :dateManipulation"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByHeurManipulation", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.heurManipulation = :heurManipulation"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByOldValeur", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.oldValeur = :oldValeur"),
@NamedQuery(name = "ServiceHistoriqueManipulation.findByNewValeur", query = "SELECT s FROM ServiceHistoriqueManipulation s WHERE s.newValeur = :newValeur")})
public class ServiceHistoriqueManipulation implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "id")
private Long id;
@Size(max = 2147483647)
@Column(name = "nom_table")
private String nomTable;
@Size(max = 2147483647)
@Column(name = "id_ligne")
private String idLigne;
@Size(max = 2147483647)
@Column(name = "type_manipumation")
private String typeManipumation;
@Column(name = "date_manipulation")
@Temporal(TemporalType.DATE)
private Date dateManipulation;
@Column(name = "heur_manipulation")
@Temporal(TemporalType.TIME)
private Date heurManipulation;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "old_valeur")
private Float oldValeur;
@Column(name = "new_valeur")
private Float newValeur;
@JoinColumn(name = "fk_manipulateur", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkManipulateur;
public ServiceHistoriqueManipulation() {
}
public ServiceHistoriqueManipulation(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNomTable() {
return nomTable;
}
public void setNomTable(String nomTable) {
this.nomTable = nomTable;
}
public String getIdLigne() {
return idLigne;
}
public void setIdLigne(String idLigne) {
this.idLigne = idLigne;
}
public String getTypeManipumation() {
return typeManipumation;
}
public void setTypeManipumation(String typeManipumation) {
this.typeManipumation = typeManipumation;
}
public Date getDateManipulation() {
return dateManipulation;
}
public void setDateManipulation(Date dateManipulation) {
this.dateManipulation = dateManipulation;
}
public Date getHeurManipulation() {
return heurManipulation;
}
public void setHeurManipulation(Date heurManipulation) {
this.heurManipulation = heurManipulation;
}
public Float getOldValeur() {
return oldValeur;
}
public void setOldValeur(Float oldValeur) {
this.oldValeur = oldValeur;
}
public Float getNewValeur() {
return newValeur;
}
public void setNewValeur(Float newValeur) {
this.newValeur = newValeur;
}
public ServiceUser getFkManipulateur() {
return fkManipulateur;
}
public void setFkManipulateur(ServiceUser fkManipulateur) {
this.fkManipulateur = fkManipulateur;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceHistoriqueManipulation)) {
return false;
}
ServiceHistoriqueManipulation other = (ServiceHistoriqueManipulation) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceHistoriqueManipulation[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,152 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_incrementation")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceIncrementation.findAll", query = "SELECT s FROM ServiceIncrementation s"),
@NamedQuery(name = "ServiceIncrementation.findById", query = "SELECT s FROM ServiceIncrementation s WHERE s.id = :id"),
@NamedQuery(name = "ServiceIncrementation.findByCode", query = "SELECT s FROM ServiceIncrementation s WHERE s.code = :code"),
@NamedQuery(name = "ServiceIncrementation.findByDateMois", query = "SELECT s FROM ServiceIncrementation s WHERE s.dateMois = :dateMois"),
@NamedQuery(name = "ServiceIncrementation.findByIncrTelephone", query = "SELECT s FROM ServiceIncrementation s WHERE s.incrTelephone = :incrTelephone"),
@NamedQuery(name = "ServiceIncrementation.findByIncrClient", query = "SELECT s FROM ServiceIncrementation s WHERE s.incrClient = :incrClient"),
@NamedQuery(name = "ServiceIncrementation.findByIncrStage", query = "SELECT s FROM ServiceIncrementation s WHERE s.incrStage = :incrStage"),
@NamedQuery(name = "ServiceIncrementation.findByIncrGroups", query = "SELECT s FROM ServiceIncrementation s WHERE s.incrGroups = :incrGroups")})
public class ServiceIncrementation implements Serializable {
@Size(max = 50)
@Column(name = "code")
private String code;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "date_mois")
@Temporal(TemporalType.DATE)
private Date dateMois;
@Column(name = "incr_telephone")
private Integer incrTelephone;
@Column(name = "incr_client")
private Integer incrClient;
@Column(name = "incr_stage")
private Integer incrStage;
@Column(name = "incr_groups")
private Integer incrGroups;
public ServiceIncrementation() {
}
public ServiceIncrementation(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getDateMois() {
return dateMois;
}
public void setDateMois(Date dateMois) {
this.dateMois = dateMois;
}
public Integer getIncrTelephone() {
return incrTelephone;
}
public void setIncrTelephone(Integer incrTelephone) {
this.incrTelephone = incrTelephone;
}
public Integer getIncrClient() {
return incrClient;
}
public void setIncrClient(Integer incrClient) {
this.incrClient = incrClient;
}
public Integer getIncrStage() {
return incrStage;
}
public void setIncrStage(Integer incrStage) {
this.incrStage = incrStage;
}
public Integer getIncrGroups() {
return incrGroups;
}
public void setIncrGroups(Integer incrGroups) {
this.incrGroups = incrGroups;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceIncrementation)) {
return false;
}
ServiceIncrementation other = (ServiceIncrementation) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceIncrementation[ id=" + id + " ]";
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,111 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_member")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceMember.findAll", query = "SELECT s FROM ServiceMember s"),
@NamedQuery(name = "ServiceMember.findById", query = "SELECT s FROM ServiceMember s WHERE s.id = :id"),
@NamedQuery(name = "ServiceMember.findByFkGroupe", query = "SELECT s FROM ServiceMember s WHERE s.fkGroupe = :fkGroupe")})
public class ServiceMember implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Size(max = 50)
@JoinColumn(name = "fk_groupe", referencedColumnName = "id")
@ManyToOne
private ServiceGroupe fkGroupe;
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkUser;
public ServiceMember() {
}
public ServiceMember(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public ServiceGroupe getFkGroupe() {
return fkGroupe;
}
public void setFkGroupe(ServiceGroupe fkGroupe) {
this.fkGroupe = fkGroupe;
}
public ServiceUser getFkUser() {
return fkUser;
}
public void setFkUser(ServiceUser fkUser) {
this.fkUser = fkUser;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceMember)) {
return false;
}
ServiceMember other = (ServiceMember) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceMember[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,236 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Asma
*/
@Entity
@Table(name = "service_user")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceUser.findAll", query = "SELECT s FROM ServiceUser s"),
@NamedQuery(name = "ServiceUser.findByUserid", query = "SELECT s FROM ServiceUser s WHERE s.userid = :userid"),
@NamedQuery(name = "ServiceUser.findByUserpw", query = "SELECT s FROM ServiceUser s WHERE s.userpw = :userpw"),
@NamedQuery(name = "ServiceUser.findByNom", query = "SELECT s FROM ServiceUser s WHERE s.nom = :nom"),
@NamedQuery(name = "ServiceUser.findByPrenom", query = "SELECT s FROM ServiceUser s WHERE s.prenom = :prenom"),
@NamedQuery(name = "ServiceUser.findByTelephone", query = "SELECT s FROM ServiceUser s WHERE s.telephone = :telephone"),
@NamedQuery(name = "ServiceUser.findByMail", query = "SELECT s FROM ServiceUser s WHERE s.mail = :mail"),
@NamedQuery(name = "ServiceUser.findByActif", query = "SELECT s FROM ServiceUser s WHERE s.actif = :actif")})
public class ServiceUser implements Serializable {
@Size(max = 2147483647)
@Column(name = "userpw")
private String userpw;
@Size(max = 2147483647)
@Column(name = "nom")
private String nom;
@Size(max = 2147483647)
@Column(name = "prenom")
private String prenom;
@Size(max = 50)
@Column(name = "telephone")
private String telephone;
@Size(max = 2147483647)
@Column(name = "mail")
private String mail;
@Size(max = 2147483647)
@Column(name = "actif")
private String actif;
@Size(max = 5)
@Column(name = "forcermap")
private String forcermap;
@OneToMany(mappedBy = "fkManipulateur")
private List<ServiceHistoriqueManipulation> serviceHistoriqueManipulationList;
@OneToMany(mappedBy = "fkUser")
private List<ServiceMember> serviceMemberList;
@OneToMany(mappedBy = "fkUser")
private List<Mouvement> mouvementList;
@OneToMany(mappedBy = "fkUser")
private List<ServiceUserTresorie> serviceUserTresorieList;
@OneToMany(mappedBy = "fkUser")
private List<ServiceEtablissementUser> serviceEtablissementUserList;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2147483647)
@Column(name = "userid")
private String userid;
@OneToMany(mappedBy = "fkUser")
private List<ServicehistoriqueConnection> servicehistoriqueConnectionList;
public ServiceUser() {
}
public ServiceUser(String userid) {
this.userid = userid;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (userid != null ? userid.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceUser)) {
return false;
}
ServiceUser other = (ServiceUser) object;
if ((this.userid == null && other.userid != null) || (this.userid != null && !this.userid.equals(other.userid))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceUser[ userid=" + userid + " ]";
}
@XmlTransient
public List<ServiceMember> getServiceMemberList() {
return serviceMemberList;
}
public void setServiceMemberList(List<ServiceMember> serviceMemberList) {
this.serviceMemberList = serviceMemberList;
}
@XmlTransient
public List<ServicehistoriqueConnection> getServicehistoriqueConnectionList() {
return servicehistoriqueConnectionList;
}
public void setServicehistoriqueConnectionList(List<ServicehistoriqueConnection> servicehistoriqueConnectionList) {
this.servicehistoriqueConnectionList = servicehistoriqueConnectionList;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@XmlTransient
public List<ServiceUserTresorie> getServiceUserTresorieList() {
return serviceUserTresorieList;
}
public void setServiceUserTresorieList(List<ServiceUserTresorie> serviceUserTresorieList) {
this.serviceUserTresorieList = serviceUserTresorieList;
}
@XmlTransient
public List<ServiceEtablissementUser> getServiceEtablissementUserList() {
return serviceEtablissementUserList;
}
public void setServiceEtablissementUserList(List<ServiceEtablissementUser> serviceEtablissementUserList) {
this.serviceEtablissementUserList = serviceEtablissementUserList;
}
@XmlTransient
public List<ServiceHistoriqueManipulation> getServiceHistoriqueManipulationList() {
return serviceHistoriqueManipulationList;
}
public void setServiceHistoriqueManipulationList(List<ServiceHistoriqueManipulation> serviceHistoriqueManipulationList) {
this.serviceHistoriqueManipulationList = serviceHistoriqueManipulationList;
}
public String getUserpw() {
return userpw;
}
public void setUserpw(String userpw) {
this.userpw = userpw;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public String getActif() {
return actif;
}
public void setActif(String actif) {
this.actif = actif;
}
public String getForcermap() {
return forcermap;
}
public void setForcermap(String forcermap) {
this.forcermap = forcermap;
}
}

View File

@ -0,0 +1,101 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_user_tresorie")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceUserTresorie.findAll", query = "SELECT s FROM ServiceUserTresorie s"),
@NamedQuery(name = "ServiceUserTresorie.findById", query = "SELECT s FROM ServiceUserTresorie s WHERE s.id = :id")})
public class ServiceUserTresorie implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "id")
private Integer id;
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkUser;
@JoinColumn(name = "fk_tresorie", referencedColumnName = "id")
@ManyToOne
private Tresorie fkTresorie;
public ServiceUserTresorie() {
}
public ServiceUserTresorie(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public ServiceUser getFkUser() {
return fkUser;
}
public void setFkUser(ServiceUser fkUser) {
this.fkUser = fkUser;
}
public Tresorie getFkTresorie() {
return fkTresorie;
}
public void setFkTresorie(Tresorie fkTresorie) {
this.fkTresorie = fkTresorie;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceUserTresorie)) {
return false;
}
ServiceUserTresorie other = (ServiceUserTresorie) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceUserTresorie[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,94 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "service_wilaya")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServiceWilaya.findAll", query = "SELECT s FROM ServiceWilaya s"),
@NamedQuery(name = "ServiceWilaya.findByNomWilaya", query = "SELECT s FROM ServiceWilaya s WHERE s.nomWilaya = :nomWilaya"),
@NamedQuery(name = "ServiceWilaya.findById", query = "SELECT s FROM ServiceWilaya s WHERE s.id = :id")})
public class ServiceWilaya implements Serializable {
@Size(max = 2147483647)
@Column(name = "nom_wilaya")
private String nomWilaya;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 2)
@Column(name = "id")
private String id;
public ServiceWilaya() {
}
public ServiceWilaya(String id) {
this.id = id;
}
public String getNomWilaya() {
return nomWilaya;
}
public void setNomWilaya(String nomWilaya) {
this.nomWilaya = nomWilaya;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServiceWilaya)) {
return false;
}
ServiceWilaya other = (ServiceWilaya) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServiceWilaya[ id=" + id + " ]";
}
}

View File

@ -0,0 +1,149 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author PC
*/
@Entity
@Table(name = "service_historique_connection")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ServicehistoriqueConnection.findAll", query = "SELECT s FROM ServicehistoriqueConnection s"),
@NamedQuery(name = "ServicehistoriqueConnection.findById", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.id = :id"),
@NamedQuery(name = "ServicehistoriqueConnection.findByDate", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.date = :date"),
@NamedQuery(name = "ServicehistoriqueConnection.findByHeur", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.heur = :heur"),
@NamedQuery(name = "ServicehistoriqueConnection.findByAdresseIP", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.adresseIp = :adresseIp")})
public class ServicehistoriqueConnection implements Serializable {
@Size(max = 2147483647)
@Column(name = "adresse_ip")
private String adresseIp;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Long id;
@Column(name = "date")
@Temporal(TemporalType.DATE)
private Date date;
@Column(name = "heur")
@Temporal(TemporalType.TIME)
private Date heur;
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
@ManyToOne
private ServiceUser fkUser;
@JoinColumn(name = "fk_etablissemnt", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
public ServicehistoriqueConnection() {
}
public ServicehistoriqueConnection(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Date getHeur() {
return heur;
}
public void setHeur(Date heur) {
this.heur = heur;
}
public ServiceUser getFkUser() {
return fkUser;
}
public void setFkUser(ServiceUser fkUser) {
this.fkUser = fkUser;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ServicehistoriqueConnection)) {
return false;
}
ServicehistoriqueConnection other = (ServicehistoriqueConnection) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.ServicehistoriqueConnection[ id=" + id + " ]";
}
public String getAdresseIp() {
return adresseIp;
}
public void setAdresseIp(String adresseIp) {
this.adresseIp = adresseIp;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
}

View File

@ -0,0 +1,107 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "sort")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Sort.findAll", query = "SELECT s FROM Sort s"),
@NamedQuery(name = "Sort.findById", query = "SELECT s FROM Sort s WHERE s.id = :id"),
@NamedQuery(name = "Sort.findBySort", query = "SELECT s FROM Sort s WHERE s.sort = :sort")})
public class Sort implements Serializable {
@Size(max = 255)
@Column(name = "sort")
private String sort;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@OneToMany(mappedBy = "fkSort")
private List<Mouvement> mouvementList;
public Sort() {
}
public Sort(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Sort)) {
return false;
}
Sort other = (Sort) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Sort[ id=" + id + " ]";
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
}

View File

@ -0,0 +1,125 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "stock_type_destinataire")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "StockTypeDestinataire.findAll", query = "SELECT s FROM StockTypeDestinataire s"),
@NamedQuery(name = "StockTypeDestinataire.findById", query = "SELECT s FROM StockTypeDestinataire s WHERE s.id = :id"),
@NamedQuery(name = "StockTypeDestinataire.findByDesignation", query = "SELECT s FROM StockTypeDestinataire s WHERE s.designation = :designation"),
@NamedQuery(name = "StockTypeDestinataire.findByStockTypeDestinataire", query = "SELECT s FROM StockTypeDestinataire s WHERE s.stockTypeDestinataire = :stockTypeDestinataire")})
public class StockTypeDestinataire implements Serializable {
@Size(max = 50)
@Column(name = "designation")
private String designation;
@Size(max = 50)
@Column(name = "stock_type_destinataire")
private String stockTypeDestinataire;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@OneToMany(mappedBy = "fkTypeDestinataire")
private List<Mouvement> mouvementList;
public StockTypeDestinataire() {
}
public StockTypeDestinataire(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getStockTypeDestinataire() {
return stockTypeDestinataire;
}
public void setStockTypeDestinataire(String stockTypeDestinataire) {
this.stockTypeDestinataire = stockTypeDestinataire;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof StockTypeDestinataire)) {
return false;
}
StockTypeDestinataire other = (StockTypeDestinataire) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.StockTypeDestinataire[ id=" + id + " ]";
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
}

View File

@ -0,0 +1,356 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "tier")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Tier.findAll", query = "SELECT t FROM Tier t"),
@NamedQuery(name = "Tier.findById", query = "SELECT t FROM Tier t WHERE t.id = :id"),
@NamedQuery(name = "Tier.findByCode", query = "SELECT t FROM Tier t WHERE t.code = :code"),
@NamedQuery(name = "Tier.findByDesignation", query = "SELECT t FROM Tier t WHERE t.designation = :designation"),
@NamedQuery(name = "Tier.findByAddresse", query = "SELECT t FROM Tier t WHERE t.addresse = :addresse"),
@NamedQuery(name = "Tier.findByNumRC", query = "SELECT t FROM Tier t WHERE t.numRC = :numRC"),
@NamedQuery(name = "Tier.findByNif", query = "SELECT t FROM Tier t WHERE t.nif = :nif"),
@NamedQuery(name = "Tier.findByArticleImpo", query = "SELECT t FROM Tier t WHERE t.articleImpo = :articleImpo"),
@NamedQuery(name = "Tier.findByMinLiq", query = "SELECT t FROM Tier t WHERE t.minLiq = :minLiq"),
@NamedQuery(name = "Tier.findByMaxLiq", query = "SELECT t FROM Tier t WHERE t.maxLiq = :maxLiq"),
@NamedQuery(name = "Tier.findBySoldInitial", query = "SELECT t FROM Tier t WHERE t.soldInitial = :soldInitial"),
@NamedQuery(name = "Tier.findByDateSoldeInit", query = "SELECT t FROM Tier t WHERE t.dateSoldeInit = :dateSoldeInit"),
@NamedQuery(name = "Tier.findByDureeMax", query = "SELECT t FROM Tier t WHERE t.dureeMax = :dureeMax"),
@NamedQuery(name = "Tier.findByNumCompteTier", query = "SELECT t FROM Tier t WHERE t.numCompteTier = :numCompteTier"),
@NamedQuery(name = "Tier.findByBp", query = "SELECT t FROM Tier t WHERE t.bp = :bp"),
@NamedQuery(name = "Tier.findByNis", query = "SELECT t FROM Tier t WHERE t.nis = :nis"),
@NamedQuery(name = "Tier.findByIdStockFournisseur", query = "SELECT t FROM Tier t WHERE t.idStockFournisseur = :idStockFournisseur"),
@NamedQuery(name = "Tier.findByIdStockClient", query = "SELECT t FROM Tier t WHERE t.idStockClient = :idStockClient"),
@NamedQuery(name = "Tier.findByIsDeleted", query = "SELECT t FROM Tier t WHERE t.isDeleted = :isDeleted")})
public class Tier implements Serializable {
@Size(max = 10)
@Column(name = "code")
private String code;
@Size(max = 50)
@Column(name = "designation")
private String designation;
@Size(max = 1000)
@Column(name = "addresse")
private String addresse;
@Size(max = 50)
@Column(name = "num_rc")
private String numRc;
@Size(max = 50)
@Column(name = "nif")
private String nif;
@Size(max = 50)
@Column(name = "article_impo")
private String articleImpo;
@Size(max = 50)
@Column(name = "num_compte_tier")
private String numCompteTier;
@Size(max = 50)
@Column(name = "bp")
private String bp;
@Size(max = 50)
@Column(name = "nis")
private String nis;
@Size(max = 50)
@Column(name = "id_stock_fournisseur")
private String idStockFournisseur;
@Size(max = 50)
@Column(name = "id_stock_client")
private String idStockClient;
@Size(max = 5)
@Column(name = "is_deleted")
private String isDeleted;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "min_liq")
private Double minLiq;
@Column(name = "max_liq")
private Double maxLiq;
@Column(name = "sold_initial")
private Double soldInitial;
@Column(name = "date_solde_init")
@Temporal(TemporalType.DATE)
private Date dateSoldeInit;
@Column(name = "duree_max")
private Integer dureeMax;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Size(max = 50)
@Column(name = "numRC")
private String numRC;
@JoinColumn(name = "fk_compte_comptable", referencedColumnName = "id")
@ManyToOne
private CompteComptable fkCompteComptable;
@JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
@OneToMany(mappedBy = "fkTier")
private List<MouvementTier> mouvementTierList;
@OneToMany(mappedBy = "fkTier")
private List<Mouvement> mouvementList;
public Tier() {
}
public Tier(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNumRC() {
return numRC;
}
public void setNumRC(String numRC) {
this.numRC = numRC;
}
public String getArticleImpo() {
return articleImpo;
}
public void setArticleImpo(String articleImpo) {
this.articleImpo = articleImpo;
}
public Double getMinLiq() {
return minLiq;
}
public void setMinLiq(Double minLiq) {
this.minLiq = minLiq;
}
public Double getMaxLiq() {
return maxLiq;
}
public void setMaxLiq(Double maxLiq) {
this.maxLiq = maxLiq;
}
public Double getSoldInitial() {
return soldInitial;
}
public void setSoldInitial(Double soldInitial) {
this.soldInitial = soldInitial;
}
public Date getDateSoldeInit() {
return dateSoldeInit;
}
public void setDateSoldeInit(Date dateSoldeInit) {
this.dateSoldeInit = dateSoldeInit;
}
public Integer getDureeMax() {
return dureeMax;
}
public void setDureeMax(Integer dureeMax) {
this.dureeMax = dureeMax;
}
public String getNumCompteTier() {
return numCompteTier;
}
public void setNumCompteTier(String numCompteTier) {
this.numCompteTier = numCompteTier;
}
public String getIdStockFournisseur() {
return idStockFournisseur;
}
public void setIdStockFournisseur(String idStockFournisseur) {
this.idStockFournisseur = idStockFournisseur;
}
public String getIdStockClient() {
return idStockClient;
}
public void setIdStockClient(String idStockClient) {
this.idStockClient = idStockClient;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public CompteComptable getFkCompteComptable() {
return fkCompteComptable;
}
public void setFkCompteComptable(CompteComptable fkCompteComptable) {
this.fkCompteComptable = fkCompteComptable;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
@XmlTransient
public List<MouvementTier> getMouvementTierList() {
return mouvementTierList;
}
public void setMouvementTierList(List<MouvementTier> mouvementTierList) {
this.mouvementTierList = mouvementTierList;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Tier)) {
return false;
}
Tier other = (Tier) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Tier[ id=" + id + " ]";
}
public String getNumRc() {
return numRc;
}
public void setNumRc(String numRc) {
this.numRc = numRc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public String getAddresse() {
return addresse;
}
public void setAddresse(String addresse) {
this.addresse = addresse;
}
public String getNif() {
return nif;
}
public void setNif(String nif) {
this.nif = nif;
}
public String getBp() {
return bp;
}
public void setBp(String bp) {
this.bp = bp;
}
public String getNis() {
return nis;
}
public void setNis(String nis) {
this.nis = nis;
}
}

View File

@ -0,0 +1,334 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "tresorie", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Tresorie.findAll", query = "SELECT t FROM Tresorie t"),
@NamedQuery(name = "Tresorie.findById", query = "SELECT t FROM Tresorie t WHERE t.id = :id"),
@NamedQuery(name = "Tresorie.findByNumero", query = "SELECT t FROM Tresorie t WHERE t.numero = :numero"),
@NamedQuery(name = "Tresorie.findByCode", query = "SELECT t FROM Tresorie t WHERE t.code = :code"),
@NamedQuery(name = "Tresorie.findByCle", query = "SELECT t FROM Tresorie t WHERE t.cle = :cle"),
@NamedQuery(name = "Tresorie.findByDesignation", query = "SELECT t FROM Tresorie t WHERE t.designation = :designation"),
@NamedQuery(name = "Tresorie.findByMinLiq", query = "SELECT t FROM Tresorie t WHERE t.minLiq = :minLiq"),
@NamedQuery(name = "Tresorie.findByMaxLiq", query = "SELECT t FROM Tresorie t WHERE t.maxLiq = :maxLiq"),
@NamedQuery(name = "Tresorie.findBySoldInitial", query = "SELECT t FROM Tresorie t WHERE t.soldInitial = :soldInitial"),
@NamedQuery(name = "Tresorie.findByDateSoldeInitial", query = "SELECT t FROM Tresorie t WHERE t.dateSoldeInitial = :dateSoldeInitial"),
@NamedQuery(name = "Tresorie.findByNbrCheque", query = "SELECT t FROM Tresorie t WHERE t.nbrCheque = :nbrCheque"),
@NamedQuery(name = "Tresorie.findByNumCompteComptable", query = "SELECT t FROM Tresorie t WHERE t.numCompteComptable = :numCompteComptable"),
@NamedQuery(name = "Tresorie.findByIsDeleted", query = "SELECT t FROM Tresorie t WHERE t.isDeleted = :isDeleted"),
@NamedQuery(name = "Tresorie.findByStockId", query = "SELECT t FROM Tresorie t WHERE t.stockId = :stockId")})
public class Tresorie implements Serializable {
@Size(max = 10)
@Column(name = "numero")
private String numero;
@Size(max = 10)
@Column(name = "code")
private String code;
@Size(max = 2)
@Column(name = "cle")
private String cle;
@Size(max = 50)
@Column(name = "designation")
private String designation;
@Size(max = 5)
@Column(name = "is_deleted")
private String isDeleted;
@Size(max = 50)
@Column(name = "stock_id")
private String stockId;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "min_liq")
private Double minLiq;
@Column(name = "max_liq")
private Double maxLiq;
@Column(name = "solde_initial")
private Double soldeInitial;
@OneToMany(mappedBy = "fkTresorie")
private List<ServiceUserTresorie> serviceUserTresorieList;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "sold_Initial")
private Double soldInitial;
@Column(name = "date_solde_initial")
@Temporal(TemporalType.DATE)
private Date dateSoldeInitial;
@Column(name = "nbr_cheque")
private Integer nbrCheque;
@Column(name = "num_compte_comptable")
private Integer numCompteComptable;
@OneToMany(mappedBy = "fkTresorie")
private List<ControleTresorie> controleTresorieList;
@OneToMany(mappedBy = "fkTresorie")
private List<Chequier> chequierList;
@JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
@ManyToOne
private Etablissement fkEtablissement;
@JoinColumn(name = "fk_agence", referencedColumnName = "id")
@ManyToOne
private Agence fkAgence;
@JoinColumn(name = "fk_compte_comptable", referencedColumnName = "id")
@ManyToOne
private CompteComptable fkCompteComptable;
@JoinColumn(name = "fk_type_tresorie", referencedColumnName = "id")
@ManyToOne
private TypeTresorie fkTypeTresorie;
@OneToMany(mappedBy = "fkTresorieSource")
private List<Mouvement> mouvementList;
@OneToMany(mappedBy = "fkTresorieDestinataire")
private List<Mouvement> mouvementList1;
public Tresorie() {
}
public Tresorie(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getMinLiq() {
return minLiq;
}
public void setMinLiq(Double minLiq) {
this.minLiq = minLiq;
}
public Double getMaxLiq() {
return maxLiq;
}
public void setMaxLiq(Double maxLiq) {
this.maxLiq = maxLiq;
}
public Double getSoldInitial() {
return soldInitial;
}
public void setSoldInitial(Double soldInitial) {
this.soldInitial = soldInitial;
}
public Date getDateSoldeInitial() {
return dateSoldeInitial;
}
public void setDateSoldeInitial(Date dateSoldeInitial) {
this.dateSoldeInitial = dateSoldeInitial;
}
public Integer getNbrCheque() {
return nbrCheque;
}
public void setNbrCheque(Integer nbrCheque) {
this.nbrCheque = nbrCheque;
}
public Integer getNumCompteComptable() {
return numCompteComptable;
}
public void setNumCompteComptable(Integer numCompteComptable) {
this.numCompteComptable = numCompteComptable;
}
public String getStockId() {
return stockId;
}
public void setStockId(String stockId) {
this.stockId = stockId;
}
@XmlTransient
public List<ControleTresorie> getControleTresorieList() {
return controleTresorieList;
}
public void setControleTresorieList(List<ControleTresorie> controleTresorieList) {
this.controleTresorieList = controleTresorieList;
}
@XmlTransient
public List<Chequier> getChequierList() {
return chequierList;
}
public void setChequierList(List<Chequier> chequierList) {
this.chequierList = chequierList;
}
public Etablissement getFkEtablissement() {
return fkEtablissement;
}
public void setFkEtablissement(Etablissement fkEtablissement) {
this.fkEtablissement = fkEtablissement;
}
public Agence getFkAgence() {
return fkAgence;
}
public void setFkAgence(Agence fkAgence) {
this.fkAgence = fkAgence;
}
public CompteComptable getFkCompteComptable() {
return fkCompteComptable;
}
public void setFkCompteComptable(CompteComptable fkCompteComptable) {
this.fkCompteComptable = fkCompteComptable;
}
public TypeTresorie getFkTypeTresorie() {
return fkTypeTresorie;
}
public void setFkTypeTresorie(TypeTresorie fkTypeTresorie) {
this.fkTypeTresorie = fkTypeTresorie;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@XmlTransient
public List<Mouvement> getMouvementList1() {
return mouvementList1;
}
public void setMouvementList1(List<Mouvement> mouvementList1) {
this.mouvementList1 = mouvementList1;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Tresorie)) {
return false;
}
Tresorie other = (Tresorie) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.Tresorie[ id=" + id + " ]";
}
@XmlTransient
public List<ServiceUserTresorie> getServiceUserTresorieList() {
return serviceUserTresorieList;
}
public void setServiceUserTresorieList(List<ServiceUserTresorie> serviceUserTresorieList) {
this.serviceUserTresorieList = serviceUserTresorieList;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCle() {
return cle;
}
public void setCle(String cle) {
this.cle = cle;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
}

View File

@ -0,0 +1,129 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "type_mouvement")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TypeMouvement.findAll", query = "SELECT t FROM TypeMouvement t"),
@NamedQuery(name = "TypeMouvement.findById", query = "SELECT t FROM TypeMouvement t WHERE t.id = :id"),
@NamedQuery(name = "TypeMouvement.findByType", query = "SELECT t FROM TypeMouvement t WHERE t.type = :type")})
public class TypeMouvement implements Serializable {
@Size(max = 255)
@Column(name = "type")
private String type;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@OneToMany(mappedBy = "fkTypeMouvement")
private List<Alerte> alerteList;
@OneToMany(mappedBy = "fkTypeMouvement")
private List<MouvementTier> mouvementTierList;
@OneToMany(mappedBy = "fkTypeMouvement")
private List<Mouvement> mouvementList;
public TypeMouvement() {
}
public TypeMouvement(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlTransient
public List<Alerte> getAlerteList() {
return alerteList;
}
public void setAlerteList(List<Alerte> alerteList) {
this.alerteList = alerteList;
}
@XmlTransient
public List<MouvementTier> getMouvementTierList() {
return mouvementTierList;
}
public void setMouvementTierList(List<MouvementTier> mouvementTierList) {
this.mouvementTierList = mouvementTierList;
}
@XmlTransient
public List<Mouvement> getMouvementList() {
return mouvementList;
}
public void setMouvementList(List<Mouvement> mouvementList) {
this.mouvementList = mouvementList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TypeMouvement)) {
return false;
}
TypeMouvement other = (TypeMouvement) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.TypeMouvement[ id=" + id + " ]";
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,111 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author FORCE TECH
*/
@Entity
@Table(name = "type_tresorie", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TypeTresorie.findAll", query = "SELECT t FROM TypeTresorie t"),
@NamedQuery(name = "TypeTresorie.findById", query = "SELECT t FROM TypeTresorie t WHERE t.id = :id"),
@NamedQuery(name = "TypeTresorie.findByType", query = "SELECT t FROM TypeTresorie t WHERE t.type = :type")})
public class TypeTresorie implements Serializable {
@Size(max = 255)
@Column(name = "type")
private String type;
@OneToMany(mappedBy = "fkTypeTresorie")
private List<Tresorie> tresorieList;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
public TypeTresorie() {
}
public TypeTresorie(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlTransient
public List<Tresorie> getTresorieList() {
return tresorieList;
}
public void setTresorieList(List<Tresorie> tresorieList) {
this.tresorieList = tresorieList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TypeTresorie)) {
return false;
}
TypeTresorie other = (TypeTresorie) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.triz.trizservice.modeles.TypeTresorie[ id=" + id + " ]";
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,43 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.modeles.object;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.service.TransactionService;
import java.util.Date;
/**
*
* @author HP
*/
public class GenerateIDObject {
public static String genererIdGroups(TransactionService service) {
System.out.println("genererIdGroups");
String id = "";
ServiceIncrementation incr = service.getIncrementation();
if (incr == null) {
incr = new ServiceIncrementation();
incr.setDateMois(new Date());
}
if (incr.getIncrGroups() == null) {
incr.setIncrGroups(0);
}
int nbrStockGroups = incr.getIncrGroups() + 1;
incr.setIncrGroups(nbrStockGroups);
id = "" + nbrStockGroups;
service.save(incr);
while (id.length() < 5) {
id = "0" + id;
}
id = "90" + id;
System.out.println("Id :" + id);
return id;
}
}

View File

@ -0,0 +1,14 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.security;
/**
*
* @author Triztech web
*/
public interface AuthenticationService {
public boolean login(String username, String password);
}

View File

@ -0,0 +1,47 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.trizservice.security.impl;
import com.triz.trizservice.security.AuthenticationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
/**
*
* @author Triztech web
*/
@Service("authenticationService")
public class AuthenticationServiceImpl implements AuthenticationService {
@Autowired
private AuthenticationManager authenticationManager; // specific for Spring Security
private Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class);
@Override
public boolean login(String username, String password) {
System.out.println("AuthenticationServiceImpl ");
try {
Authentication authenticate = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(
username, password));
if (authenticate.isAuthenticated()) {
SecurityContextHolder.getContext().setAuthentication(
authenticate);
return true;
}
} catch (AuthenticationException e) {
logger.error("", e.getCause());
}
return false;
}
}

View File

@ -0,0 +1,131 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.security.impl;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import com.triz.util.UtilGetParametre;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.security.core.Authentication;
import com.triz.util.UtilURL;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @author abderrahim.TOUAIBIA
*/
@Service
public class CostumSuccesHandler extends SavedRequestAwareAuthenticationSuccessHandler {
@Autowired
private TransactionService transactionService;
@Autowired
public UtilContext context;
public CostumSuccesHandler() {
}
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws ServletException, IOException {
setDefaultTargetUrl("/" + multiEtablissement());
super.onAuthenticationSuccess(request, response, authentication);
}
private void saveConnection(ServiceUser user, Etablissement etablissement) {
ServicehistoriqueConnection his = new ServicehistoriqueConnection();
his.setFkUser(user);
his.setDate(new Date());
his.setHeur(new Date());
his.setAdresseIp("");
his.setFkEtablissement(etablissement);
transactionService.save(his);
}
public String multiEtablissement() {
// useDistribution = UtilGetParametre.useTrizDistribution();
ServiceUser user = context.getCurrentUser();
System.out.println("-------------------- multi etablissement");
List<Etablissement> listUserEtab = transactionService.getAllStockEtablissementFromUsersEtablissementByUser(user);
System.out.println("-------------------- listUserEtab " + listUserEtab);
UtilURL.showURL();
if (listUserEtab.size() == 1) {
Etablissement etablissement = listUserEtab.get(0);
ServiceEtablissementUser userEtablissement = transactionService.getAllUserEtablissementByEtablissementByUser(etablissement, user);
UtilURL.setIdEtablissement(etablissement.getIdEtabStock());
UtilURL.setFonctionnalite(transactionService.getFonctionServerByUsersByEtablissement(context.getCurrentUser(), etablissement));
saveConnection(user, etablissement);
// if ("production".equals(etablissement.getType_etablissemnt())) {
// UtilURL.setIsProuction(true);
// return UtilURL.URL_PRODUCTION;
// }
// if (("true".equals(userEtablissement.getUseSuperette()))) {
// return UtilURL.STOCK_URL_VENTECOMPTOIRE;
// }
// if (context.getUseTB() && context.isshow1("Acceuil")) {
// return UtilURL.STOCK_URL_TB;
// }
return UtilURL.STOCK_URL;
}
if (listUserEtab.size() > 1) {
ServicehistoriqueConnection hist = transactionService.getLastStockHistoriqueConnectionByUsers(user);
if (hist != null) {
Etablissement lasteEtablissement = hist.getFkEtablissement();
// if ("true".equals(hist.getIsTableauBord())) {
// if ("true".equals(user.getShowTableauDeBord())) {
// UtilURL.setIsTableauDeBord(true);
// UtilURL.setIdEtablissement(null);
// UtilURL.setFonctionnaliteServer(null);
// UtilURL.setIsProuction(false);
// saveConnection(user, "true", null);
// return UtilURL.STOCK_URL;
// }
// }
if (lasteEtablissement != null) {
if (listUserEtab.contains(lasteEtablissement)) {
// saveConnection(user, "false", lasteEtablissement);
ServiceEtablissementUser userEtablissement = transactionService.getAllUserEtablissementByEtablissementByUser(lasteEtablissement, user);
UtilURL.setIdEtablissement(lasteEtablissement.getIdEtabStock());
UtilURL.setFonctionnalite(transactionService.getFonctionServerByUsersByEtablissement(context.getCurrentUser(), lasteEtablissement));
// if ("production".equals(lasteEtablissement.getType_etablissemnt())) {
// UtilURL.setIsProuction(true);
// return UtilURL.URL_PRODUCTION;
// }
// UtilURL.setIsProuction(false);
// if (("true".equals(userEtablissement.getUseSuperette()))) {
// return UtilURL.STOCK_URL_VENTECOMPTOIRE;
// }
// if (context.getUseTB() && context.isshow1("Acceuil")) {
// return UtilURL.STOCK_URL_TB;
// }
return UtilURL.STOCK_URL;
}
}
}
return UtilURL.STOCK_URL;
}
return UtilURL.STOCK_URL;
}
}

View File

@ -0,0 +1,130 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.security.impl;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.service.TransactionService;
import com.triz.util.UtilContext;
import com.triz.util.UtilURL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Timer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.authentication.AuthenticationManager;
/**
* this service provide authentification
*
* @author kamel.ider
*/
@Service("loginService")
@Component("loginService")
public class LoginServiceImpl implements AuthenticationProvider {
private static boolean enabled = true;
private static boolean accountNonExpired = true;
private static boolean credentialsNonExpired = true;
private static boolean accountNonLocked = true;
//@Resource(name = "transactionService")
@Autowired
private TransactionService transactionService;
@Autowired
public UtilContext context;
private Timer timer;
private Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class);
@Autowired
@Qualifier("dataSourceAuthenticationManager")
private AuthenticationManager dataSourceAuthenticationManager;
public LoginServiceImpl() {
}
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
System.out.println("login ------");
ServiceUser daoUser = null;
//authentication=dataSourceAuthenticationManager.authenticate(authentication);
String loginName = authentication.getName();
System.out.println("loginName: " + loginName);
daoUser = transactionService.getUserById(loginName.trim());
System.out.println("daoUser: " + daoUser);
UtilURL.showURL();
if (daoUser == null) {
throw new UsernameNotFoundException("Login erroné");
} else if (!daoUser.getActif().contains("true")) {
throw new UsernameNotFoundException("Votre compte est disactivé veuillez contacter l'administrateur");
}
try {
String pwd = authentication.getCredentials().toString();
System.out.println("pwd: " + pwd);
if (login(daoUser, pwd)) {
System.out.println("inside if: " + pwd);
List<ServiceMember> groups = transactionService.getGroupsByUser(daoUser);
Collection<GrantedAuthority> adminAuthorities = new ArrayList<GrantedAuthority>();
adminAuthorities.add(new SimpleGrantedAuthority("ROLE_REGISTERED"));
System.out.println("groups: " + groups.size());
if (!groups.isEmpty()) {
for (ServiceMember group : groups) {
System.out.println("group: " + group.getFkGroupe());
adminAuthorities.add(new SimpleGrantedAuthority("ROLE_" + group.getFkGroupe().getId().toUpperCase()));
}
}
User user = new User(loginName.trim(), pwd.trim(), enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, adminAuthorities);
return new UsernamePasswordAuthenticationToken(user, authentication.getCredentials(), adminAuthorities);
}
} catch (Exception e) {
System.out.println("error: " + e.getMessage());
logger.error("", e);
if (e.getCause() != null && e.getCause() instanceof java.net.ConnectException) {
throw new UsernameNotFoundException("Le serveur n'est pas accessible veuillez verifier votre connexion ou contacter l'administrateur");
}
}
if (daoUser != null) {
//dataService.createHistoric(daoUser.getId(), HistoricAction.FAILLOGIN);
}
throw new UsernameNotFoundException("Mot de passe erroné");
}
@Override
public boolean supports(Class<?> authentication) {
return authentication.equals(UsernamePasswordAuthenticationToken.class);
}
private boolean login(ServiceUser user, String pw) {
System.out.println("pw: hh " + pw);
System.out.println("user.getPw(): " + user.getUserpw()+"hh ");
if (user.getUserpw().equals(pw)) {
System.out.println("true");
return true;
}
System.out.println("false");
return false;
}
}

View File

@ -0,0 +1,115 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.service;
import com.triz.trizservice.modeles.AnneeFiscale;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.modeles.ServiceWilaya;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import java.util.List;
/**
*
* @author abder_000
*/
public interface DaoService {
public List<ServiceUser> getAllUsers();
public List<ServiceFonctionnaliter> getAllFonctionalite();
public boolean isItTimeToChangePass();
public ServiceUser getUserById(String userId);
public List<ServiceMember> getGroupsByUser(ServiceUser user);
public ServiceMember getGroupByUser(ServiceUser user);
public void saveUser(ServiceUser object);
public ServiceGroupe getGroupsById(String id);
public void saveGroup(ServiceGroupe object);
public void saveMembership(ServiceMember object);
public void saveFonctionsGroupes(ServiceFonctiongroupe object);
public ServicehistoriqueConnection getLastHistoriqueConnectionByUsers(ServiceUser user);
public ServicehistoriqueConnection getLastHistoriqueConnectionById(Long id);
public void save(ServicehistoriqueConnection historique);
public List<ServiceGroupe> getAllGroups();
public List<ServiceMember> getAllMembershipByUser(ServiceUser user);
public List<ServiceFonctiongroupe> getAllFonctionsGroupesByGroupe(ServiceGroupe group);
public List<ServiceMember> getAllMembership();
public ServiceFonctionnaliter getFonctionnaliteById(String id);
public List<ServiceFonctionnaliter> getAllFonctionnaliteServer();
public void save(ServiceFonctionnaliter object);
public void save(ServiceHistoriqueManipulation object);
public List<ServiceFonctiongroupe> getAllFonctionsGroups();
public List<ServiceFonctionnaliter> getFonctionServerByGroups(ServiceGroupe groupe);
public List<ServiceFonctionnaliter> getFonctionServerByUsers(ServiceUser user);
public ServiceFonctionnaliter getFonctionnaliteServerByFonction(String fonction);
public int genererBDD(String chemain, String nomSql);
public List<ServiceMember> getAllMemberShipByUser(ServiceUser user);
public ServiceFonctiongroupe getFonctionGroupByFonctionIdAndGoupe(String id, ServiceGroupe group);
public void save(ServiceIncrementation object);
public ServiceIncrementation getIncrementation();
public ServiceIncrementation getFirstIncrementation();
public void save(ServiceGroupe object);
public void removeFonctionsGroupes(ServiceFonctiongroupe fonctionGroupe);
public List<ServicehistoriqueConnection> getListHistoriqueConnectionByUsers(ServiceUser user);
public List<ServiceHistoriqueManipulation> getListHistoriqueManipulationByUsersByEntreprise(ServiceUser user);
public Etablissement getEtablissementById(String id);
public List<Etablissement> getAllStockEtablissementFromUsersEtablissementByUser(ServiceUser user);
public ServiceEtablissementUser getAllUserEtablissementByEtablissementByUser(Etablissement etablissement, ServiceUser user);
public List<ServiceFonctionnaliter> getFonctionServerByUsersByEtablissement(ServiceUser user, Etablissement etablissement);
public ServicehistoriqueConnection getLastStockHistoriqueConnectionByUsers(ServiceUser user);
public AnneeFiscale getAnneFiscalByEtablissementByActif(Etablissement etablissement);
public List<ServiceWilaya> getAllWilaya();
}

View File

@ -0,0 +1,115 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.service;
import com.triz.trizservice.modeles.AnneeFiscale;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.modeles.ServiceWilaya;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import java.util.List;
/**
*
* @author abder_000
*/
public interface TransactionService {
public List<ServiceUser> getAllUsers();
public List<ServiceFonctionnaliter> getAllFonctionalite();
public boolean isItTimeToChangePass();
public ServiceUser getUserById(String userId) ;
public List<ServiceMember> getGroupsByUser(ServiceUser user);
public ServiceMember getGroupByUser(ServiceUser user);
public void saveUser(ServiceUser object);
public ServiceGroupe getGroupsById(String id);
public void saveGroup(ServiceGroupe object);
public void saveMembership(ServiceMember object);
public void saveFonctionsGroupes(ServiceFonctiongroupe object);
public ServicehistoriqueConnection getLastHistoriqueConnectionByUsers(ServiceUser user);
public ServicehistoriqueConnection getLastHistoriqueConnectionById(Long id);
public void save(ServicehistoriqueConnection historique);
public List<ServiceGroupe> getAllGroups();
public List<ServiceMember> getAllMembershipByUser(ServiceUser user);
public List<ServiceFonctiongroupe> getAllFonctionsGroupesByGroupe(ServiceGroupe group);
public List<ServiceMember> getAllMembership();
public ServiceFonctionnaliter getFonctionnaliteById(String id);
public List<ServiceFonctionnaliter> getAllFonctionnaliteServer();
public void save(ServiceFonctionnaliter object);
public void save(ServiceHistoriqueManipulation object);
public List<ServiceFonctiongroupe> getAllFonctionsGroups();
public List<ServiceFonctionnaliter> getFonctionServerByGroups(ServiceGroupe groupe);
public List<ServiceFonctionnaliter> getFonctionServerByUsers(ServiceUser user);
public ServiceFonctionnaliter getFonctionnaliteServerByFonction(String fonction);
public int genererBDD(String chemain, String nomSql);
public List<ServiceMember> getAllMemberShipByUser(ServiceUser user);
public ServiceFonctiongroupe getFonctionGroupByFonctionIdAndGoupe(String id, ServiceGroupe group);
public void save(ServiceIncrementation object);
public ServiceIncrementation getIncrementation();
public ServiceIncrementation getFirstIncrementation();
public void save(ServiceGroupe object);
public void removeFonctionsGroupes(ServiceFonctiongroupe fonctionGroupe);
public List<ServicehistoriqueConnection> getListHistoriqueConnectionByUsers(ServiceUser user);
public List<ServiceHistoriqueManipulation> getListHistoriqueManipulationByUsersByEntreprise(ServiceUser user);
public Etablissement getEtablissementById(String id);
public List<Etablissement> getAllStockEtablissementFromUsersEtablissementByUser(ServiceUser user);
public ServiceEtablissementUser getAllUserEtablissementByEtablissementByUser(Etablissement etablissement,ServiceUser user);
public List<ServiceFonctionnaliter> getFonctionServerByUsersByEtablissement(ServiceUser user,Etablissement etablissement);
public ServicehistoriqueConnection getLastStockHistoriqueConnectionByUsers(ServiceUser user);
public AnneeFiscale getAnneFiscalByEtablissementByActif(Etablissement etablissement);
public List<ServiceWilaya> getAllWilaya();
}

View File

@ -0,0 +1,295 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.service.impl;
import com.triz.trizservice.modeles.AnneeFiscale;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.service.DaoService;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.modeles.ServiceWilaya;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.persistence.NoResultException;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
/**
*
* @author abder_000
*/
@Repository()
public class DaoServiceImpl implements DaoService {
@Resource(name = "sessionFactory")
SessionFactory sessionFactory;
private Session getCurrentSession() {
if (sessionFactory.getCurrentSession() == null) {
return sessionFactory.openSession();
}
sessionFactory.getCurrentSession().clear();
return sessionFactory.getCurrentSession();
}
@Override
public List<ServiceUser> getAllUsers() {
return getCurrentSession().createCriteria(ServiceUser.class).list();
}
@Override
public List<ServiceFonctionnaliter> getAllFonctionalite() {
return getCurrentSession().createCriteria(ServiceFonctionnaliter.class).list();
}
@Override
public boolean isItTimeToChangePass() {
return true;
}
@Override
public ServiceUser getUserById(String userId) {
return (ServiceUser) getCurrentSession()
.createQuery("SELECT user FROM ServiceUser user WHERE user.userid = :userid")
.setParameter("userid", userId)
.setMaxResults(1)
.uniqueResult();
}
@Override
public List<ServiceMember> getGroupsByUser(ServiceUser user) {
return getCurrentSession()
.createQuery("SELECT membre FROM ServiceMember membre WHERE membre.fkUser = :user", ServiceMember.class)
.setParameter("user", user)
.getResultList();
}
@Override
public ServiceMember getGroupByUser(ServiceUser user) {
return getCurrentSession()
.createQuery("SELECT membre FROM ServiceMember membre WHERE membre.fkUser = :user", ServiceMember.class)
.setParameter("user", user)
.setMaxResults(1)
.uniqueResult();
}
@Override
public void saveUser(ServiceUser object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public ServiceGroupe getGroupsById(String id) {
return (ServiceGroupe) getCurrentSession().createCriteria(ServiceGroupe.class).add(Restrictions.eq("id", id)).setMaxResults(1).uniqueResult();
}
@Override
public void saveGroup(ServiceGroupe object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public void saveMembership(ServiceMember object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public void saveFonctionsGroupes(ServiceFonctiongroupe object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public ServicehistoriqueConnection getLastHistoriqueConnectionByUsers(ServiceUser user) {
return (ServicehistoriqueConnection) getCurrentSession().createCriteria(ServicehistoriqueConnection.class).add(Restrictions.eq("fkUser", user)).addOrder(Order.desc("id")).setMaxResults(1).uniqueResult();
}
@Override
public ServicehistoriqueConnection getLastHistoriqueConnectionById(Long id) {
return (ServicehistoriqueConnection) getCurrentSession().createCriteria(ServicehistoriqueConnection.class).add(Restrictions.eq("id", id)).setMaxResults(1).uniqueResult();
}
@Override
public void save(ServicehistoriqueConnection historique) {
getCurrentSession().saveOrUpdate(historique);
}
@Override
public List<ServiceGroupe> getAllGroups() {
return getCurrentSession().createCriteria(ServiceGroupe.class).add(Restrictions.eq("actif", "true")).list();
}
@Override
public List<ServiceMember> getAllMembershipByUser(ServiceUser user) {
return getCurrentSession().createCriteria(ServiceMember.class).add(Restrictions.eq("fkUser", user)).list();
}
@Override
public List<ServiceFonctiongroupe> getAllFonctionsGroupesByGroupe(ServiceGroupe group) {
return getCurrentSession().createCriteria(ServiceFonctiongroupe.class).add(Restrictions.eq("fkGroupe", group)).list();
}
@Override
public List<ServiceMember> getAllMembership() {
return getCurrentSession().createCriteria(ServiceMember.class).addOrder(Order.desc("date")).list();
}
@Override
public ServiceFonctionnaliter getFonctionnaliteById(String id) {
return (ServiceFonctionnaliter) getCurrentSession().createCriteria(ServiceFonctionnaliter.class).add(Restrictions.eq("id", id)).setMaxResults(1).uniqueResult();
}
@Override
public List<ServiceFonctionnaliter> getAllFonctionnaliteServer() {
return getCurrentSession().createCriteria(ServiceFonctionnaliter.class).list();
}
@Override
public void save(ServiceFonctionnaliter object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public void save(ServiceHistoriqueManipulation object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public List<ServiceFonctiongroupe> getAllFonctionsGroups() {
return getCurrentSession().createCriteria(ServiceFonctiongroupe.class).list();
}
@Override
public List<ServiceFonctionnaliter> getFonctionServerByGroups(ServiceGroupe groupe) {
return getCurrentSession().createQuery("select sf from ServiceFonctionnaliter sf,ServiceFonctiongroupe sfg where sf.id=sfg.fkFonction and sfg.fkGroupe =:groupeS").setParameter("groupeS", groupe).list();
}
@Override
public List<ServiceFonctionnaliter> getFonctionServerByUsers(ServiceUser user) {
return getCurrentSession().createQuery("select sf from ServiceFonctionnaliter sf,ServiceFonctiongroupe sfg, ServiceMember mem where sf.id=sfg.fkFonction and sfg.fkGroupe = mem.fkGroupe and mem.fkUser= :user ").setParameter("user", user).list();
}
@Override
public ServiceFonctionnaliter getFonctionnaliteServerByFonction(String fonction) {
return (ServiceFonctionnaliter) getCurrentSession().createCriteria(ServiceFonctionnaliter.class).add(Restrictions.eq("fonction", fonction)).setMaxResults(1).uniqueResult();
}
@Override
public int genererBDD(String chemain, String nomSql) {
return getCurrentSession().createSQLQuery("BACKUP DATABASE " + nomSql + " TO DISK = '" + chemain + "' WITH FORMAT, MEDIANAME = 'SQLServerBackups', NAME = 'Full Backup of " + nomSql + "' ").executeUpdate();
}
@Override
public List<ServiceMember> getAllMemberShipByUser(ServiceUser user) {
return getCurrentSession().createQuery("select m from ServiceMember m where m.fkUser =:idUser").setParameter("idUser", user).list();
}
@Override
public ServiceFonctiongroupe getFonctionGroupByFonctionIdAndGoupe(String id, ServiceGroupe group) {
return (ServiceFonctiongroupe) getCurrentSession().createQuery("select fg from ServiceFonctiongroupe fg where fg.fkFonction.id =:fonction and fg.fkGroupe.id =:group").setParameter("fonction", id).setParameter("group", group.getId()).setMaxResults(1).uniqueResult();
}
@Override
public void save(ServiceIncrementation object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public ServiceIncrementation getIncrementation() {
return (ServiceIncrementation) getCurrentSession().createQuery("select increm from ServiceIncrementation increm").setMaxResults(1).uniqueResult();
}
@Override
public ServiceIncrementation getFirstIncrementation() {
return getCurrentSession().createQuery("SELECT s FROM ServiceIncrementation s ORDER BY s.id ASC", ServiceIncrementation.class).setMaxResults(1).getSingleResult();
}
@Override
public void save(ServiceGroupe object) {
getCurrentSession().saveOrUpdate(object);
}
@Override
public void removeFonctionsGroupes(ServiceFonctiongroupe fonctionGroupe) {
getCurrentSession().delete(fonctionGroupe);
}
@Override
public List<ServicehistoriqueConnection> getListHistoriqueConnectionByUsers(ServiceUser user) {
return getCurrentSession()
.createQuery("select e from ServicehistoriqueConnection e where e.fkUser = :user", ServicehistoriqueConnection.class)
.setParameter("user", user)
.list();
}
@Override
public List<ServiceHistoriqueManipulation> getListHistoriqueManipulationByUsersByEntreprise(ServiceUser user) {
return getCurrentSession()
.createQuery("select e from ServiceHistoriqueManipulation e where e.fkManipulateur = :user", ServiceHistoriqueManipulation.class)
.setParameter("user", user)
.list();
}
@Override
public Etablissement getEtablissementById(String id) {
return (Etablissement) getCurrentSession().createQuery("select ca from Etablissement ca where ca.idEtabStock = :id ").setParameter("id", id).setMaxResults(1).uniqueResult();
}
@Override
public List<Etablissement> getAllStockEtablissementFromUsersEtablissementByUser(ServiceUser user) {
CriteriaBuilder cb = getCurrentSession().getCriteriaBuilder();
CriteriaQuery<Etablissement> cq = cb.createQuery(Etablissement.class);
Root<ServiceEtablissementUser> root = cq.from(ServiceEtablissementUser.class);
cq.select(root.get("fkEtablissement")) // sélectionne la relation
.where(
cb.and(
cb.equal(root.get("fkUser"), user),
cb.equal(root.get("fkEtablissement").get("actif"), "true")
)
);
return getCurrentSession().createQuery(cq).getResultList();
}
@Override
public ServiceEtablissementUser getAllUserEtablissementByEtablissementByUser(Etablissement etablissement, ServiceUser user) {
return (ServiceEtablissementUser) getCurrentSession().createCriteria(ServiceEtablissementUser.class).add(Restrictions.eq("fkEtablissement", etablissement)).add(Restrictions.eq("fkUser", user)).setMaxResults(1).uniqueResult();
}
@Override
public List<ServiceFonctionnaliter> getFonctionServerByUsersByEtablissement(ServiceUser user, Etablissement etablissement) {
return getCurrentSession().createQuery("select sf from ServiceFonctionnaliter sf,ServiceFonctiongroupe sfg, ServiceMember mem where sf.id=sfg.fkFonction and sfg.fkGroupe= mem.fkGroupe and mem.fkUser=:user and mem.fkGroupe.fkEtablissement=:etab ").setParameter("etab", etablissement).setParameter("user", user).list();
}
@Override
public ServicehistoriqueConnection getLastStockHistoriqueConnectionByUsers(ServiceUser user) {
return (ServicehistoriqueConnection) getCurrentSession().createCriteria(ServicehistoriqueConnection.class).add(Restrictions.eq("fkUser", user)).addOrder(Order.desc("id")).setMaxResults(1).uniqueResult();
}
@Override
public AnneeFiscale getAnneFiscalByEtablissementByActif(Etablissement etablissement) {
return (AnneeFiscale)getCurrentSession().createQuery("select sf from AnneeFiscale sf where sf.actif='true' and sf.fkEtablissement=:etab").setParameter("etab", etablissement).setMaxResults(1).uniqueResult();
}
@Override
public List<ServiceWilaya> getAllWilaya() {
return getCurrentSession().createQuery("select m from ServiceWilaya m ").list();
}
}

View File

@ -0,0 +1,293 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.trizservice.service.impl;
import com.triz.trizservice.modeles.AnneeFiscale;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceEtablissementUser;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceGroupe;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServicehistoriqueConnection;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.modeles.ServiceWilaya;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.service.DaoService;
import com.triz.trizservice.service.TransactionService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
*
* @author abder_000
*/
@Service
public class TransactionServiceImpl implements TransactionService {
@Autowired
DaoService daoService;
@Transactional("transactionManager")
@Override
public boolean isItTimeToChangePass() {
return daoService.isItTimeToChangePass();
}
@Transactional("transactionManager")
@Override
public ServiceUser getUserById(String userId) {
return daoService.getUserById(userId);
}
@Transactional("transactionManager")
@Override
public List<ServiceMember> getGroupsByUser(ServiceUser user) {
return daoService.getGroupsByUser(user);
}
@Transactional("transactionManager")
@Override
public ServiceMember getGroupByUser(ServiceUser user) {
return daoService.getGroupByUser(user);
}
@Transactional("transactionManager")
@Override
public void saveUser(ServiceUser object) {
daoService.saveUser(object);
}
@Transactional("transactionManager")
@Override
public ServiceGroupe getGroupsById(String id) {
return daoService.getGroupsById(id);
}
@Transactional("transactionManager")
@Override
public void saveGroup(ServiceGroupe object) {
daoService.saveGroup(object);
}
@Transactional("transactionManager")
@Override
public void saveMembership(ServiceMember object) {
daoService.saveMembership(object);
}
@Transactional("transactionManager")
@Override
public void saveFonctionsGroupes(ServiceFonctiongroupe object) {
daoService.saveFonctionsGroupes(object);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctionnaliter> getAllFonctionalite() {
return daoService.getAllFonctionalite();
}
@Transactional("transactionManager")
@Override
public ServicehistoriqueConnection getLastHistoriqueConnectionByUsers(ServiceUser user) {
return daoService.getLastHistoriqueConnectionByUsers(user);
}
@Transactional("transactionManager")
@Override
public ServicehistoriqueConnection getLastHistoriqueConnectionById(Long id) {
return daoService.getLastHistoriqueConnectionById(id);
}
@Transactional("transactionManager")
@Override
public void save(ServicehistoriqueConnection historique) {
daoService.save(historique);
}
@Transactional("transactionManager")
@Override
public List<ServiceGroupe> getAllGroups() {
return daoService.getAllGroups();
}
@Transactional("transactionManager")
@Override
public List<ServiceMember> getAllMembershipByUser(ServiceUser user) {
return daoService.getAllMembershipByUser(user);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctiongroupe> getAllFonctionsGroupesByGroupe(ServiceGroupe group) {
return daoService.getAllFonctionsGroupesByGroupe(group);
}
@Transactional("transactionManager")
@Override
public List<ServiceMember> getAllMembership() {
return daoService.getAllMembership();
}
@Transactional("transactionManager")
@Override
public ServiceFonctionnaliter getFonctionnaliteById(String id) {
return daoService.getFonctionnaliteById(id);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctionnaliter> getAllFonctionnaliteServer() {
return daoService.getAllFonctionnaliteServer();
}
@Transactional("transactionManager")
@Override
public void save(ServiceFonctionnaliter object) {
daoService.save(object);
}
@Transactional("transactionManager")
@Override
public void save(ServiceHistoriqueManipulation object) {
daoService.save(object);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctiongroupe> getAllFonctionsGroups() {
return daoService.getAllFonctionsGroups();
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctionnaliter> getFonctionServerByGroups(ServiceGroupe groupe) {
return daoService.getFonctionServerByGroups(groupe);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctionnaliter> getFonctionServerByUsers(ServiceUser user) {
return daoService.getFonctionServerByUsers(user);
}
@Transactional("transactionManager")
@Override
public ServiceFonctionnaliter getFonctionnaliteServerByFonction(String fonction) {
return daoService.getFonctionnaliteServerByFonction(fonction);
}
public int genererBDD(String chemain, String nomSql) {
return daoService.genererBDD(chemain, nomSql);
}
@Transactional("transactionManager")
@Override
public List<ServiceMember> getAllMemberShipByUser(ServiceUser user) {
return daoService.getAllMemberShipByUser(user);
}
@Transactional("transactionManager")
@Override
public ServiceFonctiongroupe getFonctionGroupByFonctionIdAndGoupe(String id, ServiceGroupe group) {
return daoService.getFonctionGroupByFonctionIdAndGoupe(id, group);
}
@Transactional("transactionManager")
@Override
public void save(ServiceIncrementation object) {
daoService.save(object);
}
@Transactional("transactionManager")
@Override
public ServiceIncrementation getIncrementation() {
return daoService.getIncrementation();
}
@Transactional("transactionManager")
@Override
public ServiceIncrementation getFirstIncrementation() {
return daoService.getFirstIncrementation();
}
@Transactional("transactionManager")
@Override
public void save(ServiceGroupe object) {
daoService.save(object);
}
@Transactional("transactionManager")
@Override
public void removeFonctionsGroupes(ServiceFonctiongroupe fonctionGroupe) {
daoService.removeFonctionsGroupes(fonctionGroupe);
}
@Transactional("transactionManager")
@Override
public List<ServicehistoriqueConnection> getListHistoriqueConnectionByUsers(ServiceUser user) {
return daoService.getListHistoriqueConnectionByUsers(user);
}
@Transactional("transactionManager")
@Override
public List<ServiceHistoriqueManipulation> getListHistoriqueManipulationByUsersByEntreprise(ServiceUser user) {
return daoService.getListHistoriqueManipulationByUsersByEntreprise(user);
}
@Transactional("transactionManager")
@Override
public List<ServiceUser> getAllUsers() {
return daoService.getAllUsers();
}
@Transactional("transactionManager")
@Override
public Etablissement getEtablissementById(String id) {
return daoService.getEtablissementById(id);
}
@Transactional("transactionManager")
@Override
public List<Etablissement> getAllStockEtablissementFromUsersEtablissementByUser(ServiceUser user) {
return daoService.getAllStockEtablissementFromUsersEtablissementByUser(user);
}
@Transactional("transactionManager")
@Override
public ServiceEtablissementUser getAllUserEtablissementByEtablissementByUser(Etablissement etablissement, ServiceUser user) {
return daoService.getAllUserEtablissementByEtablissementByUser(etablissement, user);
}
@Transactional("transactionManager")
@Override
public List<ServiceFonctionnaliter> getFonctionServerByUsersByEtablissement(ServiceUser user, Etablissement etablissement) {
return daoService.getFonctionServerByUsersByEtablissement(user, etablissement);
}
@Transactional("transactionManager")
@Override
public ServicehistoriqueConnection getLastStockHistoriqueConnectionByUsers(ServiceUser user) {
return daoService.getLastHistoriqueConnectionByUsers(user);
}
@Transactional("transactionManager")
@Override
public AnneeFiscale getAnneFiscalByEtablissementByActif(Etablissement etablissement) {
return daoService.getAnneFiscalByEtablissementByActif(etablissement);
}
@Transactional("transactionManager")
@Override
public List<ServiceWilaya> getAllWilaya() {
return daoService.getAllWilaya();
}
}

View File

@ -0,0 +1,36 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
//import com.aspose.pdf.*;
/**
*
* @author Lenovo ideapad 110
*/
public class OnvertPdfToExcel {
private static Path _dataDir;
private static String pdfFileName;
public static void ConvertPDFtoExcelAdvanced_SaveXLSX(String pathfile, String filename) {
_dataDir = Paths.get(pathfile);
pdfFileName = filename;
// Load PDF document
// Document pdfDocument = new Document(_dataDir +"/"+ pdfFileName);
// // Instantiate ExcelSave Option object
// ExcelSaveOptions excelsave = new ExcelSaveOptions();
// excelsave.setInsertBlankColumnAtFirst(false);
// excelsave.setMinimizeTheNumberOfWorksheets(true);
// // Save the output in XLS format
// pdfDocument.save(pathfile+"/PDFToXLS_out.xls", excelsave);
}
}

View File

@ -0,0 +1,115 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.security.MessageDigest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
/**
*
* @author Admin
*/
public class Outils {
//region Hashage code ..
private static String key = "trizmobiletriz";
public static String decrypt(String encrypted) throws Exception {
byte[] keyb = key.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(keyb);
SecretKeySpec skey = new SecretKeySpec(thedigest, "AES");
Cipher dcipher = Cipher.getInstance("AES");
dcipher.init(Cipher.DECRYPT_MODE, skey);
byte[] clearbyte = dcipher.doFinal(Base64.getDecoder().decode(encrypted));
return new String(clearbyte);
}
public static String encrypt(String encrypted) throws Exception {
byte[] keyb = key.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(keyb);
SecretKeySpec skey = new SecretKeySpec(thedigest, "AES");
Cipher dcipher = Cipher.getInstance("AES");
dcipher.init(Cipher.ENCRYPT_MODE, skey);
byte[] clearbyte = dcipher.doFinal(encrypted.getBytes("utf-8"));
return Base64.getEncoder().encodeToString(clearbyte);
}
//endregion
public static Double dateDifferenceWithToday(String date) {
Double diff = 100.0;
try {
Date dateClient = new SimpleDateFormat("yyyy-MM-dd kk:mm").parse(date);
Date dateServer = new SimpleDateFormat("yyyy-MM-dd kk:mm").parse(getCurrentDate() + " " + getCurrentTime());
System.out.println("diff=== " + (dateServer.getTime() - dateClient.getTime()) + " now=" + getCurrentDate() + " " + getCurrentTime() + " / date= " + date);
diff = (double) ((dateServer.getTime() - dateClient.getTime()) / (1000 * 60));
System.out.println("diff=== " + diff + " min");
} catch (ParseException ex) {
Logger.getLogger(Outils.class.getName()).log(Level.SEVERE, null, ex);
}
return diff;
}
public static String getCurrentDate() {
GregorianCalendar localGregorianCalendar = new GregorianCalendar();
return new SimpleDateFormat("yyyy-MM-dd").format(localGregorianCalendar.getTime());
}
public static String getCurrentTime() {
GregorianCalendar localGregorianCalendar = new GregorianCalendar();
return new SimpleDateFormat("HH:mm:ss").format(localGregorianCalendar.getTime());
}
public static Date stringToDate(String date) {
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
try {
return simpleDate.parse(date);
} catch (ParseException ex) {
return null;
}
}
public static String dateToString(Date date) {
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
return date == null ? "0000-00-00" : simpleDate.format(date);
}
public static String formatHeur(Date date) {
if (date == null) {
return "-";
}
SimpleDateFormat simpleDate = new SimpleDateFormat("HH:mm");
return simpleDate.format(date);
}
public static String replaceNULL(Expression ex,String replacement){
try{
return ex.compile();
}catch(Exception e){
return replacement;
}
}
public interface Expression{
String compile();
}
}

View File

@ -0,0 +1,481 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.triz.trizservice.modeles.AnneeFiscale;
import com.triz.trizservice.modeles.Etablissement;
import com.triz.trizservice.modeles.ServiceIncrementation;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.modeles.ServiceHistoriqueManipulation;
import com.triz.trizservice.modeles.StockTypeDestinataire;
import com.triz.trizservice.service.TransactionService;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.io.IOUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Service;
/**
*
* @author abderrahim.TOUAIBIA
*/
@Service()
public class UtilContext {
private String titre;
private String db_URL;
private String url = "jdbc:sqlserver://localhost:1433;databaseName=";
private String dossierSauvegarde = "sauvegarde";
private ServiceHistoriqueManipulation historiqueManipulation;
@Autowired
private TransactionService service;
public String getTitre() {
return titre;
}
public void setTitre(String titre) {
this.titre = titre;
}
public ServiceUser getCurrentUser() {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (user != null) {
return service.getUserById(user.getUsername());
}
return null;
}
public String changeStatutLigneUser() {
ServiceUser user = getCurrentUser();
service.saveUser(user);
return UtilURL.DISTRIBUTION_URL;
}
public static boolean isInternetAvailable() throws IOException {
return isHostAvailable("google.com");
}
private static boolean isHostAvailable(String hostName) throws IOException {
try (Socket socket = new Socket()) {
int port = 80;
InetSocketAddress socketAddress = new InetSocketAddress(hostName, port);
socket.connect(socketAddress, 3000);
return true;
} catch (UnknownHostException unknownHost) {
return false;
}
}
public static ServiceIncrementation remiseAZeroIncr(ServiceIncrementation incr) {
System.out.println(" remiseAZeroIncr ");
Date date = new Date();
incr.setDateMois(date);
return incr;
}
public static ServiceIncrementation remiseAZeroIncrAnnee(ServiceIncrementation incr) {
System.out.println(" remiseAZeroIncr ");
Date date = new Date();
incr.setDateMois(date);
return incr;
}
public static ServiceIncrementation remiseAZeroIncrMois(ServiceIncrementation incr) {
System.out.println(" remiseAZeroIncrmois ");
Date date = new Date();
incr.setDateMois(date);
return incr;
}
public String userID() {
ServiceUser user = getCurrentUser();
return user.getUserid();
}
public static String formatDateNew(Date date) {
if (date == null) {
return "";
}
SimpleDateFormat simpleDate = new SimpleDateFormat("dd-MM-yyyy");
return simpleDate.format(date);
}
public static String dateFormatDayMonthYearAndTime(Date date) {
if (date == null) {
return "";
}
SimpleDateFormat simpleDate = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
return simpleDate.format(date);
}
public void preProcessPDF(Object document) throws IOException, BadElementException, DocumentException {
System.out.println("Hello, my name is preProcessPDF");
Document pdf = (Document) document;
pdf.open();
pdf.setPageSize(PageSize.A4);
pdf.add(new Paragraph(" " + titre + "\n\n\n"));
}
public void preProcessPDF1(String titre1, Object document) throws IOException, BadElementException, DocumentException {
Document pdf = (Document) document;
pdf.open();
pdf.setPageSize(PageSize.A4);
pdf.add(new Paragraph(" " + titre1 + "\n\n\n"));
}
public void postProcessXLS(Object document) throws DocumentException, FileNotFoundException, IOException {
XSSFWorkbook wb = (XSSFWorkbook) document;
XSSFSheet sheet = wb.getSheetAt(0);
//sheet.autoSizeColumn(100);
sheet.shiftRows(0, sheet.getLastRowNum(), 2);
XSSFRow row = sheet.createRow((short) 0);
XSSFCell cell = row.createCell(2);
cell.setCellValue(titre);
sheet.addMergedRegion(new CellRangeAddress(0, 0, 2, 8));
XSSFCellStyle cellStyleDate = (XSSFCellStyle) sheet.getWorkbook().createCellStyle();
XSSFCellStyle cellStyleHeur = (XSSFCellStyle) sheet.getWorkbook().createCellStyle();
XSSFCellStyle cellStyleMontant = (XSSFCellStyle) sheet.getWorkbook().createCellStyle();
XSSFCellStyle cellStyleInt = (XSSFCellStyle) sheet.getWorkbook().createCellStyle();
CreationHelper createHelper = sheet.getWorkbook().getCreationHelper();
cellStyleDate.setDataFormat(
createHelper.createDataFormat().getFormat("dd/MM/yyyy"));
cellStyleHeur.setDataFormat(
createHelper.createDataFormat().getFormat("hh:mm:ss"));
cellStyleMontant.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));
cellStyleInt.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0"));
for (int ligne = 0; ligne <= sheet.getLastRowNum(); ligne++) {
row = sheet.getRow(ligne);
if (row == null) {
continue;
}
for (int colon = 0; colon <= row.getPhysicalNumberOfCells(); colon++) {
cell = row.getCell(colon);
if (cell == null) {
continue;
}
String mot = "";
if (cell.getCellType() == CellType.STRING) {
mot = cell.getStringCellValue();
}
if (cell.getCellType() == CellType.NUMERIC) {
mot = cell.getNumericCellValue() + "";
}
mot = mot.replace(" ", "");
mot = mot.replace(",", ".");
try {
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
cell.setCellValue(simpleDate.parse(mot));
cell.setCellStyle(cellStyleDate);
continue;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDate = new SimpleDateFormat("hh:mm:ss");
cell.setCellValue(simpleDate.parse(mot));
cell.setCellStyle(cellStyleHeur);
continue;
} catch (Exception e) {
}
if (!mot.contains(".")) {
if (mot.length() > 8) {
continue;
}
}
try {
Integer numbre = Integer.valueOf(mot);
cell.setCellValue(numbre);
cell.setCellStyle(cellStyleInt);
continue;
} catch (Exception e) {
}
try {
Float numbre = Float.valueOf(mot);
cell.setCellValue(numbre);
cell.setCellStyle(cellStyleMontant);
continue;
} catch (Exception e) {
}
try {
Double numbre = Double.valueOf(mot);
cell.setCellValue(numbre);
cell.setCellStyle(cellStyleMontant);
continue;
} catch (Exception e) {
}
}
}
}
public String getConcatinationOfTitre(String c1, String c2, String c3, String c4, String c5) {
return c1 + c2 + c3 + c4 + c5;
}
public String getConcatinationOfTitre(String c1, String c2, String c3, String c4, String c5, String c6) {
return c1 + c2 + c3 + c4 + c5 + c6;
}
public String getConcatinationOfTitre(String c1, String c2, String c3, String c4, String c5, String c6, String c7) {
return c1 + c2 + c3 + c4 + c5 + c6 + c7;
}
public String getConcatinationOfTitre(String c1, String c2, String c3, String c4, String c5, String c6, String c7, String c8) {
return c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8;
}
public String getConcatinationOfTitreDate(String c1, String c2, Date c3, Date c4, String c5, String c6) {
return c1 + c2 + formatDate(c3) + " au " + this.formatDate(c4) + c5 + c6;
}
public String formatDate(Date date) {
SimpleDateFormat simpleDate = new SimpleDateFormat("dd-MM-yyyy");
return simpleDate.format(date);
}
public StreamedContent getFileContentDistribution() throws IOException {
db_URL = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_BD_URL);
return getFileContent(typeContenentZip, createBakFile());
}
public StreamedContent getFileContentStock() throws IOException {
db_URL = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZSTOCK_BD_URL);
return getFileContent(typeContenentZip, createBakFile());
}
private String createBakFile() {
String db = db_URL.substring(url.length());
System.out.println("bdDistribution :" + db);
String bakFileName = db + "_" + dateTimeFormat(new Date());
String bakFile = UtilFile.getDirectoryName(dossierSauvegarde) + "/" + bakFileName + ".bak";
System.out.println("bakFile :" + bakFile);
int processComplete = service.genererBDD(bakFile, db);
System.out.println("processComplete :" + processComplete);
File file = new File(bakFile);
if (file.exists()) {
try {
bakFile = createZipFile(bakFile, bakFileName, dossierSauvegarde);
} catch (Exception e) {
}
}
return bakFile;
}
public String createZipFile(String bakFile, String bakFileName, String folder_name_origine) throws IOException {
System.out.println("createZipFile"+ bakFile);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMddHHmm");
String fileOutput_name = bakFileName + ".zip";
File uploadedDer = new File(UtilFile.getDirectoryName(folder_name_origine));
if (!uploadedDer.exists()) {
uploadedDer.mkdirs();
}
File fileOutput = new File(UtilFile.getFilePath(folder_name_origine, fileOutput_name));
fileOutput.createNewFile();
List<File> listeFile_path = new ArrayList<>();
listeFile_path.add(new File(bakFile));
final File firstfile = new File(UtilFile.getDirectoryName(folder_name_origine));
if (firstfile.exists()) {
ZipUtils zipfl = new ZipUtils();
try {
zipfl.zipFiles(listeFile_path, firstfile, fileOutput);
} catch (IOException ex) {
Logger.getLogger(UtilContext.class.getName()).log(Level.SEVERE, null, ex);
}
}
System.out.println("fileOutput.getPath():" + fileOutput.getPath());
return fileOutput.getPath();
}
String typeContenentBAK = "application/bak";
String typeContenentZip = "application/zip";
public StreamedContent getFileContent(String typeContenent, String pathGet) throws IOException {
System.out.println("get file content --starts");
File file = new File(pathGet);
if (file.exists()) {
System.out.println("File exsits --- " + file);
System.out.println("File name --- " + file.getName());
byte contents[] = IOUtils.toByteArray(new FileInputStream(file));
DefaultStreamedContent content = DefaultStreamedContent.builder().name(file.getName()).contentType("application/bak").stream(() -> new ByteArrayInputStream(contents)).build();
System.out.println("File content " + content);
return content;
} else {
System.out.println("File Not exsits --- ");
return null;
}
}
public boolean backupDB(String path) {
Process runtimeProcess;
try {
runtimeProcess = Runtime.getRuntime().exec("cmd /c " + path);
int processComplete = runtimeProcess.waitFor();
if (processComplete == 0) {
System.out.println("Backup created successfully");
return true;
} else {
System.out.println("Could not create the backup");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return false;
}
private String pathBat() {
String db = db_URL.substring(url.length());
System.out.println("bdDistribution :" + db);
String bakFile = UtilFile.getDirectoryName(dossierSauvegarde) + "/" + db + "_" + dateTimeFormat(new Date()) + ".bak";
System.out.println("bakFile :" + bakFile);
String path = "osql.exe -E -Q \"BACKUP DATABASE " + db + " TO DISK='" + bakFile + "' WITH FORMAT\"";
System.out.println("path :" + path);
boolean isBackup = backupDB(path);
System.out.println("BackupStatus :" + isBackup);
if (!isBackup) {
return null;
}
return bakFile;
}
private String dateTimeFormat(Date date) {
SimpleDateFormat simpleDate = new SimpleDateFormat("dd-MM-yyyy_HH_mm_ss");
return simpleDate.format(date);
}
public String getNomEtablissementFromProperties() {
if (UtilGetParametre.TRIZDISTRIBUTION_ETABLISSEMENT_NOM != null) {
return UtilGetParametre.TRIZDISTRIBUTION_ETABLISSEMENT_NOM;
}
return "";
}
public void saveNewManipulation(String nomTable, String idLigne, String typeManipulation, Date date, Date heur, ServiceUser user, Double oldValour, Double newValeur) {
historiqueManipulation = new ServiceHistoriqueManipulation();
historiqueManipulation.setFkManipulateur(user);
historiqueManipulation.setIdLigne(idLigne);
historiqueManipulation.setNomTable(nomTable);
historiqueManipulation.setTypeManipumation(typeManipulation);
historiqueManipulation.setOldValeur(oldValour.floatValue());
historiqueManipulation.setNewValeur(newValeur.floatValue());
historiqueManipulation.setDateManipulation(new Date());
historiqueManipulation.setHeurManipulation(new Date());
service.save(historiqueManipulation);
}
public String formatAnneeForCodage(Date date) {
SimpleDateFormat simpleDate = new SimpleDateFormat("yy");
return simpleDate.format(date);
}
public boolean isOnLigneUser() {
ServiceUser user = getCurrentUser();
return false;
}
public Etablissement getCurrentEtablissement() {
System.out.println("UtilURLStock.getStock_CODE_SYSTEM() " + UtilURL.getStock_CODE_SYSTEM());
Etablissement etablissemnt = service.getEtablissementById(UtilURL.getStock_CODE_SYSTEM());
if (etablissemnt != null) {
return etablissemnt;
}
return null;
}
public AnneeFiscale getCurrentAnneeFiscal() {
System.out.println("UtilURLStock.getStock_CODE_SYSTEM() " + UtilURL.getStock_CODE_SYSTEM());
AnneeFiscale annee = service.getAnneFiscalByEtablissementByActif(getCurrentEtablissement());
if (annee != null) {
return annee;
}
return null;
}
public boolean canChangeEtablissement() {
ServiceUser user = getCurrentUser();
List<Etablissement> listeEtablissement = service.getAllStockEtablissementFromUsersEtablissementByUser(user);
if (listeEtablissement != null) {
if (!listeEtablissement.isEmpty()) {
if (listeEtablissement.size() > 1) {
return true;
}
return false;
}
return false;
}
return false;
}
}

View File

@ -0,0 +1,184 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.triz.util;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.modeles.ServiceMember;
import com.triz.trizservice.modeles.ServiceUser;
import com.triz.trizservice.service.TransactionService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
/**
*
* @author HP
*/
@Component("utilControleAccess")
@Scope("view")
public class UtilControleAccess {
private String titre;
private String userLabel;
private ServiceUser userSelect;
private List<ServiceFonctionnaliter> allFonctionByUser;
List<ServiceMember> listMemberShip;
@Autowired
public UtilContext context;
@Autowired
private TransactionService service;
public ServiceUser getCurrentUser() {
ServiceUser user = (ServiceUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (user != null) {
return service.getUserById(user.getUserid());
}
return null;
}
public String getUserLabel() {
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
if (userSelect != null) {
userLabel = userSelect.getPrenom() + " " + userSelect.getNom();
} else {
userLabel = null;
}
return userLabel;
}
public void permission() {
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
if (userSelect != null) {
userLabel = userSelect.getPrenom() + " " + userSelect.getNom();
}
}
public boolean isshowPrivilegeAdd(String fonction1) {
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
ServiceFonctiongroupe helpingFonctionGroupe = new ServiceFonctiongroupe();
List<String> list = new ArrayList<>();
listMemberShip = service.getAllMemberShipByUser(userSelect);
for (ServiceMember member : listMemberShip) {
helpingFonctionGroupe = service.getFonctionGroupByFonctionIdAndGoupe(fonction1, member.getFkGroupe());
if (helpingFonctionGroupe != null) {
list.add(helpingFonctionGroupe.getCanCreate());
}
}
if (!list.isEmpty()) {
if (list.contains("true")) {
return true;
} else {
return false;
}
}
return false;
}
public boolean isshowPrivilegeRemove(String fonction1) {
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
ServiceFonctiongroupe helpingFonctionGroupe = new ServiceFonctiongroupe();
List<String> list = new ArrayList<>();
listMemberShip = service.getAllMemberShipByUser(userSelect);
for (ServiceMember member : listMemberShip) {
helpingFonctionGroupe = service.getFonctionGroupByFonctionIdAndGoupe(fonction1, member.getFkGroupe());
if (helpingFonctionGroupe != null) {
list.add(helpingFonctionGroupe.getCanDelete());
}
}
if (!list.isEmpty()) {
if (list.contains("true")) {
return true;
} else {
return false;
}
}
return false;
}
public boolean isshowPrivilegeUpdate(String fonction1) {
System.out.println(" isshowPrivilegeUpdate(String fonction1): " + fonction1);
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
ServiceFonctiongroupe helpingFonctionGroupe = new ServiceFonctiongroupe();
List<String> list = new ArrayList<>();
if (listMemberShip == null) {
listMemberShip = service.getAllMemberShipByUser(userSelect);
}
for (ServiceMember member : listMemberShip) {
helpingFonctionGroupe = service.getFonctionGroupByFonctionIdAndGoupe(fonction1, member.getFkGroupe());
if (helpingFonctionGroupe != null) {
list.add(helpingFonctionGroupe.getCanUpdate());
System.out.println("helpingFonctionGroupe.getCanUpdate() : " + helpingFonctionGroupe.getCanUpdate());
}
}
System.out.println("helpingFonctionGroupe: " + helpingFonctionGroupe);
System.out.println("list: " + list);
if (!list.isEmpty()) {
if (list.contains("true")) {
return true;
} else {
return false;
}
}
return false;
}
public boolean isshow1(String fonction1) {
System.out.println(" isshowPrivilegeUpdate(String fonction1): " + fonction1);
if (userSelect == null) {
userSelect = context.getCurrentUser();
}
ServiceFonctiongroupe helpingFonctionGroupe = new ServiceFonctiongroupe();
List<String> list = new ArrayList<>();
if (listMemberShip == null) {
listMemberShip = service.getAllMemberShipByUser(userSelect);
}
for (ServiceMember member : listMemberShip) {
helpingFonctionGroupe = service.getFonctionGroupByFonctionIdAndGoupe(fonction1, member.getFkGroupe());
if (helpingFonctionGroupe != null) {
list.add("true");
System.out.println("helpingFonctionGroupe.getCanUpdate() : " + helpingFonctionGroupe.getCanUpdate());
}
}
System.out.println("helpingFonctionGroupe: " + helpingFonctionGroupe);
System.out.println("list: " + list);
if (!list.isEmpty()) {
if (list.contains("true")) {
return true;
} else {
return false;
}
}
return false;
}
}

View File

@ -0,0 +1,59 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service;
/**
*
* @author amtou
*/
@Service()
public class UtilExcel {
public void miseEnForm(Object document) {
System.out.println("miseEnForm");
XSSFWorkbook workbook = (XSSFWorkbook) document;
XSSFSheet sheet = workbook.getSheetAt(0);
// CellStyle totalCellStyle = workbook.createCellStyle();
//
// totalCellStyle.setDataFormat(workbook.createDataFormat().getFormat("#,##0.00"));
//
// Cell currentCell = workbook.getSheetAt(0).getRow(0).getCell(0);
//
//
// currentCell.setCellValue(Double.parseDouble(currentCell.getStringCellValue()));
// currentCell.setCellStyle(defaultCellStyle);
int ligne=0;
while(true){
XSSFRow row = sheet.getRow(ligne);
System.out.println("ligne :"+ligne+" ; Row :"+row);
ligne++;
if(row==null){
break;
}
int colon = 0;
while(true){
XSSFCell cell = row.getCell(colon);
System.out.println("ligne :"+ligne+"; colon :"+colon+" ; Cell :"+cell);
if(cell==null){
break;
}
}
}
}
}

View File

@ -0,0 +1,272 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.awt.Color;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.faces.FacesException;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
/**
*
* @author abder_000
*/
@Service()
public class UtilFile {
public String getVirtualFileUrl(String dossier, String id) {
System.out.println(" TestOf Access : "+id);
if (id != null) {
if (!(id.endsWith(".png") | id.endsWith(".PNG") | id.endsWith(".jpg") | id.endsWith(".JPG") | id.endsWith(".jpeg") | id.endsWith(".JPEG") | id.endsWith(".jfif") | id.endsWith(".JFIF"))) {
id = id + ".png";
}
}
String imageBaseUrl = getImageApplicationUri();
String url = imageBaseUrl + "/." + dossier + "/" + id;
System.out.println(" TestOf Access2 : "+url);
return url;
}
public String getVirtualFileUrlDoc(String dossier, String id) {
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_CHEMAIN);
String imageBaseUrl = getImageApplicationUri();
//String homeBaseDirectory = getDirectoryName();
//System.out.println("getVirtualFileUrl :"+imageBaseUrl+"/.trizDistribution" + "/." + dossier + "/" + id);
// String url = imageBaseUrl + "/.trizDistribution" + "/." + dossier + "/" + id;
String url = imageBaseUrl + "/." + dossier + "/" + id;
System.out.println("TestOfLink : "+ url);
return url;
}
public String getVirtualFileUrl(String dossier, String repertoire, String id) {
String imageBaseUrl = getImageApplicationUri();
//String homeBaseDirectory = getDirectoryName();
//System.out.println("getVirtualFileUrl :"+imageBaseUrl+"/.trizDistribution" + "/." + dossier + "/" + id);
// String url = imageBaseUrl + "/.trizDistribution" + "/." + dossier + "/" + repertoire + "/" + id;
String url = imageBaseUrl + "/." + dossier + "/" + repertoire + "/" + id;
return url;
}
public static String getDirectoryHome() {
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_CHEMAIN);
if (racine == null) {
racine = System.getProperty("user.home");
}
File file = new File(racine + File.separator + ".trizDistribution" );
//System.err.println("file :" + file.getPath());
file.mkdirs();
return racine + File.separator + ".trizDistribution";
}
public static String getDirectoryName(String dossier) {
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_CHEMAIN);
if (racine == null) {
racine = System.getProperty("user.home");
}
File file = new File(racine + File.separator + ".trizDistribution" + File.separator + "." + dossier);
//System.err.println("file :" + file.getPath());
file.mkdirs();
return racine + File.separator + ".trizDistribution" + File.separator + "." + dossier;
}
public static String getDirectoryMobileName(String dossier, String racine) {
//String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN);
return racine + "/" + ".trizDistribution" + "/" + "." + dossier /*+ "/"*/;
}
public static String getDirectoryMobileNameWithPath(String dossier) {
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN);
return /*racine + "/" +*/ ".trizDistribution" + "/" + "." + dossier /*+ "/"*/;
}
public static String compressionImageJPG(String chemain) {
// System.out.println("compressionImageJPG :"+ chemain);
String newChemain = chemain;
if (chemain == null) {
return null;
}
if (!(chemain.endsWith(".jpg") | chemain.endsWith(".JPG") | chemain.endsWith(".jpeg") | chemain.endsWith(".JPEG") | chemain.endsWith(".png") | chemain.endsWith(".PNG") | chemain.endsWith(".jfif") | chemain.endsWith(".JFIF"))) {
return null;
}
if (chemain.endsWith(".png") | chemain.endsWith(".PNG")) {
BufferedImage bufferedImage;
newChemain = chemain.substring(0, chemain.length()-4) + "_conv.jpg";
try {
//read image file
bufferedImage = ImageIO.read(new File(chemain));
// create a blank, RGB, same width and height, and a white background
BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(),
bufferedImage.getHeight(), BufferedImage.TYPE_INT_RGB);
newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.WHITE, null);
// write to jpeg file
ImageIO.write(newBufferedImage, "jpg", new File(newChemain));
chemain = newChemain;
newChemain = chemain + ".jpg";
System.out.println("Done");
} catch (IOException e) {
e.printStackTrace();
}
}
File imageFile = new File(chemain);
newChemain = chemain.substring(0, chemain.length()-(imageFile.getName().length()))+ "red_" + imageFile.getName();
File compressedImageFile = new File(newChemain);
String file_reselt = imageFile.getName();
int max = 0;
float reduction = 1;
try {
BufferedImage bi = ImageIO.read(imageFile);
System.out.println("Traitement de : " + chemain);
max = bi.getWidth();
System.out.println("max de : " + max);
if (bi.getHeight() > max) {
max = bi.getHeight();
}
System.out.println("max de : " + max);
if (max > 300) {
System.out.println("reduction ");
reduction = (float) 2000 / max;
int width = (int) (bi.getWidth() * reduction);
int height = (int) (bi.getHeight() * reduction);
System.out.println("width de : " + bi.getWidth());
System.out.println("height de : " + bi.getHeight());
System.out.println("width de : " + width);
System.out.println("height de : " + height);
System.out.println("reduction de : " + reduction);
BufferedImage biNew = new BufferedImage(width, height, bi.getType());
AffineTransform tx = new AffineTransform();
tx.scale(reduction, reduction);
// tx.setToRotation(0);
AffineTransformOp op = new AffineTransformOp(tx,
AffineTransformOp.TYPE_BILINEAR);
bi = op.filter(bi, biNew);
ImageIO.write(bi, "JPG", compressedImageFile);
System.out.println("saving de : " + newChemain);
file_reselt = compressedImageFile.getName();
}
} catch (Exception e) {
System.out.println("ERROR -- le fichier" + chemain + " n'est pas une image");
e.printStackTrace();
}
return file_reselt;
// return chemain;
}
// CREATE A MATRIX FOR THE MANIPULATION
//Matrix matrix = new Matrix();
//// RESIZE THE BIT MAP
//matrix.postScale(reduction, reduction);
//
//ExifInterface exif = null;
//try {
// exif = new ExifInterface(new File(chemain).getAbsolutePath());
// int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
// Log.e("ppp", "Exif: " + orientation);
//
//
// if (orientation == 6) {
// matrix.postRotate(90);
// } else if (orientation == 3) {
// matrix.postRotate(180);
// } else if (orientation == 8) {
// matrix.postRotate(270);
// }
//
//
//} catch (IOException e) {
// Log.e("ppp", " exif no file:");
// e.printStackTrace();
//}
public static String getFilePath(String dossier, String fileName) {
//System.out.println("---------------new file path call-----------");
String filePath = getDirectoryName(dossier) + File.separator + fileName;
//System.out.println("storing files in dicrecoty :"+filePath);
return filePath;
}
public static String getFilePath(String dossier, String repertoir, String fileName) {
//System.out.println("---------------new file path call-----------");
String filePath = getDirectoryName(dossier) + File.separator + repertoir + File.separator + fileName;
//System.out.println("storing files in dicrecoty :"+filePath);
return filePath;
}
public String getImageApplicationUri() {
try {
FacesContext ctxt = FacesContext.getCurrentInstance();
ExternalContext ext = ctxt.getExternalContext();
URI uri = new URI(ext.getRequestScheme(),
null, ext.getRequestServerName(), ext.getRequestServerPort(),
"/images", null, null);
return uri.toASCIIString();
} catch (URISyntaxException e) {
throw new FacesException(e);
}
}
public static String getDirectory() {
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_CHEMAIN);
if (racine == null) {
racine = System.getProperty("user.home");
}
File file = new File(racine + File.separator + ".trizDistribution" );
//System.err.println("file :" + file.getPath());
file.mkdirs();
return racine + File.separator + ".trizDistribution" ;
}
public static String getURLPath(String ip){
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
ip = ip+ ":"+request.getLocalPort()+request.getContextPath();
System.out.println("getURLPath:"+ip);
return ip;
}
}

View File

@ -0,0 +1,84 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import com.triz.trizservice.service.TransactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @author abderrahim.TOUAIBIA
*/
@Service()
public class UtilGMap {
@Autowired
private TransactionService service;
private Double centreLatitude= 36.481610506719534;
private Double centreLangitude= 2.8055021166801453;
private int zoom = 11;
public static String[] colorLine = new String []{"RGB(192,31,31)"
,"RGB(192,116,31)"
,"RGB(92,100,31)"
,"RGB(192,150,31)"
,"RGB(192,180,31)"
,"RGB(192,200,31)"
,"RGB(192,200,200)"
,"RGB(192,74,200)"
,"RGB(96,113,226)"
,"RGB(168,69,226)"
,"RGB(226,70,226)"
,"RGB(192,180,200)"
,"RGB(192,100,31)"
,"RGB(192,180,200)"
,"RGB(92,100,31)"
};
public static String[] color = new String []{"http://maps.google.com/mapfiles/ms/micons/blue-dot.png","http://maps.google.com/mapfiles/ms/micons/blue.png"
,"http://maps.google.com/mapfiles/ms/micons/green-dot.png","http://maps.google.com/mapfiles/ms/micons/green.png"
,"http://maps.google.com/mapfiles/ms/micons/ltblue-dot.png","http://maps.google.com/mapfiles/ms/micons/lightblue.png"
,"http://maps.google.com/mapfiles/ms/micons/red-dot.png","http://maps.google.com/mapfiles/ms/micons/red.png"
,"http://maps.google.com/mapfiles/ms/micons/pink-dot.png","http://maps.google.com/mapfiles/ms/micons/pink.png"
,"http://maps.google.com/mapfiles/ms/micons/yellow-dot.png","http://maps.google.com/mapfiles/ms/micons/yellow.png"
,"http://maps.google.com/mapfiles/ms/micons/purple-dot.png","http://maps.google.com/mapfiles/ms/micons/purple.png"
,"http://maps.google.com/mapfiles/ms/micons/orange-dot.png","http://maps.google.com/mapfiles/ms/micons/orange.png"
,"http:// google.com/mapfiles/kml/paddle/wht-diamond.png","http:// google.com/mapfiles/kml/paddle/wht-square.png","http:// google.com/mapfiles/kml/paddle/wht-stars.png"
,"http:// google.com/mapfiles/kml/paddle/blu-diamond.png","http:// google.com/mapfiles/kml/paddle/blu-square.png","http:// google.com/mapfiles/kml/paddle/blu-stars.png"
,"http:// google.com/mapfiles/kml/paddle/grn-diamond.png","http:// google.com/mapfiles/kml/paddle/grn-square.png","http:// google.com/mapfiles/kml/paddle/grn-stars.png"
,"http:// google.com/mapfiles/kml/paddle/red-diamond.png","http:// google.com/mapfiles/kml/paddle/red-square.png","http:// google.com/mapfiles/kml/paddle/red-stars.png"
,"http:// google.com/mapfiles/kml/paddle/purple-diamond.png","http:// google.com/mapfiles/kml/paddle/purple-square.png","http:// google.com/mapfiles/kml/paddle/purple-stars.png"
,"http:// google.com/mapfiles/kml/paddle/pink-diamond.png","http:// google.com/mapfiles/kml/paddle/pink-square.png","http:// google.com/mapfiles/kml/paddle/pink-stars.png"
};
public static String[] color_icon = new String []{"icons8-truck-50_bleu.png","icons8-truck-50_green.png"
,"icons8-truck-50_jaune_1.png","icons8-truck-50_gris.png"
,"icons8-truck-50_marron.png","icons8-truck-50_noir.png"
,"icons8-truck-50_orenge.png","icons8-truck-50_red.png"
,"icons8-truck-50_jaune_viole_2.png","icons8-truck-50_jeune.png"
,"icons8-truck-50_rose.png","icons8-truck-50_viole.png"
,"icons8-truck-50_viole_1.png","icons8-truck-50_vert.png"
};
public void setCentreLatitude(Double centreLatitude) {
this.centreLatitude = centreLatitude;
}
public void setCentreLangitude(Double centreLangitude) {
this.centreLangitude = centreLangitude;
}
public int getZoom() {
return zoom;
}
public void setZoom(int zoom) {
this.zoom = zoom;
}
}

View File

@ -0,0 +1,185 @@
package com.triz.util;
import com.triz.trizservice.service.TransactionService;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UtilGetParametre {
public static String TRIZSTOCK_BD_URL = "trizstock.jdbc.url";
public static String TRIZSTOCK_BD_USER = "trizstock.jdbc.user";
public static String TRIZSTOCK_BD_PASSWORD = "trizstock.jdbc.password";
public static String TRIZSTOCK_BD_DRIVER = "trizstock.jdbc.driver";
public static String TRIZDISTRIBUTION_ID = "trizdistribution.id";
public static String TRIZSTOCK_USE = "trizstock.use";
public static String TRIZSTOCK_MAITRE = "trizstock.maitre";
public static String TRIZSTOCK_MAITRE_PORT = "trizstock.maitre.port";
public static String TRIZDISTRIBUTION_USE = "trizdistribution.use";
public static String TRIZDISTRIBUTION_BD_URL = "jdbc.url";
public static String TRIZDISTRIBUTION_BD_USER = "jdbc.user";
public static String TRIZDISTRIBUTION_BD_PASSWORD = "jdbc.password";
public static String TRIZDISTRIBUTION_BD_DRIVER = "jdbc.driver";
public static String TRIZDISTRIBUTION_SERVEUR_ADRESSEIP = "trizdistribution.serveur.adresseip";
public static String TRIZDISTRIBUTION_SERVEUR_PORT = "trizdistribution.serveur.port";
public static String TRIZDISTRIBUTION_ETABLISSEMENT_NOM = "trizdistribution.etablissement.nom";
public static String TRIZDISTRIBUTION_MOBILE_PORT = "trizdistribution.mobile.port";
public static String TRIZDISTRIBUTION_MOBILE_PORT_MAG = "trizdistribution.mobile.portmag";
public static String TRIZDISTRIBUTION_MULTI_ETABLISSEMENT_PORT = "trizdistribution.multiEtablissement.port";
public static String TRIZDISTRIBUTION_DOSSIER_CHEMAIN = "trizdistribution.dossier.chemain";
public static String TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN = "trizdistribution.dossier.chemain.mobile";
public static String TRIZDISTRIBUTION_CODE_ETABLISSEMENT = "trizdistribution.code.etablissement";
public static String TRIZDISTRIBUTION_ADRESSE_WEB = "trizdistribution.adresse.web";
public static String TB_USE = "tb.use";
private static Map<String, String> map = new HashMap<String, String>();
//public static String idEtablissement;
@Autowired
private TransactionService service;
@Autowired
public UtilContext context;
public UtilGetParametre() {
getProperties();
}
public Map<String, String> getProperties() {
if (!map.isEmpty()) {
return map;
}
Properties propertiesFile = new Properties();
URL r = this.getClass().getResource("/");
try {
System.err.println(r.toURI());
InputStream inputStream = new FileInputStream(new File(r.toURI()) + File.separator + "database.properties");
propertiesFile.load(new InputStreamReader(inputStream));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (URISyntaxException | IOException e) {
e.printStackTrace();
}
System.out.println(TRIZDISTRIBUTION_BD_URL + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_BD_URL));
System.out.println(TRIZDISTRIBUTION_BD_USER + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_BD_USER));
System.out.println(TRIZDISTRIBUTION_BD_PASSWORD + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_BD_PASSWORD));
System.out.println(TRIZDISTRIBUTION_BD_DRIVER + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_BD_DRIVER));
System.out.println(TRIZDISTRIBUTION_SERVEUR_ADRESSEIP + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_SERVEUR_ADRESSEIP));
System.out.println(TRIZDISTRIBUTION_SERVEUR_PORT + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_SERVEUR_PORT));
System.out.println(TRIZDISTRIBUTION_ETABLISSEMENT_NOM + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_ETABLISSEMENT_NOM));
System.out.println(TRIZDISTRIBUTION_MOBILE_PORT_MAG + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_MOBILE_PORT_MAG));
System.out.println(TRIZDISTRIBUTION_MOBILE_PORT + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_MOBILE_PORT));
System.out.println(TRIZDISTRIBUTION_MULTI_ETABLISSEMENT_PORT + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_MULTI_ETABLISSEMENT_PORT));
System.out.println(TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN));
System.out.println(TRIZDISTRIBUTION_DOSSIER_CHEMAIN + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_DOSSIER_CHEMAIN));
System.out.println(TRIZDISTRIBUTION_CODE_ETABLISSEMENT + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_CODE_ETABLISSEMENT));
System.out.println(TRIZDISTRIBUTION_ADRESSE_WEB + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_ADRESSE_WEB));
System.out.println(TRIZDISTRIBUTION_ID + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_ID));
System.out.println(TRIZDISTRIBUTION_USE + " :" + propertiesFile.getProperty(TRIZDISTRIBUTION_USE));
System.out.println(TRIZSTOCK_BD_PASSWORD + " :" + propertiesFile.getProperty(TRIZSTOCK_BD_PASSWORD));
System.out.println(TRIZSTOCK_BD_DRIVER + " :" + propertiesFile.getProperty(TRIZSTOCK_BD_DRIVER));
System.out.println(TRIZSTOCK_BD_URL + " :" + propertiesFile.getProperty(TRIZSTOCK_BD_URL));
System.out.println(TRIZSTOCK_BD_USER + " :" + propertiesFile.getProperty(TRIZSTOCK_BD_USER));
System.out.println(TRIZSTOCK_USE + " :" + propertiesFile.getProperty(TRIZSTOCK_USE));
System.out.println(TRIZSTOCK_MAITRE + " :" + propertiesFile.getProperty(TRIZSTOCK_MAITRE));
System.out.println(TRIZSTOCK_MAITRE_PORT + " :" + propertiesFile.getProperty(TRIZSTOCK_MAITRE_PORT));
map.put(TRIZDISTRIBUTION_BD_URL, propertiesFile.getProperty(TRIZDISTRIBUTION_BD_URL));
map.put(TRIZDISTRIBUTION_BD_USER, propertiesFile.getProperty(TRIZDISTRIBUTION_BD_USER));
map.put(TRIZDISTRIBUTION_BD_PASSWORD, propertiesFile.getProperty(TRIZDISTRIBUTION_BD_PASSWORD));
map.put(TRIZDISTRIBUTION_BD_DRIVER, propertiesFile.getProperty(TRIZDISTRIBUTION_BD_DRIVER));
map.put(TRIZDISTRIBUTION_SERVEUR_ADRESSEIP, propertiesFile.getProperty(TRIZDISTRIBUTION_SERVEUR_ADRESSEIP));
map.put(TRIZDISTRIBUTION_SERVEUR_PORT, propertiesFile.getProperty(TRIZDISTRIBUTION_SERVEUR_PORT));
map.put(TRIZDISTRIBUTION_ETABLISSEMENT_NOM, propertiesFile.getProperty(TRIZDISTRIBUTION_ETABLISSEMENT_NOM));
map.put(TRIZDISTRIBUTION_MOBILE_PORT, propertiesFile.getProperty(TRIZDISTRIBUTION_MOBILE_PORT));
map.put(TRIZDISTRIBUTION_MOBILE_PORT_MAG, propertiesFile.getProperty(TRIZDISTRIBUTION_MOBILE_PORT_MAG));
map.put(TRIZDISTRIBUTION_MULTI_ETABLISSEMENT_PORT, propertiesFile.getProperty(TRIZDISTRIBUTION_MULTI_ETABLISSEMENT_PORT));
map.put(TRIZDISTRIBUTION_DOSSIER_CHEMAIN, propertiesFile.getProperty(TRIZDISTRIBUTION_DOSSIER_CHEMAIN));
map.put(TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN, propertiesFile.getProperty(TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN));
map.put(TRIZDISTRIBUTION_CODE_ETABLISSEMENT, propertiesFile.getProperty(TRIZDISTRIBUTION_CODE_ETABLISSEMENT));
map.put(TRIZDISTRIBUTION_ADRESSE_WEB, propertiesFile.getProperty(TRIZDISTRIBUTION_ADRESSE_WEB));
map.put(TRIZDISTRIBUTION_ID, propertiesFile.getProperty(TRIZDISTRIBUTION_ID));
map.put(TRIZDISTRIBUTION_USE, propertiesFile.getProperty(TRIZDISTRIBUTION_USE));
map.put(TRIZSTOCK_BD_PASSWORD, propertiesFile.getProperty(TRIZSTOCK_BD_PASSWORD));
map.put(TRIZSTOCK_BD_DRIVER, propertiesFile.getProperty(TRIZSTOCK_BD_DRIVER));
map.put(TRIZSTOCK_BD_URL, propertiesFile.getProperty(TRIZSTOCK_BD_URL));
map.put(TRIZSTOCK_BD_USER, propertiesFile.getProperty(TRIZSTOCK_BD_USER));
map.put(TRIZSTOCK_USE, propertiesFile.getProperty(TRIZSTOCK_USE));
map.put(TRIZSTOCK_MAITRE, propertiesFile.getProperty(TRIZSTOCK_MAITRE));
map.put(TRIZSTOCK_MAITRE_PORT, propertiesFile.getProperty(TRIZSTOCK_MAITRE_PORT));
map.put(TB_USE, propertiesFile.getProperty(TB_USE));
return map;
}
public String getPropertyByKey(String key) {
if (map.containsKey(key)) {
return map.get(key);
}
return null;
}
public Connection getConnection() throws SQLException {
UtilGetParametre ugp = new UtilGetParametre();
String url = ugp.getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_BD_URL);
String userName = ugp.getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_BD_USER);
String passWord = ugp.getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_BD_PASSWORD);
return DriverManager.getConnection(url, userName, passWord);
}
public Connection getConnectionStock() throws SQLException {
UtilGetParametre ugp = new UtilGetParametre();
String url = ugp.getPropertyByKey(UtilGetParametre.TRIZSTOCK_BD_URL);
String userName = ugp.getPropertyByKey(UtilGetParametre.TRIZSTOCK_BD_USER);
String passWord = ugp.getPropertyByKey(UtilGetParametre.TRIZSTOCK_BD_PASSWORD);
return DriverManager.getConnection(url, userName, passWord);
}
public static String getIdEtablissement() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
if(request!=null){
HttpSession mySessin = request.getSession();
return (String)mySessin.getAttribute("idEtablissementStock");
}
return null;
}
public static void setIdEtablissement(String idEtablissement) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
if(request!=null){
HttpSession mySessin = request.getSession();
mySessin.setAttribute("idEtablissementStock", idEtablissement);
// UtilGetParametre.idEtablissement = idEtablissement;
}
}
}

View File

@ -0,0 +1,114 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.text.DecimalFormat;
/**
*
* @author abder_000
*/
public class UtilString {
public static String verificationCaractaire(String mot){
return mot.replace('\'', '`');
}
private static String[] uniteEnLetters = new String[]{"", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf", "dix", "onze", "douze", "treize", "quatorze", "quinze", "seize", "dix-sept", "dix-huit", "dix-neuf"};
private static String[] dixEnLetters = new String[]{"", "dix", "vingt", "trente", "quarante", "cinquante", "soixante", "soixante", "quatre-vingt", "quatre-vingt"};
private static String[] milleEnLetters = new String[]{"", "mille", "million", "milliard"};
private static String centEnLettre(int numbre) {
if (numbre == 0) {
return "";
}
String lettre = "";
if (numbre < 0) {
lettre = " moin ";
numbre = numbre * (-1);
}
int cent = numbre / 100;
lettre = " " + uniteEnLetters[cent] + "";
if (cent > 0) {
if (cent == 1) {
lettre = " cent";
}
else
lettre = lettre + " cent";
}
numbre = numbre - cent * 100;
if (numbre < 20) {
lettre = lettre + " " + uniteEnLetters[numbre];
return lettre;
}
int dix = numbre / 10;
lettre = lettre + " " + dixEnLetters[dix];
numbre = numbre - dix * 10;
if (dix == 7 || dix == 9) {
lettre = lettre + " " + uniteEnLetters[numbre + 10];
} else {
lettre = lettre + " " + uniteEnLetters[numbre];
}
return lettre;
}
public static String num2Letters(double number, String devise) {
if (number == 0) {
return "zéro " + devise;
}
String lettre = "";
int palier = 1000000000;
int indice = 3;
while (palier > 0) {
Double valD = ((Double) number / palier);
int val= valD.intValue();
if (val != 0) {
if(val>=1000 & indice==3){
lettre = lettre + num2Letters(val, milleEnLetters[indice]);
}
else
lettre = lettre + centEnLettre(val) + " " + milleEnLetters[indice];
}
number = number - ((double) val * palier);
palier = palier / 1000;
indice = indice - 1;
}
if (!lettre.isEmpty()) {
lettre = lettre + " " + devise;
}
if (number > 0) {
DecimalFormat franc = new DecimalFormat("#,##0.00 ");
String numbreMontant = franc.format(number);
String[] virg2 = numbreMontant.split(",");
//number = number * 100;
String virgule = "";
if(virg2.length != 0){
virgule =virg2[virg2.length-1];
}
if (!lettre.isEmpty()) {
lettre = lettre + " et";
}
lettre = lettre + " " + virgule + " cts";
}
return lettre;
}
}

View File

@ -0,0 +1,159 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
/**
*
* @author amtou
*/
public class UtilTB {
public static String[][] listParametreTab = new String [][]{
{"prixVente","Prix de vente","valeur","idDetailVente","Double"},
{"quantite","Quantite vendu","valeur","idDetailVente","Double"},
{"nbrColis","Nbr colis","valeur","idDetailVente","Double"},
{"valeurDetail","Valeur detail","valeur","idDetailVente","Double"},
{"valeurAchatDetail","Valeur achat detail","valeur","idDetailVente","Double"},
{"margeDetail","Marge detail","valeur","idDetailVente","Double"},
{"valeurPoid","Poid","valeur","idDetailVente","Double"},
{"remise","Remise","valeur","idDetailVente","Double"},
{"valeurRemiseDetail","Valeur remise detail", "valeur","idDetailVente","Double"},
{"prixReference","Prix achat","valeur","fkProduit","Double"},
{"colissage","Colissage","valeur","fkProduit","Integer"},
{"fkParfum","Parfum","class","fkParfum","String"},
{"fkProduit","Produit","class","fkProduit","String"},
{"fkSousfamille","Sous Famille","class","fkSousfamille","String"},
{"fkFamille","Famille","class","fkFamille","String"},
{"fkMarque","Marque","class","fkMarque","String"},
{"fkTypeProduit","Type de produit","class","fkTypeProduit","String"},
{"poidProduit","Poid de produit","valeur","fkTypeProduit","Double"},
{"idVente","N° vente","valeur","idVente","String"},
{"dateVente","date","date","idVente","date"},
{"month","Mois","date","idVente","Integer"},
{"year","Année","date","idVente","Integer"},
{"dayOfWeekDistribution","Jour de semaine","date","idVente","String"},
{"catigorieVente","categorie de vente", "class","catigorieVente","String"},
{"typePrixVente","Type prix vente","class","typePrixVente","String"},
{"statusConfirmation","Vente confirmer","String","idVente","String"},
{"tauxTVA","TVA","valeur","idVente","Double"},
{"tauxRemise","Remise client","valeur","idVente","Double"},
{"totalTva","total tva","valeur","idVente","Double"},
{"remiseProduit","total remise produit","valeur","idVente","Double"},
{"totalRemise","total remise produit","valeur","idVente","Double"},
{"timbre","Timbre","valeur","idVente","Double"},
{"totalHT","Total HT", "valeur","idVente","Double"},
{"totalTTC","Total TTC","valeur","idVente","Double"},
{"demandeFacture","demande facture","string","idVente","String"},
{"typeDonnee","Type de donnée","string","String","String"},
{"fkTypeTransaction","Type de transaction","class","fkTypeTransaction","String"},
{"idCamion","Camion","class","idCamion","String"},
{"fkVendeur","Vendeur","class","idVente","String"},
{"actif","Produit actif", "string","idVente","String"},
{"route","Route","class","idClient","String"},
{"idClient","Client", "class","idClient","String"},
{"fkCategorieClient","Categorie client", "class","fkCategorieClient","String"},
{"idTypeActivitie","Type activitie client","class","idTypeActivitie","String"},
{"codeCommune","Commune","class","codeCommune","String"} ,
{"fkWilaya","wilaya","class","fkWilaya","String"},
{"fkUnite","Unite","class","fkUnite","String"},
{"idClient","Client","valeur","idClient","String"},
{"prixChangerDetail","Prix changer detail", "valeur","idDetailVente","Double"},
{"fkEtablissement","Etablissement","class","fkEtablissement","String"},
};
public static String[][] listParametreTab_ = new String [][]{
{"prixVente","Prix de vente","valeur","idDetailVente","Double"},
{"quantiteVente","Quantite vendu","valeur","idDetailVente","Double"},
{"nbrColisVendu","Nbr colis vendu","valeur","idDetailVente","Double"},
{"valeurDetailVente","Valeur detail vente","valeur","idDetailVente","Double"},
{"valeurAchatDetailVente","Valeur achat detail vente","valeur","idDetailVente","Double"},
{"margeDetailVente","Marge detail vente","valeur","idDetailVente","Double"},
{"valeurPoid","Poid vendu","valeur","idDetailVente","Double"},
{"remiseVente","Remise vente","valeur","idDetailVente","Double"},
{"valeurRemiseDetail","Valeur remise detail vente", "valeur","idDetailVente","Double"},
{"prixReference","Prix achat","valeur","fkProduit","Double"},
{"clissage","Colissage","valeur","fkProduit","Integer"},
{"fkParfum","Parfum","class","fkParfum","String"},
{"fkProduit","Produit","class","fkProduit","String"},
{"fkSousfamille","Sous Famille","class","fkSousfamille","String"},
{"fkFamille","Famille","class","fkFamille","String"},
{"fkMarque","Marque","class","fkMarque","String"},
{"fkTypeProduit","Type de produit","class","fkTypeProduit","String"},
{"poidProduit","Poid de produit","valeur","fkTypeProduit","Double"},
{"idVente","N° vente","valeur","idVente","String"},
{"dateVente","date","date","idVente","date"},
{"month","Mois","date","idVente","Integer"},
{"year","Année","date","idVente","Integer"},
{"dayOfWeekDistribution","Jour de semaine","date","idVente","String"},
{"catigorieVente","categorie de vente", "class","catigorieVente","String"},
{"typePrixVente","Type prix vente","class","typePrixVente","String"},
{"statusConfirmation","Vente confirmer","String","idVente","String"},
{"tauxTVA","TVA","valeur","idVente","Double"},
{"tauxRemise","Remise client","valeur","idVente","Double"},
{"totalTva","total tva","valeur","idVente","Double"},
{"remiseProduit","total remise produit","valeur","idVente","Double"},
{"totalRemise","total remise produit","valeur","idVente","Double"},
{"timbre","Timbre","valeur","idVente","Double"},
{"totalHT","Total HT", "valeur","idVente","Double"},
{"totalTTC","Total TTC","valeur","idVente","Double"},
{"demandeFacture","demande facture","string","idVente","String"},
{"typeDonnee","Type de vente","String","idVente","String"},
{"fkTypeTransaction","Type de transaction","class","fkTypeTransaction","String"},
{"idCamion","Camion","class","idCamion","String"},
{"fkVendeur","Vendeur","class","idVente","String"},
{"actif","Produit actif", "string","idVente","String"},
{"route","Route","class","idClient","String"},
{"idClient","Client", "class","idClient","String"},
{"fkCategorieClient","Categorie client", "class","fkCategorieClient","String"},
{"idTypeActivitie","Type activitie client","class","idTypeActivitie","String"},
{"codeCommune","Commune","class","codeCommune","String"} ,
{"fkWilaya","wilaya","class","fkWilaya","String"}
};
public static String[][] listFonctionValTab = new String [][]{
{"SUM","Somme"},
{"AVG","Moyenne"},
{"MIN","Min"},
{"MAX","Max"},
{"COUNT","Nombre"}
};
public static String[][] listFonctionOtherTab = new String [][]{
{"COUNT","Nombre"}
};
public static String[][] listFonctionFiltreValTab = new String [][]{
{"egale","Egale"},
{"dif","Differenet"},
{"sup","Sup"},
{"inf","Inf"},
{"sup_egale","Sup ou egale"},
{"inf_egale","Inf ou egale"}
};
public static String[][] listMoisTab = new String [][]{
{"1","Janvier"},
{"2","Fevrier"},
{"3","Mars"},
{"4","Avril"},
{"5","Mai"},
{"6","juin"},
{"7","Juillet"},
{"8","Aout"},
{"9","Septembre"},
{"10","Octobre"},
{"11","Novembre"},
{"12","Décembre"}
};
}

View File

@ -0,0 +1,244 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
import com.triz.trizservice.service.TransactionService;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.List;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @author abderrahim.TOUAIBIA
*/
@Service()
public final class UtilURL {
private static Logger logger = LoggerFactory.getLogger(UtilURL.class);
public static String STOCK_URL_CHEMAIN = "favorites/dashboard.xhtml";
public static String STOCK_URL_CHEMAIN_TB = "favorites/dashboard.xhtml";
public static String STOCK_URL_VENTECOMPTOIRE_CHEMAIN = "/view/venteSuperette/list.xhtml";
public static String DISTRIBUTION_URL = "faces/view/telephone/listActif.xhtml";
public static String TABLEAU_URL = "favorites/dashboard.xhtml";
public static String TABLEAU_URLTB = "favorites/dashboard.xhtml";
public static String STOCK_URL = "favorites/dashboard.xhtml";
public static String STOCK_URL_TB = "favorites/dashboard.xhtml";
public static String STOCK_URL_VENTECOMPTOIRE = "faces/view/venteSuperette/list.xhtml";
public static String DISTRIBUTION_URL_Multi_Etablissement = "faces/view/choixEtablissement/list.xhtml";
public static String DISTRIBUTION_URL_Caisse = "faces/view/venteSuperette/form.xhtml";
public static String DISTRIBUTION_ACCES_DENIEDED_URL = "faces/accesDenieded.xhtml";
public static String DISTRIBUTION_ADMIN_URL = "faces/view/admin/list.xhtml";
public static String URL_PRODUCTION = "faces/view/production/list.xhtml";
public static String DISTRIBUTION_URL_CARTE = "favorites/dashboard.xhtml";
public final static String DISTRIBUTION_CHANGER_MP_Url = "view/profile/changerMotDePasse.xhtml";
public static String idEntreprise;
private String nomEnreprise;
private static Boolean isTableauDeBord = null;
private static Boolean isProuction = null;
private List<String> userGroup;
@Autowired
private TransactionService service;
@Autowired
public UtilContext context;
public boolean showDash(String groupVisibility) {
if (groupVisibility != null) {
for (String ele : groupVisibility.split(";")) {
if (userGroup.contains(ele)) {
return true;
}
}
}
return false;
}
public static String getService_CODE_SYSTEM() {
return getIdEntreprise();
}
public UtilURL() {
}
public static String decodeParam(String param) {
if (param == null || param.isEmpty()) {
return param;
}
try {
param = URLDecoder.decode(param, "UTF-8");
} catch (UnsupportedEncodingException ex) {
logger.error(null, ex);
}
return param;
}
public static String encodeParam(String param) {
if (param == null || param.isEmpty()) {
return param;
}
try {
param = URLEncoder.encode(param, "UTF-8");
} catch (UnsupportedEncodingException ex) {
logger.error(null, ex);
}
return param;
}
public static String getIdEntreprise() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
return (String) mySessin.getAttribute("idEntreprise");
}
public static void setIdEnreprise(String idEntreprise) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
mySessin.setAttribute("idEntreprise", idEntreprise);
}
public static boolean isIsTableauDeBord() {
// if(isTableauDeBord==null){
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
isTableauDeBord = false;
if (mySessin.getAttribute("isTableauDeBordStock") != null) {
isTableauDeBord = (boolean) mySessin.getAttribute("isTableauDeBordStock");
}
System.out.println("isTableauDeBord = " + isTableauDeBord);
// }
if (isTableauDeBord == null) {
return false;
}
return isTableauDeBord;
}
public static void showURL() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
System.out.println("request.getContextPath()" + request.getContextPath());
System.out.println("request.getLocalAddr()" + request.getLocalAddr());
System.out.println("request.getLocalName()" + request.getLocalName());
System.out.println("request.getLocalPort()" + request.getLocalPort());
System.out.println("request.getRemoteAddr()" + request.getRemoteAddr());
System.out.println("request.getPathInfo()" + request.getPathInfo());
System.out.println("request.getRequestURI()" + request.getRequestURI());
System.out.println("request.getServletPath()" + request.getServletPath());
System.out.println("request.toString()" + request.toString());
System.out.println("request.getRemoteHost()" + request.getRemoteHost());
System.out.println("request.getRemotePort()" + request.getRemotePort());
System.out.println("request.getRemoteUser()" + request.getRemoteUser());
}
// request.getContextPath()/TrizStockV2
// request.getLocalAddr()192.168.1.35
// request.getLocalName()DESKTOP-SUETGA1
// request.getLocalPort()8182
// request.getRemoteAddr()192.168.1.43
// request.getPathInfo()null
// request.getRequestURI()/TrizStockV2/j_spring_security_check
// request.getServletPath()/j_spring_security_check
// request.toString()SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper@53e90dfd]
// request.getRemoteHost()192.168.1.43
// request.getRemotePort()52085
// request.getRemoteUser()admin
public static void resetSession() {
System.out.println("// ****** resetSession()");
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession session = request.getSession();
if (session != null && !session.isNew()) {
session.invalidate();
request.getSession(true);
}
}
public static String getURLPath(String ip) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
ip = ip + ":" + request.getLocalPort() + request.getContextPath();
System.out.println("getURLPath:" + ip);
return ip;
}
public static String getContext() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
String ip;
ip = request.getContextPath();
System.out.println("getURLPath:" + ip);
return ip;
}
public static void setFonctionnalite(List<ServiceFonctionnaliter> fonction) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
mySessin.setAttribute("fonctionStock", fonction);
}
public static List<ServiceFonctionnaliter> getFonctionnalite() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
return (List<ServiceFonctionnaliter>) mySessin.getAttribute("fonctionStock");
}
public static String getStock_CODE_SYSTEM() {
return getIdEtablissement();
}
public static String getIdEtablissement() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
return (String) mySessin.getAttribute("idEtablissementStock");
}
public static void setIdEtablissement(String idEtablissement) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
mySessin.setAttribute("idEtablissementStock", idEtablissement);
}
public static void setFonctionnaliteServer(List<ServiceFonctiongroupe> fonction) {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
mySessin.setAttribute("fonctionStock", fonction);
}
public static List<ServiceFonctiongroupe> getFonctionnaliteServer() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
HttpSession mySessin = request.getSession();
return (List<ServiceFonctiongroupe>) mySessin.getAttribute("fonctionStock");
}
}

View File

@ -0,0 +1,72 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.text.MessageFormat;
import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
/**
*
* @author abderrahim.TOUAIBIA
*/
@Service
public final class UtilView {
private static String MESSAGE = "exMessage";
private static String error = "errorMSG";
public static String urlParam(String param){
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
return request.getParameter(param);
}
public static void setErrorMessage(String exMessage) {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(MESSAGE, exMessage);
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(error, true);
}
public static void setInfoMessage(String exMessage) {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(MESSAGE, exMessage);
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(error, false);
}
public static void reinitMessage() {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(MESSAGE, null);
}
public static void updateMessages(boolean update) throws Exception {
String exMessage = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(MESSAGE);
Boolean errorMSG = (Boolean) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(error);
if (exMessage != null) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage((errorMSG != null && errorMSG ? FacesMessage.SEVERITY_ERROR : FacesMessage.SEVERITY_INFO), exMessage, null));
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(MESSAGE, null);
}
}
public static void setAjaxInfoMessage(String exMessage) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_INFO, exMessage, null));
}
public static void setAjaxErrorMessage(String exMessage) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_ERROR, exMessage, null));
}
public static String getMessage(String key, String... param) {
ResourceBundle bundle = ResourceBundle.getBundle("langue.message", FacesContext.getCurrentInstance().getViewRoot().getLocale());
String text = bundle.getString(key);
return MessageFormat.format(text, param);
}
}

View File

@ -0,0 +1,74 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.triz.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.commons.io.IOUtils;
/**
*
* @author HydroTriz
*/
public class ZipUtils {
public static void zipFolder(final File folder, final File zipFile) throws IOException {
zipFolder(folder, new FileOutputStream(zipFile));
}
public static void zipFiles(final List<File> listFiles, final File folder, final File zipFile) throws IOException {
zipFiles(listFiles, folder, new FileOutputStream(zipFile));
}
public static void zipFolder(final File folder, final OutputStream outputStream) throws IOException {
try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
processFolder(folder, zipOutputStream, folder.getPath().length() + 1);
}
}
public static void zipFiles(final List<File> listFiles, final File folder, final OutputStream outputStream) throws IOException {
try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
processFiles(listFiles, zipOutputStream, folder.getPath().length() + 1);
}
}
private static void processFolder(final File folder, final ZipOutputStream zipOutputStream, final int prefixLength)
throws IOException {
for (final File file : folder.listFiles()) {
if (file.isFile()) {
final ZipEntry zipEntry = new ZipEntry(file.getPath().substring(prefixLength));
zipOutputStream.putNextEntry(zipEntry);
try (FileInputStream inputStream = new FileInputStream(file)) {
IOUtils.copy(inputStream, zipOutputStream);
}
zipOutputStream.closeEntry();
} else if (file.isDirectory()) {
processFolder(file, zipOutputStream, prefixLength);
}
}
}
private static void processFiles(final List<File> listFiles, final ZipOutputStream zipOutputStream, final int prefixLength)
throws IOException {
for (final File file : listFiles) {
if (file.isFile()) {
final ZipEntry zipEntry = new ZipEntry(file.getPath().substring(prefixLength));
zipOutputStream.putNextEntry(zipEntry);
try (FileInputStream inputStream = new FileInputStream(file)) {
IOUtils.copy(inputStream, zipOutputStream);
}
zipOutputStream.closeEntry();
} else if (file.isDirectory()) {
processFolder(file, zipOutputStream, prefixLength);
}
}
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.blockviewer;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.component.FacesComponent;
import javax.faces.component.UINamingContainer;
@FacesComponent(value="blockViewer")
@ManagedBean(name="blockViewer", eager=true)
public class BlockViewer extends UINamingContainer implements Serializable {
@Override
public String getFamily() { return "javax.faces.NamingContainer"; }
private enum PropertyKeys {
CODEMODE
}
public void change2PreviewMode() {
setCodeMode(false);
}
public void change2CodeMode() {
setCodeMode(true);
}
public void setCodeMode(boolean expanded) {
getStateHelper().put(PropertyKeys.CODEMODE, expanded);
}
public boolean isCodeMode() {
return (boolean) getStateHelper().eval(PropertyKeys.CODEMODE, false);
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
public class Country implements Serializable {
private String name;
private String code;
public Country() {}
public Country(String name, String code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,98 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
import java.time.LocalDate;
public class Customer implements Serializable {
private int id;
private String name;
private Country country;
private LocalDate date;
private CustomerStatus status;
private int activity;
private Representative representative;
public Customer() {}
public Customer(int id, String name, Country country, LocalDate date, CustomerStatus status, int activity, Representative representative) {
this.id = id;
this.name = name;
this.country = country;
this.date = date;
this.status = status;
this.activity = activity;
this.representative = representative;
}
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 Country getCountry() {
return country;
}
public void setCountry(Country country) {
this.country = country;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public CustomerStatus getStatus() {
return status;
}
public void setStatus(CustomerStatus status) {
this.status = status;
}
public int getActivity() {
return activity;
}
public void setActivity(int activity) {
this.activity = activity;
}
public Representative getRepresentative() {
return representative;
}
public void setRepresentative(Representative representative) {
this.representative = representative;
}
}

View File

@ -0,0 +1,32 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.util.Random;
public enum CustomerStatus {
QUALIFIED,
UNQUALIFIED,
NEGOTIATION,
NEW,
RENEWAL,
PROPOSAL;
public static CustomerStatus random() {
Random random = new Random();
return values()[random.nextInt(values().length)];
}
}

View File

@ -0,0 +1,104 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
public class Document implements Serializable, Comparable<Document> {
private String name;
private String size;
private String type;
public Document(String name, String size, String type) {
this.name = name;
this.size = size;
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
//Eclipse Generated hashCode and equals
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((size == null) ? 0 : size.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Document other = (Document) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (size == null) {
if (other.size != null)
return false;
} else if (!size.equals(other.size))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
return true;
}
@Override
public String toString() {
return name;
}
public int compareTo(Document document) {
return this.getName().compareTo(document.getName());
}
}

View File

@ -0,0 +1,32 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
public enum InventoryStatus {
INSTOCK("In Stock"),
OUTOFSTOCK("Out of Stock"),
LOWSTOCK("Low Stock");
private String text;
InventoryStatus(String text) {
this.text = text;
}
public String getText() {
return text;
}
}

View File

@ -0,0 +1,104 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
import java.time.LocalDate;
public class Order implements Serializable {
private int id;
private String productCode;
private LocalDate date;
private double amount;
private int quantity;
private String customer;
private OrderStatus status;
public Order() {}
public Order(int id, String productCode, LocalDate date, double amount, int quantity, String customer, OrderStatus status) {
this.id = id;
this.productCode = productCode;
this.date = date;
this.amount = amount;
this.quantity = quantity;
this.customer = customer;
this.status = status;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public OrderStatus getStatus() {
return status;
}
public void setStatus(OrderStatus status) {
this.status = status;
}
}

View File

@ -0,0 +1,30 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.util.Random;
public enum OrderStatus {
PENDING,
DELIVERED,
CANCELLED,
RETURNED;
public static OrderStatus random() {
Random random = new Random();
return values()[random.nextInt(values().length)];
}
}

View File

@ -0,0 +1,69 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
public class Photo implements Serializable {
private String itemImageSrc;
private String thumbnailImageSrc;
private String alt;
private String title;
public Photo() {
}
public Photo(String itemImageSrc, String thumbnailImageSrc, String alt, String title) {
this.itemImageSrc = itemImageSrc;
this.thumbnailImageSrc = thumbnailImageSrc;
this.alt = alt;
this.title = title;
}
public String getItemImageSrc() {
return itemImageSrc;
}
public void setItemImageSrc(String itemImageSrc) {
this.itemImageSrc = itemImageSrc;
}
public String getThumbnailImageSrc() {
return thumbnailImageSrc;
}
public void setThumbnailImageSrc(String thumbnailImageSrc) {
this.thumbnailImageSrc = thumbnailImageSrc;
}
public String getAlt() {
return alt;
}
public void setAlt(String alt) {
this.alt = alt;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}

View File

@ -0,0 +1,178 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
import java.util.List;
public class Product implements Serializable {
private int id;
private String code;
private String name;
private String description;
private String image;
private double price;
private String category;
private int quantity;
private InventoryStatus inventoryStatus;
private int rating;
private List<Order> orders;
public Product() {}
public Product(int id, String code, String name, String description, String image, double price, String category, int quantity, InventoryStatus inventoryStatus, int rating) {
this.id = id;
this.code = code;
this.name = name;
this.description = description;
this.image = image;
this.price = price;
this.category = category;
this.quantity = quantity;
this.inventoryStatus = inventoryStatus;
this.rating = rating;
}
public Product clone() {
return new Product(getId(), getCode(), getName(), getDescription(), getImage(), getPrice(), getCategory(), getQuantity(), getInventoryStatus(), getRating());
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
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 String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public InventoryStatus getInventoryStatus() {
return inventoryStatus;
}
public void setInventoryStatus(InventoryStatus inventoryStatus) {
this.inventoryStatus = inventoryStatus;
}
public int getRating() {
return rating;
}
public void setRating(int rating) {
this.rating = rating;
}
public List<Order> getOrders() {
return this.orders;
}
public void setOrders(List<Order> orders) {
this.orders = orders;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((code == null) ? 0 : code.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Product other = (Product) obj;
if (code == null) {
if (other.code != null)
return false;
} else if (!code.equals(other.code))
return false;
return true;
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.domain;
import java.io.Serializable;
public class Representative implements Serializable {
private String name;
private String image;
public Representative() {}
public Representative(String name, String image) {
this.name = name;
this.image = image;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}

View File

@ -0,0 +1,51 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package org.primefaces.demo.jsf;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.config.Scope;
/**
*
* @author Triztech web
*/
public class ViewScope implements Scope {
@Override
public Object get(String name, ObjectFactory objectFactory) {
Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap();
if (viewMap.containsKey(name)) {
return viewMap.get(name);
} else {
Object object = objectFactory.getObject();
viewMap.put(name, object);
return object;
}
}
@Override
public Object remove(String name) {
return FacesContext.getCurrentInstance().getViewRoot().getViewMap().remove(name);
}
@Override
public String getConversationId() {
return null;
}
@Override
public void registerDestructionCallback(String name, Runnable callback) {
//Do nothing ;)
}
@Override
public Object resolveContextualObject(String key) {
return null;
}
}

View File

@ -0,0 +1,104 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.demo.domain.Country;
import org.primefaces.demo.domain.Customer;
import org.primefaces.demo.domain.CustomerStatus;
import org.primefaces.demo.domain.Representative;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Scope("view")
@ManagedBean(name="customerService", eager=true)
public class CustomerService {
private final static Country[] countries;
private final static Representative[] representatives;
private final static String[] names;
List<Customer> customers = new ArrayList<>();
static {
countries = new Country[]{
new Country("Argentina", "ar"),new Country("Australia", "au"),new Country("Brazil", "br"),
new Country("Canada", "ca"),new Country("Germany", "de"),new Country("France", "fr"),
new Country("India", "in"), new Country("Italy", "it"),new Country("Japan", "jp"),
new Country("Russia", "ru"),
new Country("Spain", "es"),new Country("United Kingdom", "gb")};
representatives = new Representative[]{new Representative("Amy Elsner", "amyelsner.png"),new Representative("Anna Fali", "annafali.png"),
new Representative("Asiya Javayant", "asiyajavayant.png"),new Representative("Bernardo Dominic", "bernardodominic.png"),
new Representative("Elwin Sharvill", "elwinsharvill.png"),new Representative("Ioni Bowcher", "ionibowcher.png"),
new Representative("Ivan Magalhaes", "ivanmagalhaes.png"),new Representative("Onyama Limba", "onyamalimba.png"),
new Representative("Stephen Shaw", "stephenshaw.png"),new Representative("Xuxue Feng", "xuxuefeng.png")};
names = new String[]{"James","David","Jeanfrancois","Ivar","Tony","Adams","Claire","Costa","Juan","Maria","Jennifer","Stacey","Leja","Morrow",
"Arvin","Darci","Izzy","Lionel","Clifford","Emily","Kadeem","Mujtaba","Aika","Mayumi","Misaki","Silvio","Nicolas","Antonio",
"Deepesh","Aditya","Aruna","Jones","Julie","Smith","Johnson","Francesco","Salvatore","Kaitlin","Faith","Maisha","Jefferson",
"Leon","Rodrigues","Alejandro","Munro","Cody","Chavez","Sinclair","Isabel","Octavia","Murillo","Greenwood","Wickens","Ashley"};
}
public List<Customer> getCustomers(int number) {
List<Customer> customers = new ArrayList<>();
for (int i = 0; i < number; i++) {
customers.add(new Customer(i + 1000, getCustomerName(), getCountry(), getDate(), CustomerStatus.random(), getActivity(), getRepresentative()));
}
return customers;
}
private String getCustomerName() {
String firstName = this.getName();
String lastName;
while((lastName = this.getName()).equals(firstName)) {}
return firstName + " " + lastName;
}
private String getName() {
return names[(int) (Math.random() * names.length)];
}
private Country getCountry() {
return countries[(int) (Math.random() * countries.length)];
}
private LocalDate getDate() {
LocalDate now = LocalDate.now();
long randomDay = ThreadLocalRandom.current().nextLong(now.minusDays(30).toEpochDay(), now.toEpochDay());
return LocalDate.ofEpochDay(randomDay);
}
private int getActivity() {
return (int) (Math.random() * 100);
}
private Representative getRepresentative() {
return representatives[(int) (Math.random() * representatives.length)];
}
}

View File

@ -0,0 +1,99 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.service;
//import javax.inject.Named;
import javax.faces.bean.ManagedBean;
import org.primefaces.model.CheckboxTreeNode;
import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;
import org.primefaces.demo.domain.Document;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//@Named
@Scope("view")
@ManagedBean(name="documentService", eager=true)
public class DocumentService {
public TreeNode createDocuments() {
TreeNode root = new DefaultTreeNode(new Document("Files", "-", "Folder"), null);
TreeNode documents = new DefaultTreeNode(new Document("Documents", "-", "Folder"), root);
TreeNode pictures = new DefaultTreeNode(new Document("Pictures", "-", "Folder"), root);
TreeNode movies = new DefaultTreeNode(new Document("Movies", "-", "Folder"), root);
TreeNode work = new DefaultTreeNode(new Document("Work", "-", "Folder"), documents);
TreeNode primefaces = new DefaultTreeNode(new Document("PrimeFaces", "-", "Folder"), documents);
//Documents
TreeNode expenses = new DefaultTreeNode("document", new Document("Expenses.doc", "30 KB", "Word Document"), work);
TreeNode resume = new DefaultTreeNode("document", new Document("Resume.doc", "10 KB", "Word Document"), work);
TreeNode refdoc = new DefaultTreeNode("document", new Document("RefDoc.pages", "40 KB", "Pages Document"), primefaces);
//Pictures
TreeNode barca = new DefaultTreeNode("picture", new Document("barcelona.jpg", "30 KB", "JPEG Image"), pictures);
TreeNode primelogo = new DefaultTreeNode("picture", new Document("logo.jpg", "45 KB", "JPEG Image"), pictures);
TreeNode optimus = new DefaultTreeNode("picture", new Document("optimusprime.png", "96 KB", "PNG Image"), pictures);
//Movies
TreeNode pacino = new DefaultTreeNode(new Document("Al Pacino", "-", "Folder"), movies);
TreeNode deniro = new DefaultTreeNode(new Document("Robert De Niro", "-", "Folder"), movies);
TreeNode scarface = new DefaultTreeNode("mp3", new Document("Scarface", "15 GB", "Movie File"), pacino);
TreeNode carlitosWay = new DefaultTreeNode("mp3", new Document("Carlitos' Way", "24 GB", "Movie File"), pacino);
TreeNode goodfellas = new DefaultTreeNode("mp3", new Document("Goodfellas", "23 GB", "Movie File"), deniro);
TreeNode untouchables = new DefaultTreeNode("mp3", new Document("Untouchables", "17 GB", "Movie File"), deniro);
return root;
}
public TreeNode createCheckboxDocuments() {
TreeNode root = new CheckboxTreeNode(new Document("Files", "-", "Folder"), null);
TreeNode documents = new CheckboxTreeNode(new Document("Documents", "-", "Folder"), root);
TreeNode pictures = new CheckboxTreeNode(new Document("Pictures", "-", "Folder"), root);
TreeNode movies = new CheckboxTreeNode(new Document("Movies", "-", "Folder"), root);
TreeNode work = new CheckboxTreeNode(new Document("Work", "-", "Folder"), documents);
TreeNode primefaces = new CheckboxTreeNode(new Document("PrimeFaces", "-", "Folder"), documents);
//Documents
TreeNode expenses = new CheckboxTreeNode("document", new Document("Expenses.doc", "30 KB", "Word Document"), work);
TreeNode resume = new CheckboxTreeNode("document", new Document("Resume.doc", "10 KB", "Word Document"), work);
TreeNode refdoc = new CheckboxTreeNode("document", new Document("RefDoc.pages", "40 KB", "Pages Document"), primefaces);
//Pictures
TreeNode barca = new CheckboxTreeNode("picture", new Document("barcelona.jpg", "30 KB", "JPEG Image"), pictures);
TreeNode primelogo = new CheckboxTreeNode("picture", new Document("logo.jpg", "45 KB", "JPEG Image"), pictures);
TreeNode optimus = new CheckboxTreeNode("picture", new Document("optimusprime.png", "96 KB", "PNG Image"), pictures);
//Movies
TreeNode pacino = new CheckboxTreeNode(new Document("Al Pacino", "-", "Folder"), movies);
TreeNode deniro = new CheckboxTreeNode(new Document("Robert De Niro", "-", "Folder"), movies);
TreeNode scarface = new CheckboxTreeNode("mp3", new Document("Scarface", "15 GB", "Movie File"), pacino);
TreeNode carlitosWay = new CheckboxTreeNode("mp3", new Document("Carlitos' Way", "24 GB", "Movie File"), pacino);
TreeNode goodfellas = new CheckboxTreeNode("mp3", new Document("Goodfellas", "23 GB", "Movie File"), deniro);
TreeNode untouchables = new CheckboxTreeNode("mp3", new Document("Untouchables", "17 GB", "Movie File"), deniro);
return root;
}
}

View File

@ -0,0 +1,84 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.demo.domain.Order;
import org.primefaces.demo.domain.OrderStatus;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("orderService")
@ManagedBean(name="orderService", eager=true)
public class OrderService {
private final static String[] names;
static {
names = new String[]{"James","David","Jeanfrancois","Ivar","Tony","Adams","Claire","Costa","Juan","Maria","Jennifer","Stacey","Leja","Morrow",
"Arvin","Darci","Izzy","Lionel","Clifford","Emily","Kadeem","Mujtaba","Aika","Mayumi","Misaki","Silvio","Nicolas","Antonio",
"Deepesh","Aditya","Aruna","Jones","Julie","Smith","Johnson","Francesco","Salvatore","Kaitlin","Faith","Maisha","Jefferson",
"Leon","Rodrigues","Alejandro","Munro","Cody","Chavez","Sinclair","Isabel","Octavia","Murillo","Greenwood","Wickens","Ashley"};
}
public List<Order> getOrders(int number) {
List<Order> orders = new ArrayList<>();
for (int i = 0; i < number; i++) {
orders.add(new Order(i + 1000, getProductCode(), getDate(), getAmount(), getQuantity(), getCustomerName(), OrderStatus.random()));
}
return orders;
}
private String getCustomerName() {
String firstName = this.getName();
String lastName;
while((lastName = this.getName()).equals(firstName)) {}
return firstName + " " + lastName;
}
private String getName() {
return names[(int) (Math.random() * names.length)];
}
private String getProductCode() {
return UUID.randomUUID().toString().substring(6, 16);
}
private LocalDate getDate() {
LocalDate now = LocalDate.now();
long randomDay = ThreadLocalRandom.current().nextLong(now.minusDays(30).toEpochDay(), now.toEpochDay());
return LocalDate.ofEpochDay(randomDay);
}
private double getAmount() {
return ThreadLocalRandom.current().nextDouble(1, 200);
}
private int getQuantity() {
return ThreadLocalRandom.current().nextInt(1, 10);
}
}

View File

@ -0,0 +1,75 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.service;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.demo.domain.Photo;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("photoService")
@ManagedBean(name="photoService", eager=true)
public class PhotoService {
private List<Photo> photos;
////@PostConstruct
public void init() {
photos = new ArrayList<>();
photos.add(new Photo("demo/images/galleria/galleria1.jpg", "demo/images/galleria/galleria1s.jpg",
"Description for Image 1", "Title 1"));
photos.add(new Photo("demo/images/galleria/galleria2.jpg", "demo/images/galleria/galleria2s.jpg",
"Description for Image 2", "Title 2"));
photos.add(new Photo("demo/images/galleria/galleria3.jpg", "demo/images/galleria/galleria3s.jpg",
"Description for Image 3", "Title 3"));
photos.add(new Photo("demo/images/galleria/galleria4.jpg", "demo/images/galleria/galleria4s.jpg",
"Description for Image 4", "Title 4"));
photos.add(new Photo("demo/images/galleria/galleria5.jpg", "demo/images/galleria/galleria5s.jpg",
"Description for Image 5", "Title 5"));
photos.add(new Photo("demo/images/galleria/galleria6.jpg", "demo/images/galleria/galleria6s.jpg",
"Description for Image 6", "Title 6"));
photos.add(new Photo("demo/images/galleria/galleria7.jpg", "demo/images/galleria/galleria7s.jpg",
"Description for Image 7", "Title 7"));
photos.add(new Photo("demo/images/galleria/galleria8.jpg", "demo/images/galleria/galleria8s.jpg",
"Description for Image 8", "Title 8"));
photos.add(new Photo("demo/images/galleria/galleria9.jpg", "demo/images/galleria/galleria9s.jpg",
"Description for Image 9", "Title 9"));
photos.add(new Photo("demo/images/galleria/galleria10.jpg", "demo/images/galleria/galleria10s.jpg",
"Description for Image 10", "Title 10"));
photos.add(new Photo("demo/images/galleria/galleria11.jpg", "demo/images/galleria/galleria11s.jpg",
"Description for Image 11", "Title 11"));
photos.add(new Photo("demo/images/galleria/galleria12.jpg", "demo/images/galleria/galleria12s.jpg",
"Description for Image 12", "Title 12"));
photos.add(new Photo("demo/images/galleria/galleria13.jpg", "demo/images/galleria/galleria13s.jpg",
"Description for Image 13", "Title 13"));
photos.add(new Photo("demo/images/galleria/galleria14.jpg", "demo/images/galleria/galleria14s.jpg",
"Description for Image 14", "Title 14"));
photos.add(new Photo("demo/images/galleria/galleria15.jpg", "demo/images/galleria/galleria15s.jpg",
"Description for Image 15", "Title 15"));
}
public List<Photo> getPhotos() {
return photos;
}
}

View File

@ -0,0 +1,108 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.demo.domain.InventoryStatus;
import org.primefaces.demo.domain.Product;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("productService")
@ApplicationScoped
@ManagedBean(name="productService", eager=true)
public class ProductService {
List<Product> products;
//@PostConstruct
public void init() {
products = new ArrayList<>();
products.add(new Product(1000, "f230fh0g3", "Bamboo Watch", "Product Description", "bamboo-watch.jpg", 65, "Accessories", 24, InventoryStatus.INSTOCK, 5));
products.add(new Product(1001, "nvklal433", "Black Watch", "Product Description", "black-watch.jpg", 72, "Accessories", 61, InventoryStatus.OUTOFSTOCK, 4));
products.add(new Product(1002, "zz21cz3c1", "Blue Band", "Product Description", "blue-band.jpg", 79, "Fitness", 2, InventoryStatus.LOWSTOCK, 3));
products.add(new Product(1003, "244wgerg2", "Blue T-Shirt", "Product Description", "blue-t-shirt.jpg", 29, "Clothing", 25, InventoryStatus.INSTOCK, 5));
products.add(new Product(1004, "h456wer53", "Bracelet", "Product Description", "bracelet.jpg", 15, "Accessories", 73, InventoryStatus.INSTOCK, 4));
products.add(new Product(1005, "av2231fwg", "Brown Purse", "Product Description", "brown-purse.jpg", 120, "Accessories", 0, InventoryStatus.OUTOFSTOCK, 4));
products.add(new Product(1006, "bib36pfvm", "Chakra Bracelet", "Product Description", "chakra-bracelet.jpg", 32, "Accessories", 5, InventoryStatus.LOWSTOCK, 3));
products.add(new Product(1007, "mbvjkgip5", "Galaxy Earrings", "Product Description", "galaxy-earrings.jpg", 34, "Accessories", 23, InventoryStatus.INSTOCK, 5));
products.add(new Product(1008, "vbb124btr", "Game Controller", "Product Description", "game-controller.jpg", 99, "Electronics", 2, InventoryStatus.LOWSTOCK, 4));
products.add(new Product(1009, "cm230f032", "Gaming Set", "Product Description", "gaming-set.jpg", 299, "Electronics", 63, InventoryStatus.INSTOCK, 3));
products.add(new Product(1010, "plb34234v", "Gold Phone Case", "Product Description", "gold-phone-case.jpg", 24, "Accessories", 0, InventoryStatus.OUTOFSTOCK, 4));
products.add(new Product(1011, "4920nnc2d", "Green Earbuds", "Product Description", "green-earbuds.jpg", 89, "Electronics", 23, InventoryStatus.INSTOCK, 4));
products.add(new Product(1012, "250vm23cc", "Green T-Shirt", "Product Description", "green-t-shirt.jpg", 49, "Clothing", 74, InventoryStatus.INSTOCK, 5));
products.add(new Product(1013, "fldsmn31b", "Grey T-Shirt", "Product Description", "grey-t-shirt.jpg", 48, "Clothing", 0, InventoryStatus.OUTOFSTOCK, 3));
products.add(new Product(1014, "waas1x2as", "Headphones", "Product Description", "headphones.jpg", 175, "Electronics", 8, InventoryStatus.LOWSTOCK, 5));
products.add(new Product(1015, "vb34btbg5", "Light Green T-Shirt", "Product Description", "light-green-t-shirt.jpg", 49, "Clothing", 34, InventoryStatus.INSTOCK, 4));
products.add(new Product(1016, "k8l6j58jl", "Lime Band", "Product Description", "lime-band.jpg", 79, "Fitness", 12, InventoryStatus.INSTOCK, 3));
products.add(new Product(1017, "v435nn85n", "Mini Speakers", "Product Description", "mini-speakers.jpg", 85, "Clothing", 42, InventoryStatus.INSTOCK, 4));
products.add(new Product(1018, "09zx9c0zc", "Painted Phone Case", "Product Description", "painted-phone-case.jpg", 56, "Accessories", 41, InventoryStatus.INSTOCK, 5));
products.add(new Product(1019, "mnb5mb2m5", "Pink Band", "Product Description", "pink-band.jpg", 79, "Fitness", 63, InventoryStatus.INSTOCK, 4));
products.add(new Product(1020, "r23fwf2w3", "Pink Purse", "Product Description", "pink-purse.jpg", 110, "Accessories", 0, InventoryStatus.OUTOFSTOCK, 4));
products.add(new Product(1021, "pxpzczo23", "Purple Band", "Product Description", "purple-band.jpg", 79, "Fitness", 6, InventoryStatus.LOWSTOCK, 3));
products.add(new Product(1022, "2c42cb5cb", "Purple Gemstone Necklace", "Product Description", "purple-gemstone-necklace.jpg", 45, "Accessories", 62, InventoryStatus.INSTOCK, 4));
products.add(new Product(1023, "5k43kkk23", "Purple T-Shirt", "Product Description", "purple-t-shirt.jpg", 49, "Clothing", 2, InventoryStatus.LOWSTOCK, 5));
products.add(new Product(1024, "lm2tny2k4", "Shoes", "Product Description", "shoes.jpg", 64, "Clothing", 0, InventoryStatus.INSTOCK, 4));
products.add(new Product(1025, "nbm5mv45n", "Sneakers", "Product Description", "sneakers.jpg", 78, "Clothing", 52, InventoryStatus.INSTOCK, 4));
products.add(new Product(1026, "zx23zc42c", "Teal T-Shirt", "Product Description", "teal-t-shirt.jpg", 49, "Clothing", 3, InventoryStatus.LOWSTOCK, 3));
products.add(new Product(1027, "acvx872gc", "Yellow Earbuds", "Product Description", "yellow-earbuds.jpg", 89, "Electronics", 35, InventoryStatus.INSTOCK, 3));
products.add(new Product(1028, "tx125ck42", "Yoga Mat", "Product Description", "yoga-mat.jpg", 20, "Fitness", 15, InventoryStatus.INSTOCK, 5));
products.add(new Product(1029, "gwuby345v", "Yoga Set", "Product Description", "yoga-set.jpg", 20, "Fitness", 25, InventoryStatus.INSTOCK, 8));
}
public List<Product> getProducts() {
return new ArrayList<>(products);
}
public List<Product> getProducts(int size) {
if (size > products.size()) {
Random rand = new Random();
List<Product> randomList = new ArrayList<>();
for (int i = 0; i < size; i++) {
int randomIndex = rand.nextInt(products.size());
randomList.add(products.get(randomIndex));
}
return randomList;
}
else {
return new ArrayList<>(products.subList(0, size));
}
}
public List<Product> getClonedProducts(int size) {
List<Product> results = new ArrayList<>();
List<Product> originals = getProducts(size);
for (Product original : originals) {
results.add(original.clone());
}
return results;
}
}

View File

@ -0,0 +1,518 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.favorites;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.model.charts.ChartData;
import org.primefaces.model.charts.bar.BarChartDataSet;
import org.primefaces.model.charts.bar.BarChartModel;
import org.primefaces.model.charts.donut.DonutChartDataSet;
import org.primefaces.model.charts.donut.DonutChartModel;
import org.primefaces.model.charts.line.LineChartDataSet;
import org.primefaces.model.charts.line.LineChartModel;
import org.primefaces.model.charts.pie.PieChartDataSet;
import org.primefaces.model.charts.pie.PieChartModel;
import org.primefaces.demo.domain.Product;
import org.primefaces.demo.service.ProductService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//@Component("dashboardAnalyticsView")
@Scope("view")
@ManagedBean(name = "dashboardAnalyticsView", eager = true)
public class DashboardAnalyticsView implements Serializable {
private List<Product> products;
private BarChartModel monthlyChartModel;
private DonutChartModel donutChartModel;
private PieChartModel pieChartModel;
private int storeADiff = 0;
private int storeBDiff = 0;
private int storeCDiff = 0;
private int storeDDiff = 0;
private int storeATotalValue = 100;
private int storeBTotalValue = 120;
private int storeCTotalValue = 150;
private int storeDTotalValue = 80;
private LineChartModel storeAModel;
private LineChartModel storeBModel;
private LineChartModel storeCModel;
private LineChartModel storeDModel;
//@Inject
private ProductService service;
//@PostConstruct
public void init() {
if (this.service == null) {
this.service = new ProductService();
this.service.init();
}
products = this.service.getProducts();
createMonthlyChart();
createDonutChart();
createPieChart();
List<String> labels = new ArrayList<>();
labels.add("January");
labels.add("February");
labels.add("March");
labels.add("April");
labels.add("May");
labels.add("June");
labels.add("July");
labels.add("August");
labels.add("September");
createStoreAChart(labels);
createStoreBChart(labels);
createStoreCChart(labels);
createStoreDChart(labels);
}
public void createMonthlyChart() {
monthlyChartModel = new BarChartModel();
ChartData data = new ChartData();
List<String> labels = new ArrayList<>();
labels.add("January");
labels.add("February");
labels.add("March");
labels.add("April");
labels.add("May");
labels.add("June");
labels.add("July");
data.setLabels(labels);
BarChartDataSet barDataSet1 = new BarChartDataSet();
List<Number> values1 = new ArrayList<>();
values1.add(6);
values1.add(25);
values1.add(97);
values1.add(12);
values1.add(7);
values1.add(70);
values1.add(42);
barDataSet1.setLabel("2012");
barDataSet1.setData(values1);
barDataSet1.setBorderWidth(2);
data.addChartDataSet(barDataSet1);
BarChartDataSet barDataSet2 = new BarChartDataSet();
List<Number> values2 = new ArrayList<>();
values2.add(81);
values2.add(3);
values2.add(5);
values2.add(11);
values2.add(59);
values2.add(47);
values2.add(99);
barDataSet2.setLabel("2013");
barDataSet2.setData(values2);
barDataSet2.setBorderWidth(2);
data.addChartDataSet(barDataSet2);
BarChartDataSet barDataSet3 = new BarChartDataSet();
List<Number> values3 = new ArrayList<>();
values3.add(68);
values3.add(47);
values3.add(46);
values3.add(46);
values3.add(61);
values3.add(70);
values3.add(94);
barDataSet3.setLabel("2014");
barDataSet3.setData(values3);
barDataSet3.setBorderWidth(2);
data.addChartDataSet(barDataSet3);
BarChartDataSet barDataSet4 = new BarChartDataSet();
List<Number> values4 = new ArrayList<>();
values4.add(31);
values4.add(9);
values4.add(18);
values4.add(76);
values4.add(6);
values4.add(11);
values4.add(79);
barDataSet4.setLabel("2015");
barDataSet4.setData(values4);
barDataSet4.setBorderWidth(2);
data.addChartDataSet(barDataSet4);
BarChartDataSet barDataSet5 = new BarChartDataSet();
List<Number> values5 = new ArrayList<>();
values5.add(85);
values5.add(37);
values5.add(47);
values5.add(29);
values5.add(2);
values5.add(10);
values5.add(54);
barDataSet5.setLabel("2016");
barDataSet5.setData(values5);
barDataSet5.setBorderWidth(2);
data.addChartDataSet(barDataSet5);
BarChartDataSet barDataSet6 = new BarChartDataSet();
List<Number> values6 = new ArrayList<>();
values6.add(28);
values6.add(48);
values6.add(40);
values6.add(19);
values6.add(86);
values6.add(27);
values6.add(90);
barDataSet6.setLabel("2017");
barDataSet6.setData(values6);
barDataSet6.setBorderWidth(2);
data.addChartDataSet(barDataSet6);
BarChartDataSet barDataSet7 = new BarChartDataSet();
List<Number> values7 = new ArrayList<>();
values7.add(89);
values7.add(18);
values7.add(95);
values7.add(18);
values7.add(97);
values7.add(61);
values7.add(54);
barDataSet7.setLabel("2018");
barDataSet7.setData(values7);
barDataSet7.setBorderWidth(2);
data.addChartDataSet(barDataSet7);
BarChartDataSet barDataSet8 = new BarChartDataSet();
List<Number> values8 = new ArrayList<>();
values8.add(18);
values8.add(36);
values8.add(39);
values8.add(58);
values8.add(41);
values8.add(50);
values8.add(72);
barDataSet8.setLabel("2019");
barDataSet8.setData(values8);
barDataSet8.setBorderWidth(2);
data.addChartDataSet(barDataSet8);
BarChartDataSet barDataSet9 = new BarChartDataSet();
List<Number> values9 = new ArrayList<>();
values9.add(31);
values9.add(4);
values9.add(35);
values9.add(74);
values9.add(47);
values9.add(35);
values9.add(46);
barDataSet9.setLabel("2020");
barDataSet9.setData(values9);
barDataSet9.setBorderWidth(2);
data.addChartDataSet(barDataSet9);
monthlyChartModel.setData(data);
monthlyChartModel.setExtender("monthlyChartExtender");
}
public void createDonutChart() {
donutChartModel = new DonutChartModel();
ChartData data = new ChartData();
DonutChartDataSet dataSet = new DonutChartDataSet();
List<Number> values = new ArrayList<>();
values.add(11);
values.add(29);
values.add(71);
values.add(33);
values.add(28);
values.add(95);
values.add(6);
dataSet.setData(values);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("Sunday");
labels.add("Monday");
labels.add("Tuesday");
labels.add("Wednesday");
labels.add("Thursday");
labels.add("Friday");
labels.add("Saturday");
data.setLabels(labels);
donutChartModel.setData(data);
donutChartModel.setExtender("donutChartExtender");
}
public void createPieChart() {
pieChartModel = new PieChartModel();
ChartData data = new ChartData();
PieChartDataSet dataSet = new PieChartDataSet();
List<Number> values = new ArrayList<>();
values.add(300);
values.add(50);
values.add(100);
dataSet.setData(values);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("O");
labels.add("D");
labels.add("R");
data.setLabels(labels);
pieChartModel.setData(data);
pieChartModel.setExtender("pieChartExtender");
}
public LineChartModel createStoreChart(List<String> labels, List<Object> values) {
LineChartModel overviewChartModel = new LineChartModel();
ChartData data = new ChartData();
data.setLabels(labels);
LineChartDataSet dataSet = new LineChartDataSet();
dataSet.setData(values);
dataSet.setFill(true);
dataSet.setBackgroundColor("rgba(77, 208, 225, 0.8)");
dataSet.setBorderWidth(2);
dataSet.setBorderColor("#4DD0E1");
dataSet.setTension(0.4);
data.addChartDataSet(dataSet);
overviewChartModel.setData(data);
return overviewChartModel;
}
public void createStoreAChart(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(55);
values.add(3);
values.add(45);
values.add(6);
values.add(44);
values.add(58);
values.add(84);
values.add(68);
values.add(64);
storeAModel = createStoreChart(labels, values);
storeAModel.setExtender("storeAChartExtender");
}
public void createStoreBChart(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(81);
values.add(75);
values.add(63);
values.add(100);
values.add(69);
values.add(79);
values.add(38);
values.add(37);
values.add(76);
storeBModel = createStoreChart(labels, values);
storeBModel.setExtender("storeBChartExtender");
}
public void createStoreCChart(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(99);
values.add(55);
values.add(22);
values.add(72);
values.add(24);
values.add(79);
values.add(35);
values.add(91);
values.add(48);
storeCModel = createStoreChart(labels, values);
storeCModel.setExtender("storeCChartExtender");
}
public void createStoreDChart(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(5);
values.add(51);
values.add(68);
values.add(82);
values.add(28);
values.add(21);
values.add(29);
values.add(45);
values.add(44);
storeDModel = createStoreChart(labels, values);
storeDModel.setExtender("storeDChartExtender");
}
public void calculateStore() {
// A
int randomNumber = (int) (Math.random() * 100 + 1);
ChartData data = storeAModel.getData();
LineChartDataSet dataSet = (LineChartDataSet) data.getDataSet().get(0);
List<Object> values = dataSet.getData();
storeADiff = randomNumber - (int) values.get(values.size() - 1);
storeATotalValue += storeADiff;
values.remove(0);
values.add(randomNumber);
// B
randomNumber = (int) (Math.random() * 100 + 1);
data = storeBModel.getData();
dataSet = (LineChartDataSet) data.getDataSet().get(0);
values = dataSet.getData();
storeBDiff = randomNumber - (int) values.get(values.size() - 1);
storeBTotalValue += storeBDiff;
values.remove(0);
values.add(randomNumber);
// C
randomNumber = (int) (Math.random() * 100 + 1);
data = storeCModel.getData();
dataSet = (LineChartDataSet) data.getDataSet().get(0);
values = dataSet.getData();
storeCDiff = randomNumber - (int) values.get(values.size() - 1);
storeCTotalValue += storeCDiff;
values.remove(0);
values.add(randomNumber);
// D
randomNumber = (int) (Math.random() * 100 + 1);
data = storeDModel.getData();
dataSet = (LineChartDataSet) data.getDataSet().get(0);
values = dataSet.getData();
storeDDiff = randomNumber - (int) values.get(values.size() - 1);
storeDTotalValue += storeDDiff;
values.remove(0);
values.add(randomNumber);
}
public List<Product> getProducts() {
return products;
}
public BarChartModel getMonthlyChartModel() {
return monthlyChartModel;
}
public DonutChartModel getDonutChartModel() {
return donutChartModel;
}
public PieChartModel getPieChartModel() {
return pieChartModel;
}
public int getStoreADiff() {
return storeADiff;
}
public void setStoreADiff(int storeADiff) {
this.storeADiff = storeADiff;
}
public int getStoreBDiff() {
return storeBDiff;
}
public void setStoreBDiff(int storeBDiff) {
this.storeBDiff = storeBDiff;
}
public int getStoreCDiff() {
return storeCDiff;
}
public void setStoreCDiff(int storeCDiff) {
this.storeCDiff = storeCDiff;
}
public int getStoreDDiff() {
return storeDDiff;
}
public void setStoreDDiff(int storeDDiff) {
this.storeDDiff = storeDDiff;
}
public int getStoreATotalValue() {
return storeATotalValue;
}
public void setStoreATotalValue(int storeATotalValue) {
this.storeATotalValue = storeATotalValue;
}
public int getStoreBTotalValue() {
return storeBTotalValue;
}
public void setStoreBTotalValue(int storeBTotalValue) {
this.storeBTotalValue = storeBTotalValue;
}
public int getStoreCTotalValue() {
return storeCTotalValue;
}
public void setStoreCTotalValue(int storeCTotalValue) {
this.storeCTotalValue = storeCTotalValue;
}
public int getStoreDTotalValue() {
return storeDTotalValue;
}
public void setStoreDTotalValue(int storeDTotalValue) {
this.storeDTotalValue = storeDTotalValue;
}
public LineChartModel getStoreAModel() {
return storeAModel;
}
public LineChartModel getStoreBModel() {
return storeBModel;
}
public LineChartModel getStoreCModel() {
return storeCModel;
}
public LineChartModel getStoreDModel() {
return storeDModel;
}
}

View File

@ -0,0 +1,433 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.favorites;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.inject.Inject;
//import javax.inject.Named;
import org.primefaces.model.charts.ChartData;
import org.primefaces.model.charts.line.LineChartDataSet;
import org.primefaces.model.charts.line.LineChartModel;
import org.primefaces.model.charts.line.LineChartOptions;
import org.primefaces.model.charts.optionconfig.elements.Elements;
import org.primefaces.model.charts.optionconfig.elements.ElementsPoint;
import org.primefaces.model.charts.optionconfig.legend.Legend;
import org.primefaces.model.charts.optionconfig.tooltip.Tooltip;
import org.primefaces.demo.domain.Product;
import org.primefaces.demo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//@Component("dashboardView")
//@Scope("view")
@ManagedBean(name = "dashboardView", eager = true)
@SessionScoped
public class DashboardView implements Serializable {
private List<Product> products;
private List<Message> chatMessages;
private String[] chatEmojis;
private List<Event> chronolineEvents;
private LineChartModel ordersChartModel;
private LineChartModel overviewChartModel1;
private LineChartModel overviewChartModel2;
private LineChartModel overviewChartModel3;
private LineChartModel overviewChartModel4;
private String chatMessage = "";
@Autowired
private ProductService service;
//@PostConstruct
public void init() {
if (this.service == null) {
this.service = new ProductService();
this.service.init();
}
products = this.service.getProducts();
chatMessages = new ArrayList<>();
chatMessages.add(new Message("Ioni Bowcher", "images/avatar/ionibowcher.png", new ArrayList<String>(Arrays.asList("Hey M. hope you are well.", "Our idea is accepted by the board. Now it's time to execute it"))));
chatMessages.add(new Message(new ArrayList<String>(Arrays.asList("We did it! 🤠"))));
chatMessages.add(new Message("Ioni Bowcher", "images/avatar/ionibowcher.png", new ArrayList<String>(Arrays.asList("That's really good!"))));
chatMessages.add(new Message(Arrays.asList("But it's important to ship MVP ASAP")));
chatMessages.add(new Message("Ioni Bowcher", "images/avatar/ionibowcher.png", new ArrayList<String>(Arrays.asList("I'll be looking at the process then, just to be sure 🤓"))));
chatMessages.add(new Message(new ArrayList<String>(Arrays.asList("That's awesome. Thanks!"))));
chatEmojis = new String[]{
"😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣", "😇", "😉", "😊", "🙂", "🙃", "😋", "😌", "😍", "🥰", "😘", "😗", "😙", "😚", "🤪", "😜", "😝", "😛",
"🤑", "😎", "🤓", "🧐", "🤠", "🥳", "🤗", "🤡", "😏", "😶", "😐", "😑", "😒", "🙄", "🤨", "🤔", "🤫", "🤭", "🤥", "😳", "😞", "😟", "😠", "😡", "🤬", "😔",
"😟", "😠", "😡", "🤬", "😔", "😕", "🙁", "😬", "🥺", "😣", "😖", "😫", "😩", "🥱", "😤", "😮", "😱", "😨", "😰", "😯", "😦", "😧", "😢", "😥", "😪", "🤤"
};
chronolineEvents = new ArrayList<>();
chronolineEvents.add(new Event("Ordered", "15/10/2020 10:30", "pi pi-shopping-cart", "#E91E63", "Richard Jones (C8012) has ordered a blue t-shirt for $79."));
chronolineEvents.add(new Event("Processing", "15/10/2020 14:00", "pi pi-cog", "#FB8C00", "Order #99207 has processed succesfully."));
chronolineEvents.add(new Event("Shipped", "15/10/2020 16:15", "pi pi-compass", "#673AB7", "Order #99207 has shipped with shipping code 2222302090."));
chronolineEvents.add(new Event("Delivered", "16/10/2020 10:00", "pi pi-check-square", "#0097A7", "Richard Jones (C8012) has recieved his blue t-shirt."));
List<String> labels = new ArrayList<>();
labels.add("January");
labels.add("February");
labels.add("March");
labels.add("April");
labels.add("May");
labels.add("June");
labels.add("July");
labels.add("August");
labels.add("September");
createOrdersChart(labels);
createOverviewChart1(labels);
createOverviewChart2(labels);
createOverviewChart3(labels);
createOverviewChart4(labels);
}
public void createOrdersChart(List<String> labels) {
ordersChartModel = new LineChartModel();
ChartData data = new ChartData();
data.setLabels(labels);
LineChartDataSet dataSet1 = new LineChartDataSet();
List<Object> values1 = new ArrayList<>();
values1.add(31);
values1.add(83);
values1.add(69);
values1.add(29);
values1.add(62);
values1.add(25);
values1.add(59);
values1.add(26);
values1.add(46);
dataSet1.setData(values1);
dataSet1.setLabel("New Orders");
dataSet1.setFill(true);
dataSet1.setBackgroundColor("rgba(77, 208, 225, 0.8)");
dataSet1.setBorderWidth(2);
dataSet1.setBorderColor("#4DD0E1");
dataSet1.setTension(0.4);
data.addChartDataSet(dataSet1);
LineChartDataSet dataSet2 = new LineChartDataSet();
List<Object> values2 = new ArrayList<>();
values2.add(67);
values2.add(98);
values2.add(27);
values2.add(88);
values2.add(38);
values2.add(3);
values2.add(22);
values2.add(60);
values2.add(56);
dataSet2.setData(values2);
dataSet2.setLabel("Completed Orders");
dataSet2.setFill(true);
dataSet2.setBackgroundColor("rgba(63, 81, 181, 0.8)");
dataSet2.setBorderWidth(2);
dataSet2.setBorderColor("#3F51B5");
dataSet2.setTension(0.4);
data.addChartDataSet(dataSet2);
ordersChartModel.setData(data);
ordersChartModel.setExtender("ordersChartExtender");
}
public LineChartModel createOverviewChart(List<String> labels, List<Object> values) {
LineChartModel overviewChartModel = new LineChartModel();
ChartData data = new ChartData();
data.setLabels(labels);
LineChartDataSet dataSet = new LineChartDataSet();
dataSet.setData(values);
dataSet.setFill(true);
dataSet.setBackgroundColor("rgba(77, 208, 225, 0.8)");
dataSet.setBorderWidth(2);
dataSet.setBorderColor("#4DD0E1");
dataSet.setTension(0.4);
data.addChartDataSet(dataSet);
LineChartOptions options = new LineChartOptions();
Legend legend = new Legend();
legend.setDisplay(false);
options.setLegend(legend);
Tooltip tooltip = new Tooltip();
tooltip.setEnabled(false);
options.setTooltip(tooltip);
Elements elements = new Elements();
ElementsPoint point = new ElementsPoint();
point.setRadius(0);
elements.setPoint(point);
options.setElements(elements);
overviewChartModel.setOptions(options);
overviewChartModel.setData(data);
return overviewChartModel;
}
public void createOverviewChart1(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(50);
values.add(64);
values.add(32);
values.add(24);
values.add(18);
values.add(27);
values.add(20);
values.add(36);
values.add(30);
overviewChartModel1 = createOverviewChart(labels, values);
overviewChartModel1.setExtender("overviewChartExtender1");
}
public void createOverviewChart2(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(11);
values.add(30);
values.add(52);
values.add(35);
values.add(39);
values.add(20);
values.add(14);
values.add(18);
values.add(29);
overviewChartModel2 = createOverviewChart(labels, values);
overviewChartModel2.setExtender("overviewChartExtender2");
}
public void createOverviewChart3(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(20);
values.add(29);
values.add(39);
values.add(36);
values.add(45);
values.add(24);
values.add(28);
values.add(20);
values.add(15);
overviewChartModel3 = createOverviewChart(labels, values);
overviewChartModel3.setExtender("overviewChartExtender3");
}
public void createOverviewChart4(List<String> labels) {
List<Object> values = new ArrayList<>();
values.add(30);
values.add(39);
values.add(50);
values.add(21);
values.add(33);
values.add(18);
values.add(10);
values.add(24);
values.add(20);
overviewChartModel4 = createOverviewChart(labels, values);
overviewChartModel4.setExtender("overviewChartExtender4");
}
public void addEmoji(String emoji) {
chatMessage += emoji;
}
public void addMessage() {
Message lastMessage = chatMessages.get(chatMessages.size() - 1);
if (lastMessage.from != null) {
chatMessages.add(new Message(new ArrayList<String>(Arrays.asList(chatMessage))));
} else {
lastMessage.messages.add(chatMessage);
}
Pattern pattern = Pattern.compile("primeng|primereact|primefaces|primevue", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(chatMessage);
if (matcher.find()) {
chatMessages.add(new Message("Ioni Bowcher", "images/avatar/ionibowcher.png", new ArrayList<String>(Arrays.asList("Always bet on Prime!"))));
}
chatMessage = "";
}
public List<Product> getProducts() {
return products;
}
public List<Message> getChatMessages() {
return chatMessages;
}
public String[] getChatEmojis() {
return chatEmojis;
}
public List<Event> getChronolineEvents() {
return chronolineEvents;
}
public LineChartModel getOrdersChartModel() {
return ordersChartModel;
}
public LineChartModel getOverviewChartModel1() {
return overviewChartModel1;
}
public LineChartModel getOverviewChartModel2() {
return overviewChartModel2;
}
public LineChartModel getOverviewChartModel3() {
return overviewChartModel3;
}
public LineChartModel getOverviewChartModel4() {
return overviewChartModel4;
}
public String getChatMessage() {
return chatMessage;
}
public void setChatMessage(String chatMessage) {
this.chatMessage = chatMessage;
}
public static class Event {
private String status;
private String date;
private String icon;
private String color;
private String description;
public Event() {
}
public Event(String status, String date, String icon, String color, String description) {
this.status = status;
this.date = date;
this.icon = icon;
this.color = color;
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
public static class Message {
private String from;
private String url;
private List<String> messages;
public Message() {
}
public Message(List<String> messages) {
this.messages = messages;
}
public Message(String from, String url, List<String> messages) {
this(messages);
this.from = from;
this.url = url;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<String> getMessages() {
return messages;
}
public void setMessages(List<String> messages) {
this.messages = messages;
}
}
}

View File

@ -0,0 +1,317 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.pages;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import javax.faces.view.ViewScoped;
//import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.event.schedule.ScheduleEntryMoveEvent;
import org.primefaces.event.schedule.ScheduleEntryResizeEvent;
import org.primefaces.model.DefaultScheduleEvent;
import org.primefaces.model.DefaultScheduleModel;
import org.primefaces.model.ScheduleEvent;
import org.primefaces.model.ScheduleModel;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("calendarDemoView")
@Scope("view")
@ManagedBean(name="calendarDemoView", eager=true)
public class CalendarDemoView implements Serializable {
private ScheduleModel eventModel;
private ScheduleEvent event = new DefaultScheduleEvent();
private boolean showWeekends = true;
private boolean tooltip = true;
private boolean allDaySlot = true;
private String timeFormat;
private String slotDuration="00:30:00";
private String slotLabelInterval;
private String scrollTime="06:00:00";
private String minTime="04:00:00";
private String maxTime="20:00:00";
private String locale="en";
private String timeZone="";
private String clientTimeZone="local";
private String columnHeaderFormat="";
//@PostConstruct
public void init() {
eventModel = new DefaultScheduleModel();
DefaultScheduleEvent event = DefaultScheduleEvent.builder()
.title("Client A Meeting")
.startDate(previousDay8Pm())
.endDate(previousDay11Pm())
.description("Gather Requirements")
.build();
eventModel.addEvent(event);
event = DefaultScheduleEvent.builder()
.title("Sales Reports")
.startDate(today1Pm())
.endDate(today6Pm())
.description("Review Reports")
.overlapAllowed(true)
.build();
eventModel.addEvent(event);
event = DefaultScheduleEvent.builder()
.title("Webinar")
.startDate(nextDay9Am())
.endDate(nextDay11Am())
.description("Live Event")
.overlapAllowed(true)
.build();
eventModel.addEvent(event);
event = DefaultScheduleEvent.builder()
.title("Client B Meeting")
.startDate(theDayAfter3Pm())
.endDate(fourDaysLater3pm())
.description("Introduce Team")
.build();
eventModel.addEvent(event);
DefaultScheduleEvent scheduleEventAllDay=DefaultScheduleEvent.builder()
.title("Team Meeting")
.startDate(sevenDaysLater0am())
.endDate(eightDaysLater0am())
.description("Discuss Revenue Stream")
.allDay(true)
.build();
eventModel.addEvent(scheduleEventAllDay);
}
public LocalDateTime getRandomDateTime(LocalDateTime base) {
LocalDateTime dateTime = base.withMinute(0).withSecond(0).withNano(0);
return dateTime.plusDays(((int) (Math.random()*30)));
}
public ScheduleModel getEventModel() {
return eventModel;
}
private LocalDateTime previousDay8Pm() {
return LocalDateTime.now().minusDays(1).withHour(20).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime previousDay11Pm() {
return LocalDateTime.now().minusDays(1).withHour(23).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime today1Pm() {
return LocalDateTime.now().withHour(13).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime theDayAfter3Pm() {
return LocalDateTime.now().plusDays(1).withHour(15).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime today6Pm() {
return LocalDateTime.now().withHour(18).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime nextDay9Am() {
return LocalDateTime.now().plusDays(1).withHour(9).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime nextDay11Am() {
return LocalDateTime.now().plusDays(1).withHour(11).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime fourDaysLater3pm() {
return LocalDateTime.now().plusDays(4).withHour(15).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime sevenDaysLater0am() {
return LocalDateTime.now().plusDays(7).withHour(0).withMinute(0).withSecond(0).withNano(0);
}
private LocalDateTime eightDaysLater0am() {
return LocalDateTime.now().plusDays(7).withHour(0).withMinute(0).withSecond(0).withNano(0);
}
public LocalDate getInitialDate() {
return LocalDate.now().plusDays(1);
}
public ScheduleEvent getEvent() {
return event;
}
public void setEvent(ScheduleEvent event) {
this.event = event;
}
public void addEvent() {
if (event.isAllDay()) {
//see https://github.com/primefaces/primefaces/issues/1164
if (event.getStartDate().toLocalDate().equals(event.getEndDate().toLocalDate())) {
event.setEndDate(event.getEndDate().plusDays(1));
}
}
if(event.getId() == null)
eventModel.addEvent(event);
else
eventModel.updateEvent(event);
event = new DefaultScheduleEvent();
}
public void onEventSelect(SelectEvent<ScheduleEvent> selectEvent) {
event = selectEvent.getObject();
}
public void onDateSelect(SelectEvent<LocalDateTime> selectEvent) {
event = DefaultScheduleEvent.builder().startDate(selectEvent.getObject()).endDate(selectEvent.getObject().plusHours(1)).build();
}
public void onEventMove(ScheduleEntryMoveEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event moved", "Delta:" + event.getDeltaAsDuration());
addMessage(message);
}
public void onEventResize(ScheduleEntryResizeEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event resized", "Start-Delta:" + event.getDeltaStartAsDuration() + ", End-Delta: " + event.getDeltaEndAsDuration());
addMessage(message);
}
private void addMessage(FacesMessage message) {
FacesContext.getCurrentInstance().addMessage(null, message);
}
public boolean isShowWeekends() {
return showWeekends;
}
public void setShowWeekends(boolean showWeekends) {
this.showWeekends = showWeekends;
}
public boolean isTooltip() {
return tooltip;
}
public void setTooltip(boolean tooltip) {
this.tooltip = tooltip;
}
public boolean isAllDaySlot() {
return allDaySlot;
}
public void setAllDaySlot(boolean allDaySlot) {
this.allDaySlot = allDaySlot;
}
public String getTimeFormat() {
return timeFormat;
}
public void setTimeFormat(String timeFormat) {
this.timeFormat = timeFormat;
}
public String getSlotDuration() {
return slotDuration;
}
public void setSlotDuration(String slotDuration) {
this.slotDuration = slotDuration;
}
public String getSlotLabelInterval() {
return slotLabelInterval;
}
public void setSlotLabelInterval(String slotLabelInterval) {
this.slotLabelInterval = slotLabelInterval;
}
public String getScrollTime() {
return scrollTime;
}
public void setScrollTime(String scrollTime) {
this.scrollTime = scrollTime;
}
public String getMinTime() {
return minTime;
}
public void setMinTime(String minTime) {
this.minTime = minTime;
}
public String getMaxTime() {
return maxTime;
}
public void setMaxTime(String maxTime) {
this.maxTime = maxTime;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public String getTimeZone() {
return timeZone;
}
public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}
public String getClientTimeZone() {
return clientTimeZone;
}
public void setClientTimeZone(String clientTimeZone) {
this.clientTimeZone = clientTimeZone;
}
public String getColumnHeaderFormat() {
return columnHeaderFormat;
}
public void setColumnHeaderFormat(String columnHeaderFormat) {
this.columnHeaderFormat = columnHeaderFormat;
}
}

View File

@ -0,0 +1,122 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.pages;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//import javax.inject.Named;
@Component("chronolineView")
@Scope("view")
public class ChronolineView {
private List<Event> events;
private List<String> events2;
//@PostConstruct
public void init() {
events = new ArrayList<>();
events.add(new Event("Ordered", "15/1/2021 10:30", "pi pi-shopping-cart", "#9C27B0", "game-controller.jpg"));
events.add(new Event("Processing", "15/1/2021 14:00", "pi pi-cog", "#673AB7"));
events.add(new Event("Shipped", "15/1/2021 16:15", "pi pi-envelope", "#FF9800"));
events.add(new Event("Delivered", "16/1/2021 10:00", "pi pi-check", "#607D8B"));
events2 = new ArrayList<>();
events2.add("2021");
events2.add("2021");
events2.add("2022");
events2.add("2023");
}
public List<Event> getEvents() {
return events;
}
public List<String> getEvents2() {
return events2;
}
public static class Event {
String status;
String date;
String icon;
String color;
String image;
public Event() {
}
public Event(String status, String date, String icon, String color) {
this.status = status;
this.date = date;
this.icon = icon;
this.color = color;
}
public Event(String status, String date, String icon, String color, String image) {
this.status = status;
this.date = date;
this.icon = icon;
this.color = color;
this.image = image;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}
}

View File

@ -0,0 +1,131 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.pages;
import java.io.Serializable;
import java.util.List;
import java.util.UUID;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
//import javax.inject.Named;
import org.primefaces.PrimeFaces;
import org.primefaces.event.ToggleEvent;
import org.primefaces.model.Visibility;
import org.primefaces.demo.domain.Product;
import org.primefaces.demo.service.OrderService;
import org.primefaces.demo.service.ProductService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("crudDemoView")
@Scope("view")
public class CrudDemoView implements Serializable {
private List<Product> products;
private Product selectedProduct;
private List<Product> selectedProducts;
//@Inject
private ProductService productService;
//@Inject
private OrderService orderService;
//@PostConstruct
public void init() {
this.products = this.productService.getClonedProducts(30);
}
public List<Product> getProducts() {
return products;
}
public Product getSelectedProduct() {
return selectedProduct;
}
public void setSelectedProduct(Product selectedProduct) {
this.selectedProduct = selectedProduct;
}
public List<Product> getSelectedProducts() {
return selectedProducts;
}
public void setSelectedProducts(List<Product> selectedProducts) {
this.selectedProducts = selectedProducts;
}
public void openNew() {
this.selectedProduct = new Product();
}
public void saveProduct() {
if (this.selectedProduct.getCode() == null) {
this.selectedProduct.setCode(UUID.randomUUID().toString().replaceAll("-", "").substring(0, 9));
this.products.add(this.selectedProduct);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Product Added"));
}
else {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Product Updated"));
}
PrimeFaces.current().executeScript("PF('manageProductDialog').hide()");
PrimeFaces.current().ajax().update("form:messages", "form:dt-products");
}
public void deleteProduct() {
this.products.remove(this.selectedProduct);
this.selectedProduct = null;
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Product Removed"));
PrimeFaces.current().ajax().update("form:messages", "form:dt-products");
}
public String getDeleteButtonMessage() {
if (hasSelectedProducts()) {
int size = this.selectedProducts.size();
return size > 1 ? size + " products selected" : "1 product selected";
}
return "Delete";
}
public boolean hasSelectedProducts() {
return this.selectedProducts != null && !this.selectedProducts.isEmpty();
}
public void deleteSelectedProducts() {
this.products.removeAll(this.selectedProducts);
this.selectedProducts = null;
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Products Removed"));
PrimeFaces.current().ajax().update("form:messages", "form:dt-products");
}
public void onRowToggle(ToggleEvent event) {
if (event.getVisibility() == Visibility.VISIBLE) {
Product product = (Product) event.getData();
if (product.getOrders() == null) {
product.setOrders(orderService.getOrders((int) (Math.random() * 10)));
}
}
}
}

View File

@ -0,0 +1,160 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.pages;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//import javax.inject.Named;
@Component("invoiceDemoView")
@Scope("view")
@ManagedBean(name="invoiceDemoView", eager=true)
public class InvoiceDemoView {
private List<Bill> billData;
private List<Product> productData;
//@PostConstruct
public void init() {
billData = new ArrayList<>();
billData.add(new Bill("TOYOKSU SYSCOM CORPORATION 11-27, MEIEKI 4-CHROME NAKAMURA-KU, NAGOYA 450-0002 JAPAN", "30/08/2021", "A/3100", "N/A"));
productData = new ArrayList<>();
productData.add(new Product("License A", "4", "$99.00", "$396.00"));
productData.add(new Product("License B", "1", "$790.00", "$790.00"));
productData.add(new Product("License C", "2", "$59.00", "$118.00"));
}
public List<Bill> getBillData() {
return billData;
}
public void setBillData(List<Bill> billData) {
this.billData = billData;
}
public List<Product> getProductData() {
return productData;
}
public void setProductData(List<Product> productData) {
this.productData = productData;
}
public static class Bill implements Serializable {
private String to;
private String date;
private String no;
private String notes;
public Bill() {
}
public Bill(String to, String date, String no, String notes) {
this.to = to;
this.date = date;
this.no = no;
this.notes = notes;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
}
public static class Product implements Serializable {
private String description;
private String quantity;
private String price;
private String total;
public Product() {
}
public Product(String description, String quantity, String price, String total) {
this.description = description;
this.quantity = quantity;
this.price = price;
this.total = total;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
}
}

View File

@ -0,0 +1,458 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.primeblocks;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.view.ViewScoped;
//import javax.inject.Named;
import org.primefaces.PrimeFaces;
import org.primefaces.util.EscapeUtils;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("blocksDemoView")
@Scope("view")
@ManagedBean(name="blocksDemoView", eager=true)
public class BlocksDemoView implements Serializable {
private final String block1 = "<div class=\"grid grid-nogutter surface-section text-800\">\n" +
" <div class=\"col-12 md:col-6 p-6 text-center md:text-left flex align-items-center \">\n" +
" <section>\n" +
" <span class=\"block text-6xl font-bold mb-1\">Create the screens your</span>\n" +
" <div class=\"text-6xl text-primary font-bold mb-3\">your visitors deserve to see</div>\n" +
" <p class=\"mt-0 mb-4 text-700 line-height-3\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>\n" +
"\n" +
" <p:commandButton value=\"Learn More\" type=\"button\" class=\"mr-3 ui-button-raised\"/>\n" +
" <p:commandButton value=\"Live Demo\" type=\"button\" class=\"ui-button-outlined\"/>\n" +
" </section>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-6 overflow-hidden\">\n" +
" <p:graphicImage name=\"images/primeblocks/hero/hero-1.png\" library=\"demo\" alt=\"Image\"\n" +
" styleClass=\"md:ml-auto block md:h-full\"\n" +
" style=\"clip-path: polygon(8% 0, 100% 0%, 100% 100%, 0 100%)\"/>\n" +
" </div>\n" +
"</div>";
private final String block2 = "<div class=\"surface-section text-center\">\n" +
" <div class=\"mb-3 font-bold text-2xl\">\n" +
" <span class=\"text-900\">One Product, </span>\n" +
" <span class=\"text-blue-600\">Many Solutions</span>\n" +
" </div>\n" +
" <div class=\"text-700 text-sm mb-6\">Ac turpis egestas maecenas pharetra convallis posuere morbi leo urna.\n" +
" </div>\n" +
" <div class=\"grid\">\n" +
" <div class=\"col-12 md:col-4 mb-4 px-5\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-desktop text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">Built for Developers</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Duis aute irure dolor in reprehenderit in voluptate\n" +
" velit esse cillum dolore eu fugiat nulla pariatur.</span>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-4 mb-4 px-5\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-lock text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">End-to-End Encryption</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Risus nec feugiat in fermentum posuere urna nec.\n" +
" Posuere sollicitudin aliquam ultrices sagittis.</span>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-4 mb-4 px-5\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-check-circle text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">Easy to Use</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Ornare suspendisse sed nisi lacus sed viverra\n" +
" tellus. Neque volutpat ac tincidunt vitae semper.</span>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-4 mb-4 px-5\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-globe text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">Fast &amp; Global Support</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Fermentum et sollicitudin ac orci phasellus egestas\n" +
" tellus rutrum tellus.</span>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-4 mb-4 px-5\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-github text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">Open Source</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Nec tincidunt praesent semper feugiat. Sed\n" +
" adipiscing diam donec adipiscing tristique risus nec feugiat. </span>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-4 md:mb-4 mb-0 px-3\">\n" +
" <span class=\"p-3 shadow-2 mb-3 inline-block surface-card\" style=\"border-radius: 10px\">\n" +
" <i class=\"pi pi-shield text-4xl text-blue-500\" />\n" +
" </span>\n" +
" <div class=\"text-900 mb-3 font-medium\">Trusted Securitty</div>\n" +
" <span class=\"text-700 text-sm line-height-3\">Mattis rhoncus urna neque viverra justo nec\n" +
" ultrices. Id cursus metus aliquam eleifend.</span>\n" +
" </div>\n" +
" </div>\n" +
"</div>";
private final String block3 = "<div>\n" +
" <div class=\"text-900 font-bold text-6xl mb-4 text-center\">Pricing Plans</div>\n" +
" <div class=\"text-700 text-xl mb-6 text-center line-height-3\">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Velit numquam eligendi quos.</div>\n" +
"\n" +
" <div class=\"grid\">\n" +
" <div class=\"col-12 lg:col-4\">\n" +
" <div class=\"p-3 h-full\">\n" +
" <div class=\"shadow-2 p-3 h-full flex flex-column surface-card\" style=\"border-radius: 6px\">\n" +
" <div class=\"text-900 font-medium text-xl mb-2\">Basic</div>\n" +
" <div class=\"text-600\">Plan description</div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <div class=\"flex align-items-center\">\n" +
" <span class=\"font-bold text-2xl text-900\">$9</span>\n" +
" <span class=\"ml-2 font-medium text-600\">per month</span>\n" +
" </div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <ul class=\"list-none p-0 m-0 flex-grow-1\">\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Arcu vitae elementum</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Dui faucibus in ornare</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Morbi tincidunt augue</span>\n" +
" </li>\n" +
" </ul>\n" +
" <hr class=\"mb-3 mx-0 border-top-1 border-bottom-none surface-border mt-auto\"/>\n" +
" <p:commandButton type=\"button\" value=\"Buy Now\" styleClass=\"px-3 py-2 w-full mt-auto\"/>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"\n" +
" <div class=\"col-12 lg:col-4\">\n" +
" <div class=\"p-3 h-full\">\n" +
" <div class=\"shadow-2 p-3 h-full flex flex-column surface-card\" style=\"border-radius: 6px\">\n" +
" <div class=\"text-900 font-medium text-xl mb-2\">Premium</div>\n" +
" <div class=\"text-600\">Plan description</div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <div class=\"flex align-items-center\">\n" +
" <span class=\"font-bold text-2xl text-900\">$29</span>\n" +
" <span class=\"ml-2 font-medium text-600\">per month</span>\n" +
" </div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <ul class=\"list-none p-0 m-0 flex-grow-1\">\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Arcu vitae elementum</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Dui faucibus in ornare</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Morbi tincidunt augue</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Duis ultricies lacus sed</span>\n" +
" </li>\n" +
" </ul>\n" +
" <hr class=\"mb-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <p:commandButton type=\"button\" value=\"Buy Now\" styleClass=\"px-3 py-2 w-full\"/>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"\n" +
" <div class=\"col-12 lg:col-4\">\n" +
" <div class=\"p-3 h-full\">\n" +
" <div class=\"shadow-2 p-3 flex flex-column surface-card\" style=\"border-radius: 6px\">\n" +
" <div class=\"text-900 font-medium text-xl mb-2\">Enterprise</div>\n" +
" <div class=\"text-600\">Plan description</div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <div class=\"flex align-items-center\">\n" +
" <span class=\"font-bold text-2xl text-900\">$49</span>\n" +
" <span class=\"ml-2 font-medium text-600\">per month</span>\n" +
" </div>\n" +
" <hr class=\"my-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <ul class=\"list-none p-0 m-0 flex-grow-1\">\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Arcu vitae elementum</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Dui faucibus in ornare</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Morbi tincidunt augue</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Duis ultricies lacus sed</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Imperdiet proin</span>\n" +
" </li>\n" +
" <li class=\"flex align-items-center mb-3\">\n" +
" <i class=\"pi pi-check-circle text-green-500 mr-2\"/>\n" +
" <span>Nisi scelerisque</span>\n" +
" </li>\n" +
" </ul>\n" +
" <hr class=\"mb-3 mx-0 border-top-1 border-bottom-none surface-border\"/>\n" +
" <p:commandButton type=\"button\" value=\"Buy Now\"\n" +
" styleClass=\"px-3 py-2 w-full ui-button-outlined\"/>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>";
private final String block4 = "<div class=\"surface-section text-700 text-center\">\n" +
" <div class=\"text-blue-600 font-bold mb-3\"><i class=\"pi pi-discord\"/>&#160;POWERED BY DISCORD</div>\n" +
" <div class=\"text-900 font-bold text-5xl mb-3\">Join Our Design Community</div>\n" +
" <div class=\"text-700 text-2xl mb-5\">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Velit numquam eligendi quos.</div>\n" +
" <p:commandButton type=\"button\" value=\"Join Now\" icon=\"pi pi-discord ml-4\"\n" +
" styleClass=\"font-bold px-4 py-2 ui-button-raised rounded-button white-space-nowrap\"/>\n" +
"</div>";
private final String block5 = "<div class=\"bg-bluegray-900 text-gray-100 p-3 flex justify-content-between lg:justify-content-center align-items-center flex-wrap\">\n" +
" <div class=\"font-bold mr-8\">\uD83D\uDD25 Hot Deals!</div>\n" +
" <div class=\"align-items-center hidden lg:flex\">\n" +
" <span class=\"line-height-3\">Libero voluptatum atque exercitationem praesentium provident odit.</span>\n" +
" </div>\n" +
" <div class=\"flex align-items-center ml-2 mr-8\">\n" +
" <a class=\"text-white\" href=\"#\"><span class=\"underline font-bold\">Learn More</span></a>\n" +
" </div>\n" +
" <a class=\"flex align-items-center no-underline justify-content-center border-circle text-white-100 hover:bg-bluegray-700 cursor-pointer transition-colors transition-duration-150\"\n" +
" style=\"width:2rem; height: 2rem\">\n" +
" <i class=\"pi pi-times\"></i>\n" +
" </a>\n" +
"</div>";
private final String block6 = "<div class=\"surface-section px-4 py-5 md:px-6 lg:px-8\">\n" +
" <ul class=\"list-none p-0 m-0 flex align-items-center font-medium mb-3\">\n" +
" <li>\n" +
" <a class=\"text-500 no-underline line-height-3 cursor-pointer\">Application</a>\n" +
" </li>\n" +
" <li class=\"px-2\">\n" +
" <i class=\"pi pi-angle-right text-500 line-height-3\"/>\n" +
" </li>\n" +
" <li>\n" +
" <span class=\"text-900 line-height-3\">Analytics</span>\n" +
" </li>\n" +
" </ul>\n" +
" <div class=\"flex align-items-start flex-column lg:justify-content-between lg:flex-row\">\n" +
" <div>\n" +
" <div class=\"font-medium text-3xl text-900\">Customers</div>\n" +
" <div class=\"flex align-items-center text-700 flex-wrap\">\n" +
" <div class=\"mr-5 flex align-items-center mt-3\">\n" +
" <i class=\"pi pi-users mr-2\"/>\n" +
" <span>332 Active Users</span>\n" +
" </div>\n" +
" <div class=\"mr-5 flex align-items-center mt-3\">\n" +
" <i class=\"pi pi-globe mr-2\"/>\n" +
" <span>9402 Sessions</span>\n" +
" </div>\n" +
" <div class=\"flex align-items-center mt-3\">\n" +
" <i class=\"pi pi-clock mr-2\"/>\n" +
" <span>2.32m Avg. Duration</span>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"mt-3 lg:mt-0\">\n" +
" <p:commandButton type=\"button\" value=\"Add\" icon=\"pi pi-user-plus\"\n" +
" styleClass=\"ui-button-outlined mr-2\"/>\n" +
" <p:commandButton type=\"button\" value=\"Save\" icon=\"pi pi-check\"/>\n" +
" </div>\n" +
" </div>\n" +
"</div>" ;
private final String block7 = "<div class=\"surface-ground\">\n" +
" <div class=\"text-900 font-bold text-2xl line-height-2 mb-3\">\uD83C\uDF55 Choice of all Ninja Turtles</div>\n" +
" <p class=\"text-600 line-height-3 text-lg m-0 mb-5\">Excepteur sint occaecat cupidatat\n" +
" non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n" +
"\n" +
" <div class=\"grid\">\n" +
" <div class=\"col-12 md:col-6 lg:col-3\">\n" +
" <div class=\"px-5 py-3 surface-card shadow-2 border-round\">\n" +
" <div class=\"text-blue-600 font-medium line-height-3 mb-2\">Neapolitan</div>\n" +
" <div class=\"text-900 font-bold line-height-3 text-2xl mb-2\">995</div>\n" +
" <p class=\"text-700 line-height-3 m-0\">Nostrum laborum accusamus quia iste facere possimus minus itaque error unde.</p>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-6 lg:col-3\">\n" +
" <div class=\"px-5 py-3 surface-card shadow-2 border-round\">\n" +
" <div class=\"text-blue-600 font-medium line-height-3 mb-2\">Pepperoni</div>\n" +
" <div class=\"text-900 font-bold line-height-3 text-2xl mb-2\">1504</div>\n" +
" <p class=\"text-700 line-height-3 m-0\">Nostrum laborum accusamus quia iste facere possimus minus itaque error unde.</p>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-6 lg:col-3\">\n" +
" <div class=\"px-5 py-3 surface-card shadow-2 border-round\">\n" +
" <div class=\"text-blue-600 font-medium line-height-3 mb-2\">Margherita</div>\n" +
" <div class=\"text-900 font-bold line-height-3 text-2xl mb-2\">2038</div>\n" +
" <p class=\"text-700 line-height-3 m-0\">Nostrum laborum accusamus quia iste facere possimus minus itaque error unde.</p>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"col-12 md:col-6 lg:col-3\">\n" +
" <div class=\"px-5 py-3 surface-card shadow-2 border-round\">\n" +
" <div class=\"text-blue-600 font-medium line-height-3 mb-2\">BBQ Chicken</div>\n" +
" <div class=\"text-900 font-bold line-height-3 text-2xl mb-2\">766</div>\n" +
" <p class=\"text-700 line-height-3 m-0\">Nostrum laborum accusamus quia iste facere possimus minus itaque error unde.</p>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>";
private final String block8 = "<div class=\"flex align-items-center justify-content-center\">\n" +
" <div class=\"surface-card p-4 shadow-2 border-round w-full lg:w-6\">\n" +
" <div class=\"text-center mb-5\">\n" +
" <p:graphicImage name=\"images/primeblocks/logos/hyper.svg\" library=\"demo\" alt=\"Image\"\n" +
" height=\"50\" styleClass=\"mb-3\"/>\n" +
" <div class=\"text-900 text-3xl font-medium mb-3\">Welcome Back</div>\n" +
" <span class=\"text-600 font-medium line-height-3\">Don't have an account?</span>\n" +
" <a class=\"font-medium no-underline ml-2 text-blue-500 cursor-pointer\">Create today!</a>\n" +
" </div>\n" +
"\n" +
" <div>\n" +
" <label for=\"email1\" class=\"block text-900 font-medium mb-2\">Email</label>\n" +
" <p:inputText id=\"email1\" styleClass=\"w-full mb-3\"/>\n" +
"\n" +
" <label for=\"password1\" class=\"block text-900 font-medium mb-2\">Password</label>\n" +
" <p:inputText id=\"password1\" type=\"password\" styleClass=\"w-full mb-3\"/>\n" +
"\n" +
" <div class=\"flex align-items-center justify-content-between mb-6\">\n" +
" <div class=\"flex align-items-center\">\n" +
" <p:selectBooleanCheckbox id=\"rememberme\" styleClass=\"mr-2\"/>\n" +
" <label for=\"rememberme\">Remember me</label>\n" +
" </div>\n" +
" <a class=\"font-medium no-underline ml-2 text-blue-500 text-right cursor-pointer\">Forgot your password?</a>\n" +
" </div>\n" +
"\n" +
" <p:commandButton type=\"button\" value=\"Sign In\" icon=\"pi pi-user\" styleClass=\"w-full\"/>\n" +
" </div>\n" +
" </div>\n" +
"</div>" ;
private final String block9 = "<div class=\"surface-section\">\n" +
" <div class=\"font-medium text-3xl text-900 mb-3\">Movie Information</div>\n" +
" <div class=\"text-500 mb-5\">Morbi tristique blandit turpis. In viverra ligula id nulla hendrerit rutrum.</div>\n" +
" <ul class=\"list-none p-0 m-0\">\n" +
" <li class=\"flex align-items-center py-3 px-2 border-top-1 surface-border flex-wrap\">\n" +
" <div class=\"text-500 w-6 md:w-2 font-medium\">Title</div>\n" +
" <div class=\"text-900 w-full md:w-8 md:flex-order-0 flex-order-1\">Heat</div>\n" +
" <div class=\"w-6 md:w-2 flex justify-content-end\">\n" +
" <p:commandButton type=\"button\" value=\"Edit\" icon=\"pi pi-pencil\"\n" +
" styleClass=\"ui-button-flat\"/>\n" +
" </div>\n" +
" </li>\n" +
" <li class=\"flex align-items-center py-3 px-2 border-top-1 surface-border flex-wrap\">\n" +
" <div class=\"text-500 w-6 md:w-2 font-medium\">Genre</div>\n" +
" <div class=\"text-900 w-full md:w-8 md:flex-order-0 flex-order-1\">\n" +
" <p:chip label=\"Crime\" styleClass=\"mr-2\"/>\n" +
" <p:chip label=\"Drama\" styleClass=\"mr-2\"/>\n" +
" <p:chip label=\"Thriller\"/>\n" +
" </div>\n" +
" <div class=\"w-6 md:w-2 flex justify-content-end\">\n" +
" <p:commandButton type=\"button\" value=\"Edit\" icon=\"pi pi-pencil\"\n" +
" styleClass=\"ui-button-flat\"/>\n" +
" </div>\n" +
" </li>\n" +
" <li class=\"flex align-items-center py-3 px-2 border-top-1 surface-border flex-wrap\">\n" +
" <div class=\"text-500 w-6 md:w-2 font-medium\">Director</div>\n" +
" <div class=\"text-900 w-full md:w-8 md:flex-order-0 flex-order-1\">Michael Mann</div>\n" +
" <div class=\"w-6 md:w-2 flex justify-content-end\">\n" +
" <p:commandButton type=\"button\" value=\"Edit\" icon=\"pi pi-pencil\"\n" +
" styleClass=\"ui-button-flat\"/>\n" +
" </div>\n" +
" </li>\n" +
" <li class=\"flex align-items-center py-3 px-2 border-top-1 surface-border flex-wrap\">\n" +
" <div class=\"text-500 w-6 md:w-2 font-medium\">Actors</div>\n" +
" <div class=\"text-900 w-full md:w-8 md:flex-order-0 flex-order-1\">Robert De Niro, Al Pacino</div>\n" +
" <div class=\"w-6 md:w-2 flex justify-content-end\">\n" +
" <p:commandButton type=\"button\" value=\"Edit\" icon=\"pi pi-pencil\"\n" +
" styleClass=\"ui-button-flat\"/>\n" +
" </div>\n" +
" </li>\n" +
" <li class=\"flex align-items-center py-3 px-2 border-top-1 border-bottom-1 surface-border flex-wrap\">\n" +
" <div class=\"text-500 w-6 md:w-2 font-medium\">Plot</div>\n" +
" <div class=\"text-900 w-full md:w-8 md:flex-order-0 flex-order-1 line-height-3\">\n" +
" A group of professional bank robbers start to feel the heat from police\n" +
" when they unknowingly leave a clue at their latest heist.\n" +
" </div>\n" +
" <div class=\"w-6 md:w-2 flex justify-content-end\">\n" +
" <p:commandButton type=\"button\" value=\"Edit\" icon=\"pi pi-pencil\"\n" +
" styleClass=\"ui-button-flat\"/>\n" +
" </div>\n" +
" </li>\n" +
" </ul>\n" +
"</div>" ;
private final String block10 = "<div class=\"surface-card p-4 shadow-2 border-round\">\n" +
" <div class=\"text-3xl font-medium text-900 mb-3\">Card Title</div>\n" +
" <div class=\"font-medium text-500 mb-3\">Vivamus id nisl interdum, blandit augue sit amet, eleifend mi.</div>\n" +
" <div style=\"height: 150px\" class=\"border-2 border-dashed surface-border\"></div>\n" +
"</div>" ;
public String getBlock1() {
return block1;
}
public String getBlock2() {
return block2;
}
public String getBlock3() {
return block3;
}
public String getBlock4() {
return block4;
}
public String getBlock5() {
return block5;
}
public String getBlock6() {
return block6;
}
public String getBlock7() {
return block7;
}
public String getBlock8() {
return block8;
}
public String getBlock9() {
return block9;
}
public String getBlock10() {
return block10;
}
public void copyCode(String code) {
PrimeFaces.current().executeScript("navigator.clipboard.writeText('" + EscapeUtils.forJavaScript(code) + "')");
}
}

View File

@ -0,0 +1,364 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.uikit;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
//import javax.inject.Named;
import org.primefaces.event.ItemSelectEvent;
import org.primefaces.model.charts.ChartData;
import org.primefaces.model.charts.bar.BarChartDataSet;
import org.primefaces.model.charts.bar.BarChartModel;
import org.primefaces.model.charts.donut.DonutChartDataSet;
import org.primefaces.model.charts.donut.DonutChartModel;
import org.primefaces.model.charts.line.LineChartDataSet;
import org.primefaces.model.charts.line.LineChartModel;
import org.primefaces.model.charts.pie.PieChartDataSet;
import org.primefaces.model.charts.pie.PieChartModel;
import org.primefaces.model.charts.polar.PolarAreaChartDataSet;
import org.primefaces.model.charts.polar.PolarAreaChartModel;
import org.primefaces.model.charts.radar.RadarChartDataSet;
import org.primefaces.model.charts.radar.RadarChartModel;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//@Component("chartDemoView")
@Scope("view")
@ManagedBean(name="chartDemoView", eager=true)
public class ChartDemoView implements Serializable {
private LineChartModel lineModel;
private PieChartModel pieModel;
private PolarAreaChartModel polarAreaModel;
private BarChartModel barModel;
private DonutChartModel donutModel;
private RadarChartModel radarModel;
//@PostConstruct
public void init() {
createLineModel();
createPieModel();
createPolarAreaModel();
createBarModel();
createDonutModel();
createRadarModel();
}
public void createLineModel() {
lineModel = new LineChartModel();
ChartData data = new ChartData();
LineChartDataSet dataSet = new LineChartDataSet();
List<Object> values = new ArrayList<>();
values.add(65);
values.add(59);
values.add(80);
values.add(81);
values.add(56);
values.add(55);
values.add(40);
dataSet.setData(values);
dataSet.setFill(false);
dataSet.setLabel("My First Dataset");
dataSet.setBorderColor("rgb(75, 192, 192)");
dataSet.setTension(0.1);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("January");
labels.add("February");
labels.add("March");
labels.add("April");
labels.add("May");
labels.add("June");
labels.add("July");
data.setLabels(labels);
lineModel.setData(data);
lineModel.setExtender("chartExtender");
}
private void createPieModel() {
pieModel = new PieChartModel();
ChartData data = new ChartData();
PieChartDataSet dataSet = new PieChartDataSet();
List<Number> values = new ArrayList<>();
values.add(300);
values.add(50);
values.add(100);
dataSet.setData(values);
List<String> bgColors = new ArrayList<>();
bgColors.add("rgb(255, 99, 132)");
bgColors.add("rgb(54, 162, 235)");
bgColors.add("rgb(255, 205, 86)");
dataSet.setBackgroundColor(bgColors);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("Red");
labels.add("Blue");
labels.add("Yellow");
data.setLabels(labels);
pieModel.setData(data);
pieModel.setExtender("chartExtenderCircle");
}
private void createPolarAreaModel() {
polarAreaModel = new PolarAreaChartModel();
ChartData data = new ChartData();
PolarAreaChartDataSet dataSet = new PolarAreaChartDataSet();
List<Number> values = new ArrayList<>();
values.add(11);
values.add(16);
values.add(7);
values.add(3);
values.add(14);
dataSet.setData(values);
List<String> bgColors = new ArrayList<>();
bgColors.add("rgb(255, 99, 132)");
bgColors.add("rgb(75, 192, 192)");
bgColors.add("rgb(255, 205, 86)");
bgColors.add("rgb(201, 203, 207)");
bgColors.add("rgb(54, 162, 235)");
dataSet.setBackgroundColor(bgColors);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("Red");
labels.add("Green");
labels.add("Yellow");
labels.add("Grey");
labels.add("Blue");
data.setLabels(labels);
polarAreaModel.setData(data);
polarAreaModel.setExtender("chartExtenderRScale");
}
public void createBarModel() {
barModel = new BarChartModel();
ChartData data = new ChartData();
BarChartDataSet barDataSet = new BarChartDataSet();
barDataSet.setLabel("My First Dataset");
List<Number> values = new ArrayList<>();
values.add(65);
values.add(59);
values.add(80);
values.add(81);
values.add(56);
values.add(55);
values.add(40);
barDataSet.setData(values);
List<String> bgColor = new ArrayList<>();
bgColor.add("rgba(255, 99, 132, 0.2)");
bgColor.add("rgba(255, 159, 64, 0.2)");
bgColor.add("rgba(255, 205, 86, 0.2)");
bgColor.add("rgba(75, 192, 192, 0.2)");
bgColor.add("rgba(54, 162, 235, 0.2)");
bgColor.add("rgba(153, 102, 255, 0.2)");
bgColor.add("rgba(201, 203, 207, 0.2)");
barDataSet.setBackgroundColor(bgColor);
List<String> borderColor = new ArrayList<>();
borderColor.add("rgb(255, 99, 132)");
borderColor.add("rgb(255, 159, 64)");
borderColor.add("rgb(255, 205, 86)");
borderColor.add("rgb(75, 192, 192)");
borderColor.add("rgb(54, 162, 235)");
borderColor.add("rgb(153, 102, 255)");
borderColor.add("rgb(201, 203, 207)");
barDataSet.setBorderColor(borderColor);
barDataSet.setBorderWidth(1);
data.addChartDataSet(barDataSet);
List<String> labels = new ArrayList<>();
labels.add("January");
labels.add("February");
labels.add("March");
labels.add("April");
labels.add("May");
labels.add("June");
labels.add("July");
data.setLabels(labels);
barModel.setData(data);
barModel.setExtender("chartExtender");
}
public void createRadarModel() {
radarModel = new RadarChartModel();
ChartData data = new ChartData();
RadarChartDataSet radarDataSet = new RadarChartDataSet();
radarDataSet.setLabel("My First Dataset");
radarDataSet.setFill(true);
radarDataSet.setBackgroundColor("rgba(255, 99, 132, 0.2)");
radarDataSet.setBorderColor("rgb(255, 99, 132)");
radarDataSet.setPointBackgroundColor("rgb(255, 99, 132)");
radarDataSet.setPointBorderColor("#fff");
radarDataSet.setPointHoverBackgroundColor("#fff");
radarDataSet.setPointHoverBorderColor("rgb(255, 99, 132)");
List<Number> dataVal = new ArrayList<>();
dataVal.add(65);
dataVal.add(59);
dataVal.add(90);
dataVal.add(81);
dataVal.add(56);
dataVal.add(55);
dataVal.add(40);
radarDataSet.setData(dataVal);
RadarChartDataSet radarDataSet2 = new RadarChartDataSet();
radarDataSet2.setLabel("My Second Dataset");
radarDataSet2.setFill(true);
radarDataSet2.setBackgroundColor("rgba(54, 162, 235, 0.2)");
radarDataSet2.setBorderColor("rgb(54, 162, 235)");
radarDataSet2.setPointBackgroundColor("rgb(54, 162, 235)");
radarDataSet2.setPointBorderColor("#fff");
radarDataSet2.setPointHoverBackgroundColor("#fff");
radarDataSet2.setPointHoverBorderColor("rgb(54, 162, 235)");
List<Number> dataVal2 = new ArrayList<>();
dataVal2.add(28);
dataVal2.add(48);
dataVal2.add(40);
dataVal2.add(19);
dataVal2.add(96);
dataVal2.add(27);
dataVal2.add(100);
radarDataSet2.setData(dataVal2);
data.addChartDataSet(radarDataSet);
data.addChartDataSet(radarDataSet2);
List<String> labels = new ArrayList<>();
labels.add("Eating");
labels.add("Drinking");
labels.add("Sleeping");
labels.add("Designing");
labels.add("Coding");
labels.add("Cycling");
labels.add("Running");
data.setLabels(labels);
radarModel.setData(data);
radarModel.setExtender("chartExtenderRScale");
}
public void createDonutModel() {
donutModel = new DonutChartModel();
ChartData data = new ChartData();
DonutChartDataSet dataSet = new DonutChartDataSet();
List<Number> values = new ArrayList<>();
values.add(300);
values.add(50);
values.add(100);
dataSet.setData(values);
List<String> bgColors = new ArrayList<>();
bgColors.add("rgb(255, 99, 132)");
bgColors.add("rgb(54, 162, 235)");
bgColors.add("rgb(255, 205, 86)");
dataSet.setBackgroundColor(bgColors);
data.addChartDataSet(dataSet);
List<String> labels = new ArrayList<>();
labels.add("Red");
labels.add("Blue");
labels.add("Yellow");
data.setLabels(labels);
donutModel.setData(data);
donutModel.setExtender("chartExtenderCircle");
}
public void itemSelect(ItemSelectEvent event) {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Item selected",
"Item Index: " + event.getItemIndex() + ", DataSet Index:" + event.getDataSetIndex());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public PieChartModel getPieModel() {
return pieModel;
}
public void setPieModel(PieChartModel pieModel) {
this.pieModel = pieModel;
}
public PolarAreaChartModel getPolarAreaModel() {
return polarAreaModel;
}
public void setPolarAreaModel(PolarAreaChartModel polarAreaModel) {
this.polarAreaModel = polarAreaModel;
}
public LineChartModel getLineModel() {
return lineModel;
}
public void setLineModel(LineChartModel lineModel) {
this.lineModel = lineModel;
}
public BarChartModel getBarModel() {
return barModel;
}
public void setBarModel(BarChartModel barModel) {
this.barModel = barModel;
}
public RadarChartModel getRadarModel() {
return radarModel;
}
public void setRadarModel(RadarChartModel radarModel) {
this.radarModel = radarModel;
}
public DonutChartModel getDonutModel() {
return donutModel;
}
public void setDonutModel(DonutChartModel donutModel) {
this.donutModel = donutModel;
}
}

View File

@ -0,0 +1,108 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.uikit;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
//import javax.inject.Named;
import org.primefaces.event.ToggleEvent;
import org.primefaces.model.Visibility;
import org.primefaces.demo.domain.Customer;
import org.primefaces.demo.domain.Product;
import org.primefaces.demo.service.CustomerService;
import org.primefaces.demo.service.OrderService;
import org.primefaces.demo.service.ProductService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("dataTableDemoView")
@Scope("view")
@ManagedBean(name="dataTableDemoView", eager=true)
public class DataTableDemoView implements Serializable {
private List<Customer> customers1;
private List<Customer> customers2;
private List<Product> products1;
private Customer selectedCustomer;
private List<Customer> selectedCustomers;
//@Inject
private CustomerService service;
//@Inject
private ProductService productService;
//@Inject
private OrderService orderService;
//@PostConstruct
public void init() {
customers1 = service.getCustomers(50);
customers2 = service.getCustomers(50);
products1 = productService.getProducts();
}
public long getTotalCount(String name) {
return customers1.stream().filter(customers -> name.equals(customers.getRepresentative().getName())).count();
}
public void onRowToggle(ToggleEvent event) {
if (event.getVisibility() == Visibility.VISIBLE) {
Product product = (Product) event.getData();
if (product.getOrders() == null) {
product.setOrders(orderService.getOrders((int) (Math.random() * 10)));
}
}
}
public List<Customer> getCustomers1() {
return customers1;
}
public List<Customer> getCustomers2() {
return customers2;
}
public List<Product> getProducts1() {
return products1;
}
public List<Customer> getSelectedCustomers() {
return selectedCustomers;
}
public void setSelectedCustomers(List<Customer> selectedCustomers) {
this.selectedCustomers = selectedCustomers;
}
public Customer getSelectedCustomer() {
return selectedCustomer;
}
public void setSelectedCustomer(Customer selectedCustomer) {
this.selectedCustomer = selectedCustomer;
}
}

View File

@ -0,0 +1,56 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.uikit;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
//import javax.inject.Named;
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.file.UploadedFile;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("fileDemoView")
@Scope("view")
@ManagedBean(name="fileDemoView", eager=true)
public class FileDemoView {
private UploadedFile file;
public UploadedFile getFile() {
return file;
}
public void setFile(UploadedFile file) {
this.file = file;
}
public void upload() {
if (file != null) {
FacesMessage message = new FacesMessage("Successful", file.getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, message);
}
}
public void handleFileUpload(FileUploadEvent event) {
FacesMessage msg = new FacesMessage("Successful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}

View File

@ -0,0 +1,41 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.uikit;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//import javax.inject.Named;
@Component("inputDemoView")
@Scope("view")
@ManagedBean(name="inputDemoView", eager=true)
public class InputDemoView {
public List<String> completeText(String query) {
List<String> results = new ArrayList<>();
for(int i = 0; i < 10; i++) {
results.add(query + i);
}
return results;
}
}

View File

@ -0,0 +1,90 @@
/*
* Copyright 2009-2022 PrimeTek.
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Licensed under PrimeFaces Commercial License, Version 1.0 (the "License");
*
* 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.
*/
package org.primefaces.demo.view.uikit;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import org.primefaces.model.DualListModel;
import org.primefaces.demo.domain.Product;
import org.primefaces.demo.service.ProductService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("listDemoView")
@Scope("view")
@ManagedBean(name = "listDemoView", eager = true)
public class ListDemoView {
private DualListModel<String> cities1 = new DualListModel<String>();
private List<String> cities2;
private List<Product> products;
//@Inject
private ProductService service;
//@PostConstruct
public void init() {
List<String> citiesSource = new ArrayList<String>();
List<String> citiesTarget = new ArrayList<String>();
citiesSource.add("San Francisco");
citiesSource.add("London");
citiesSource.add("Paris");
citiesSource.add("Istanbul");
citiesSource.add("Berlin");
citiesSource.add("Barcelona");
citiesSource.add("Rome");
cities1 = new DualListModel<String>(citiesSource, citiesTarget);
cities2 = new ArrayList<String>();
cities2.add("San Francisco");
cities2.add("London");
cities2.add("Paris");
cities2.add("Istanbul");
cities2.add("Berlin");
cities2.add("Barcelona");
cities2.add("Rome");
if (this.service == null) {
this.service = new ProductService();
this.service.init();
}
this.products = this.service.getProducts();
}
public DualListModel<String> getCities1() {
return cities1;
}
public List<String> getCities2() {
return cities2;
}
public List<Product> getProducts() {
if (this.service == null) {
this.service = new ProductService();
this.service.init();
}
this.products = this.service.getProducts();
return products;
}
}

Some files were not shown because too many files have changed in this diff Show More