diff --git a/spring-integration-samples/loanshark/.classpath b/spring-integration-samples/loanshark/.classpath new file mode 100644 index 0000000000..4241ac4294 --- /dev/null +++ b/spring-integration-samples/loanshark/.classpath @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-integration-samples/loanshark/.project b/spring-integration-samples/loanshark/.project new file mode 100644 index 0000000000..d845ba2443 --- /dev/null +++ b/spring-integration-samples/loanshark/.project @@ -0,0 +1,37 @@ + + loanshark + + + + + org.eclipse.ajdt.core.ajbuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + org.eclipse.ajdt.core.ajbuilder + + + aspectPath + org.springframework.aspects + + + + + org.springframework.ide.eclipse.core.springbuilder + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.ajdt.ui.ajnature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + com.springsource.sts.roo.core.nature + org.springframework.ide.eclipse.core.springnature + + \ No newline at end of file diff --git a/spring-integration-samples/loanshark/.settings/org.eclipse.jdt.core.prefs b/spring-integration-samples/loanshark/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..dc2026daf4 --- /dev/null +++ b/spring-integration-samples/loanshark/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Wed Mar 24 13:06:08 PDT 2010 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 diff --git a/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.component b/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000000..08ac5c9818 --- /dev/null +++ b/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.component @@ -0,0 +1,190 @@ + + + + + + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + + + diff --git a/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.project.facet.core.xml b/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000000..b54cb2a146 --- /dev/null +++ b/spring-integration-samples/loanshark/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/spring-integration-samples/loanshark/.settings/org.springframework.ide.eclipse.beans.core.prefs b/spring-integration-samples/loanshark/.settings/org.springframework.ide.eclipse.beans.core.prefs new file mode 100644 index 0000000000..b3e45991ef --- /dev/null +++ b/spring-integration-samples/loanshark/.settings/org.springframework.ide.eclipse.beans.core.prefs @@ -0,0 +1,4 @@ +#Mon Mar 29 11:51:49 EDT 2010 +eclipse.preferences.version=1 +org.springframework.ide.eclipse.beans.core.ignoreMissingNamespaceHandler=false +org.springframework.ide.eclipse.beans.core.loadNamespaceHandlerFromClasspath=true diff --git a/spring-integration-samples/loanshark/pom.xml b/spring-integration-samples/loanshark/pom.xml new file mode 100644 index 0000000000..ab3611320d --- /dev/null +++ b/spring-integration-samples/loanshark/pom.xml @@ -0,0 +1,410 @@ + + + 4.0.0 + com.springframework.integration.loanbroker.loanshark + loanshark + war + 0.1.0-SNAPSHOT + loanshark + + + + com.springsource.repository.bundles.release + SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases + http://repository.springsource.com/maven/bundles/release + + + com.springsource.repository.bundles.external + SpringSource Enterprise Bundle Repository - External Bundle Releases + http://repository.springsource.com/maven/bundles/external + + + com.springsource.repository.bundles.milestone + SpringSource Enterprise Bundle Repository - External Bundle Milestones + http://repository.springsource.com/maven/bundles/milestone + + + + com.springsource.repository.bundles.snapshot + SpringSource Enterprise Bundle Repository - External Bundle Snapshots + http://repository.springsource.com/maven/bundles/snapshot + + + + + + com.springsource.repository.bundles.release + SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases + http://repository.springsource.com/maven/bundles/release + + + com.springsource.repository.bundles.external + SpringSource Enterprise Bundle Repository - External Bundle Releases + http://repository.springsource.com/maven/bundles/external + + + com.springsource.repository.bundles.milestone + SpringSource Enterprise Bundle Repository - External Bundle Milestones + http://repository.springsource.com/maven/bundles/milestone + + + + + + + org.junit + com.springsource.org.junit + 4.7.0 + test + + + org.apache.log4j + com.springsource.org.apache.log4j + 1.2.15 + + + org.apache.commons + com.springsource.org.apache.commons.logging + 1.1.1 + + + org.aspectj + com.springsource.org.aspectj.runtime + ${aspectj.version} + + + javax.servlet + com.springsource.javax.servlet + 2.5.0 + provided + + + + org.springframework.roo + org.springframework.roo.annotations + 1.0.2.RELEASE + provided + + + + org.springframework + org.springframework.core + ${spring.version} + + + org.springframework + org.springframework.test + ${spring.version} + test + + + org.springframework + org.springframework.context + ${spring.version} + + + org.springframework + org.springframework.aop + ${spring.version} + + + org.springframework + org.springframework.aspects + ${spring.version} + + + org.springframework + org.springframework.transaction + ${spring.version} + + + org.hsqldb + com.springsource.org.hsqldb + 1.8.0.9 + + + org.hibernate + com.springsource.org.hibernate.annotations + 3.3.1.ga + + + org.hibernate + com.springsource.org.hibernate.ejb + 3.3.2.GA + + + net.sourceforge.ehcache + com.springsource.net.sf.ehcache + 1.4.1 + + + edu.emory.mathcs.backport + com.springsource.edu.emory.mathcs.backport + 3.1.0 + + + org.slf4j + com.springsource.slf4j.log4j + 1.5.6 + + + javax.persistence + com.springsource.javax.persistence + 1.0.0 + + + org.slf4j + com.springsource.slf4j.api + 1.5.6 + + + org.hibernate + com.springsource.org.hibernate.validator + 4.0.0.GA + + + org.slf4j + slf4j-api + + + + + javax.validation + com.springsource.javax.validation + 1.0.0.GA + + + javax.transaction + com.springsource.javax.transaction + 1.1.0 + + + org.apache.commons + com.springsource.org.apache.commons.dbcp + 1.2.2.osgi + + + org.springframework + org.springframework.jdbc + ${spring.version} + + + org.springframework + org.springframework.orm + ${spring.version} + + + org.springframework + org.springframework.web + ${spring.version} + + + org.springframework + org.springframework.web.servlet + ${spring.version} + + + org.springframework.webflow + org.springframework.js + 2.0.8.RELEASE + + + org.apache.commons + com.springsource.org.apache.commons.fileupload + 1.2.0 + + + org.tuckey + com.springsource.org.tuckey.web.filters.urlrewrite + 3.1.0 + + + javax.servlet + com.springsource.javax.servlet.jsp.jstl + 1.2.0 + + + org.apache.el + com.springsource.org.apache.el + 6.0.20 + + + org.joda + com.springsource.org.joda.time + 1.6.0 + + + org.apache.tiles + com.springsource.org.apache.tiles + 2.1.3 + + + org.apache.tiles + com.springsource.org.apache.tiles.jsp + 2.1.3 + + + org.apache.tiles + com.springsource.org.apache.tiles.core + 2.1.3 + + + org.springframework + org.springframework.expression + ${spring.version} + + + org.springframework.integration + org.springframework.integration + 2.0.0.M3 + + + org.springframework.integration + org.springframework.integration.ip + 2.0.0.M3 + + + org.springframework.integration + org.springframework.integration.adapter + 2.0.0.M3 + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.0.2 + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + org.codehaus.mojo + aspectj-maven-plugin + 1.0 + + + + org.aspectj + com.springsource.org.aspectj.runtime + ${aspectj.version} + + + org.aspectj + com.springsource.org.aspectj.tools + ${aspectj.version} + + + + + + compile + test-compile + + + + + true + + + org.springframework + org.springframework.aspects + + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.4.3 + + org.junit:com.springsource.org.junit + + **/*_Roo_* + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.1 + + + + jar-with-dependencies + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.4 + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.7 + + true + false + 2.0 + + + org.eclipse.ajdt.core.ajbuilder + + org.springframework.aspects + + + + org.springframework.ide.eclipse.core.springbuilder + + + + org.eclipse.ajdt.ui.ajnature + com.springsource.sts.roo.core.nature + org.springframework.ide.eclipse.core.springnature + + + + + org.apache.maven.plugins + maven-idea-plugin + 2.2 + + true + true + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.0-beta-1 + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.10 + + + + + + 3.0.1.RELEASE-A + 1.6.6.RELEASE + + diff --git a/spring-integration-samples/loanshark/script.roo b/spring-integration-samples/loanshark/script.roo new file mode 100644 index 0000000000..848ca8aae0 --- /dev/null +++ b/spring-integration-samples/loanshark/script.roo @@ -0,0 +1,12 @@ +project --topLevelPackage com.springframework.integration.loanbroker.loanshark3 +persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY +entity --class ~.domain.LoanShark +field string --fieldName name +field number --type java.lang.Long --fieldName counter +field number --type java.lang.Double --fieldName averageRate +finder add --finderName findLoanSharksByName +controller scaffold --class ~.web.SharkController +logging setup --level DEBUG +dependency add --artifactId org.springframework.integration.ip --groupId org.springframework.integration --version 2.0.0.M3 +//change spring version in pom.xml to 3.0.0-RELEASE-A before perform eclipse +//perform eclipse diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/Accumulator.java b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/Accumulator.java new file mode 100644 index 0000000000..8733360f6e --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/Accumulator.java @@ -0,0 +1,50 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * 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 com.springframework.integration.loanbroker.loanshark.biz; + +import org.springframework.dao.DataAccessException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.springframework.integration.loanbroker.loanshark.domain.LoanShark; + +/** + * @author Gary Russell + * + */ +@Service +public class Accumulator { + + @Transactional + public void accumulate(SharkQuote quote) { + LoanShark shark = null; + try { + shark = (LoanShark) LoanShark.findLoanSharksByName( + quote.getSharkName()).getSingleResult(); + } catch (DataAccessException dae) {} + if (shark == null) { + shark = new LoanShark(); + shark.setName(quote.getSharkName()); + shark.setCounter(new Long(0)); + shark.setAverageRate(0.0d); + shark.persist(); + } + Double current = shark.getCounter() * shark.getAverageRate(); + shark.setCounter(shark.getCounter().longValue() + 1); + shark.setAverageRate((current + quote.getSharkRate()) / shark.getCounter()); + } + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkQuote.java b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkQuote.java new file mode 100644 index 0000000000..48a5fc8b5c --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkQuote.java @@ -0,0 +1,59 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * 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 com.springframework.integration.loanbroker.loanshark.biz; + +/** + * @author Gary Russell + * + */ +public class SharkQuote { + private String sharkName; + private Double sharkRate; + + /** + * @param sharkName + * @param sharkRate + */ + public SharkQuote(String sharkName, double sharkRate) { + super(); + this.sharkName = sharkName; + this.sharkRate = sharkRate; + } + /** + * @return the sharkName + */ + public String getSharkName() { + return sharkName; + } + /** + * @param sharkName the sharkName to set + */ + public void setSharkName(String sharkName) { + this.sharkName = sharkName; + } + /** + * @return the sharkRate + */ + public Double getSharkRate() { + return sharkRate; + } + /** + * @param sharkRate the sharkRate to set + */ + public void setSharkRate(Double sharkRate) { + this.sharkRate = sharkRate; + } +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkTransformer.java b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkTransformer.java new file mode 100644 index 0000000000..3ad692dea1 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/biz/SharkTransformer.java @@ -0,0 +1,28 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * 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 com.springframework.integration.loanbroker.loanshark.biz; + +/** + * @author Gary Russell + * + */ +public class SharkTransformer { + + public SharkQuote transform(byte[] buffer) { + String[] data = new String(buffer).split(","); + return new SharkQuote(data[0], Double.parseDouble(data[1])); + } +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark.java b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark.java new file mode 100644 index 0000000000..9af6f0a6c9 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark.java @@ -0,0 +1,19 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import javax.persistence.Entity; +import org.springframework.roo.addon.entity.RooEntity; +import org.springframework.roo.addon.javabean.RooJavaBean; +import org.springframework.roo.addon.tostring.RooToString; + +@Entity +@RooJavaBean +@RooToString +@RooEntity(finders = { "findLoanSharksByName" }) +public class LoanShark { + + private String name; + + private Long counter; + + private Double averageRate; +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Configurable.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Configurable.aj new file mode 100644 index 0000000000..501963648a --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Configurable.aj @@ -0,0 +1,9 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import org.springframework.beans.factory.annotation.Configurable; + +privileged aspect LoanShark_Roo_Configurable { + + declare @type: LoanShark: @Configurable; + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Entity.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Entity.aj new file mode 100644 index 0000000000..a0d1033f11 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Entity.aj @@ -0,0 +1,100 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import com.springframework.integration.loanbroker.loanshark.domain.LoanShark; +import java.lang.Integer; +import java.lang.Long; +import java.util.List; +import javax.persistence.Column; +import javax.persistence.EntityManager; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.PersistenceContext; +import javax.persistence.Version; +import org.springframework.transaction.annotation.Transactional; + +privileged aspect LoanShark_Roo_Entity { + + @PersistenceContext + transient EntityManager LoanShark.entityManager; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long LoanShark.id; + + @Version + @Column(name = "version") + private Integer LoanShark.version; + + public Long LoanShark.getId() { + return this.id; + } + + public void LoanShark.setId(Long id) { + this.id = id; + } + + public Integer LoanShark.getVersion() { + return this.version; + } + + public void LoanShark.setVersion(Integer version) { + this.version = version; + } + + @Transactional + public void LoanShark.persist() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.persist(this); + } + + @Transactional + public void LoanShark.remove() { + if (this.entityManager == null) this.entityManager = entityManager(); + if (this.entityManager.contains(this)) { + this.entityManager.remove(this); + } else { + LoanShark attached = this.entityManager.find(LoanShark.class, this.id); + this.entityManager.remove(attached); + } + } + + @Transactional + public void LoanShark.flush() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.flush(); + } + + @Transactional + public void LoanShark.merge() { + if (this.entityManager == null) this.entityManager = entityManager(); + LoanShark merged = this.entityManager.merge(this); + this.entityManager.flush(); + this.id = merged.getId(); + } + + public static final EntityManager LoanShark.entityManager() { + EntityManager em = new LoanShark().entityManager; + if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)"); + return em; + } + + public static long LoanShark.countLoanSharks() { + return (Long) entityManager().createQuery("select count(o) from LoanShark o").getSingleResult(); + } + + public static List LoanShark.findAllLoanSharks() { + return entityManager().createQuery("select o from LoanShark o").getResultList(); + } + + public static LoanShark LoanShark.findLoanShark(Long id) { + if (id == null) return null; + return entityManager().find(LoanShark.class, id); + } + + public static List LoanShark.findLoanSharkEntries(int firstResult, int maxResults) { + return entityManager().createQuery("select o from LoanShark o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); + } + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Finder.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Finder.aj new file mode 100644 index 0000000000..a9b42788f2 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_Finder.aj @@ -0,0 +1,19 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import java.lang.String; +import java.lang.SuppressWarnings; +import javax.persistence.EntityManager; +import javax.persistence.Query; + +privileged aspect LoanShark_Roo_Finder { + + @SuppressWarnings("unchecked") + public static Query LoanShark.findLoanSharksByName(String name) { + if (name == null || name.length() == 0) throw new IllegalArgumentException("The name argument is required"); + EntityManager em = LoanShark.entityManager(); + Query q = em.createQuery("SELECT LoanShark FROM LoanShark AS loanshark WHERE loanshark.name = :name"); + q.setParameter("name", name); + return q; + } + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_JavaBean.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_JavaBean.aj new file mode 100644 index 0000000000..ccbf0b6f99 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_JavaBean.aj @@ -0,0 +1,33 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import java.lang.Double; +import java.lang.Long; +import java.lang.String; + +privileged aspect LoanShark_Roo_JavaBean { + + public String LoanShark.getName() { + return this.name; + } + + public void LoanShark.setName(String name) { + this.name = name; + } + + public Long LoanShark.getCounter() { + return this.counter; + } + + public void LoanShark.setCounter(Long counter) { + this.counter = counter; + } + + public Double LoanShark.getAverageRate() { + return this.averageRate; + } + + public void LoanShark.setAverageRate(Double averageRate) { + this.averageRate = averageRate; + } + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_ToString.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_ToString.aj new file mode 100644 index 0000000000..5a6dae7363 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/domain/LoanShark_Roo_ToString.aj @@ -0,0 +1,17 @@ +package com.springframework.integration.loanbroker.loanshark.domain; + +import java.lang.String; + +privileged aspect LoanShark_Roo_ToString { + + public String LoanShark.toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Id: ").append(getId()).append(", "); + sb.append("Version: ").append(getVersion()).append(", "); + sb.append("Name: ").append(getName()).append(", "); + sb.append("Counter: ").append(getCounter()).append(", "); + sb.append("AverageRate: ").append(getAverageRate()); + return sb.toString(); + } + +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController.java b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController.java new file mode 100644 index 0000000000..b2f13073c4 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController.java @@ -0,0 +1,12 @@ +package com.springframework.integration.loanbroker.loanshark.web; + +import org.springframework.roo.addon.web.mvc.controller.RooWebScaffold; +import com.springframework.integration.loanbroker.loanshark.domain.LoanShark; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +@RooWebScaffold(path = "loanshark", automaticallyMaintainView = true, formBackingObject = LoanShark.class) +@RequestMapping("/loanshark/**") +@Controller +public class SharkController { +} diff --git a/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController_Roo_Controller.aj b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController_Roo_Controller.aj new file mode 100644 index 0000000000..1b76095ca8 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/java/com/springframework/integration/loanbroker/loanshark/web/SharkController_Roo_Controller.aj @@ -0,0 +1,90 @@ +package com.springframework.integration.loanbroker.loanshark.web; + +import com.springframework.integration.loanbroker.loanshark.domain.LoanShark; +import java.lang.Long; +import java.lang.String; +import javax.validation.Valid; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +privileged aspect SharkController_Roo_Controller { + + @RequestMapping(value = "/loanshark", method = RequestMethod.POST) + public String SharkController.create(@Valid LoanShark loanShark, BindingResult result, ModelMap modelMap) { + if (loanShark == null) throw new IllegalArgumentException("A loanShark is required"); + if (result.hasErrors()) { + modelMap.addAttribute("loanShark", loanShark); + return "loanshark/create"; + } + loanShark.persist(); + return "redirect:/loanshark/" + loanShark.getId(); + } + + @RequestMapping(value = "/loanshark/form", method = RequestMethod.GET) + public String SharkController.createForm(ModelMap modelMap) { + modelMap.addAttribute("loanShark", new LoanShark()); + return "loanshark/create"; + } + + @RequestMapping(value = "/loanshark/{id}", method = RequestMethod.GET) + public String SharkController.show(@PathVariable("id") Long id, ModelMap modelMap) { + if (id == null) throw new IllegalArgumentException("An Identifier is required"); + modelMap.addAttribute("loanShark", LoanShark.findLoanShark(id)); + return "loanshark/show"; + } + + @RequestMapping(value = "/loanshark", method = RequestMethod.GET) + public String SharkController.list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, ModelMap modelMap) { + if (page != null || size != null) { + int sizeNo = size == null ? 10 : size.intValue(); + modelMap.addAttribute("loansharks", LoanShark.findLoanSharkEntries(page == null ? 0 : (page.intValue() - 1) * sizeNo, sizeNo)); + float nrOfPages = (float) LoanShark.countLoanSharks() / sizeNo; + modelMap.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages)); + } else { + modelMap.addAttribute("loansharks", LoanShark.findAllLoanSharks()); + } + return "loanshark/list"; + } + + @RequestMapping(method = RequestMethod.PUT) + public String SharkController.update(@Valid LoanShark loanShark, BindingResult result, ModelMap modelMap) { + if (loanShark == null) throw new IllegalArgumentException("A loanShark is required"); + if (result.hasErrors()) { + modelMap.addAttribute("loanShark", loanShark); + return "loanshark/update"; + } + loanShark.merge(); + return "redirect:/loanshark/" + loanShark.getId(); + } + + @RequestMapping(value = "/loanshark/{id}/form", method = RequestMethod.GET) + public String SharkController.updateForm(@PathVariable("id") Long id, ModelMap modelMap) { + if (id == null) throw new IllegalArgumentException("An Identifier is required"); + modelMap.addAttribute("loanShark", LoanShark.findLoanShark(id)); + return "loanshark/update"; + } + + @RequestMapping(value = "/loanshark/{id}", method = RequestMethod.DELETE) + public String SharkController.delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size) { + if (id == null) throw new IllegalArgumentException("An Identifier is required"); + LoanShark.findLoanShark(id).remove(); + return "redirect:/loanshark?page=" + ((page == null) ? "1" : page.toString()) + "&size=" + ((size == null) ? "10" : size.toString()); + } + + @RequestMapping(value = "find/ByName/form", method = RequestMethod.GET) + public String SharkController.findLoanSharksByNameForm(ModelMap modelMap) { + return "loanshark/findLoanSharksByName"; + } + + @RequestMapping(value = "find/ByName", method = RequestMethod.GET) + public String SharkController.findLoanSharksByName(@RequestParam("name") String name, ModelMap modelMap) { + if (name == null || name.length() == 0) throw new IllegalArgumentException("A Name is required."); + modelMap.addAttribute("loansharks", LoanShark.findLoanSharksByName(name).getResultList()); + return "loanshark/list"; + } + +} diff --git a/spring-integration-samples/loanshark/src/main/resources/META-INF/persistence.xml b/spring-integration-samples/loanshark/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000000..0e13ebb1f8 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,13 @@ + + + + + org.hibernate.ejb.HibernatePersistence + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/applicationContext.xml b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/applicationContext.xml new file mode 100644 index 0000000000..9deaede3dc --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/applicationContext.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/database.properties b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/database.properties new file mode 100644 index 0000000000..3781784f08 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/database.properties @@ -0,0 +1,6 @@ +#Updated at Wed Mar 24 10:09:33 PDT 2010 +#Wed Mar 24 10:09:33 PDT 2010 +database.password= +database.url=jdbc\:hsqldb\:mem\:loanshark +database.username=sa +database.driverClassName=org.hsqldb.jdbcDriver diff --git a/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/integrationContext.xml b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/integrationContext.xml new file mode 100644 index 0000000000..e58e47f06c --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/integrationContext.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/log4j.properties b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/log4j.properties new file mode 100644 index 0000000000..d9877f3ff5 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/resources/META-INF/spring/log4j.properties @@ -0,0 +1,12 @@ +#Updated at Wed Mar 24 10:09:35 PDT 2010 +#Wed Mar 24 10:09:35 PDT 2010 +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.rootLogger=DEBUG, stdout, R +log4j.appender.R.File=application.log +log4j.appender.R.MaxFileSize=100KB +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.MaxBackupIndex=1 +log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n +log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.R=org.apache.log4j.RollingFileAppender diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/alt.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/alt.properties new file mode 100644 index 0000000000..5280c238f6 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/alt.properties @@ -0,0 +1 @@ +styleSheet=static/styles/alt.css diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/standard.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/standard.properties new file mode 100644 index 0000000000..9aea1e64d4 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/classes/standard.properties @@ -0,0 +1 @@ +styleSheet=static/styles/standard.css diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/application.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/application.properties new file mode 100644 index 0000000000..664f129a4f --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/application.properties @@ -0,0 +1,7 @@ +#Updated at test Wed Mar 24 10:09:34 PDT 2010 +#Wed Mar 24 10:09:34 PDT 2010 +application.name=Loanshark +label.loanshark=Loan Shark +label.loansharks=Loan Sharks +label.name=Name +menu.category.web_mvc_jsp_loanshark_category.label=Loan Shark diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages.properties new file mode 100644 index 0000000000..c9286f52b2 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages.properties @@ -0,0 +1,95 @@ +#menu +global.menu.new=Create new {0} +global.menu.list=List all {0} +global.menu.find=Find by {0} +global.language.switch=Switch language to {0} +global.language=Language +global.sponsored=Sponsored by SpringSource +global.theme=Theme +global.theme.alt=alt +global.theme.standard=standard + +#welcome page +welcome.titlepane=Welcome to {0} +welcome.h3=Welcome to {0} +welcome.text=Spring Roo provides interactive, lightweight and user customizable tooling that enables rapid delivery of high performance enterprise Java applications. + +#entity labels +entity.list.all=List all {0} +entity.show=Show {0} +entity.create=Create new {0} +entity.update=Update {0} +entity.delete=Delete {0} +entity.find=Find by {0} +entity.not.found=No {0} found. +entity.not.found.single=No {0} found with this id. + +#button labels +button.home=Home +button.save=Save +button.update=Update +button.find=Find +button.cancel=Cancel +button.proceed=Proceed +button.submit=Submit +button.reset=Reset +button.end=End +button.showmessage=Show Message +button.showstacktrace=Show Stack Trace +button.showcookie=Show Cookie + +#field labels +field.simple.validation=Enter {0} {1} +field.invalid.email=Please enter a valid email +field.invalid.number=Number with \\'-\\' or \\'.\\' allowed +field.invalid.integer=Integer numbers only +field.invalid=Please enter valid {0} +field.required=required + +#list labels +list.first=First Page +list.next=Next Page +list.previous=Previous Page +list.last=Last Page +list.page=Page {0} of {1} +list.size=List results per page: + +#selenium +selenium.menu.test.suite=Test Suite + +#exception +exception.message=Exception Message +exception.stacktrace=Exception Stack Trace +exception.cookie=Cookies +exception.details=Details + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Data access failure +error.dataaccessfailure.problemdescription=Sorry, a problem occurred while accessing the database. + +#resourceNotFound.jspx +error.resourcenotfound.title=Requested Resource Not Found +error.resourcenotfound.problemdescription=Sorry, we did not find the resource you were looking for. + +#uncaughtException.jspx +error.uncaughtexception.title=Internal Error +error.uncaughtexception.problemdescription=Sorry, we encountered an internal error. + +#webflow +webflow.menu.enter=Enter {0} WebFlow +webflow.state1.title=Spring WebFlow - View State One +webflow.state1.message=This is a simple example to get started with Spring Web Flow. The buttons below lead you to another view state (Proceed) or to an end state. +webflow.state2.title=Spring WebFlow - View State Two +webflow.state2.message=This is a simple example to get started with Spring Web Flow. The buttons below lead you to another view state (Proceed) or to an end state. +webflow.endstate.title=Spring WebFlow - End State +webflow.endstate.message=You have now reached the end of this flow. + +#security +security.login.title=Spring Security Login +security.login.message=You have tried to access a protected area of this application. By default you can login as "admin", with a password of "admin". +security.login.form.name=Name +security.login.form.name.message=Enter your name +security.login.form.password=Password +security.login.form.password.message=Enter your password +security.login.unsuccessful=Your login attempt was not successful, try again. Reason: +security.logout=Logout \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_de.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_de.properties new file mode 100644 index 0000000000..ca8582d5e0 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_de.properties @@ -0,0 +1,96 @@ +#menu +global.menu.new={0} erstellen +global.menu.list=Alle {0} finden +global.menu.find=Suchen: {0} +global.language.switch=Sprache nach {0} ändern +global.language=Sprache +global.sponsored=Gesponsert von SpringSource +global.theme=Thema +global.theme.alt=alt +global.theme.standard=standard + +#welcome page +welcome.titlepane=Willkommen zu {0} +welcome.h3=Willkommen zu {0} +welcome.text=Spring Roo bietet ein interaktives, leichtgewichtiges und vom Anwender anpassbares Tool, welches die schnelle Erstellung von performanten Enterprise Java Applikationen ermöglicht. + +#entity labels +entity.list.all=Liste alle {0} +entity.show=Zeige {0} +entity.create={0} erstellen +entity.update={0} aktualisieren +entity.delete={0} löschen +entity.find=Finde {0} +entity.not.found={0} konnte nicht gefunden werden. +entity.not.found.single={0} konnte nicht gefunden werden mit dieser ID. + +#button labels +button.home=Home +button.save=Speichern +button.update=Aktualisieren +button.find=Finde +button.cancel=Abbrechen +button.proceed=Fortfahren +button.submit=Absenden +button.reset=Zurücksetzen +button.end=Ende +button.showmessage=Meldung Anzeigen +button.showstacktrace=Stack Trace Anzeigen +button.showcookie=Cookie Anzeigen + +#field labels +field.simple.validation=Bitte {0} eingeben {1} +field.invalid.email=E-Mail Adresse muss korrekt sein +field.invalid.number=Nummern mit \\'-\\' oder \\'.\\' erlaubt +field.invalid.integer=Nur Integer-Zahlen erlaubt +field.required=Pflichtfeld + +#list labels +list.first=Erste Seite +list.next=Nächste Seite +list.previous=Vorhergehende Seite +list.last=Letzte Seite +list.page=Seite {0} von {1} +list.size=Ergebnisse pro Seite: + +#webflow +webflow.menu.enter= {0} WebFlow starten + +#selenium +selenium.menu.test.suite=Testfälle + +#exception +exception.message=Exception Meldung +exception.stacktrace=Exception Stack Trace +exception.details=Details + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Datenzugriff fehlgeschlagen +error.dataaccessfailure.problemdescription=Ein Problem ist aufgetreten während des Datenzugriffs. + +#resourceNotFound.jspx +error.resourcenotfound.title=Angeforderte Ressource nicht gefunden +error.resourcenotfound.problemdescription=Die angeforderte Ressource konnte leider nicht gefunden werden. + +#uncaughtException.jspx +error.uncaughtexception.title=Interner Fehler +error.uncaughtexception.problemdescription=Leider ist ein interner Fehler aufgetreten. + +#webflow +webflow.menu.enter=WebFlow {0} starten +webflow.state1.title=Spring WebFlow - Seite (View State) Eins +webflow.state1.message=Dies ist ein einfaches Beispiel um Spring Webflow zu demonstrieren. Die Buttons unten führen Sie zum nächsten Schritt (Fortfahren) oder zum Ende (Ende). +webflow.state2.title=Spring WebFlow - Seite (View State) Zwei +webflow.state2.message=Dies ist ein einfaches Beispiel um Spring Webflow zu demonstrieren. Der Button unten führt Sie zum Ende (Ende) des Flows. +webflow.endstate.title=Spring WebFlow - Letzte Seite (End State) +webflow.endstate.message=Sie haben das Ende des Flows erreicht. + +#security +security.login.title=Spring Security Login +security.login.message=Sie haben versucht eine gesicherte Seite aufzurufen. Standardmäßig können Sie als "admin", mit "admin" als Passwort einloggen. +security.login.form.name=Name +security.login.form.name.message=Geben Sie Ihren Namen ein +security.login.form.password=Passwort +security.login.form.password.message=Geben Sie Ihr Passwort ein +security.login.unsuccessful=Ihre Anmeldung war nicht erfolgreich, bitte versuchen Sie es noch einmal. Grund: +security.logout=Ausloggen \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_es.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_es.properties new file mode 100644 index 0000000000..9ad5facb3c --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_es.properties @@ -0,0 +1,95 @@ +#menu +global.menu.new=Crear nuevo {0} +global.menu.list=Listar {0} +global.menu.find=Buscar por {0} +global.language.switch=Cambiar idioma a {0} +global.language=Idioma +global.sponsored=Sponsored by SpringSource +global.theme=Tema +global.theme.alt=alt +global.theme.standard=estandarte + +#welcome page +welcome.titlepane=Bienvenido a {0} +welcome.h3=Bienvenido a {0} +welcome.text=Spring Roo proporciona herramientas interactivas, ligeras y adaptables al usuario que permiten la rápida entrega de aplicaciones empresariales Java de alto rendimiento. + +#entity labels +entity.list.all=Listar {0} +entity.show=Mostrar {0} +entity.create=Crear nuevo {0} +entity.update=Actualizar {0} +entity.delete=Borrar {0} +entity.find={0} +entity.not.found=No se han encontrado {0}. +entity.not.found.single=No se han encontrado {0} con este id. + +#button labels +button.home=Inicio +button.save=Guardar +button.update=Actualizar +button.find=Buscar +button.cancel=Cancelar +button.proceed=Proceder +button.submit=Enviar +button.reset=Reiniciar +button.end=Fin +button.showmessage=Mostrar Mensaje +button.showstacktrace=Mostar Stack Trace +button.showcookie=Mostrar Cookie + +#field labels +field.simple.validation=Introduzca {0} {1} +field.invalid.email=Por favor, introduzca un email válido +field.invalid.number=Números con \\'-\\' o \\'.\\' permitidos +field.invalid.integer=Sólo números enteros +field.invalid=Por favor, introduzca un {0} válido +field.required=requerido + +#list labels +list.first=Primera Página +list.next=Página Siguiente +list.previous=Página Anterior +list.last=Última página +list.page=Página {0} de {1} +list.size=Resultados por página: + +#selenium +selenium.menu.test.suite=Batería de pruebas + +#exception +exception.message=Mensaje de la Excepción +exception.stacktrace=Stack Trace de la Excepción +exception.cookie=Cookies +exception.details=Detalles + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Error de acceso a datos +error.dataaccessfailure.problemdescription=Lo sentimos, ha ocurrido un problema al acceder a la base de datos. + +#resourceNotFound.jspx +error.resourcenotfound.title=Recurso Solicitado No Encontrado +error.resourcenotfound.problemdescription=Lo sentimos, no hemos encontrado el recurso que buscaba. + +#uncaughtException.jspx +error.uncaughtexception.title=Error Interno +error.uncaughtexception.problemdescription=Lo sentimos, ha ocurrido un error interno. + +#webflow +webflow.menu.enter=Empezar WebFlow {0} +webflow.state1.title=Spring WebFlow - View State Uno +webflow.state1.message=Este es un simple ejemplo para empezar con Spring Web Flow. Los botones de abajo llevan al siguiente estado (Proceder) o a al estado final. +webflow.state2.title=Spring WebFlow - View State Dos +webflow.state2.message=Este es un simple ejemplo para empezar con Spring Web Flow. El botón de abajo lleva al fin del flujo (end state). +webflow.endstate.title=Spring WebFlow - Estado final (End State) +webflow.endstate.message=Ha llegado al final del flujo. + +#security +security.login.title=Spring Security Login +security.login.message=Ha intentado acceder a una área protegida de esta aplicación. Por defecto, puede iniciar sesión con "admin" y contraseña "admin". +security.login.form.name=Nombre +security.login.form.name.message=Introduzca su nombre +security.login.form.password=Contraseña +security.login.form.password.message=Introduzca su constraseña +security.login.unsuccessful=Su intento de inicio de sesión no ha tenido éxito, inténtelo de nuevo. Razón: +security.logout=Cerrar sesión \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_it.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_it.properties new file mode 100644 index 0000000000..d02d80852b --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_it.properties @@ -0,0 +1,95 @@ +#menu +global.menu.new=Crea nuovo {0} +global.menu.list=Elenca tutti {0} +global.menu.find=Trova per {0} +global.language.switch=Cambia linguaggio in {0} +global.language=Lingua +global.sponsored=Sponsorizzato da SpringSource +global.theme=Tema +global.theme.alt=alt +global.theme.standard=standard + +#welcome page +welcome.titlepane=Benvenuto in {0} +welcome.h3=Benvenuto in {0} +welcome.text=Spring Roo fornisce un tool interattivo, leggero e personalizzabile dall'utente, che abilita lo sviluppo rapido di applicazioni Java enterprise ad alte prestazioni. + +#entity labels +entity.list.all=Elenca tutti {0} +entity.show=Mostra {0} +entity.create=Crea nuovo {0} +entity.update=Aggiorna {0} +entity.delete=Elimina {0} +entity.find={0} +entity.not.found=Nessun {0} trovato. +entity.not.found.single=Nessun {0} trovato con questo id. + +#button labels +button.home=Home +button.save=Salva +button.update=Aggiorna +button.find=Trova +button.cancel=Cancella +button.proceed=Procedi +button.submit=Invia +button.reset=Azzera +button.end=Fine +button.showmessage=Mostra Messaggio +button.showstacktrace=Mostra Stack Trace +button.showcookie=Mostra Cookie + +#field labels +field.simple.validation=Inserisci {0} {1} +field.invalid.email=Si prega di inserire un indirizzo email valido +field.invalid.number=Numero con \\'-\\' o \\'.\\' ammesso +field.invalid.integer=Solo numeri interi +field.invalid=Si prega di inserire dei validi {0} +field.required=richiesto + +#list labels +list.first=Prima pagina +list.next=Prossima Pagina +list.previous=Pagina Precedente +list.last=Ultima Pagina +list.page=Pagina {0} di {1} +list.size=Elenco risultati per pagina: + +#selenium +selenium.menu.test.suite=Test Suite + +#exception +exception.message=Messaggio Eccezione +exception.stacktrace=Stack Trace Eccezione +exception.cookie=Cookies +exception.details=Dettagli + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Fallito l'accesso ai dati +error.dataaccessfailure.problemdescription=Spiacente, si è verificato un problema durante l'accesso al database. + +#resourceNotFound.jspx +error.resourcenotfound.title=Risorsa richiesta non trovata +error.resourcenotfound.problemdescription=Spiacente, non troviamo la risorsa che stai cercando. + +#uncaughtException.jspx +error.uncaughtexception.title=Errore Interno +error.uncaughtexception.problemdescription=Spiacente, abbiamo incontrato un errore interno. + +#webflow +webflow.menu.enter=Inserire {0} WebFlow +webflow.state1.title=Spring WebFlow - Stato View Uno +webflow.state1.message=Questo è un semplice esempio con Spring Web Flow. I pulsanti sotto conducono ad un altro view state (Procedi) o ad uno stato finale. +webflow.state2.title=Spring WebFlow - Stato View Due +webflow.state2.message=Questo è un semplice esempio per iniziare con Spring Web Flow. I pulsanti sotto conducono ad un altro stato view (Procedi) o ad uno stato finale. +webflow.endstate.title=Spring WebFlow - Stato finale +webflow.endstate.message=Hai raggiunto la fine di questo flusso. + +#security +security.login.title=Spring Security Login +security.login.message=Hai provato ad accedere ad un area protetta di questa applicazione. Di default puoi fare il login come "admin", con password "admin". +security.login.form.name=Nome +security.login.form.name.message=Inserisci il tuo nome +security.login.form.password=Password +security.login.form.password.message=Inserisci la password +security.login.unsuccessful=Il tentativo di login non ha avuto successo, prova ancora. Motivo: +security.logout=Logout diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_nl.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_nl.properties new file mode 100644 index 0000000000..836a96c3a4 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_nl.properties @@ -0,0 +1,96 @@ +#menu +global.menu.new={0} maken +global.menu.list=Toon alle {0} +global.menu.find=Vind op {0} +global.language.switch=Wissel taal naar: {0} +global.language=Taal +global.sponsored=Gesponsord door SpringSource +global.theme=Thema +global.theme.alt=alt +global.theme.standard=standaard + +#welcome page +welcome.titlepane=Welkom bij {0} +welcome.h3=Welkom bij {0} +welcome.text=Spring Roo levert interactieve, lichtgewicht en door de gebruiker aanpasbare tools waarmee snel hoogwaardige Enterprise Java applicaties gemaakt kunnen worden. + +#entity labels +entity.list.all=Toon alle {0} +entity.show=Toon {0} +entity.create={0} maken +entity.update=Bewerk {0} +entity.delete=Verwijder {0} +entity.find=Zoek {0} +entity.not.found=Geen {0} gevonden. +entity.not.found.single=Geen {0} gevonden met dit id. + +#button labels +button.home=Home +button.save=Sla op +button.update=Bewerk +button.find=Zoek +button.cancel=Annuleer +button.proceed=Ga door +button.submit=Verstuur +button.reset=Herstel +button.end=Einde +button.showmessage=Toon bericht +button.showstacktrace=Toon stack trace +button.showcookie=Toon cookie + +#field labels +field.simple.validation=Voer {0} {1} in +field.invalid.email=Voer een geldig email adres in +field.invalid.number=Getal met \\'-\\' or \\',\\' toegestaan +field.invalid.integer=Alleen gehele getallen +field.invalid=Voer een geldige {0} in +field.required=verplicht + +#list labels +list.first=Eerste pagina +list.next=Volgende pagina +list.previous=Vorige pagina +list.last=Laatste pagina +list.page=Pagina {0} van {1} +list.size=Resultaten per pagina: + +#selenium +selenium.menu.test.suite=Test Suite + +#exception +#intentionally left the two exception entries below in English as Dutch translations of technical terms are confusing to Dutch developers +exception.message=Exception Message +exception.stacktrace=Exception Stack Trace +exception.cookie=Cookies +exception.details=Details + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Data toegang gefaald +error.dataaccessfailure.problemdescription=Sorry, er heeft zich een probleem voorgedaan bij het benaderen van de database. + +#resourceNotFound.jspx +error.resourcenotfound.title=Gevraagde bron is niet gevonden +error.resourcenotfound.problemdescription=Sorry, de gevraagde bron is niet gevonden + +#uncaughtException.jspx +error.uncaughtexception.title=Interne fout +error.uncaughtexception.problemdescription=Sorry, het systeem heeft een intern probleem aangetroffen + +#webflow +webflow.menu.enter=Ga webflow {0} in +webflow.state1.title=Spring WebFlow - Bekijk eerste status +webflow.state1.message=Dit is een simpel voorbeeld van hoe met Spring Web Flow te beginnen. De knoppen hieronder leiden je naar een andere view state (Proceed), of naar een eind state. +webflow.state2.title=Spring WebFlow - Bekijk tweede status +webflow.state2.message=Dit is een simpel voorbeeld van hoe met Spring Web Flow te beginnen. De knoppen hieronder leiden je naar een andere view state (Proceed), of naar een eind state. +webflow.endstate.title=Spring WebFlow - status einde +webflow.endstate.message=U heeft het einde van deze flow bereikt. + +#security +security.login.title=Spring Security Login +security.login.message=U hebt geprobeerd een beveiligd gedeelte van de applicatie te benaderen. De standaard login is "admin", met wachtwoord "admin". +security.login.form.name=Naam +security.login.form.name.message=Voer uw naam in +security.login.form.password=Wachtwoord +security.login.form.password.message=Voer uw wachtwoord in +security.login.unsuccessful=Uw login poging was niet succesvoal, probeer het nogmaals. Reden: +security.logout=Afmelden \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_sv.properties b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_sv.properties new file mode 100644 index 0000000000..92d50da86d --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/i18n/messages_sv.properties @@ -0,0 +1,96 @@ +#menu +global.menu.new=Skapa ny {0} +global.menu.list=Visa alla {0} +global.menu.find=Sök på {0} +global.language.switch=Byt språk till {0} +global.language=Språk +global.sponsored=Sponsrad av SpringSource +global.theme=Tema +global.theme.alt=alt +global.theme.standard=standard + +#welcome page +welcome.titlepane=Välkommen till {0} +welcome.h3=Välkommen till {0} +welcome.text=Spring Roo ger interaktiva, lättviktiga verktyg som kan anpassas av användaren och möjliggör snabb leverans av högpresterande enterprise Java applikationer. + +#entity labels +entity.list.all=Visa alla {0} +entity.show=Visa {0} +entity.create=Skapa ny {0} +entity.update=Uppdatera {0} +entity.delete=Ta bort {0} +entity.find=Sök på {0} +entity.not.found=Ingen {0} hittades. +entity.not.found.single=Ingen {0} hittades med detta id. + +#button labels +button.home=Hem +button.save=Spara +button.update=Uppdatera +button.find=Hitta +button.cancel=Avbryt +button.proceed=Fortsätt +button.submit=Skicka +button.reset=Börja om +button.end=Sista +button.showmessage=Visa meddelande +button.showstacktrace=Visa Stack Trace +button.showcookie=Visa Cookie + +#field labels +field.simple.validation=Ange {0} {1} +field.invalid.email=Var vänlig använd en giltig emailadress +field.invalid.number=Siffra med \\'-\\' eller \\'.\\' tillåten +field.invalid.integer=Endast heltal +field.invalid=Var vänlig anväd en giltig {0} +field.required=obligatoriskt + +#list labels +list.first=Första sidan +list.next=Nästa sida +list.previous=Förra sidan +list.last=Sista sidan +list.page=Sida {0} av {1} +list.size=Visa antal resultat per sida: + +#selenium +selenium.menu.test.suite=Test Svit + +#exception +exception.message=Undantagsmeddelande +exception.stacktrace=Undantag Stack Trace +exception.cookie=Cookies +exception.details=Detaljer + +#dataAccessFailure.jspx +error.dataaccessfailure.title=Fel vid dataläsning +error.dataaccessfailure.problemdescription=Beklagar, ett problem uppstod vid läsning av databasen. + +#resourceNotFound.jspx +error.resourcenotfound.title=Efterfrågad tillgång hittades inte +error.resourcenotfound.problemdescription=Beklagar, vi kunde inte hitta tillgången du efterfrågade. + +#uncaughtException.jspx +error.uncaughtexception.title=Internt fel +error.uncaughtexception.problemdescription=Beklagar, ett internt fel inträffade. + +#webflow +webflow.menu.enter=Börja {0} WebFlow +webflow.state1.title=Spring WebFlow - See tillstånd ett +webflow.state1.message=Det här är ett enkelt exempel på hur du kommer igång med Spring Web Flow. Knapparna nedan leder dig till ett annat tillstånd (Fortsätt) eller till sluttillståndet. +webflow.state2.title=Spring WebFlow - See tillstånd två +webflow.state2.message=Det här är ett enkelt exempel på hur du kommer igång med Spring Web Flow. Knapparna nedan leder dig till ett annat tillstånd (Fortsätt) eller till sluttillståndet. +webflow.endstate.title=Spring WebFlow - Sluttillståndet +webflow.endstate.message=Du har nu kommit till slutet på detta flöde + +#security +security.login.title=Spring Security Login +security.login.message=Du har försökt komma in på en skyddad del av den här applikationen. Som standard kan du logga in som "admin", med lösenord "admin". + +security.login.form.name=Namn +security.login.form.name.message=Ange ditt namn +security.login.form.password=Lösenord +security.login.form.password.message=Ange ditt lösenord +security.login.unsuccessful=Ditt försök att logga in misslyckades, försök igen. Anledning: +security.logout=Logga ut \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/default.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/default.jspx new file mode 100644 index 0000000000..4a8fb09695 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/default.jspx @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + <spring:message code="welcome.h3" arguments="${app_name}" /> + + +
+ +
+ + +
+
+ + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/layouts.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/layouts.xml new file mode 100644 index 0000000000..322c65a63f --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/layouts/layouts.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/spring/webmvc-config.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/spring/webmvc-config.xml new file mode 100644 index 0000000000..1767a0dbc9 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/spring/webmvc-config.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /WEB-INF/layouts/layouts.xml + + /WEB-INF/views/**/views.xml + + + + + + + + + + + + + + + + + + + + + dataAccessFailure + resourceNotFound + resourceNotFound + resourceNotFound + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/language.tagx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/language.tagx new file mode 100644 index 0000000000..cfe0a660b8 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/language.tagx @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + ${lang_en} + + + + + + + + + + + + + + ${lang_de} + + + + + + + + + + + + + + ${lang_sv} + + + + + + + + + + + + + + ${lang_es} + + + + + + + + + + + + + + ${lang_it} + + + + + + + + + + + + + + ${lang_nl} + + + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/pagination.tagx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/pagination.tagx new file mode 100644 index 0000000000..d5c848a373 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/pagination.tagx @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${i} + + + + + + + + + + + + + + + ${first_label} + + + + + + + + + + + ${previous_label} + + + + + + + + + + + + + + ${next_label} + + + + + + + + + + + ${last_label} + + + \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/theme.tagx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/theme.tagx new file mode 100644 index 0000000000..d97bbef9d5 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/tags/theme.tagx @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + ${theme_standard} + + + + + + + + + + + + ${theme_alt} + + \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/urlrewrite.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/urlrewrite.xml new file mode 100644 index 0000000000..314c4acd18 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/urlrewrite.xml @@ -0,0 +1,34 @@ + + + + + + /resources/** + /resources/$1 + + + /static/WEB-INF/** + 403 + /static/WEB-INF/$1 + + + /static/** + /$1 + + + / + /app/index + + + /app/** + /app/$1 + + + /** + /app/$1 + + + /app/** + /$1 + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/controller-index.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/controller-index.jspx new file mode 100644 index 0000000000..76e3f3cabf --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/controller-index.jspx @@ -0,0 +1,10 @@ +
+ + +
+ + + +

Controller Index Page

+
+
\ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx new file mode 100644 index 0000000000..3fd4aeb625 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx @@ -0,0 +1,30 @@ +
+ + +
+ + +

${title}

+

+ +

+

+ + +
+ + +
+ + +
+ + +
+
+
+

+
+
+
+ diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/index.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/index.jspx new file mode 100644 index 0000000000..ee8e0a1c98 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/index.jspx @@ -0,0 +1,11 @@ +
+ + +
+ + + +

+

+
+
\ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/create.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/create.jspx new file mode 100644 index 0000000000..3fa6350f09 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/create.jspx @@ -0,0 +1,51 @@ +
+ + +
+ + + + + + +
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + + +
+
+
+
diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/findLoanSharksByName.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/findLoanSharksByName.jspx new file mode 100644 index 0000000000..85c6a9c309 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/findLoanSharksByName.jspx @@ -0,0 +1,25 @@ +
+ + +
+ + + + + +
+ + + + + +
+
+
+ + + +
+
+
+
diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/list.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/list.jspx new file mode 100644 index 0000000000..980f74eb71 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/list.jspx @@ -0,0 +1,87 @@ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdNameCounterAverage Rate + + +
${loanShark.id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/show.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/show.jspx new file mode 100644 index 0000000000..8720448a8b --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/show.jspx @@ -0,0 +1,35 @@ +
+ + +
+ + + + +
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ + + +
+
diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/update.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/update.jspx new file mode 100644 index 0000000000..95e0e82b8c --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/update.jspx @@ -0,0 +1,53 @@ +
+ + +
+ + + + + + +
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + + +
+ + +
+
+
diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/views.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/views.xml new file mode 100644 index 0000000000..eda77f5acc --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/loanshark/views.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/menu.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/menu.jspx new file mode 100644 index 0000000000..3701577494 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/menu.jspx @@ -0,0 +1,34 @@ + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/resourceNotFound.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/resourceNotFound.jspx new file mode 100644 index 0000000000..3190fb5e3c --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/resourceNotFound.jspx @@ -0,0 +1,29 @@ +
+ + +
+ + +

${title}

+

+ +

+

+ + +
+ + +
+ + +
+ + +
+
+
+

+
+
+
\ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/uncaughtException.jspx b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/uncaughtException.jspx new file mode 100644 index 0000000000..267f8eb116 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/uncaughtException.jspx @@ -0,0 +1,29 @@ +
+ + +
+ + +

${title}

+

+ +

+

+ + +
+ + +
+ + +
+ + +
+
+
+

+
+
+
\ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/views.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/views.xml new file mode 100644 index 0000000000..865a7c87a3 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/views/views.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/web.xml b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..20dcb64219 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,136 @@ + + + loanshark + Roo generated loanshark application + + + log4jConfigLocation + classpath:META-INF/spring/log4j.properties + + + defaultHtmlEscape + true + + + + webAppRootKey + loanshark.root + + + + contextConfigLocation + classpath*:META-INF/spring/applicationContext*.xml + + + + etagFilter + org.springframework.web.filter.ShallowEtagHeaderFilter + + + + CharacterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + + httpMethodFilter + org.springframework.web.filter.HiddenHttpMethodFilter + + + + UrlRewriteFilter + org.tuckey.web.filters.urlrewrite.UrlRewriteFilter + + + + Spring OpenEntityManagerInViewFilter + org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter + + + + Spring OpenEntityManagerInViewFilter + /* + + + CharacterEncodingFilter + /* + + + + httpMethodFilter + /* + + + + UrlRewriteFilter + /* + + + + org.springframework.web.util.Log4jConfigListener + + + org.springframework.web.context.ContextLoaderListener + + + + loanshark + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + /WEB-INF/spring/webmvc-config.xml + + + + + + Resource Servlet + org.springframework.js.resource.ResourceServlet + + + + loanshark + /app/* + + + + + Resource Servlet + /resources/* + + + + 10 + + + + index.jspx + + + + java.lang.Exception + /app/uncaughtException + + + + 404 + /app/resourceNotFound + + diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/add.png b/spring-integration-samples/loanshark/src/main/webapp/images/add.png new file mode 100644 index 0000000000..d5bfa0719b Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/add.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/banner-graphic.png b/spring-integration-samples/loanshark/src/main/webapp/images/banner-graphic.png new file mode 100644 index 0000000000..7d2b78c6e3 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/banner-graphic.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/de.png b/spring-integration-samples/loanshark/src/main/webapp/images/de.png new file mode 100644 index 0000000000..ac4a977362 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/de.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/delete.png b/spring-integration-samples/loanshark/src/main/webapp/images/delete.png new file mode 100644 index 0000000000..1514d51a3c Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/delete.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/es.png b/spring-integration-samples/loanshark/src/main/webapp/images/es.png new file mode 100644 index 0000000000..c2de2d7111 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/es.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/favicon.ico b/spring-integration-samples/loanshark/src/main/webapp/images/favicon.ico new file mode 100644 index 0000000000..c2f2b6ccda Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/favicon.ico differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/gb.png b/spring-integration-samples/loanshark/src/main/webapp/images/gb.png new file mode 100644 index 0000000000..ff701e19f6 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/gb.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/it.png b/spring-integration-samples/loanshark/src/main/webapp/images/it.png new file mode 100644 index 0000000000..89692f74f0 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/it.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/list.png b/spring-integration-samples/loanshark/src/main/webapp/images/list.png new file mode 100644 index 0000000000..acc30b853b Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/list.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/nl.png b/spring-integration-samples/loanshark/src/main/webapp/images/nl.png new file mode 100644 index 0000000000..fe44791e32 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/nl.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/resultset_first.png b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_first.png new file mode 100644 index 0000000000..b03eaf8b54 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_first.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/resultset_last.png b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_last.png new file mode 100644 index 0000000000..8ec8947847 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_last.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/resultset_next.png b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_next.png new file mode 100644 index 0000000000..e252606d3e Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_next.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/resultset_previous.png b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_previous.png new file mode 100644 index 0000000000..18f9cc1094 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/resultset_previous.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/show.png b/spring-integration-samples/loanshark/src/main/webapp/images/show.png new file mode 100644 index 0000000000..2f193889f7 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/show.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/springsource-logo.png b/spring-integration-samples/loanshark/src/main/webapp/images/springsource-logo.png new file mode 100644 index 0000000000..e170f8abf7 Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/springsource-logo.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/sv.png b/spring-integration-samples/loanshark/src/main/webapp/images/sv.png new file mode 100644 index 0000000000..1994653dac Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/sv.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/images/update.png b/spring-integration-samples/loanshark/src/main/webapp/images/update.png new file mode 100644 index 0000000000..046811ed7a Binary files /dev/null and b/spring-integration-samples/loanshark/src/main/webapp/images/update.png differ diff --git a/spring-integration-samples/loanshark/src/main/webapp/styles/alt.css b/spring-integration-samples/loanshark/src/main/webapp/styles/alt.css new file mode 100644 index 0000000000..5cb9a08877 --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/styles/alt.css @@ -0,0 +1,348 @@ +/* main elements */ + +body,div,td { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #666; +} + +body { + background-color: #fff; + background-image: url(../images/banner-graphic.png); + background-position: top center; + background-repeat: no-repeat; + text-align: center; +} + +#wrapper { + width:800px; + min-width: 800px; + max-width: 800px; + margin-right: auto; + margin-left: auto; + /* fix max-width incompatibility in IE6 */ + width:expression(document.body.clientWidth > 800? "800px": "auto" ); + + overflow:hidden; + display:block; + margin-top: 90px; +} + +/* header and footer elements */ + +#main { + overflow:hidden; + display:box; +} + +#menu { + background: #eee; + position:relative; + float:right; + left:0px; + width:220px; + margin-left:15px; +} + +#menu ul{ + list-style: none; + margin: 0; + padding: 0; +} + +#menu ul li{ + padding: 0px; +} + + +#menu a, #menu h2 { + display: block; + margin: 0; + padding: 2px 6px; + color:#FFFFFF; +} + +#menu h2 { + color: #fff; + background: #648C1D; + text-transform: uppercase; + font-weight:bold; + font-size: 12px; +} + +#menu a { + color: #666666; + background: #efefef; + text-decoration: none; + padding: 2px 12px; +} + +#menu a:hover { + color: #648C1D; + background: #fff; +} + +#footer { + background:#fff; + border:none; + margin-top:15px; + border-top:1px solid #999999; +} + +#footer .new { + float:left; +} + +#footer a:link {color: #7db223;} + +label { + width:100px; + float:left; + margin-left: 5px; + margin-top: 0px; +} + +input { + height:20px; +} + +input, textarea, select { + border:1px solid #B3B3B3; +} + +input.image { + border: none; + height: auto; +} + +submit { + height:25px; +} + +div { + text-align: left; +} + +div .box { + display:block; + margin-left:105px; +} + +/* menu elements*/ + +a.menu, a.menu:link, a.menu:visited {display:block; width:150px; height:25px;} + +/* text styles */ + +h1,h2,h3 { + font-family: Helvetica, sans-serif; + color: #7db223; +} + +h1 { + font-size: 20px; + line-height: 26px; +} + +h2 { + font-size: 18px; + line-height: 20px; +} + +h3 { + font-size: 15px; + line-height: 21px; + color:#555; +} + +h4 { + font-size: 14px; + line-height: 20px; +} + +.errors { + color: red; + font-weight: bold; + display: block; + margin-left: 105px; +} + +a { + text-decoration: underline; + font-size: 12px; +} + +a img { + border: 0 none; + vertical-align: middle; +} + +tr:nth-child(odd) { + background-color: #FFFFFF; +} + +tr:nth-child(even) { + background-color: #EFEFEF; +} + +a:link { + color: #7db223; +} + +a:hover { + color: #456314; +} + +a:active { + color: #7db223; +} + +a:visited { + color: #7db223; +} + +ul { + list-style: disc url(../images/bullet-arrow.png); +} + +li { + padding-top: 5px; + text-align: left; +} + +li ul { + list-style: square url(../images/sub-bullet.gif); +} + +li ul li ul { + list-style: circle none; +} + +ul li { + margin:0 0 0.25em 0; + padding:0; +} +/* table elements */ + +table { + background: #EEEEEE; + margin: 2px 0 0 0; + border: 1px solid #BBBBBB; + border-collapse: collapse; + width: 100% +} + +table table { + margin: -5px 0; + border: 0px solid #e0e7d3; + width: 100%; +} + +table td,table th { + padding: 2px; + border: 1px solid #CCCCCC; +} + +table td form { + text-align:center; + vertical-align: middle; + margin: 0px; +} + +table th { + font-size: 0.75em; + text-align: left; + font-weight: bold; + color: #FFF; + background: #999; +} + +table thead { + font-weight: bold; + font-style: italic; + background-color: #BBBBBB; +} + +table a:link {color: #303030;} + +caption { + caption-side: top; + width: auto; + text-align: left; + font-size: 12px; + color: #848f73; + padding-bottom: 4px; +} + +fieldset { + background: #e0e7d3; + padding: 8px; + padding-bottom: 22px; + border: none; + width: 560px; +} + +fieldset label { + width: 70px; + float: left; + margin-top: 1.7em; + margin-left: 20px; +} + +fieldset textfield { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset textarea { + margin: 3px; + height: 165px; + background: #e0e7d3; +} + +fieldset input { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset table { + width: 100%; +} + +fieldset th { + padding-left: 25px; +} + +.table-buttons { + background-color:#fff; + border:none; +} + +.table-buttons td { + border:none; +} + +.submit input { + border: 1px solid #BBBBBB; + color:#777777; + padding:2px 7px; + font-size:11px; + text-transform:uppercase; + font-weight:bold; + height:24px; +} + +.updated { + background:#ecf1e5; + font-size:11px; + margin-left:2px; + border:4px solid #ecf1e5; +} + +.updated td { + padding:2px 8px; + font-size:11px; + color:#888888; +} \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/main/webapp/styles/standard.css b/spring-integration-samples/loanshark/src/main/webapp/styles/standard.css new file mode 100644 index 0000000000..8a8939642b --- /dev/null +++ b/spring-integration-samples/loanshark/src/main/webapp/styles/standard.css @@ -0,0 +1,348 @@ +/* main elements */ + +body,div,td { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #666; +} + +body { + background-color: #fff; + background-image: url(../images/banner-graphic.png); + background-position: top center; + background-repeat: no-repeat; + text-align: center; +} + +#wrapper { + width:800px; + min-width: 800px; + max-width: 800px; + margin-right: auto; + margin-left: auto; + /* fix max-width incompatibility in IE6 */ + width:expression(document.body.clientWidth > 800? "800px": "auto" ); + + overflow:hidden; + display:block; + margin-top: 90px; +} + +/* header and footer elements */ + +#main { + overflow:hidden; + display:box; +} + +#menu { + background: #eee; + position:relative; + float:left; + left:0px; + width:220px; + margin-right:15px; +} + +#menu ul{ + list-style: none; + margin: 0; + padding: 0; +} + +#menu ul li{ + padding: 0px; +} + + +#menu a, #menu h2 { + display: block; + margin: 0; + padding: 2px 6px; + color:#FFFFFF; +} + +#menu h2 { + color: #fff; + background: #648C1D; + text-transform: uppercase; + font-weight:bold; + font-size: 12px; +} + +#menu a { + color: #666666; + background: #efefef; + text-decoration: none; + padding: 2px 12px; +} + +#menu a:hover { + color: #648C1D; + background: #fff; +} + +#footer { + background:#fff; + border:none; + margin-top:15px; + border-top:1px solid #999999; +} + +#footer .new { + float:left; +} + +#footer a:link {color: #7db223;} + +label { + width:100px; + float:left; + margin-left: 5px; + margin-top: 0px; +} + +input { + height:20px; +} + +input, textarea, select { + border:1px solid #B3B3B3; +} + +input.image { + border: none; + height: auto; +} + +submit { + height:25px; +} + +div { + text-align: left; +} + +div .box { + display:block; + margin-left:105px; +} + +/* menu elements*/ + +a.menu, a.menu:link, a.menu:visited {display:block; width:150px; height:25px;} + +/* text styles */ + +h1,h2,h3 { + font-family: Helvetica, sans-serif; + color: #7db223; +} + +h1 { + font-size: 20px; + line-height: 26px; +} + +h2 { + font-size: 18px; + line-height: 20px; +} + +h3 { + font-size: 15px; + line-height: 21px; + color:#555; +} + +h4 { + font-size: 14px; + line-height: 20px; +} + +.errors { + color: red; + font-weight: bold; + display: block; + margin-left: 105px; +} + +a { + text-decoration: underline; + font-size: 12px; +} + +a img { + border: 0 none; + vertical-align: middle; +} + +tr:nth-child(odd) { + background-color: #FFFFFF; +} + +tr:nth-child(even) { + background-color: #EFEFEF; +} + +a:link { + color: #7db223; +} + +a:hover { + color: #456314; +} + +a:active { + color: #7db223; +} + +a:visited { + color: #7db223; +} + +ul { + list-style: disc url(../images/bullet-arrow.png); +} + +li { + padding-top: 5px; + text-align: left; +} + +li ul { + list-style: square url(../images/sub-bullet.gif); +} + +li ul li ul { + list-style: circle none; +} + +ul li { + margin:0 0 0.25em 0; + padding:0; +} +/* table elements */ + +table { + background: #EEEEEE; + margin: 2px 0 0 0; + border: 1px solid #BBBBBB; + border-collapse: collapse; + width: 100% +} + +table table { + margin: -5px 0; + border: 0px solid #e0e7d3; + width: 100%; +} + +table td,table th { + padding: 2px; + border: 1px solid #CCCCCC; +} + +table td form { + text-align:center; + vertical-align: middle; + margin: 0px; +} + +table th { + font-size: 0.75em; + text-align: left; + font-weight: bold; + color: #FFF; + background: #999; +} + +table thead { + font-weight: bold; + font-style: italic; + background-color: #BBBBBB; +} + +table a:link {color: #303030;} + +caption { + caption-side: top; + width: auto; + text-align: left; + font-size: 12px; + color: #848f73; + padding-bottom: 4px; +} + +fieldset { + background: #e0e7d3; + padding: 8px; + padding-bottom: 22px; + border: none; + width: 560px; +} + +fieldset label { + width: 70px; + float: left; + margin-top: 1.7em; + margin-left: 20px; +} + +fieldset textfield { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset textarea { + margin: 3px; + height: 165px; + background: #e0e7d3; +} + +fieldset input { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset table { + width: 100%; +} + +fieldset th { + padding-left: 25px; +} + +.table-buttons { + background-color:#fff; + border:none; +} + +.table-buttons td { + border:none; +} + +.submit input { + border: 1px solid #BBBBBB; + color:#777777; + padding:2px 7px; + font-size:11px; + text-transform:uppercase; + font-weight:bold; + height:24px; +} + +.updated { + background:#ecf1e5; + font-size:11px; + margin-left:2px; + border:4px solid #ecf1e5; +} + +.updated td { + padding:2px 8px; + font-size:11px; + color:#888888; +} \ No newline at end of file diff --git a/spring-integration-samples/loanshark/src/test/java/com/springframework/integration/loanbroker/loanshark/biz/TestAccumulator.java b/spring-integration-samples/loanshark/src/test/java/com/springframework/integration/loanbroker/loanshark/biz/TestAccumulator.java new file mode 100644 index 0000000000..e62e04f1f7 --- /dev/null +++ b/spring-integration-samples/loanshark/src/test/java/com/springframework/integration/loanbroker/loanshark/biz/TestAccumulator.java @@ -0,0 +1,51 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * 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 com.springframework.integration.loanbroker.loanshark.biz; + + +import static junit.framework.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import com.springframework.integration.loanbroker.loanshark.domain.LoanShark; + + +/** + * @author Gary Russell + * + */ +@ContextConfiguration(locations="classpath:META-INF/spring/applicationContext.xml") +@RunWith(SpringJUnit4ClassRunner.class) +public class TestAccumulator { + + @Autowired + Accumulator accumulator; + + @Test + @Transactional + public void test() { + accumulator.accumulate(new SharkQuote("fred", 6.0d)); + accumulator.accumulate(new SharkQuote("fred", 6.2d)); + LoanShark shark = (LoanShark) LoanShark.findLoanSharksByName("fred").getSingleResult(); + assertEquals(new Long(2), shark.getCounter()); + assertEquals(new Double(6.1), shark.getAverageRate()); + } +} diff --git a/spring-integration-samples/loanshark/src/test/resources/log4j.properties b/spring-integration-samples/loanshark/src/test/resources/log4j.properties new file mode 100644 index 0000000000..becbf46cca --- /dev/null +++ b/spring-integration-samples/loanshark/src/test/resources/log4j.properties @@ -0,0 +1,12 @@ +#Updated at Tue Mar 23 17:20:25 PDT 2010 +#Tue Mar 23 17:20:25 PDT 2010 +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.rootLogger=DEBUG, stdout, R +log4j.appender.R.File=application.log +log4j.appender.R.MaxFileSize=100KB +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.MaxBackupIndex=1 +log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n +log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.R=org.apache.log4j.RollingFileAppender diff --git a/spring-integration-samples/loanshark/udps.groovy b/spring-integration-samples/loanshark/udps.groovy new file mode 100644 index 0000000000..f9b69716a7 --- /dev/null +++ b/spring-integration-samples/loanshark/udps.groovy @@ -0,0 +1,12 @@ +//Groovy Script to catch multicast packets. +socket = new MulticastSocket(11111) +mcast = InetAddress.getByName("225.6.7.8") +socket.joinGroup(mcast) +buffer = (' ' * 1024) as byte[] +while(true) { + incoming = new DatagramPacket(buffer, buffer.length) + socket.receive(incoming) + s = new String(incoming.data, 0, incoming.length) + println ("** Shark **" + s) +} + diff --git a/spring-integration-samples/loanshark/udps.pl b/spring-integration-samples/loanshark/udps.pl new file mode 100755 index 0000000000..ed00ed571d --- /dev/null +++ b/spring-integration-samples/loanshark/udps.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w +#Perl Script to catch multicast packets. +use strict; +use IO::Socket::Multicast; + +my $socket = IO::Socket::Multicast->new(LocalPort=>11111, ReuseAddr=>1) + or die "Can't start UDP server: $@"; + +$socket->mcast_add('225.6.7.8'); + +my ($datagram,$flags); +while ($socket->recv($datagram,1024,$flags)) { + print "**Shark** $datagram\n"; +} + +$socket->close();