chore: reorganize into polyglot monorepo (workshop)
- Move bigmind/ -> mcp/bigmind/ - Move webscraper/ -> mcp/webscraper/ - Move mss-failsafe/ -> java/mss-failsafe/ - Move Wellmann-Shop/ -> java/wellmann-shop/ (normalize to kebab-case) - Add .roo/ IDE config files to tracking - Add plans/REPO_STRATEGY.md (monorepo strategy document) - Expand .gitignore: Java/Maven, Node/TS, coverage, uv.lock - Rewrite README.md as navigation index - Update .roo/mcp.json webscraper path to mcp/webscraper/
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-shared-configuration>
|
||||
<!--
|
||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||
The configuration is intended to be shared among all the users of project and
|
||||
therefore it is assumed to be part of version control checkout.
|
||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||
-->
|
||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||
<!--
|
||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||
-->
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>WildFly</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
|
||||
<org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
|
||||
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
|
||||
<org-netbeans-modules-css-prep.less_2e_mappings>/less:/css</org-netbeans-modules-css-prep.less_2e_mappings>
|
||||
<org-netbeans-modules-css-prep.less_2e_enabled>false</org-netbeans-modules-css-prep.less_2e_enabled>
|
||||
<org-netbeans-modules-css-prep.sass_2e_enabled>false</org-netbeans-modules-css-prep.sass_2e_enabled>
|
||||
<org-netbeans-modules-css-prep.sass_2e_compiler_2e_options/>
|
||||
<org-netbeans-modules-css-prep.less_2e_compiler_2e_options/>
|
||||
<org-netbeans-modules-css-prep.sass_2e_mappings>/scss:/css</org-netbeans-modules-css-prep.sass_2e_mappings>
|
||||
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>js/libs</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
|
||||
</properties>
|
||||
<libraries xmlns="http://www.netbeans.org/ns/cdnjs-libraries/1"/>
|
||||
</project-shared-configuration>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>Plate</groupId>
|
||||
<artifactId>Wellmann-Shop</artifactId>
|
||||
<version>0.2</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>Wellmann-Shop</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Primefaces -->
|
||||
<dependency>
|
||||
<groupId>org.primefaces</groupId>
|
||||
<artifactId>primefaces</artifactId>
|
||||
<version>6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.primefaces.themes</groupId>
|
||||
<artifactId>all-themes</artifactId>
|
||||
<version>1.0.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.persistence</groupId>
|
||||
<artifactId>eclipselink</artifactId>
|
||||
<version>2.7.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.persistence</groupId>
|
||||
<artifactId>javax.persistence</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<type>jar</type>
|
||||
<version>1.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-java</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>2.44.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.opera</groupId>
|
||||
<artifactId>operadriver</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>1.5</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-remote-driver</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>4.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-web-api</artifactId>
|
||||
<version>8.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-api</artifactId>
|
||||
<version>8.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.46</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>prime-repo</id>
|
||||
<name>PrimeFaces Maven Repository</name>
|
||||
<url>http://repository.primefaces.org/</url>
|
||||
<layout>default</layout>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>unknown-jars-temp-repo</id>
|
||||
<name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>
|
||||
<url>file:${project.basedir}/lib</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright 2018 JoinFaces.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package httpauthenticationmechanism;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.faces.annotation.FacesConfig;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.security.enterprise.authentication.mechanism.http.CustomFormAuthenticationMechanismDefinition;
|
||||
import javax.security.enterprise.authentication.mechanism.http.LoginToContinue;
|
||||
import javax.security.enterprise.identitystore.DatabaseIdentityStoreDefinition;
|
||||
import javax.security.enterprise.identitystore.IdentityStore;
|
||||
import javax.security.enterprise.identitystore.Pbkdf2PasswordHash;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.business.MyPasswordHash;
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
/*@AutoApplySession // For "Is user already logged-in?"
|
||||
@RememberMe(isRememberMeExpression = "httpMessageContext.authParameters.rememberMe", cookieMaxAgeSeconds = 60 * 60 * 24 * 14) // 14 days*/
|
||||
@CustomFormAuthenticationMechanismDefinition(
|
||||
loginToContinue = @LoginToContinue(
|
||||
loginPage = "/login.xhtml",
|
||||
useForwardToLogin = false,
|
||||
errorPage = "/error.xhtml"
|
||||
))
|
||||
@DatabaseIdentityStoreDefinition(
|
||||
dataSourceLookup = "${'java:/Wellmann-Shop'}",
|
||||
callerQuery = "#{'select password from Password where customer_id = (select id from customer where Email = ?)'}",
|
||||
groupsQuery = "select userGroup from MyUserGroups where customer_id = (select id from customer where Email = ?)",
|
||||
hashAlgorithm = MyPasswordHash.class,
|
||||
priority = 10
|
||||
)
|
||||
@FacesConfig
|
||||
@ApplicationScoped
|
||||
@Named
|
||||
public class ApplicationConfig {
|
||||
|
||||
final static Logger logger = Logger.getLogger(ApplicationConfig.class);
|
||||
|
||||
@Inject
|
||||
private IdentityStore identityStore;
|
||||
|
||||
@Inject
|
||||
private Pbkdf2PasswordHash passwordHash;
|
||||
|
||||
/*@Inject
|
||||
private EntityManager em;*/
|
||||
|
||||
/*@Transactional
|
||||
private void init(){
|
||||
PasswordManager passwordManager = new PasswordManager();
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword("user".toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Customer test = new Customer("user@test.de", password, salt);
|
||||
test.setGroups(new MyUserGroups(test, MyUserGroups.Group.ADMIN));
|
||||
try {
|
||||
em.persist(test);
|
||||
logger.debug(test.getEmail() + " got registered");
|
||||
} catch (Exception e) {
|
||||
logger.error("Init persisting doenst work : " + e.toString());
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
public AuthenticationStatus validateRequest(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
HttpMessageContext context) throws AuthenticationException {
|
||||
|
||||
Credential credential = context.getAuthParameters().getCredential();
|
||||
|
||||
if (credential != null) {
|
||||
return context.notifyContainerAboutLogin(identityStore.validate(credential));
|
||||
} else {
|
||||
return context.doNothing();
|
||||
}
|
||||
}*/
|
||||
|
||||
public String hashPw(String pw){
|
||||
return passwordHash.generate(pw.toCharArray());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* Copyright 2018 JoinFaces.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package httpauthenticationmechanism;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.enterprise.inject.Model;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import static javax.faces.application.FacesMessage.SEVERITY_ERROR;
|
||||
import javax.faces.context.ExternalContext;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.security.enterprise.AuthenticationStatus;
|
||||
import static javax.security.enterprise.AuthenticationStatus.SEND_CONTINUE;
|
||||
import static javax.security.enterprise.AuthenticationStatus.SEND_FAILURE;
|
||||
import javax.security.enterprise.SecurityContext;
|
||||
import javax.security.enterprise.authentication.mechanism.http.AuthenticationParameters;
|
||||
import static javax.security.enterprise.authentication.mechanism.http.AuthenticationParameters.withParams;
|
||||
import javax.security.enterprise.credential.Credential;
|
||||
import javax.security.enterprise.credential.Password;
|
||||
import javax.security.enterprise.credential.UsernamePasswordCredential;
|
||||
import javax.security.enterprise.identitystore.CredentialValidationResult;
|
||||
import javax.security.enterprise.identitystore.IdentityStoreHandler;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.business.PasswordManager;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
import plate.wellmann.shop.persistence.MyUserGroups;
|
||||
import plate.wellmann.shop.persistence.Salt;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class LoginBean {
|
||||
|
||||
@Inject
|
||||
private PasswordManager passwordManager;
|
||||
|
||||
@Inject
|
||||
private IdentityStoreHandler identityStoreHandler;
|
||||
|
||||
@Inject
|
||||
private SecurityContext securityContext;
|
||||
|
||||
@Inject
|
||||
private FacesContext facesContext;
|
||||
|
||||
@Inject
|
||||
private ExternalContext externalContext;
|
||||
|
||||
@NotEmpty
|
||||
@Email(message = "Please provide a valid email")
|
||||
private String username;
|
||||
|
||||
@NotEmpty
|
||||
@Size(min = 4, max = 50, message = "Password must be between 4 and 50 characters")
|
||||
private String password;
|
||||
|
||||
private boolean rememberMe = false;
|
||||
|
||||
private boolean continued = true;
|
||||
|
||||
final static Logger LOG = Logger.getLogger(LoginBean.class);
|
||||
|
||||
public void login() throws IOException {
|
||||
Credential credential = new UsernamePasswordCredential(username, new Password(password));
|
||||
|
||||
CredentialValidationResult cres = identityStoreHandler.validate(credential);
|
||||
switch (cres.getStatus()) {
|
||||
case VALID:
|
||||
facesContext.responseComplete();
|
||||
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Anmeldung erfolgreich!", null));
|
||||
break;
|
||||
default:
|
||||
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Benutzername oder Password inkorrekt!", null));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
switch (continueAuthentication()) {
|
||||
case SEND_CONTINUE:
|
||||
facesContext.responseComplete();
|
||||
break;
|
||||
case SEND_FAILURE:
|
||||
facesContext.addMessage(null,
|
||||
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login failed", null));
|
||||
break;
|
||||
case SUCCESS:
|
||||
facesContext.addMessage(null,
|
||||
new FacesMessage(FacesMessage.SEVERITY_INFO, "Login succeed", null));
|
||||
externalContext.redirect(externalContext.getRequestContextPath() + "/ressources/users/welcome.xhtml");
|
||||
break;
|
||||
case NOT_DONE:
|
||||
}*/
|
||||
}
|
||||
|
||||
private static HttpServletResponse getResponse(FacesContext facesContext) {
|
||||
return (HttpServletResponse) facesContext
|
||||
.getExternalContext()
|
||||
.getResponse();
|
||||
}
|
||||
|
||||
private static HttpServletRequest getRequest(FacesContext facesContext) {
|
||||
return (HttpServletRequest) facesContext
|
||||
.getExternalContext()
|
||||
.getRequest();
|
||||
}
|
||||
|
||||
private AuthenticationStatus continueAuthentication() {
|
||||
return securityContext.authenticate(
|
||||
(HttpServletRequest) externalContext.getRequest(),
|
||||
(HttpServletResponse) externalContext.getResponse(),
|
||||
AuthenticationParameters.withParams()
|
||||
.credential(new UsernamePasswordCredential(username, password))
|
||||
);
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isRememberMe() {
|
||||
return rememberMe;
|
||||
}
|
||||
|
||||
public void setRememberMe(boolean rememberMe) {
|
||||
this.rememberMe = rememberMe;
|
||||
}
|
||||
|
||||
public boolean isContinued() {
|
||||
return continued;
|
||||
}
|
||||
|
||||
public void setContinued(boolean continued) {
|
||||
this.continued = continued;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
import plate.wellmann.shop.persistence.Costumer;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.persistence.Salt;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@SessionScoped
|
||||
public class CostumerManager implements Serializable{
|
||||
|
||||
final static Logger logger = Logger.getLogger(CostumerManager.class);
|
||||
|
||||
private Costumer currentCostumer = Costumer.nullCostumer;
|
||||
|
||||
@Inject
|
||||
private PasswordManager passwordManager;
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional
|
||||
private Costumer init(){
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword("user".toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
return new Costumer("user@test.de", password, salt);
|
||||
// try {
|
||||
// em.persist(testCostumer);
|
||||
// logger.debug("user@test.de got registered");
|
||||
// } catch (Exception e) {
|
||||
// logger.error("Init persisting doenst work : " + e.toString());
|
||||
// }
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean login(String email, String password){
|
||||
if(currentCostumer != Costumer.nullCostumer){
|
||||
logout();
|
||||
}
|
||||
if (loadCostumer(email)) {
|
||||
byte[] pw = passwordManager.hashPassword(password.toCharArray(), currentCostumer.getSalt().getSalt(), currentCostumer.getSalt().getInterations());
|
||||
if(Arrays.equals(pw, currentCostumer.getPassword().getPassword())){
|
||||
logger.info("Passwordcheck correct " + email);
|
||||
for(int i = 0; i < pw.length; i++){
|
||||
pw[i] = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLoggedIn() {
|
||||
return currentCostumer != Costumer.nullCostumer;
|
||||
}
|
||||
|
||||
public void logout(){
|
||||
currentCostumer = Costumer.nullCostumer;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
private boolean loadCostumer(String email){
|
||||
try {
|
||||
|
||||
Costumer newCostumer = init();
|
||||
em.persist(newCostumer);
|
||||
|
||||
TypedQuery<Costumer> query = em.createNamedQuery("Costumer.findByEmail", Costumer.class);
|
||||
query.setParameter("email", email);
|
||||
this.currentCostumer = query.getSingleResult();
|
||||
logger.info(email + " sucessfully loaded.");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.error(email + " couldn't be loaded. " + e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for register as Superuser
|
||||
*
|
||||
* TODO Check for Superuser
|
||||
* @param email
|
||||
* @return boolean if succesfull
|
||||
*/
|
||||
@Transactional
|
||||
public boolean register(String email) {
|
||||
|
||||
if(currentCostumer == Costumer.nullCostumer){
|
||||
logger.error("Nullcostumer tried to register user" + email);
|
||||
logout();
|
||||
return false;
|
||||
}
|
||||
//extract domain
|
||||
String domain = extractDomain(email);
|
||||
String userDomain = extractDomain(currentCostumer.getEmail());
|
||||
|
||||
logger.info("trying to register User to " + domain + " by user: " + currentCostumer.getEmail());
|
||||
if(!userDomain.equals(domain)){
|
||||
logger.warn("Cannot register " + email + " to " + domain + " by " + currentCostumer.getEmail());
|
||||
return false;
|
||||
}
|
||||
|
||||
TypedQuery<Costumer> query = em.createNamedQuery("Costumer.findByEmail", Costumer.class);
|
||||
query.setParameter("email", email);
|
||||
try {
|
||||
Costumer cost = query.getSingleResult();
|
||||
logger.warn("User: " + currentCostumer.getEmail() + "tried to register allready registered user: " + email);
|
||||
return false;
|
||||
} catch (NoResultException e) {
|
||||
String pass = org.apache.commons.codec.binary.Base64.encodeBase64String(passwordManager.generateRandomPassword());
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword(pass.toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Costumer newCostumer = new Costumer(email, password, salt, currentCostumer.getDomain());
|
||||
currentCostumer.getDomain().addCostumer(newCostumer);
|
||||
em.persist(newCostumer);
|
||||
logger.info("New Costumer was registered: " + email + " by " + currentCostumer.getEmail());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean registerNewCostumerDomain(String email){
|
||||
String pass = org.apache.commons.codec.binary.Base64.encodeBase64String(passwordManager.generateRandomPassword());
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword(pass.toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Costumer newCostumer = new Costumer(email, password, salt);
|
||||
logger.info("User: " + currentCostumer.getEmail() + "trying to register user: " + email);
|
||||
try {
|
||||
em.persist(newCostumer);
|
||||
} catch (Exception e) {
|
||||
logger.error("User: " + currentCostumer.getEmail() + "tried to register user: " + email + " with: " + e.toString());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//@Transactional
|
||||
private String extractDomain(String email){
|
||||
return email.substring(email.indexOf("@") + 1);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean changePassword(String passwordOld, String passwordNew){
|
||||
return passwordManager.changePassword(currentCostumer, passwordNew, passwordOld);
|
||||
}
|
||||
|
||||
public String resetPassword(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import httpauthenticationmechanism.ApplicationConfig;
|
||||
import java.io.Serializable;
|
||||
//import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.enterprise.inject.Produces;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.persistence.MyUserGroups;
|
||||
import plate.wellmann.shop.persistence.Salt;
|
||||
import javax.security.enterprise.credential.Password;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@SessionScoped
|
||||
public class CustomerManager implements Serializable{
|
||||
|
||||
final static Logger logger = Logger.getLogger(CustomerManager.class);
|
||||
|
||||
//private final Charset UTF8_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
private Customer currentCostumer = Customer.nullCustomer;
|
||||
|
||||
@Inject
|
||||
private PasswordManager passwordManager;
|
||||
|
||||
@PersistenceContext(name = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
public String demo(){
|
||||
Salt salt = new Salt();
|
||||
Customer test = new Customer("user@test.de", Arrays.toString(passwordManager.hashPassword("test".toCharArray(), ("salz".getBytes()), 3072)), salt);
|
||||
test.setGroups(new MyUserGroups(test, MyUserGroups.Group.MANAGER));
|
||||
currentCostumer = test;
|
||||
|
||||
return "/ressources/manager/welcome.xhtml";
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void init(){
|
||||
//logger.info("Password to string; " + Arrays.toString(passwordString));
|
||||
Salt salt = new Salt();
|
||||
//byte[] password = passwordManager.hashPassword("user".toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Customer test = new Customer("user@test.de", Arrays.toString(passwordManager.hashPassword("test".toCharArray(), ("salz".getBytes()), 3072)), salt);
|
||||
test.setGroups(new MyUserGroups(test, MyUserGroups.Group.USER));
|
||||
em.persist(test);
|
||||
// try {
|
||||
// em.persist(testCostumer);
|
||||
// logger.debug("user@test.de got registered");
|
||||
// } catch (Exception e) {
|
||||
// logger.error("Init persisting doenst work : " + e.toString());
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
@Transactional
|
||||
public boolean login(String email, String password){
|
||||
if(currentCostumer != Customer.nullCustomer){
|
||||
logout();
|
||||
}
|
||||
if (loadCostumer(email)) {
|
||||
byte[] pw = passwordManager.hashPassword(password.toCharArray(), currentCostumer.getSalt().getSalt(), currentCostumer.getSalt().getInterations());
|
||||
if(Arrays.equals(pw, currentCostumer.getPassword().getPassword())){
|
||||
logger.info("Passwordcheck correct " + email);
|
||||
for(int i = 0; i < pw.length; i++){
|
||||
pw[i] = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
|
||||
public boolean isLoggedIn() {
|
||||
return currentCostumer != Customer.nullCustomer;
|
||||
}
|
||||
|
||||
public void logout(){
|
||||
currentCostumer = Customer.nullCustomer;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
private boolean loadCostumer(String email){
|
||||
try {
|
||||
|
||||
//Customer newCostumer = init();
|
||||
//em.persist(newCostumer);
|
||||
|
||||
TypedQuery<Customer> query = em.createNamedQuery("Customer.findByEmail", Customer.class);
|
||||
query.setParameter("email", email);
|
||||
this.currentCostumer = query.getSingleResult();
|
||||
logger.info(email + " sucessfully loaded.");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.error(email + " couldn't be loaded. " + e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for register as Superuser
|
||||
*
|
||||
* TODO Check for Superuser
|
||||
* @param email
|
||||
* @return boolean if succesfull
|
||||
*/
|
||||
@Transactional
|
||||
public boolean register(String email) {
|
||||
|
||||
if(currentCostumer == Customer.nullCustomer){
|
||||
logger.error("Nullcustomer tried to register user" + email);
|
||||
logout();
|
||||
return false;
|
||||
}
|
||||
//extract domain
|
||||
String domain = extractDomain(email);
|
||||
String userDomain = extractDomain(currentCostumer.getEmail());
|
||||
|
||||
logger.info("trying to register User to " + domain + " by user: " + currentCostumer.getEmail());
|
||||
if(!userDomain.equals(domain)){
|
||||
logger.warn("Cannot register " + email + " to " + domain + " by " + currentCostumer.getEmail());
|
||||
return false;
|
||||
}
|
||||
|
||||
TypedQuery<Customer> query = em.createNamedQuery("Customer.findByEmail", Customer.class);
|
||||
query.setParameter("email", email);
|
||||
try {
|
||||
Customer cost = query.getSingleResult();
|
||||
logger.warn("User: " + currentCostumer.getEmail() + "tried to register allready registered user: " + email);
|
||||
return false;
|
||||
} catch (NoResultException e) {
|
||||
String pass = new String (passwordManager.generateRandomPassword());
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword(pass.toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Customer newCostumer = new Customer(email, "Monat2018!", salt, currentCostumer.getDomain());
|
||||
currentCostumer.getDomain().addCostumer(newCostumer);
|
||||
em.persist(newCostumer);
|
||||
logger.info("New Costumer was registered: " + email + " by " + currentCostumer.getEmail());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean registerNewCostumerDomain(String email){
|
||||
String pass = new String(passwordManager.generateRandomPassword());
|
||||
Salt salt = new Salt();
|
||||
byte[] password = passwordManager.hashPassword(pass.toCharArray(), salt.getSalt(), salt.getInterations());
|
||||
Customer newCostumer = new Customer(email, pass, salt);
|
||||
logger.info("User: " + currentCostumer.getEmail() + "trying to register user: " + email);
|
||||
try {
|
||||
em.persist(newCostumer);
|
||||
} catch (Exception e) {
|
||||
logger.error("User: " + currentCostumer.getEmail() + "tried to register user: " + email + " with: " + e.toString());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private char[] genPW(String pw){
|
||||
return (new Password("test").getValue());
|
||||
}
|
||||
|
||||
/*private String genPW(String pw){
|
||||
Map<String, String> parameters= new HashMap<>();
|
||||
parameters.put("Pbkdf2PasswordHash.Iterations", "3072");
|
||||
parameters.put("Pbkdf2PasswordHash.Algorithm", "PBKDF2WithHmacSHA512");
|
||||
parameters.put("Pbkdf2PasswordHash.SaltSizeBytes", "64");
|
||||
passwordHash.initialize(parameters);
|
||||
return passwordHash.generate(pw.toCharArray());
|
||||
}*/
|
||||
//@Transactional
|
||||
private String extractDomain(String email){
|
||||
return email.substring(email.indexOf("@") + 1);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean changePassword(String passwordOld, String passwordNew){
|
||||
return false;
|
||||
//return passwordManager.changePassword(currentCostumer, passwordNew, passwordOld);
|
||||
}
|
||||
|
||||
public String resetPassword(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Produces
|
||||
@RequestScoped
|
||||
public Customer activeCostumer(){
|
||||
return currentCostumer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.enterprise.inject.Produces;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
import plate.wellmann.shop.persistence.UserDomain;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named(value = "itemManager")
|
||||
@SessionScoped
|
||||
public class ItemManager implements Serializable {
|
||||
|
||||
@Inject
|
||||
private Customer activeCustomer;
|
||||
|
||||
private List<Item> tickets;
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Produces
|
||||
@RequestScoped
|
||||
public List<Item> getActiveTickets() {
|
||||
if (tickets == null) {
|
||||
tickets = new ArrayList<>();
|
||||
return tickets;
|
||||
}
|
||||
|
||||
List<Item> activeTickets;
|
||||
activeTickets = new ArrayList<>();
|
||||
|
||||
tickets.stream().filter((ticket) -> (ticket.getStatus() != Item.TicketStatus.CLOSED)).forEach((ticket) -> {
|
||||
activeTickets.add(ticket);
|
||||
});
|
||||
return activeTickets;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Item> findActiveDomainTickets(UserDomain userDomain) {
|
||||
Query qry = em.createQuery("select object(o) from Item o "
|
||||
+ "where o.creator IN (:creators) "
|
||||
+ "AND "
|
||||
+ "o.status <> :status",
|
||||
Item.class);
|
||||
|
||||
qry.setParameter("creators", userDomain.getCustomers());
|
||||
qry.setParameter("status", Item.TicketStatus.CLOSED);
|
||||
try {
|
||||
return qry.getResultList();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Item> findDomainTickets(UserDomain userDomain){
|
||||
Query qry = em.createQuery("select object(o) from Item o "
|
||||
+ "where o.creator IN (:creators)",
|
||||
Item.class);
|
||||
|
||||
qry.setParameter("creators", userDomain.getCustomers());
|
||||
|
||||
try {
|
||||
return qry.getResultList();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Item> findDomainTicketsByStatus(UserDomain userDomain, List <Item.TicketStatus> status) {
|
||||
Query qry = em.createQuery("select object(o) from Item o "
|
||||
+ "where o.creator IN (:creators) "
|
||||
+ "AND "
|
||||
+ "o.status IN (:status)",
|
||||
Item.class);
|
||||
|
||||
qry.setParameter("creators", userDomain.getCustomers());
|
||||
qry.setParameter("status", status);
|
||||
try {
|
||||
return qry.getResultList();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Item> findAllTicketsByStatus(List <Item.TicketStatus> status){
|
||||
Query qry = em.createQuery("select object(o) from Item o "
|
||||
+ "where o.status IN (:status)",
|
||||
Item.class);
|
||||
qry.setParameter("status", status);
|
||||
|
||||
try {
|
||||
return qry.getResultList();
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.Arrays;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.security.enterprise.identitystore.PasswordHash;
|
||||
import org.apache.log4j.Logger;
|
||||
import static plate.wellmann.shop.business.PasswordManager.logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
public class MyPasswordHash implements PasswordHash{
|
||||
|
||||
final static Logger LOG = Logger.getLogger(MyPasswordHash.class);
|
||||
|
||||
@Override
|
||||
public String generate(char[] chars) {
|
||||
try {
|
||||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
|
||||
PBEKeySpec spec = new PBEKeySpec(chars, "salz".getBytes(), 3072, 256);
|
||||
SecretKey key = skf.generateSecret(spec);
|
||||
//this.password = new Password(this.costumer, key.getEncoded());
|
||||
logger.debug("Hash created!");
|
||||
return Arrays.toString(key.getEncoded());
|
||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
||||
logger.error("Failure creating hash with:" + e);
|
||||
return null;
|
||||
//throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verify(char[] chars, String string) {
|
||||
String pw = generate(chars);
|
||||
return pw.equals(string);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.Arrays;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Named;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class PasswordManager implements Serializable {
|
||||
|
||||
final static Logger logger = Logger.getLogger(PasswordManager.class);
|
||||
|
||||
@PersistenceContext(name = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
//private Password password;
|
||||
private Customer costumer;
|
||||
|
||||
private final int keyLength = 256;
|
||||
|
||||
public byte[] hashPassword(final char[] password, final byte[] salt, final int iterations) {
|
||||
|
||||
// if(costumer == Customer.nullCustomer || costumer == null){
|
||||
// logger.error("Tried to create hash for Nullcostumer!");
|
||||
// return null;
|
||||
// }
|
||||
try {
|
||||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
|
||||
PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, this.keyLength);
|
||||
SecretKey key = skf.generateSecret(spec);
|
||||
//this.password = new Password(this.costumer, key.getEncoded());
|
||||
logger.debug("Hash created!");
|
||||
return key.getEncoded();
|
||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
||||
logger.error("Failure creating hash for with:" + e);
|
||||
return null;
|
||||
//throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] hashPasswordCostumer(final char[] password, Customer cost) {
|
||||
|
||||
if(costumer == Customer.nullCustomer || costumer == null){
|
||||
logger.error("Tried to create hash for Nullcostumer!");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
|
||||
PBEKeySpec spec = new PBEKeySpec(password, cost.getSalt().getSalt(), cost.getSalt().getInterations(), keyLength);
|
||||
SecretKey key = skf.generateSecret(spec);
|
||||
logger.debug("Hash created!");
|
||||
return key.getEncoded();
|
||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
||||
logger.error("Failure creating hash for" + cost.getEmail() + "with: " + e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Transactional
|
||||
public boolean passwordCheckEmail(final String email, final byte[] password) {
|
||||
TypedQuery<Customer> query = em.createNamedQuery("Costumer.findByEmail", Customer.class);
|
||||
query.setParameter("email", email);
|
||||
try {
|
||||
Customer cost;
|
||||
cost = query.getSingleResult();
|
||||
|
||||
boolean equals = Arrays.equals(password, cost.getPassword().getPassword());
|
||||
|
||||
for (int i = 0; i < password.length; i++) {
|
||||
password[i] = 0;
|
||||
}
|
||||
|
||||
return equals;
|
||||
} catch (NoResultException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean passwordCheckCostumer(final Customer cost, final String password) {
|
||||
byte[] pw = hashPasswordCostumer(password.toCharArray(), cost);
|
||||
|
||||
boolean equals = Arrays.equals(pw, cost.getPassword().getPassword());
|
||||
|
||||
for (int i = 0; i < pw.length; i++) {
|
||||
pw[i] = 0;
|
||||
}
|
||||
|
||||
return equals;
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean changePassword(Customer cost, String newPassword, String oldPassword) {
|
||||
if (cost == Customer.nullCustomer || cost == null) {
|
||||
logger.error("Nullcostumer tried to change Password");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(passwordCheckCostumer(cost, oldPassword)){
|
||||
cost.getPassword().setPassowrd(hashPasswordCostumer(newPassword.toCharArray(), cost));
|
||||
logger.info("Password changed for " + cost.getEmail());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
em.persist(cost);
|
||||
logger.info("Password changed for " + cost.getEmail());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
logger.error("Couldn't save new password to " + cost.getEmail() + " with: " + e.toString());
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
public byte[] generateRandomPassword() {
|
||||
SecureRandom random = new SecureRandom();
|
||||
byte bytes[] = new byte[20];
|
||||
random.nextBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public Customer getCostumer() {
|
||||
return costumer;
|
||||
}
|
||||
|
||||
public void setCostumer(Customer costumer) {
|
||||
this.costumer = costumer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.transaction.Transactional;
|
||||
import plate.wellmann.shop.persistence.Color;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
import plate.wellmann.shop.persistence.Paper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named(value = "shoppingcartManager")
|
||||
@SessionScoped
|
||||
public class ShoppingcartManager implements Serializable {
|
||||
|
||||
@PersistenceContext(name = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
private List<Item> items;
|
||||
private HashMap<Integer, Integer> quantity;
|
||||
|
||||
@Inject
|
||||
private Customer activeCustomer;
|
||||
|
||||
/**
|
||||
* Creates a new instance of ShoppingcartManager
|
||||
*/
|
||||
public ShoppingcartManager() {
|
||||
quantity = new HashMap<>();
|
||||
}
|
||||
|
||||
public void addItem(Item item, Integer quantity) {
|
||||
if (items == null) {
|
||||
items = new ArrayList<>();
|
||||
}
|
||||
if (this.quantity == null) {
|
||||
this.quantity = new HashMap<>();
|
||||
}
|
||||
this.items.add(item);
|
||||
this.quantity.put(item.hashCode(), quantity);
|
||||
}
|
||||
|
||||
public boolean deleteItem(Long id) {
|
||||
for (Item next : items) {
|
||||
if (Objects.equals(next.getId(), id)) {
|
||||
if (items.remove(next)) {
|
||||
this.quantity.remove(next.hashCode());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setQuantity(Item item, Integer quantity) {
|
||||
if (items.contains(item)) {
|
||||
this.quantity.replace(item.hashCode(), quantity);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean demo() {
|
||||
Item item = new Item(LocalDateTime.now());
|
||||
item.setCreator(activeCustomer);
|
||||
item.setName("Visitenkarten");
|
||||
item.setPrice(new BigInteger("53199"));
|
||||
|
||||
List<Color> colors = new ArrayList<Color>();
|
||||
Color c = new Color();
|
||||
c.setColorRoom(Color.ColorRoom.SKALA);
|
||||
c.setName("Schwarz");
|
||||
c.setColorType(Color.ColorType.K);
|
||||
c.setHtmlDotStyle("height:20px;width: 20px; background-color: #000000;border-radius: 50%;display: inline-block;");
|
||||
colors.add(c);
|
||||
|
||||
Color co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Magenta");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #ff00ff;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Cyan");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #00FFFF;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Yellow");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #FFFF00;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
item.setColors(colors);
|
||||
|
||||
Paper paper = new Paper();
|
||||
paper.setFormat("A3");
|
||||
paper.setName("Papiername1");
|
||||
paper.setSort("HeißesWeißes");
|
||||
item.setPaper(paper);
|
||||
item.setQuantity(new BigInteger("500"));
|
||||
|
||||
|
||||
try {
|
||||
em.persist(item);
|
||||
} catch (Exception e) {
|
||||
System.out.println("plate.wellmann.shop.business.ShoppingcartManager.demo() " + e);
|
||||
}
|
||||
addItem(item, 600);
|
||||
|
||||
item = new Item(LocalDateTime.now());
|
||||
item.setCreator(activeCustomer);
|
||||
item.setName("Brackepappe");
|
||||
item.setPrice(new BigInteger("448745"));
|
||||
|
||||
colors = new ArrayList<Color>();
|
||||
c = new Color();
|
||||
c.setColorRoom(Color.ColorRoom.SKALA);
|
||||
c.setName("Schwarz");
|
||||
c.setColorType(Color.ColorType.K);
|
||||
c.setHtmlDotStyle("height:20px;width: 20px; background-color: #000000;border-radius: 50%;display: inline-block;");
|
||||
colors.add(c);
|
||||
|
||||
co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Cyan");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #00FFFF;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
item.setColors(colors);
|
||||
|
||||
paper = new Paper();
|
||||
paper.setFormat("A3");
|
||||
paper.setName("Altpapier");
|
||||
paper.setSort("HeißesBraunes");
|
||||
item.setPaper(paper);
|
||||
item.setQuantity(new BigInteger("452"));
|
||||
|
||||
addItem(item, 1231);
|
||||
try {
|
||||
em.persist(item);
|
||||
em.flush();
|
||||
} catch (Exception e) {
|
||||
System.out.println("plate.wellmann.shop.business.ShoppingcartManager.demo() " + e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public Integer getQuantity(Item item) {
|
||||
return quantity.get(item.hashCode());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Named;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.persistence.UserDomain;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class UserDomainManager implements Serializable{
|
||||
|
||||
final static Logger logger = Logger.getLogger(UserDomainManager.class);
|
||||
|
||||
@PersistenceContext(name = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional
|
||||
public UserDomain getDomain(String domain){
|
||||
|
||||
if (domain == null) {
|
||||
logger.error("Tried to load a domain with domain == Null");
|
||||
return null;
|
||||
}
|
||||
|
||||
TypedQuery<UserDomain> query = em.createNamedQuery("UserDomain.findByName", UserDomain.class);
|
||||
query.setParameter("userDomain", domain);
|
||||
try {
|
||||
UserDomain userDomain;
|
||||
logger.info("Loading Domain: " + domain);
|
||||
userDomain = query.getSingleResult();
|
||||
logger.info("Domain " + domain + "succesfully loaded!");
|
||||
return userDomain;
|
||||
} catch (NoResultException e){
|
||||
logger.error("Could'nt find domain " + e.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package plate.wellmann.shop.business.exceptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class IllegalOrphanException extends Exception {
|
||||
private List<String> messages;
|
||||
public IllegalOrphanException(List<String> messages) {
|
||||
super((messages != null && messages.size() > 0 ? messages.get(0) : null));
|
||||
if (messages == null) {
|
||||
this.messages = new ArrayList<String>();
|
||||
}
|
||||
else {
|
||||
this.messages = messages;
|
||||
}
|
||||
}
|
||||
public List<String> getMessages() {
|
||||
return messages;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package plate.wellmann.shop.business.exceptions;
|
||||
|
||||
public class NonexistentEntityException extends Exception {
|
||||
public NonexistentEntityException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
public NonexistentEntityException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package plate.wellmann.shop.business.exceptions;
|
||||
|
||||
public class PreexistingEntityException extends Exception {
|
||||
public PreexistingEntityException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
public PreexistingEntityException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
public abstract class AbstractFacade<T> {
|
||||
|
||||
private Class<T> entityClass;
|
||||
|
||||
public AbstractFacade(Class<T> entityClass) {
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
protected abstract EntityManager getEntityManager();
|
||||
|
||||
public void create(T entity) {
|
||||
getEntityManager().persist(entity);
|
||||
}
|
||||
|
||||
public void edit(T entity) {
|
||||
getEntityManager().merge(entity);
|
||||
}
|
||||
|
||||
public void remove(T entity) {
|
||||
getEntityManager().remove(getEntityManager().merge(entity));
|
||||
}
|
||||
|
||||
public T find(Object id) {
|
||||
return getEntityManager().find(entityClass, id);
|
||||
}
|
||||
|
||||
public List<T> findAll() {
|
||||
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
|
||||
cq.select(cq.from(entityClass));
|
||||
return getEntityManager().createQuery(cq).getResultList();
|
||||
}
|
||||
|
||||
public List<T> findRange(int[] range) {
|
||||
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
|
||||
cq.select(cq.from(entityClass));
|
||||
javax.persistence.Query q = getEntityManager().createQuery(cq);
|
||||
q.setMaxResults(range[1] - range[0] + 1);
|
||||
q.setFirstResult(range[0]);
|
||||
return q.getResultList();
|
||||
}
|
||||
|
||||
public int count() {
|
||||
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
|
||||
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
|
||||
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
|
||||
javax.persistence.Query q = getEntityManager().createQuery(cq);
|
||||
return ((Long) q.getSingleResult()).intValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Comment;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class CommentFacade extends AbstractFacade<Comment> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public CommentFacade() {
|
||||
super(Comment.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class CustomerFacade extends AbstractFacade<Customer> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public CustomerFacade() {
|
||||
super(Customer.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class ItemFacade extends AbstractFacade<Item> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public ItemFacade() {
|
||||
super(Item.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.MyUserGroups;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class MyUserGroupsFacade extends AbstractFacade<MyUserGroups> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public MyUserGroupsFacade() {
|
||||
super(MyUserGroups.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Paper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class PaperFacade extends AbstractFacade<Paper> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public PaperFacade() {
|
||||
super(Paper.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Password;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class PasswordFacade extends AbstractFacade<Password> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public PasswordFacade() {
|
||||
super(Password.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.Salt;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class SaltFacade extends AbstractFacade<Salt> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public SaltFacade() {
|
||||
super(Salt.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.business.test;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import plate.wellmann.shop.persistence.UserDomain;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Stateless
|
||||
public class UserDomainFacade extends AbstractFacade<UserDomain> {
|
||||
|
||||
@PersistenceContext(unitName = "MySQL-Wellmann")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
protected EntityManager getEntityManager() {
|
||||
return em;
|
||||
}
|
||||
|
||||
public UserDomainFacade() {
|
||||
super(UserDomain.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.business.CostumerManager;
|
||||
import plate.wellmann.shop.business.PasswordManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@SessionScoped
|
||||
public class CostumerController implements Serializable {
|
||||
@Inject
|
||||
private CostumerManager costumerManager;
|
||||
|
||||
@Inject
|
||||
private PasswordManager passwordManager;
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
final static Logger logger = Logger.getLogger(CostumerController.class);
|
||||
|
||||
public CostumerController(){
|
||||
|
||||
}
|
||||
|
||||
public String login(){
|
||||
logger.info("User trying to log in: " + username);
|
||||
if(costumerManager.login(username, password)){
|
||||
logger.info("Login succesfull " + username);
|
||||
return "welcome.xhtml";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String logout(){
|
||||
logger.info("User trying to logged out: " + username);
|
||||
costumerManager.logout();
|
||||
return "index.xhmtl";
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.apache.log4j.Logger;
|
||||
import plate.wellmann.shop.business.CustomerManager;
|
||||
import plate.wellmann.shop.business.PasswordManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@SessionScoped
|
||||
public class CustomerController implements Serializable {
|
||||
@Inject
|
||||
private CustomerManager costumerManager;
|
||||
|
||||
@Inject
|
||||
private PasswordManager passwordManager;
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
final static Logger logger = Logger.getLogger(CustomerController.class);
|
||||
|
||||
public CustomerController(){
|
||||
|
||||
}
|
||||
|
||||
public String login(){
|
||||
logger.info("User trying to log in: " + username);
|
||||
costumerManager.init();
|
||||
/*if(costumerManager.login(username, password)){
|
||||
logger.info("Login succesfull " + username);
|
||||
return "ressources/users/welcome.xhtml";
|
||||
}*/
|
||||
return "";
|
||||
}
|
||||
|
||||
public String logout(){
|
||||
logger.info("User trying to logged out: " + username);
|
||||
costumerManager.logout();
|
||||
return "index.xhmtl";
|
||||
}
|
||||
|
||||
public String demo(){
|
||||
return costumerManager.demo();
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Named;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class DomainTicketController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.view.ViewScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.primefaces.event.FlowEvent;
|
||||
import org.primefaces.event.SlideEndEvent;
|
||||
import plate.wellmann.shop.persistence.Color;
|
||||
import plate.wellmann.shop.persistence.Format;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
import plate.wellmann.shop.persistence.Paper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named(value = "productController")
|
||||
@ViewScoped
|
||||
public class ProductController implements Serializable{
|
||||
final static Logger logger = Logger.getLogger(ProductController.class);
|
||||
|
||||
private Item item;
|
||||
private int size;
|
||||
private String variations;
|
||||
private List<Price> prices;
|
||||
private Price selectedPrice;
|
||||
|
||||
public class Price {
|
||||
private final int id;
|
||||
private final BigInteger price;
|
||||
private final int elements;
|
||||
|
||||
public Price(int id, BigInteger price, int elements) {
|
||||
this.id = id;
|
||||
this.price = price;
|
||||
this.elements = elements;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public BigInteger getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public int getElements() {
|
||||
return elements;
|
||||
}
|
||||
|
||||
public String euros(){
|
||||
return price.toString().substring(0, price.toString().length()-2);
|
||||
}
|
||||
|
||||
public String cents(){
|
||||
return price.toString().substring(price.toString().length()-2);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
private ShoppingcartController shoppingcartController;
|
||||
|
||||
private String formatString;
|
||||
|
||||
public ProductController() {
|
||||
this.item = new Item(LocalDateTime.now());
|
||||
this.item.setDatacheck("Basis-Datencheck");
|
||||
this.item.setRoundedCorners(false);
|
||||
this.item.setNumberAdresses(1);
|
||||
}
|
||||
|
||||
public String onFlowProcess(FlowEvent event) {
|
||||
return event.getNewStep();
|
||||
}
|
||||
|
||||
public String toCart(){
|
||||
info(item.getName() + " wurde dem Warenkorb hiznugefügt!");
|
||||
|
||||
shoppingcartController.addItem(item, size);
|
||||
return "/resources/manager/shoppingcart.xhtml";
|
||||
}
|
||||
|
||||
public void addFormat(String x, String y){
|
||||
item.setFormat(new Format(new BigInteger(x), new BigInteger(y)));
|
||||
logger.debug("added Format "+ item.getFormat().getX() + " x " + item.getFormat().getY());
|
||||
createFormatString();
|
||||
}
|
||||
|
||||
public void createFormatString(){
|
||||
String x = item.getFormat().getX().toString();
|
||||
String y = item.getFormat().getY().toString();
|
||||
|
||||
this.formatString = x.substring(0, x.length()-2)+ ","+ x.substring(x.length()-2) + "cm x "
|
||||
+ y.substring(0, y.length()-2) + ","+ y.substring(y.length()-2) + "cm";
|
||||
}
|
||||
|
||||
public void addPaper(String name){
|
||||
Paper paper = new Paper();
|
||||
paper.setFormat("A3");
|
||||
paper.setName(name);
|
||||
paper.setSort("HeißesWeißes");
|
||||
item.setPaper(paper);
|
||||
}
|
||||
|
||||
public void addFinishing (String finishing){
|
||||
item.setFinishing(finishing);
|
||||
}
|
||||
|
||||
public void addColor(int id){
|
||||
switch(id){
|
||||
case 0:
|
||||
item.setColors(cmyk());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public void createPricesV(){
|
||||
logger.debug("started Pricegenerator");
|
||||
prices = new ArrayList<>();
|
||||
BigInteger var = new BigInteger(variations);
|
||||
|
||||
int i = 1;
|
||||
|
||||
BigInteger nr = new BigInteger("5043").multiply(var);
|
||||
Price price = new Price(i, nr, 100);
|
||||
prices.add(price);
|
||||
i++;
|
||||
|
||||
nr = new BigInteger("8064").multiply(var);
|
||||
Price price2 = new Price(i, nr, 250);
|
||||
prices.add(price2);
|
||||
i++;
|
||||
|
||||
nr = new BigInteger("11022").multiply(var);
|
||||
Price price3 = new Price(i, nr, 1000);
|
||||
prices.add(price3);
|
||||
i++;
|
||||
|
||||
nr = new BigInteger("12011").multiply(var);
|
||||
Price price4 = new Price(i, nr, 2500);
|
||||
prices.add(price4);
|
||||
i++;
|
||||
|
||||
nr = new BigInteger("13522").multiply(var);
|
||||
Price price5 = new Price(i, nr, 5000);
|
||||
prices.add(price5);
|
||||
|
||||
selectedPrice = prices.get(0);
|
||||
}
|
||||
|
||||
private List<Color> cmyk(){
|
||||
List<Color> colors = new ArrayList<>();
|
||||
Color c = new Color();
|
||||
c.setColorRoom(Color.ColorRoom.SKALA);
|
||||
c.setName("Schwarz");
|
||||
c.setColorType(Color.ColorType.K);
|
||||
c.setHtmlDotStyle("height:20px;width: 20px; background-color: #000000;border-radius: 50%;display: inline-block;");
|
||||
colors.add(c);
|
||||
|
||||
Color co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Magenta");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #ff00ff;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Cyan");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #00FFFF;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
co = new Color();
|
||||
co.setColorRoom(Color.ColorRoom.SKALA);
|
||||
co.setName("Yellow");
|
||||
co.setColorType(Color.ColorType.K);
|
||||
co.setHtmlDotStyle("height:20px;width: 20px; background-color: #FFFF00;border-radius: 50%;display: inline-block;");
|
||||
colors.add(co);
|
||||
|
||||
return colors;
|
||||
}
|
||||
|
||||
private void error(String message) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Fehler", message));
|
||||
|
||||
}
|
||||
|
||||
private void info(String message) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Erfolg", message));
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(Item item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public String getFormatString() {
|
||||
return formatString;
|
||||
}
|
||||
|
||||
public String paperString(){
|
||||
return item.getPaper().getName();
|
||||
}
|
||||
|
||||
public String finishingString(){
|
||||
return item.getFinishing();
|
||||
}
|
||||
|
||||
public String getVariations() {
|
||||
return variations;
|
||||
}
|
||||
|
||||
public void setVariations(String variations) {
|
||||
this.variations = variations;
|
||||
}
|
||||
|
||||
public List<Price> getPrices() {
|
||||
return prices;
|
||||
}
|
||||
|
||||
public Price getSelectedPrice() {
|
||||
return selectedPrice;
|
||||
}
|
||||
|
||||
public void setSelectedPrice(Price selectedPrice) {
|
||||
this.selectedPrice = selectedPrice;
|
||||
}
|
||||
|
||||
public String getDatacheck(){
|
||||
return item.getDatacheck();
|
||||
}
|
||||
|
||||
public void setDatacheck(String datacheck){
|
||||
item.setDatacheck(datacheck);
|
||||
}
|
||||
|
||||
public boolean isRoundedCorners(){
|
||||
return item.isRoundedCorners();
|
||||
}
|
||||
|
||||
public void setRoundedCorners(boolean roundedCorners){
|
||||
item.setRoundedCorners(roundedCorners);
|
||||
}
|
||||
|
||||
public int getNumberAdresses(){
|
||||
return item.getNumberAdresses();
|
||||
}
|
||||
|
||||
public void setNumberAdresses(int numberAdresses){
|
||||
item.setNumberAdresses(numberAdresses);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import plate.wellmann.shop.business.ShoppingcartManager;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
import java.util.List;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@SessionScoped
|
||||
@Named
|
||||
public class ShoppingcartController implements Serializable{
|
||||
@Inject
|
||||
ShoppingcartManager cartManager;
|
||||
|
||||
public void addItem(Item item, Integer size){
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
cartManager.addItem(item, size);
|
||||
}
|
||||
|
||||
public List<Item> getItems(){
|
||||
return cartManager.getItems();
|
||||
}
|
||||
|
||||
public void deleteItem(Long id){
|
||||
if (id == null) {
|
||||
error("Element konnte nicht aus Warenkorb entfernt werden!");
|
||||
return;
|
||||
}
|
||||
boolean status = cartManager.deleteItem(id);
|
||||
if (status) {
|
||||
info("Element wurde vom Warenkorb entfernt!");
|
||||
} else {
|
||||
error("Element konnte nicht aus Warenkorb entfernt werden!");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setQuantity(Item item, Integer size){
|
||||
boolean status = cartManager.setQuantity(item, size);
|
||||
if (status) {
|
||||
info(item.getName() +" wurde zum Warenkorb hinzugefügt!");
|
||||
} else {
|
||||
error(item.getName() +" konnte nicht zum Warenkorb hinzugefügt werden!");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
private void error(String message) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Fehler", message));
|
||||
|
||||
}
|
||||
|
||||
private void info(String message) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Erfolg", message));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void demo(){
|
||||
cartManager.demo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named(value = "themeController")
|
||||
@SessionScoped
|
||||
public class ThemeController implements Serializable {
|
||||
|
||||
private String theme = "start";
|
||||
|
||||
private final String[] themes = {
|
||||
"afterdark",
|
||||
"afternoon",
|
||||
"afterwork",
|
||||
"aristo",
|
||||
"black-tie",
|
||||
"blitzer",
|
||||
"bluesky",
|
||||
"bootstrap",
|
||||
"casablanca",
|
||||
"cupertino",
|
||||
"cruze",
|
||||
"dark-hive",
|
||||
"delta",
|
||||
"dot-luv",
|
||||
"eggplant",
|
||||
"excite-bike",
|
||||
"flick",
|
||||
"glass-x",
|
||||
"home",
|
||||
"hot-sneaks",
|
||||
"humanity",
|
||||
"le-frog",
|
||||
"midnight",
|
||||
"mint-choc",
|
||||
"overcast",
|
||||
"pepper-grinder",
|
||||
"redmond",
|
||||
"rocket",
|
||||
"sam",
|
||||
"smoothness",
|
||||
"south-street",
|
||||
"start",
|
||||
"sunny",
|
||||
"swanky-purse",
|
||||
"trontastic",
|
||||
"ui-darkness",
|
||||
"ui-lightness",
|
||||
"vader"
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the value of themes
|
||||
*
|
||||
* @return the value of themes
|
||||
*/
|
||||
public String[] getThemes() {
|
||||
return themes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of theme
|
||||
*
|
||||
* @return the value of theme
|
||||
*/
|
||||
public String getTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of theme
|
||||
*
|
||||
* @param theme new value of theme
|
||||
*/
|
||||
public void setTheme(String theme) {
|
||||
this.theme = theme;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new instance of ThemeController
|
||||
*/
|
||||
public ThemeController() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Named;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class EmailController implements Serializable {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.controller.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import plate.wellmann.shop.persistence.Customer;
|
||||
import plate.wellmann.shop.persistence.Item;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Named
|
||||
@SessionScoped
|
||||
public class UserTicketsController implements Serializable{
|
||||
@Inject
|
||||
private Customer activeCostumer;
|
||||
|
||||
@Inject
|
||||
private List<Item> activeTickets;
|
||||
|
||||
public List<Item> getActiveTickets() {
|
||||
return activeTickets;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package plate.wellmann.shop.persistence;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick Plate
|
||||
*/
|
||||
@MappedSuperclass
|
||||
public class AbstractEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long 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) {
|
||||
if (!(object.getClass() == this.getClass())) {
|
||||
return false;
|
||||
}
|
||||
AbstractEntity other = (AbstractEntity) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import javax.validation.constraints.DecimalMin;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Color extends AbstractEntity{
|
||||
|
||||
@NotNull
|
||||
private BigDecimal price;
|
||||
|
||||
@ManyToOne
|
||||
private Item item;
|
||||
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
private String htmlDotStyle;
|
||||
|
||||
private String htmlStyle;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin(value = "0", message = "Nicht unter Null")
|
||||
@DecimalMax(value = "100", message = "Nicht über Hundert")
|
||||
private BigDecimal cyan;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin(value = "0", message = "Nicht unter Null")
|
||||
@DecimalMax(value = "100", message = "Nicht über Hundert")
|
||||
private BigDecimal magenta;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin(value = "0", message = "Nicht unter Null")
|
||||
@DecimalMax(value = "100", message = "Nicht über Hundert")
|
||||
private BigDecimal yellow;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin(value = "0", message = "Nicht unter Null")
|
||||
@DecimalMax(value = "100", message = "Nicht über Hundert")
|
||||
private BigDecimal kontrast;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
private ColorRoom colorRoom;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private ColorType colorType;
|
||||
|
||||
public enum ColorRoom {
|
||||
SKALA,
|
||||
HKS,
|
||||
PANTONE
|
||||
}
|
||||
|
||||
public enum ColorType {
|
||||
K,
|
||||
N
|
||||
}
|
||||
|
||||
public String getHtmlDotStyle() {
|
||||
return htmlDotStyle;
|
||||
}
|
||||
|
||||
public void setHtmlDotStyle(String htmlDotStyle) {
|
||||
this.htmlDotStyle = htmlDotStyle;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ColorRoom getColorRoom() {
|
||||
return colorRoom;
|
||||
}
|
||||
|
||||
public void setColorRoom(ColorRoom colorRoom) {
|
||||
this.colorRoom = colorRoom;
|
||||
}
|
||||
|
||||
public ColorType getColorType() {
|
||||
return colorType;
|
||||
}
|
||||
|
||||
public void setColorType(ColorType colorType) {
|
||||
this.colorType = colorType;
|
||||
}
|
||||
|
||||
public String getHtmlStyle() {
|
||||
return htmlStyle;
|
||||
}
|
||||
|
||||
public void setHtmlStyle(String htmlStyle) {
|
||||
this.htmlStyle = htmlStyle;
|
||||
}
|
||||
|
||||
public BigDecimal getCyan() {
|
||||
return cyan;
|
||||
}
|
||||
|
||||
public void setCyan(BigDecimal cyan) {
|
||||
this.cyan = cyan;
|
||||
}
|
||||
|
||||
public BigDecimal getMagenta() {
|
||||
return magenta;
|
||||
}
|
||||
|
||||
public void setMagenta(BigDecimal magenta) {
|
||||
this.magenta = magenta;
|
||||
}
|
||||
|
||||
public BigDecimal getYellow() {
|
||||
return yellow;
|
||||
}
|
||||
|
||||
public void setYellow(BigDecimal yellow) {
|
||||
this.yellow = yellow;
|
||||
}
|
||||
|
||||
public BigDecimal getKontrast() {
|
||||
return kontrast;
|
||||
}
|
||||
|
||||
public void setKontrast(BigDecimal kontrast) {
|
||||
this.kontrast = kontrast;
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(Item item) {
|
||||
this.item = item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Comment extends AbstractEntity {
|
||||
|
||||
private String text;
|
||||
private final Customer writer;
|
||||
private final LocalDateTime creationDate;
|
||||
private LocalDateTime lastEditedDate;
|
||||
private boolean edited;
|
||||
|
||||
@ManyToOne
|
||||
private Item item;
|
||||
|
||||
public Comment(Customer customer) {
|
||||
this.writer = customer;
|
||||
this.creationDate = LocalDateTime.now();
|
||||
this.edited = false;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastEditedDate() {
|
||||
return lastEditedDate;
|
||||
}
|
||||
|
||||
public void setLastEditedDate(LocalDateTime lastEditedDate) {
|
||||
this.lastEditedDate = lastEditedDate;
|
||||
}
|
||||
|
||||
public boolean isEdited() {
|
||||
return edited;
|
||||
}
|
||||
|
||||
public void setEdited(boolean edited) {
|
||||
this.edited = edited;
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(Item item) {
|
||||
this.item = item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Costumer.findByEmail",
|
||||
query = "SELECT c FROM Costumer c WHERE c.email = :email"),
|
||||
@NamedQuery(name = "Costumer.findByID",
|
||||
query = "SELECT c FROM Costumer c WHERE c.id = :id")
|
||||
})
|
||||
public class Costumer extends AbstractEntity {
|
||||
|
||||
public static Costumer nullCostumer = new Costumer();
|
||||
|
||||
@ManyToOne(cascade = CascadeType.ALL)
|
||||
private UserDomain userDomain;
|
||||
|
||||
@Column(name="Email", unique=true, nullable=false)
|
||||
private String email;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
private Password password;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
private Salt salt;
|
||||
|
||||
@Column(name="Kunde")
|
||||
private String kunde;
|
||||
|
||||
@Column(name="Kunde2")
|
||||
private String kunde2;
|
||||
|
||||
@Column(name="Ansprechpartner")
|
||||
private String contact;
|
||||
|
||||
@Column(name="Straße")
|
||||
private String street;
|
||||
|
||||
@Column(name="Ort")
|
||||
private String city;
|
||||
|
||||
@Column(name="Telefon")
|
||||
private String telefon;
|
||||
|
||||
@Column(name="Mobil")
|
||||
private String mobile;
|
||||
|
||||
@Column(name="Anrede")
|
||||
private String call;
|
||||
|
||||
@Column(name="Liefername")
|
||||
private String deliveryName;
|
||||
|
||||
@Column(name="Lieferansprechpartner")
|
||||
private String deliveryContakt;
|
||||
|
||||
@Column(name="Lieferort")
|
||||
private String deliveryCity;
|
||||
|
||||
@Column(name="Lieferstraße")
|
||||
private String deliveryStreet;
|
||||
|
||||
//Besser als enum
|
||||
@Column(name="Zahlungsbedingungen")
|
||||
private String paymentConditions;
|
||||
|
||||
public Costumer(String email, byte[] password, Salt salt) {
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = new UserDomain(email.substring(email.indexOf("@") + 1), this);
|
||||
}
|
||||
|
||||
public Costumer(String email, byte[] password, Salt salt, String domain) {
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = new UserDomain(domain, this);
|
||||
}
|
||||
|
||||
public Costumer(String email, byte[] password, Salt salt, UserDomain domain){
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = domain;
|
||||
}
|
||||
|
||||
private Costumer() {
|
||||
}
|
||||
|
||||
public Password getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(Password password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public static Costumer getNullCostumer() {
|
||||
return nullCostumer;
|
||||
}
|
||||
|
||||
public static void setNullCostumer(Costumer nullCostumer) {
|
||||
Costumer.nullCostumer = nullCostumer;
|
||||
}
|
||||
|
||||
public UserDomain getDomain() {
|
||||
return userDomain;
|
||||
}
|
||||
|
||||
public void setDomain(UserDomain domain) {
|
||||
this.userDomain = domain;
|
||||
}
|
||||
|
||||
public String getKunde() {
|
||||
return kunde;
|
||||
}
|
||||
|
||||
public void setKunde(String kunde) {
|
||||
this.kunde = kunde;
|
||||
}
|
||||
|
||||
public String getKunde2() {
|
||||
return kunde2;
|
||||
}
|
||||
|
||||
public void setKunde2(String kunde2) {
|
||||
this.kunde2 = kunde2;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getTelefon() {
|
||||
return telefon;
|
||||
}
|
||||
|
||||
public void setTelefon(String telefon) {
|
||||
this.telefon = telefon;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getCall() {
|
||||
return call;
|
||||
}
|
||||
|
||||
public void setCall(String call) {
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public String getDeliveryName() {
|
||||
return deliveryName;
|
||||
}
|
||||
|
||||
public void setDeliveryName(String deliveryName) {
|
||||
this.deliveryName = deliveryName;
|
||||
}
|
||||
|
||||
public String getDeliveryContakt() {
|
||||
return deliveryContakt;
|
||||
}
|
||||
|
||||
public void setDeliveryContakt(String deliveryContakt) {
|
||||
this.deliveryContakt = deliveryContakt;
|
||||
}
|
||||
|
||||
public String getDeliveryCity() {
|
||||
return deliveryCity;
|
||||
}
|
||||
|
||||
public void setDeliveryCity(String deliveryCity) {
|
||||
this.deliveryCity = deliveryCity;
|
||||
}
|
||||
|
||||
public String getDeliveryStreet() {
|
||||
return deliveryStreet;
|
||||
}
|
||||
|
||||
public void setDeliveryStreet(String deliveryStreet) {
|
||||
this.deliveryStreet = deliveryStreet;
|
||||
}
|
||||
|
||||
public String getPaymentConditions() {
|
||||
return paymentConditions;
|
||||
}
|
||||
|
||||
public void setPaymentConditions(String paymentConditions) {
|
||||
this.paymentConditions = paymentConditions;
|
||||
}
|
||||
|
||||
public Salt getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(Salt salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Customer.findByEmail",
|
||||
query = "SELECT c FROM Customer c WHERE c.email = :email"),
|
||||
@NamedQuery(name = "Customer.findByID",
|
||||
query = "SELECT c FROM Customer c WHERE c.id = :id")
|
||||
})
|
||||
public class Customer extends AbstractEntity {
|
||||
|
||||
public static Customer nullCustomer = new Customer();
|
||||
|
||||
@OneToMany(mappedBy = "creator", fetch = FetchType.LAZY)
|
||||
private List<Item> tickets;
|
||||
|
||||
@ManyToMany(mappedBy = "watchers")
|
||||
private List<Item> watchTickets;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.ALL)
|
||||
private UserDomain userDomain;
|
||||
|
||||
@Column(name="Email", unique=true, nullable=false)
|
||||
private String email;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
private Password password;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
private Salt salt;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
private MyUserGroups groups;
|
||||
|
||||
@Column(name="Kunde")
|
||||
private String kunde;
|
||||
|
||||
@Column(name="Kunde2")
|
||||
private String kunde2;
|
||||
|
||||
@Column(name="Ansprechpartner")
|
||||
private String contact;
|
||||
|
||||
@Column(name="Straße")
|
||||
private String street;
|
||||
|
||||
@Column(name="Ort")
|
||||
private String city;
|
||||
|
||||
@Column(name="Telefon")
|
||||
private String telefon;
|
||||
|
||||
@Column(name="Mobil")
|
||||
private String mobile;
|
||||
|
||||
@Column(name="Anrede")
|
||||
private String call;
|
||||
|
||||
@Column(name="Liefername")
|
||||
private String deliveryName;
|
||||
|
||||
@Column(name="Lieferansprechpartner")
|
||||
private String deliveryContakt;
|
||||
|
||||
@Column(name="Lieferort")
|
||||
private String deliveryCity;
|
||||
|
||||
@Column(name="Lieferstraße")
|
||||
private String deliveryStreet;
|
||||
|
||||
//Besser als enum
|
||||
@Column(name="Zahlungsbedingungen")
|
||||
private String paymentConditions;
|
||||
|
||||
public Customer(){
|
||||
|
||||
}
|
||||
|
||||
public Customer(String email, String password, Salt salt) {
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = new UserDomain(email.substring(email.indexOf("@") + 1), this);
|
||||
}
|
||||
|
||||
public Customer(String email, String password, Salt salt, String domain) {
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = new UserDomain(domain, this);
|
||||
}
|
||||
|
||||
public Customer(String email, String password, Salt salt, UserDomain domain){
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = domain;
|
||||
}
|
||||
|
||||
public Customer(String email, String password, Salt salt, UserDomain domain, MyUserGroups groups){
|
||||
this.email = email;
|
||||
this.password = new Password(this, password);
|
||||
this.salt = salt;
|
||||
this.userDomain = domain;
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public Password getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(Password password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public static Customer getNullCustomer() {
|
||||
return nullCustomer;
|
||||
}
|
||||
|
||||
public static void setNullCustomer(Customer nullCustomer) {
|
||||
Customer.nullCustomer = nullCustomer;
|
||||
}
|
||||
|
||||
public UserDomain getDomain() {
|
||||
return userDomain;
|
||||
}
|
||||
|
||||
public void setDomain(UserDomain domain) {
|
||||
this.userDomain = domain;
|
||||
}
|
||||
|
||||
public String getKunde() {
|
||||
return kunde;
|
||||
}
|
||||
|
||||
public void setKunde(String kunde) {
|
||||
this.kunde = kunde;
|
||||
}
|
||||
|
||||
public String getKunde2() {
|
||||
return kunde2;
|
||||
}
|
||||
|
||||
public void setKunde2(String kunde2) {
|
||||
this.kunde2 = kunde2;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getTelefon() {
|
||||
return telefon;
|
||||
}
|
||||
|
||||
public void setTelefon(String telefon) {
|
||||
this.telefon = telefon;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getCall() {
|
||||
return call;
|
||||
}
|
||||
|
||||
public void setCall(String call) {
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public String getDeliveryName() {
|
||||
return deliveryName;
|
||||
}
|
||||
|
||||
public void setDeliveryName(String deliveryName) {
|
||||
this.deliveryName = deliveryName;
|
||||
}
|
||||
|
||||
public String getDeliveryContakt() {
|
||||
return deliveryContakt;
|
||||
}
|
||||
|
||||
public void setDeliveryContakt(String deliveryContakt) {
|
||||
this.deliveryContakt = deliveryContakt;
|
||||
}
|
||||
|
||||
public String getDeliveryCity() {
|
||||
return deliveryCity;
|
||||
}
|
||||
|
||||
public void setDeliveryCity(String deliveryCity) {
|
||||
this.deliveryCity = deliveryCity;
|
||||
}
|
||||
|
||||
public String getDeliveryStreet() {
|
||||
return deliveryStreet;
|
||||
}
|
||||
|
||||
public void setDeliveryStreet(String deliveryStreet) {
|
||||
this.deliveryStreet = deliveryStreet;
|
||||
}
|
||||
|
||||
public String getPaymentConditions() {
|
||||
return paymentConditions;
|
||||
}
|
||||
|
||||
public void setPaymentConditions(String paymentConditions) {
|
||||
this.paymentConditions = paymentConditions;
|
||||
}
|
||||
|
||||
public Salt getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(Salt salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public UserDomain getUserDomain() {
|
||||
return userDomain;
|
||||
}
|
||||
|
||||
public void setUserDomain(UserDomain userDomain) {
|
||||
this.userDomain = userDomain;
|
||||
}
|
||||
|
||||
public MyUserGroups getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public void setGroups(MyUserGroups groups) {
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public List<Item> getTickets() {
|
||||
return tickets;
|
||||
}
|
||||
|
||||
public void setTickets(List<Item> tickets) {
|
||||
this.tickets = tickets;
|
||||
}
|
||||
|
||||
public void addTicket(Item ticket){
|
||||
if (tickets == null) {
|
||||
tickets = new ArrayList<>();
|
||||
}
|
||||
tickets.add(ticket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Format extends AbstractEntity {
|
||||
|
||||
private final BigInteger x;
|
||||
private final BigInteger y;
|
||||
|
||||
public Format(BigInteger x, BigInteger y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "plate.wellmann.shop.persistence.Format[ id=" + getId() + " ]";
|
||||
}
|
||||
|
||||
public BigInteger getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public BigInteger getY() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Item.findByID",
|
||||
query = "SELECT t FROM Item t WHERE t.id = :id"),
|
||||
@NamedQuery(name = "Item.findByUser",
|
||||
query = "SELECT t FROM Item t WHERE t.creator = :creator")
|
||||
})
|
||||
public class Item extends AbstractEntity {
|
||||
|
||||
private String name;
|
||||
|
||||
private String datacheck;
|
||||
|
||||
private Paper paper;
|
||||
|
||||
@OneToMany(mappedBy = "item", fetch = FetchType.LAZY)
|
||||
private List<Color> colors;
|
||||
|
||||
@ManyToOne
|
||||
private Customer creator;
|
||||
|
||||
private Customer manager;
|
||||
|
||||
private BigInteger quantity;
|
||||
|
||||
private BigInteger price;
|
||||
|
||||
@OneToMany(mappedBy = "item", fetch = FetchType.LAZY)
|
||||
private List<Comment> comments;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TicketStatus status;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PayMethod payMethod;
|
||||
|
||||
private final LocalDateTime creationDate;
|
||||
|
||||
private LocalDateTime lastChangeDate;
|
||||
|
||||
@ManyToMany(fetch = FetchType.EAGER)
|
||||
private List<Customer> watchers;
|
||||
|
||||
@OneToMany(mappedBy = "ticket", fetch = FetchType.LAZY)
|
||||
private List<Log> log;
|
||||
|
||||
private boolean payed;
|
||||
|
||||
private Format format;
|
||||
|
||||
private String finishing;
|
||||
|
||||
private boolean roundedCorners;
|
||||
|
||||
private int numberAdresses;
|
||||
|
||||
public enum PayMethod {
|
||||
BILL,
|
||||
AHEAD,
|
||||
CREDITCARD,
|
||||
PAYPAL
|
||||
}
|
||||
|
||||
public enum TicketStatus {
|
||||
NEW,
|
||||
PENDING,
|
||||
ACTIVE,
|
||||
CLOSED,
|
||||
REOPENED
|
||||
}
|
||||
|
||||
public Item(LocalDateTime creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
this.status = TicketStatus.NEW;
|
||||
}
|
||||
|
||||
public BigInteger getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(BigInteger quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Paper getPaper() {
|
||||
return paper;
|
||||
}
|
||||
|
||||
public void setPaper(Paper paper) {
|
||||
this.paper = paper;
|
||||
}
|
||||
|
||||
public List<Color> getColors() {
|
||||
return colors;
|
||||
}
|
||||
|
||||
public void setColors(List<Color> colors) {
|
||||
this.colors = colors;
|
||||
}
|
||||
|
||||
public Customer getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(Customer customer) {
|
||||
this.creator = customer;
|
||||
}
|
||||
|
||||
public Customer getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(Customer manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public List<Comment> getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(List<Comment> comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public TicketStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(TicketStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastChangeDate() {
|
||||
return lastChangeDate;
|
||||
}
|
||||
|
||||
public void setLastChangeDate(LocalDateTime lastChangeDate) {
|
||||
this.lastChangeDate = lastChangeDate;
|
||||
}
|
||||
|
||||
public List<Customer> getWatchers() {
|
||||
return watchers;
|
||||
}
|
||||
|
||||
public void setWatchers(List<Customer> watchers) {
|
||||
this.watchers = watchers;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public List<Log> getLog() {
|
||||
return log;
|
||||
}
|
||||
|
||||
public void addLogEntry(String entry) {
|
||||
if (log == null) {
|
||||
log = new ArrayList<>();
|
||||
}
|
||||
log.add(new Log(entry, this));
|
||||
}
|
||||
|
||||
public boolean isPayed() {
|
||||
return payed;
|
||||
}
|
||||
|
||||
public void setPayed(boolean payed) {
|
||||
this.payed = payed;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public BigInteger getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public PayMethod getPayMethod() {
|
||||
return payMethod;
|
||||
}
|
||||
|
||||
public void setPayMethod(PayMethod payMethod) {
|
||||
this.payMethod = payMethod;
|
||||
}
|
||||
|
||||
public void setPrice(BigInteger price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Format getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public void setFormat(Format format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public String getPriceEuro(){
|
||||
if (price == null) {
|
||||
return "error";
|
||||
}
|
||||
//return price.remainder(new BigInteger("100")).toString();
|
||||
String digits = price.toString();
|
||||
return digits.substring(0, digits.length()-2);
|
||||
}
|
||||
|
||||
public String getPriceCent(){
|
||||
String digits = price.toString();
|
||||
int length = digits.length();
|
||||
return digits.substring(length-2, length);
|
||||
}
|
||||
|
||||
public String fullPriceEuro(){
|
||||
return getPriceEuro()+","+getPriceCent()+" €";
|
||||
}
|
||||
|
||||
public String getFinishing() {
|
||||
return finishing;
|
||||
}
|
||||
|
||||
public void setFinishing(String finishing) {
|
||||
this.finishing = finishing;
|
||||
}
|
||||
|
||||
public String getDatacheck() {
|
||||
return datacheck;
|
||||
}
|
||||
|
||||
public void setDatacheck(String datacheck) {
|
||||
this.datacheck = datacheck;
|
||||
}
|
||||
|
||||
public boolean isRoundedCorners() {
|
||||
return roundedCorners;
|
||||
}
|
||||
|
||||
public void setRoundedCorners(boolean roundedCorners) {
|
||||
this.roundedCorners = roundedCorners;
|
||||
}
|
||||
|
||||
public int getNumberAdresses() {
|
||||
return numberAdresses;
|
||||
}
|
||||
|
||||
public void setNumberAdresses(int numberAdresses) {
|
||||
this.numberAdresses = numberAdresses;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Log extends AbstractEntity{
|
||||
private final String entry;
|
||||
|
||||
@ManyToOne
|
||||
private final Item ticket;
|
||||
|
||||
public Log(String entry, Item ticket) {
|
||||
this.entry = entry;
|
||||
this.ticket = ticket;
|
||||
}
|
||||
|
||||
public String getEntry() {
|
||||
return entry;
|
||||
}
|
||||
|
||||
public Item getTicket() {
|
||||
return ticket;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class MyUserGroups extends AbstractEntity {
|
||||
@OneToOne
|
||||
private final Customer customer;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Group userGroup;
|
||||
|
||||
public enum Group {
|
||||
USER,
|
||||
SUPERUSER,
|
||||
MANAGER,
|
||||
ADMIN
|
||||
}
|
||||
|
||||
public MyUserGroups(Customer customer, Group group) {
|
||||
this.customer = customer;
|
||||
this.userGroup = group;
|
||||
}
|
||||
|
||||
public Group getUserGroup() {
|
||||
return userGroup;
|
||||
}
|
||||
|
||||
public void setUserGroup(Group userGroup) {
|
||||
this.userGroup = userGroup;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Paper extends AbstractEntity{
|
||||
|
||||
@Column(name="Bestellnummer")
|
||||
private String orderNR;
|
||||
|
||||
@Column(name="Bestellnummer2")
|
||||
private String orderNR2;
|
||||
|
||||
@Column(name="Betand")
|
||||
private int inStorage;
|
||||
|
||||
@Column(name="Datum papier eingabe")
|
||||
private Date date;
|
||||
|
||||
@Column(name="Euro Bestand")
|
||||
private int euroStorage;
|
||||
|
||||
@Column(name="Format")
|
||||
private String format;
|
||||
|
||||
@Column(name="Gewicht")
|
||||
private String weight;
|
||||
|
||||
@Column(name="Laufrichtung")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Direction direction;
|
||||
|
||||
@Column(name="Ort Papier")
|
||||
private String place;
|
||||
|
||||
@Column(name="Papierlieferant")
|
||||
private String source;
|
||||
|
||||
@Column(name="Papiername")
|
||||
private String name;
|
||||
|
||||
@Column(name="Papierpreis ein")
|
||||
private BigDecimal priceBuy;
|
||||
|
||||
@Column(name="Papiersorte")
|
||||
private String sort;
|
||||
|
||||
@Column(name="Riesinhalt")
|
||||
private int riesCapacity;
|
||||
|
||||
//Direction of the Paper
|
||||
public enum Direction {
|
||||
SB, BB
|
||||
}
|
||||
|
||||
public String getOrderNR() {
|
||||
return orderNR;
|
||||
}
|
||||
|
||||
public void setOrderNR(String orderNR) {
|
||||
this.orderNR = orderNR;
|
||||
}
|
||||
|
||||
public String getOrderNR2() {
|
||||
return orderNR2;
|
||||
}
|
||||
|
||||
public void setOrderNR2(String orderNR2) {
|
||||
this.orderNR2 = orderNR2;
|
||||
}
|
||||
|
||||
public int getInStorage() {
|
||||
return inStorage;
|
||||
}
|
||||
|
||||
public void setInStorage(int inStorage) {
|
||||
this.inStorage = inStorage;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public int getEuroStorage() {
|
||||
return euroStorage;
|
||||
}
|
||||
|
||||
public void setEuroStorage(int euroStorage) {
|
||||
this.euroStorage = euroStorage;
|
||||
}
|
||||
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public String getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(String weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public Direction getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(Direction direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getPlace() {
|
||||
return place;
|
||||
}
|
||||
|
||||
public void setPlace(String place) {
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public BigDecimal getPriceBuy() {
|
||||
return priceBuy;
|
||||
}
|
||||
|
||||
public void setPriceBuy(BigDecimal priceBuy) {
|
||||
this.priceBuy = priceBuy;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getRiesCapacity() {
|
||||
return riesCapacity;
|
||||
}
|
||||
|
||||
public void setRiesCapacity(int riesCapacity) {
|
||||
this.riesCapacity = riesCapacity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "MyPassword.findByPassword",
|
||||
query = "SELECT p FROM Password p WHERE p.password = :password"),
|
||||
@NamedQuery(name = "Password.findByCostumerID",
|
||||
query = "SELECT p FROM Password p WHERE p.customer = :customer")
|
||||
})
|
||||
public class Password extends AbstractEntity {
|
||||
|
||||
@OneToOne
|
||||
private final Customer customer;
|
||||
|
||||
@Column(name="password")
|
||||
private String password;
|
||||
|
||||
public Password (Customer costumer, String password) {
|
||||
this.customer = costumer;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public Customer getCostumer() {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassowrd(String password){
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
//import java.nio.charset.Charset;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
public class Salt extends AbstractEntity {
|
||||
|
||||
//private final Charset UTF8_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
private byte[] salt;
|
||||
private int interations;
|
||||
|
||||
public Salt(){
|
||||
interations = 3072;
|
||||
generateSalt();
|
||||
}
|
||||
|
||||
private void generateSalt() {
|
||||
SecureRandom random = new SecureRandom();
|
||||
byte bytes[] = new byte[64];
|
||||
random.nextBytes(bytes);
|
||||
salt = bytes;
|
||||
}
|
||||
|
||||
public java.lang.String bytetoString(byte[] input) {
|
||||
return Arrays.toString(input);
|
||||
}
|
||||
|
||||
public byte[] getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public int getInterations() {
|
||||
return interations;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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 plate.wellmann.shop.persistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Patrick
|
||||
*/
|
||||
@Entity
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "UserDomain.findByName",
|
||||
query = "SELECT d FROM UserDomain d WHERE d.userDomain = :userDomain"),
|
||||
@NamedQuery(name = "UserDomain.findAll",
|
||||
query = "SELECT d FROM UserDomain d ")
|
||||
})
|
||||
public class UserDomain extends AbstractEntity{
|
||||
|
||||
final static Logger logger = Logger.getLogger(UserDomain.class);
|
||||
|
||||
@OneToMany(mappedBy = "userDomain")
|
||||
private List<Customer> customers;
|
||||
|
||||
@Column(name="userDomain", unique=true, nullable=false)
|
||||
private final String userDomain;
|
||||
|
||||
public UserDomain() {
|
||||
userDomain = null;
|
||||
}
|
||||
|
||||
public UserDomain(String domain, Customer customer){
|
||||
this.userDomain = domain;
|
||||
customers = new ArrayList<>();
|
||||
customers.add(customer);
|
||||
logger.info("Created new UserDomain " + domain + " and added Costumer: " + customer.getEmail());
|
||||
}
|
||||
|
||||
public void addCostumer(Customer customer){
|
||||
if(customers == null){
|
||||
customers = new ArrayList<>();
|
||||
}
|
||||
if (customer == null || customer == Customer.nullCustomer) {
|
||||
logger.warn("Tried to add null Customer to domain" + userDomain);
|
||||
return;
|
||||
}
|
||||
//to safe RAM
|
||||
//String domain = customer.getEmail().substring(customer.getEmail().indexOf("@") + 1);
|
||||
if (customer.getEmail().substring(customer.getEmail().indexOf("@") + 1).equals(userDomain)) {
|
||||
customers.add(customer);
|
||||
logger.info("Added " + customer.getEmail() + " to Domain " + userDomain);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Customer> getCustomers() {
|
||||
return customers;
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return userDomain;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
||||
<persistence-unit name="MySQL-Wellmann" transaction-type="JTA">
|
||||
<jta-data-source>java:/Wellmann-Shop</jta-data-source>
|
||||
<class>plate.wellmann.shop.persistence.Customer</class>
|
||||
<class>plate.wellmann.shop.persistence.Salt</class>
|
||||
<class>plate.wellmann.shop.persistence.UserDomain</class>
|
||||
<class>plate.wellmann.shop.persistence.MyUserGroups</class>
|
||||
<class>plate.wellmann.shop.persistence.Password</class>
|
||||
<class>plate.wellmann.shop.persistence.Color</class>
|
||||
<class>plate.wellmann.shop.persistence.Item</class>
|
||||
<class>plate.wellmann.shop.persistence.Comment</class>
|
||||
<class>plate.wellmann.shop.persistence.Paper</class>
|
||||
<class>plate.wellmann.shop.persistence.Log</class>
|
||||
<class>plate.wellmann.shop.persistence.Format</class>
|
||||
<exclude-unlisted-classes>false</exclude-unlisted-classes>
|
||||
<properties>
|
||||
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
@@ -0,0 +1,16 @@
|
||||
# Root logger option
|
||||
log4j.rootLogger=DEBUG, stdout, file
|
||||
|
||||
# Redirect log messages to console
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
||||
|
||||
# Redirect log messages to a log file, support file rolling.
|
||||
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.file.File=${user.home}/wellmann-shop.log
|
||||
log4j.appender.file.MaxFileSize=5MB
|
||||
log4j.appender.file.MaxBackupIndex=10
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faces-config
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
|
||||
version="2.3">
|
||||
<managed-bean>
|
||||
<managed-bean-name>loginBean</managed-bean-name>
|
||||
<managed-bean-class>httpauthenticationmechanism.LoginBean</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
</faces-config>
|
||||
@@ -0,0 +1,6 @@
|
||||
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
|
||||
version="10.0">
|
||||
<security-domain>wellmannsec</security-domain>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,6 @@
|
||||
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
|
||||
version="10.0">
|
||||
<security-domain>wellmannsec</security-domain>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
|
||||
version="4.0">
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>authorise</web-resource-name>
|
||||
<url-pattern>/ressources/users/*</url-pattern>
|
||||
<http-method>GET</http-method>
|
||||
<http-method>POST</http-method>
|
||||
<http-method>TRACE</http-method>
|
||||
<http-method>HEAD</http-method>
|
||||
<http-method>DELETE</http-method>
|
||||
<http-method>CONNECT</http-method>
|
||||
<http-method>OPTIONS</http-method>
|
||||
<http-method>PUT</http-method>
|
||||
</web-resource-collection>
|
||||
|
||||
<auth-constraint>
|
||||
<role-name>ADMIN</role-name>
|
||||
<role-name>MANAGER</role-name>
|
||||
<role-name>SUPER_USER</role-name>
|
||||
<role-name>USER</role-name>
|
||||
</auth-constraint>
|
||||
|
||||
<user-data-constraint>
|
||||
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
|
||||
</user-data-constraint>
|
||||
</security-constraint>
|
||||
|
||||
<security-role>
|
||||
<description>Normal User which got invited</description>
|
||||
<role-name>USER</role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<description>User that can invite other user from the same domain</description>
|
||||
<role-name>SUPER_USER</role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<description>User that controlls the process in the company</description>
|
||||
<role-name>MANAGER></role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<description>Admin user who can change entries, invite new domains and more..</description>
|
||||
<role-name>ADMIN</role-name>
|
||||
</security-role>
|
||||
|
||||
<login-config>
|
||||
<auth-method>FORM</auth-method>
|
||||
<realm-name>wellmannsec</realm-name>
|
||||
<form-login-config>
|
||||
<form-login-page>/login.xhtml</form-login-page>
|
||||
<form-error-page>/error.xhtml</form-error-page>
|
||||
</form-login-config>
|
||||
</login-config>
|
||||
|
||||
|
||||
<context-param>
|
||||
<param-name>javax.faces.PROJECT_STAGE</param-name>
|
||||
<param-value>Development</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>primefaces.THEME</param-name>
|
||||
<param-value>#{themeController.theme}</param-value>
|
||||
</context-param>
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>*.xhtml</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
<cookie-config>
|
||||
<http-only>true</http-only> <!-- Prevent client side scripting from accessing/manipulating session cookie. -->
|
||||
</cookie-config>
|
||||
<tracking-mode>COOKIE</tracking-mode> <!-- This disables URL rewriting. -->
|
||||
</session-config>
|
||||
<welcome-file-list>
|
||||
<welcome-file>/login.xhtml</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
@@ -0,0 +1,31 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<h:head>
|
||||
<title>Login Testpage</title>
|
||||
</h:head>
|
||||
<h:body>
|
||||
<h:form>
|
||||
ERROR
|
||||
<p:messages id="messages" globalOnly="true"/>
|
||||
|
||||
<p:panel header="Login Wellmann-Shop example" style="width: 350px; margin: auto; margin-top: 100px;">
|
||||
<h:panelGrid columns="2" cellpadding="5">
|
||||
<p:outputLabel for="username" value="Username:" />
|
||||
<p:inputText id="username" value="#{customerController.username}" required="true" label="username" />
|
||||
|
||||
<p:outputLabel for="password" value="Password:" />
|
||||
<p:password id="password" value="#{customerController.password}" required="true" label="password" />
|
||||
|
||||
<f:facet name="footer">
|
||||
<p:commandButton value="Login" action="#{customerController.login()}" ajax="false" />
|
||||
<p:link value="Registrieren" outcome="index.xhtml" style="text-align: right; color: blue; margin-left: 20px" />
|
||||
</f:facet>
|
||||
</h:panelGrid>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
|
||||
</h:body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Start Page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,30 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<h:head>
|
||||
<title>Login Testpage</title>
|
||||
</h:head>
|
||||
<h:body>
|
||||
<h:form>
|
||||
<p:messages id="messages" globalOnly="true"/>
|
||||
|
||||
<p:panel header="Login Wellmann-Shop example" style="width: 350px; margin: auto; margin-top: 100px;">
|
||||
<h:panelGrid columns="2" cellpadding="5">
|
||||
<p:outputLabel for="j_username" value="Username:" />
|
||||
<p:inputText id="j_username" value="#{customerController.username}" required="true" label="username" />
|
||||
|
||||
<p:outputLabel for="j_password" value="Password:" />
|
||||
<p:password id="j_password" value="#{customerController.password}" required="true" label="password" />
|
||||
|
||||
<f:facet name="footer">
|
||||
<p:commandButton value="Login" action="#{customerController.login()}" ajax="false" />
|
||||
<p:link value="Registrieren" outcome="resources/users/welcome.xhtml" style="text-align: right; color: blue; margin-left: 20px" />
|
||||
</f:facet>
|
||||
</h:panelGrid>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
|
||||
</h:body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<h:head>
|
||||
<title>Login Testpage</title>
|
||||
</h:head>
|
||||
<h:body>
|
||||
<h:form id="loginForm">
|
||||
<p:messages id="messages" globalOnly="true"/>
|
||||
|
||||
<p:panel header="Login Wellmann-Shop example" style="width: 450px; margin: auto; margin-top: 100px;">
|
||||
<h:panelGrid columns="2" cellpadding="5">
|
||||
<p:outputLabel for="username" value="Username:" />
|
||||
<p:inputText id="username" value="#{loginBean.username}" required="true" label="username" />
|
||||
|
||||
<p:outputLabel for="password" value="Password:" />
|
||||
<p:password id="password" value="#{loginBean.password}" required="true" label="password" />
|
||||
|
||||
<f:facet name="footer">
|
||||
<p:commandButton value="Login" action="#{loginBean.login()}" ajax="false" update="messages"/>
|
||||
<p:link value="Registrieren" outcome="index.xhtml" style="text-align: right; color: blue; margin-left: 20px" />
|
||||
</f:facet>
|
||||
|
||||
<p:commandButton value="Demo" action="#{customerController.demo()}" ajax="false"/>
|
||||
<p:link value="Demo" outcome="/resources/manager/welcome.xhtml" style="text-align: right; color: blue; margin-left: 20px" />
|
||||
</h:panelGrid>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
|
||||
</h:body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
.centeredMenuBar.ui-menubar {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centeredMenuBar .ui-menu-list {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.stickyMenubar{
|
||||
text-align: center;
|
||||
width: 1300px;
|
||||
border: none;
|
||||
z-index: 9000
|
||||
}
|
||||
|
||||
.ui-sticky {
|
||||
width: 1300px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
@media (max-width: 960px) {
|
||||
.ui-sticky {
|
||||
top: 0px !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.panel {
|
||||
text-align: center;
|
||||
border: none;
|
||||
max-width: 1300px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.ui-noborder{
|
||||
padding: 0px 0px
|
||||
}
|
||||
|
||||
.ui-panelgrid td {
|
||||
padding: 0px 0px ;
|
||||
}
|
||||
|
||||
.tile:hover {
|
||||
border-color: #009999;
|
||||
border-style: solid;
|
||||
cursor: pointer;
|
||||
color: #009999;
|
||||
}
|
||||
|
||||
.tile:active{
|
||||
box-shadow: 0px 0px 0px silver inset;
|
||||
}
|
||||
|
||||
.tile{
|
||||
border: 2px solid silver;
|
||||
border-radius: 10px;
|
||||
box-shadow: 10px 10px 15px silver;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
transition: opacity 2s ease, border-color 1s ease, color 1s ease;
|
||||
}
|
||||
|
||||
.tileCreator {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.panelCreator{
|
||||
border: 2px solid silver;
|
||||
border-radius: 10px;
|
||||
box-shadow: 10px 10px 15px silver;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
float: top;
|
||||
}
|
||||
|
||||
.picture {
|
||||
border-radius: 10px;
|
||||
padding: 0px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.picture:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.creatorPicture{
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.productInfo {
|
||||
border-style: solid;
|
||||
border-color: silver;
|
||||
border-left: 2px;
|
||||
border-bottom: 0px;
|
||||
border-right: 0px;
|
||||
border-top: 0px;
|
||||
height: 100%;
|
||||
width: 350px;
|
||||
float: right;
|
||||
text-align: left;
|
||||
padding: 0px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
html{
|
||||
min-height:100%;
|
||||
min-width:100%;
|
||||
-ms-text-size-adjust:none;
|
||||
}
|
||||
body,div,dl,dt,dd,ul,ol,li,nav,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td,a{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
border-width:0px;
|
||||
border-style:solid;
|
||||
border-color:transparent;
|
||||
-webkit-transform-origin:left top;
|
||||
-ms-transform-origin:left top;-o-transform-origin:left top;
|
||||
transform-origin:left top;
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
button.submit-btn{
|
||||
-moz-box-sizing:content-box;
|
||||
-webkit-box-sizing:content-box;
|
||||
box-sizing:content-box;
|
||||
}
|
||||
.transition{
|
||||
-webkit-transition-property:background-image,background-position,background-color,border-color,border-radius,color,font-size,font-style,font-weight,letter-spacing,line-height,text-align,box-shadow,text-shadow,opacity;
|
||||
transition-property:background-image,background-position,background-color,border-color,border-radius,color,font-size,font-style,font-weight,letter-spacing,line-height,text-align,box-shadow,text-shadow,opacity;
|
||||
}
|
||||
.transition *{
|
||||
-webkit-transition:inherit;
|
||||
transition:inherit;
|
||||
}
|
||||
|
||||
table{
|
||||
border-collapse:collapse;
|
||||
border-spacing:0px;
|
||||
}
|
||||
|
||||
fieldset,img{
|
||||
border:0px;
|
||||
border-style:solid;
|
||||
-webkit-transform-origin:left top;
|
||||
-ms-transform-origin:left top;
|
||||
-o-transform-origin:left top;
|
||||
transform-origin:left top;
|
||||
}
|
||||
|
||||
address,caption,cite,code,dfn,em,strong,th,var,optgroup{
|
||||
font-style:inherit;
|
||||
font-weight:inherit;
|
||||
}
|
||||
|
||||
del,ins{
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
li{
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
caption,th{
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6{
|
||||
font-size:100%;
|
||||
font-weight:inherit;
|
||||
}
|
||||
|
||||
input,button,textarea,select,optgroup,option{
|
||||
font-family:inherit;
|
||||
font-size:inherit;
|
||||
font-style:inherit;
|
||||
font-weight:inherit;
|
||||
}
|
||||
.form-grp input,.form-grp textarea{
|
||||
-webkit-appearance:none;
|
||||
-webkit-border-radius:0;
|
||||
}
|
||||
|
||||
body{
|
||||
font-family:Arial, Helvetica Neue, Helvetica, sans-serif;
|
||||
text-align:left;
|
||||
font-size:14px;
|
||||
line-height:17px;
|
||||
word-wrap:break-word;text-rendering:optimizeLegibility;
|
||||
-moz-font-feature-settings:'liga';
|
||||
-ms-font-feature-settings:'liga';
|
||||
-webkit-font-feature-settings:'liga';
|
||||
font-feature-settings:'liga';
|
||||
}
|
||||
|
||||
a:link{
|
||||
color:#0000FF;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color:#800080;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
a:hover{
|
||||
color:#0000FF;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
a:active{
|
||||
color:#EE0000;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
a.nontext{
|
||||
color:black;
|
||||
text-decoration:none;
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
}
|
||||
.normal_text{
|
||||
color:#000000;
|
||||
direction:ltr;
|
||||
font-family:Arial, Helvetica Neue, Helvetica, sans-serif;
|
||||
font-size:14px;
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
letter-spacing:0px;
|
||||
line-height:17px;
|
||||
text-align:left;
|
||||
text-decoration:none;
|
||||
text-indent:0px;
|
||||
text-transform:none;
|
||||
vertical-align:0px;
|
||||
padding:0px;
|
||||
}
|
||||
.list0 li:before{
|
||||
position:absolute;
|
||||
right:100%;
|
||||
letter-spacing:0px;
|
||||
text-decoration:none;
|
||||
font-weight:normal;
|
||||
font-style:normal;
|
||||
}
|
||||
.rtl-list li:before{
|
||||
right:auto;
|
||||
left:100%;
|
||||
}
|
||||
.nls-None > li:before,.nls-None .list3 > li:before,.nls-None .list6 > li:before{
|
||||
margin-right:6px;
|
||||
content:'•';
|
||||
}
|
||||
.nls-None .list1 > li:before,.nls-None .list4 > li:before,.nls-None .list7 > li:before{
|
||||
margin-right:6px;
|
||||
content:'○';
|
||||
}
|
||||
.nls-None,.nls-None .list1,.nls-None .list2,.nls-None .list3,.nls-None .list4,.nls-None .list5,.nls-None .list6,.nls-None .list7,.nls-None .list8{
|
||||
padding-left:34px;
|
||||
}.nls-None.rtl-list,.nls-None .list1.rtl-list,.nls-None .list2.rtl-list,.nls-None .list3.rtl-list,.nls-None .list4.rtl-list,.nls-None .list5.rtl-list,.nls-None .list6.rtl-list,.nls-None .list7.rtl-list,.nls-None .list8.rtl-list{
|
||||
padding-left:0px;
|
||||
padding-right:34px;
|
||||
}.nls-None .list2 > li:before,.nls-None .list5 > li:before,.nls-None .list8 > li:before{margin-right:6px;content:'-';}.nls-None.rtl-list > li:before,.nls-None .list1.rtl-list > li:before,.nls-None .list2.rtl-list > li:before,.nls-None .list3.rtl-list > li:before,.nls-None .list4.rtl-list > li:before,.nls-None .list5.rtl-list > li:before,.nls-None .list6.rtl-list > li:before,.nls-None .list7.rtl-list > li:before,.nls-None .list8.rtl-list > li:before{margin-right:0px;margin-left:6px;}.TabbedPanelsTab{white-space:nowrap;}.MenuBar .MenuBarView,.MenuBar .SubMenuView{display:block;list-style:none;}.MenuBar .SubMenu{display:none;position:absolute;}.NoWrap{white-space:nowrap;word-wrap:normal;}.rootelem{margin-left:auto;margin-right:auto;}.colelem{display:inline;float:left;clear:both;}.clearfix:after{content:"\0020";visibility:hidden;display:block;height:0px;clear:both;}*:first-child+html .clearfix{zoom:1;}.clip_frame{overflow:hidden;}.popup_anchor{position:relative;width:0px;height:0px;}.allow_click_through *{pointer-events:auto;}.popup_element{z-index:100000;}.svg{display:block;vertical-align:top;}span.wrap{content:'';clear:left;display:block;}span.actAsInlineDiv{display:inline-block;}.position_content,.excludeFromNormalFlow{float:left;}.preload_images{position:absolute;overflow:hidden;left:-9999px;top:-9999px;height:1px;width:1px;}.preload{height:1px;width:1px;}.animateStates{-webkit-transition:0.3s ease-in-out;-moz-transition:0.3s ease-in-out;-o-transition:0.3s ease-in-out;transition:0.3s ease-in-out;}[data-whatinput="mouse"] *:focus,[data-whatinput="touch"] *:focus,input:focus,textarea:focus{outline:none;}textarea{resize:none;overflow:auto;}.allow_click_through,.fld-prompt{pointer-events:none;}.wrapped-input{position:absolute;top:0px;left:0px;background:transparent;border:none;}.submit-btn{z-index:50000;cursor:pointer;}.anchor_item{width:22px;height:18px;}.MenuBar .SubMenuVisible,.MenuBarVertical .SubMenuVisible,.MenuBar .SubMenu .SubMenuVisible,.popup_element.Active,span.actAsPara,.actAsDiv,a.nonblock.nontext,img.block{display:block;}.widget_invisible,.js .invi,.js .mse_pre_init{visibility:hidden;}.ose_ei{visibility:hidden;z-index:0;}.no_vert_scroll{overflow-y:hidden;}.always_vert_scroll{overflow-y:scroll;}.always_horz_scroll{overflow-x:scroll;}.fullscreen{overflow:hidden;left:0px;top:0px;position:fixed;height:100%;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}.fullwidth{position:absolute;}.borderbox{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}.scroll_wrapper{position:absolute;overflow:auto;left:0px;right:0px;top:0px;bottom:0px;padding-top:0px;padding-bottom:0px;margin-top:0px;margin-bottom:0px;}.browser_width > *{position:absolute;left:0px;right:0px;}.grpelem,.accordion_wrapper{display:inline;float:left;}.fld-checkbox input[type=checkbox],.fld-radiobutton input[type=radio]{position:absolute;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);height:1px;width:1px;margin:-1px;padding:0px;border:0px;}.fld-checkbox input[type=checkbox] + label,.fld-radiobutton input[type=radio] + label{display:inline-block;background-repeat:no-repeat;cursor:pointer;float:left;width:100%;height:100%;}.pointer_cursor,.fld-recaptcha-mode,.fld-recaptcha-refresh,.fld-recaptcha-help{cursor:pointer;}p,h1,h2,h3,h4,h5,h6,ol,ul,span.actAsPara{max-height:1000000px;}.superscript{vertical-align:super;font-size:66%;line-height:0px;}.subscript{vertical-align:sub;font-size:66%;line-height:0px;}.horizontalSlideShow{-ms-touch-action:pan-y;touch-action:pan-y;}.verticalSlideShow{-ms-touch-action:pan-x;touch-action:pan-x;}.colelem100,.verticalspacer{clear:both;}.list0 li,.MenuBar .MenuItemContainer,.SlideShowContentPanel .fullscreen img,.css_verticalspacer .verticalspacer{position:relative;}.popup_element.Inactive,.js .disn,.js .an_invi,.hidden,.breakpoint{display:none;}#muse_css_mq{position:absolute;display:none;background-color:#FFFFFE;}.fluid_height_spacer{width:0.01px;}.muse_check_css{display:none;position:fixed;}@media screen and (-webkit-min-device-pixel-ratio:0){body{text-rendering:auto;}}
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 397 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 852 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 452 B |
|
After Width: | Height: | Size: 451 B |
|
After Width: | Height: | Size: 416 B |