mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 07:45:49 +00:00
Merge pull request #21 from cheapy-ispp/Cambio
Cambiado todos los petclinics por cheapy y arreglada la vista de error
This commit is contained in:
commit
5bfc714444
22 changed files with 83 additions and 94 deletions
|
@ -1,12 +0,0 @@
|
|||
mysql:
|
||||
image: mysql:5.7
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
||||
- MYSQL_USER=petclinic
|
||||
- MYSQL_PASSWORD=petclinic
|
||||
- MYSQL_DATABASE=petclinic
|
||||
volumes:
|
||||
- "./conf.d:/etc/mysql/conf.d:ro"
|
|
@ -20,7 +20,7 @@ import org.springframework.boot.SpringApplication;
|
|||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* PetClinic Spring Boot Application.
|
||||
* Cheapy Spring Boot Application.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
class CacheConfiguration {
|
||||
|
||||
@Bean
|
||||
public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
|
||||
public JCacheManagerCustomizer cheapyCacheConfigurationCustomizer() {
|
||||
return cm -> {
|
||||
cm.createCache("vets", cacheConfiguration());
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
@Controller
|
||||
public class CrashController {
|
||||
|
||||
@GetMapping("/oups")
|
||||
@GetMapping(value="/oups")
|
||||
public String triggerException() {
|
||||
throw new RuntimeException(
|
||||
"Expected: controller used to showcase what " + "happens when an exception is thrown");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
================================================================================
|
||||
=== Spring PetClinic sample application - MySQL Configuration ===
|
||||
=== Spring Cheapy sample application - MySQL Configuration ===
|
||||
================================================================================
|
||||
|
||||
@author Sam Brannen
|
||||
|
@ -18,15 +18,15 @@
|
|||
mysql_1_eedb4818d817 | MySQL init process done. Ready for start up.
|
||||
...
|
||||
|
||||
2) (Once only) create the PetClinic database and user by executing the "db/mysql/user.sql"
|
||||
2) (Once only) create the Cheapy database and user by executing the "db/mysql/user.sql"
|
||||
scripts. You can connect to the database running in the docker container using
|
||||
`mysql -u root -h localhost --protocol tcp`, but you don't need to run the script there
|
||||
because the petclinic user is already set up if you use the provided `docker-compose.yaml`.
|
||||
because the cheapy user is already set up if you use the provided `docker-compose.yaml`.
|
||||
|
||||
3) Run the app with `spring.profiles.active=mysql` (e.g. as a System property via the command
|
||||
line, but any way that sets that property in a Spring Boot app should work).
|
||||
|
||||
N.B. the "petclinic" database has to exist for the app to work with the JDBC URL value
|
||||
N.B. the "cheapy" database has to exist for the app to work with the JDBC URL value
|
||||
as it is configured by default. This condition is taken care of automatically by the
|
||||
docker-compose configuration provided, or by the `user.sql` script if you run that as
|
||||
root.
|
||||
|
|
BIN
src/main/resources/static/resources/images/bar3.jpg
Normal file
BIN
src/main/resources/static/resources/images/bar3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 479 KiB |
15
src/main/webapp/WEB-INF/jsp/error.jsp
Normal file
15
src/main/webapp/WEB-INF/jsp/error.jsp
Normal file
|
@ -0,0 +1,15 @@
|
|||
<%@ page session="false" trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
|
||||
<cheapy:layout pageName="error">
|
||||
|
||||
<h2>Algo malo ha pasado...</h2>
|
||||
|
||||
<spring:url value="/resources/images/Logo Cheapy.png" htmlEscape="true" var="cheapyImage"/>
|
||||
<img class="img-responsive" src="${cheapyImage}"/>
|
||||
|
||||
<p>${exception.message}</p>
|
||||
|
||||
</cheapy:layout>
|
|
@ -1,14 +0,0 @@
|
|||
<%@ page session="false" trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<petclinic:layout pageName="error">
|
||||
|
||||
<spring:url value="/resources/images/pets.png" var="petsImage"/>
|
||||
<img src="${petsImage}"/>
|
||||
|
||||
<h2>Something happened...</h2>
|
||||
|
||||
<p>${exception.message}</p>
|
||||
|
||||
</petclinic:layout>
|
|
@ -4,19 +4,19 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<petclinic:layout pageName="owners">
|
||||
<cheapy:layout pageName="owners">
|
||||
<h2>
|
||||
<c:if test="${owner['new']}">New </c:if> Owner
|
||||
</h2>
|
||||
<form:form modelAttribute="owner" class="form-horizontal" id="add-owner-form">
|
||||
<div class="form-group has-feedback">
|
||||
<petclinic:inputField label="First Name" name="firstName"/>
|
||||
<petclinic:inputField label="Last Name" name="lastName"/>
|
||||
<petclinic:inputField label="Address" name="address"/>
|
||||
<petclinic:inputField label="City" name="city"/>
|
||||
<petclinic:inputField label="Telephone" name="telephone"/>
|
||||
<cheapy:inputField label="First Name" name="firstName"/>
|
||||
<cheapy:inputField label="Last Name" name="lastName"/>
|
||||
<cheapy:inputField label="Address" name="address"/>
|
||||
<cheapy:inputField label="City" name="city"/>
|
||||
<cheapy:inputField label="Telephone" name="telephone"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
|
@ -31,4 +31,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="sec"
|
||||
uri="http://www.springframework.org/security/tags"%>
|
||||
<!-- >%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%-->
|
||||
|
||||
<petclinic:layout pageName="owners">
|
||||
<cheapy:layout pageName="owners">
|
||||
|
||||
<h2>Find Owners</h2>
|
||||
|
||||
|
@ -37,4 +37,4 @@
|
|||
<a class="btn btn-default" href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a>
|
||||
</sec:authorize>
|
||||
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<petclinic:layout pageName="owners">
|
||||
<cheapy:layout pageName="owners">
|
||||
|
||||
<h2>Owner Information</h2>
|
||||
|
||||
|
@ -33,4 +33,4 @@
|
|||
</spring:url>
|
||||
<a href="${fn:escapeXml(editUrl)}" class="btn btn-default">Edit Owner</a>
|
||||
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<petclinic:layout pageName="owners">
|
||||
<cheapy:layout pageName="owners">
|
||||
<h2>Owners</h2>
|
||||
|
||||
<table id="ownersTable" class="table table-striped">
|
||||
|
@ -41,4 +41,4 @@
|
|||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -4,21 +4,21 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<petclinic:layout pageName="owners">
|
||||
<cheapy:layout pageName="owners">
|
||||
<h2>
|
||||
<c:if test="${owner['new']}">New </c:if> Owner
|
||||
</h2>
|
||||
<form:form modelAttribute="owner" class="form-horizontal" id="add-owner-form">
|
||||
<div class="form-group has-feedback">
|
||||
<petclinic:inputField label="First Name" name="firstName"/>
|
||||
<petclinic:inputField label="Last Name" name="lastName"/>
|
||||
<petclinic:inputField label="Address" name="address"/>
|
||||
<petclinic:inputField label="City" name="city"/>
|
||||
<petclinic:inputField label="Telephone" name="telephone"/>
|
||||
<petclinic:inputField label="Username" name="user.username"/>
|
||||
<petclinic:inputField label="Password" name="user.password"/>
|
||||
<cheapy:inputField label="First Name" name="firstName"/>
|
||||
<cheapy:inputField label="Last Name" name="lastName"/>
|
||||
<cheapy:inputField label="Address" name="address"/>
|
||||
<cheapy:inputField label="City" name="city"/>
|
||||
<cheapy:inputField label="Telephone" name="telephone"/>
|
||||
<cheapy:inputField label="Username" name="user.username"/>
|
||||
<cheapy:inputField label="Password" name="user.password"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
|
@ -33,4 +33,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<%@ page session="false" trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
|
||||
<!-- %@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %-->
|
||||
|
||||
<petclinic:layout pageName="home">
|
||||
<cheapy:layout pageName="home">
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 50px; color: rgb(0, 64, 128); padding:20px"><fmt:message key="welcome"/></h2>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
@ -19,4 +19,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</petclinic:layout>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<%@ attribute name="menuName" required="true" rtexprvalue="true"
|
||||
description="Name of the active menu: home, owners, vets or error" %>
|
||||
description="Name of the active menu: home, ofertas, contactanos, login" %>
|
||||
|
||||
<petclinic:menu name="${menuName}"/>
|
||||
<cheapy:menu name="${menuName}"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<%--
|
||||
PetClinic :: a Spring Framework demonstration
|
||||
Cheapy :: a Spring Framework demonstration
|
||||
--%>
|
||||
|
||||
<head>
|
||||
|
@ -17,8 +17,8 @@ PetClinic :: a Spring Framework demonstration
|
|||
<title>Cheapy : eat fast, eat cheapy</title>
|
||||
|
||||
<%-- CSS generated from LESS --%>
|
||||
<spring:url value="/resources/css/petclinic.css" var="petclinicCss"/>
|
||||
<link href="${petclinicCss}" rel="stylesheet"/>
|
||||
<spring:url value="/resources/css/cheapy.css" var="cheapyCss"/>
|
||||
<link href="${cheapyCss}" rel="stylesheet"/>
|
||||
|
||||
|
||||
<%-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --%>
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<%@ tag trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
|
||||
<%@ attribute name="pageName" required="true" %>
|
||||
<%@ attribute name="customScript" required="false" fragment="true"%>
|
||||
|
||||
<!doctype html>
|
||||
<html>
|
||||
<petclinic:htmlHeader/>
|
||||
<cheapy:htmlHeader/>
|
||||
|
||||
<body>
|
||||
<petclinic:bodyHeader menuName="${pageName}"/>
|
||||
<cheapy:bodyHeader menuName="${pageName}"/>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container xd-container">
|
||||
|
||||
<jsp:doBody/>
|
||||
|
||||
<petclinic:pivotal/>
|
||||
<cheapy:pivotal/>
|
||||
</div>
|
||||
</div>
|
||||
<petclinic:footer/>
|
||||
<cheapy:footer/>
|
||||
<jsp:invoke fragment="customScript" />
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="sec"
|
||||
uri="http://www.springframework.org/security/tags"%>
|
||||
<!-- >%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%-->
|
||||
<%@ attribute name="name" required="true" rtexprvalue="true"
|
||||
description="Name of the active menu: home, owners, vets or error"%>
|
||||
description="Name of the active menu: home, ofertas, contactanos, login"%>
|
||||
|
||||
<nav class="navbar navbar-default" role="navigation">
|
||||
<div class="container">
|
||||
|
@ -22,30 +22,30 @@
|
|||
<div class="navbar-collapse collapse" id="main-navbar">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<petclinic:menuItem active="${name eq 'home'}" url="/"
|
||||
<cheapy:menuItem active="${name eq 'home'}" url="/"
|
||||
title="home page">
|
||||
<span class="glyphicon glyphicon-home" aria-hidden="true"></span>
|
||||
<span>Home</span>
|
||||
</petclinic:menuItem>
|
||||
</cheapy:menuItem>
|
||||
|
||||
<petclinic:menuItem active="${name eq 'ofertas'}" url="/ofertas"
|
||||
<cheapy:menuItem active="${name eq 'ofertas'}" url="/ofertas"
|
||||
title="ofertas">
|
||||
<span class="glyphicon glyphicon-cutlery" aria-hidden="true"></span>
|
||||
<span>Ver ofertas</span>
|
||||
</petclinic:menuItem>
|
||||
</cheapy:menuItem>
|
||||
|
||||
<petclinic:menuItem active="${name eq 'contactanos'}" url="/contactanos"
|
||||
<cheapy:menuItem active="${name eq 'contactanos'}" url="/contactanos"
|
||||
title="contactanos">
|
||||
<span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
|
||||
<span>Contáctanos</span>
|
||||
</petclinic:menuItem>
|
||||
</cheapy:menuItem>
|
||||
|
||||
|
||||
<petclinic:menuItem active="${name eq 'login'}" url="/login"
|
||||
<cheapy:menuItem active="${name eq 'login'}" url="/login"
|
||||
title="login">
|
||||
<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
|
||||
<span>Login</span>
|
||||
</petclinic:menuItem>
|
||||
</cheapy:menuItem>
|
||||
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<groups xmlns="http://www.isdc.ro/wro">
|
||||
<group name="petclinic">
|
||||
<group name="cheapy">
|
||||
<css>classpath:META-INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less</css>
|
||||
<css>/petclinic.less</css>
|
||||
<css>/cheapy.less</css>
|
||||
</group>
|
||||
</groups>
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||
|
||||
|
||||
@SpringBootTest
|
||||
class PetclinicIntegrationTests {
|
||||
class CheapyIntegrationTests {
|
||||
|
||||
|
||||
}
|
|
@ -7,13 +7,13 @@
|
|||
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="Variables pr<70>-d<>finies" enabled="true">
|
||||
<collectionProp name="Arguments.arguments">
|
||||
<elementProp name="PETCLINIC_HOST" elementType="Argument">
|
||||
<stringProp name="Argument.name">PETCLINIC_HOST</stringProp>
|
||||
<elementProp name="CHEAPY_HOST" elementType="Argument">
|
||||
<stringProp name="Argument.name">CHEAPY_HOST</stringProp>
|
||||
<stringProp name="Argument.value">localhost</stringProp>
|
||||
<stringProp name="Argument.metadata">=</stringProp>
|
||||
</elementProp>
|
||||
<elementProp name="PETCLINIC_PORT" elementType="Argument">
|
||||
<stringProp name="Argument.name">PETCLINIC_PORT</stringProp>
|
||||
<elementProp name="CHEAPY_PORT" elementType="Argument">
|
||||
<stringProp name="Argument.name">CHEAPY_PORT</stringProp>
|
||||
<stringProp name="Argument.value">8080</stringProp>
|
||||
<stringProp name="Argument.metadata">=</stringProp>
|
||||
</elementProp>
|
||||
|
@ -52,8 +52,8 @@
|
|||
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Variables pr<70>-d<>finies" enabled="true">
|
||||
<collectionProp name="Arguments.arguments"/>
|
||||
</elementProp>
|
||||
<stringProp name="HTTPSampler.domain">${PETCLINIC_HOST}</stringProp>
|
||||
<stringProp name="HTTPSampler.port">${PETCLINIC_PORT}</stringProp>
|
||||
<stringProp name="HTTPSampler.domain">${CHEAPY_HOST}</stringProp>
|
||||
<stringProp name="HTTPSampler.port">${CHEAPY_PORT}</stringProp>
|
||||
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
||||
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
||||
<stringProp name="HTTPSampler.protocol"></stringProp>
|
||||
|
@ -115,7 +115,7 @@
|
|||
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
||||
<stringProp name="HTTPSampler.protocol"></stringProp>
|
||||
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
||||
<stringProp name="HTTPSampler.path">${CONTEXT_WEB}/resources/css/petclinic.css</stringProp>
|
||||
<stringProp name="HTTPSampler.path">${CONTEXT_WEB}/resources/css/cheapy.css</stringProp>
|
||||
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
||||
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
Loading…
Reference in a new issue