├── .gitignore ├── .project ├── LICENSE ├── README.md ├── si-gradle-plugin ├── .gitignore ├── LICENSE.txt ├── README.md ├── build.gradle ├── distribution │ ├── org │ │ └── springframework │ │ │ └── integration │ │ │ └── gradle │ │ │ └── si-gradle-plugin │ │ │ └── 1.0.0.M1.BUILD-SNAPSHOT │ │ │ ├── si-gradle-plugin-1.0.0.M1.BUILD-SNAPSHOT.jar │ │ │ └── si-gradle-plugin-1.0.0.M1.BUILD-SNAPSHOT.pom │ └── spring-integration-apply.groovy ├── gradle.properties └── src │ └── main │ ├── groovy │ └── org │ │ └── springframework │ │ └── integration │ │ └── gradle │ │ ├── ProjectGenerator.groovy │ │ ├── ProjectInformation.groovy │ │ ├── SimpleProjectTask.groovy │ │ ├── SpringIntegrationPlugin.groovy │ │ ├── SpringIntegrationPluginUtils.groovy │ │ ├── StandaloneProjectTask.groovy │ │ ├── WarProjectTask.groovy │ │ └── support │ │ └── TemplateType.groovy │ └── resources │ ├── META-INF │ └── gradle-plugins │ │ └── spring-integration.properties │ └── templates │ ├── si-template-standalone-project.jar │ ├── si-template-standalone-simple-project.jar │ └── si-template-war-project.jar ├── si-maven-archetypes └── archetype-standalone-simple │ └── .project ├── si-sts-templates ├── .gitignore ├── README.md ├── builds │ ├── 1.0.0.M5 │ │ ├── ico │ │ │ ├── apple-touch-icon-114-precomposed.png │ │ │ ├── apple-touch-icon-144-precomposed.png │ │ │ ├── apple-touch-icon-57-precomposed.png │ │ │ └── apple-touch-icon-72-precomposed.png │ │ └── img │ │ │ └── spring │ │ │ └── SpringSource-logo.png │ ├── 1.0.0.RELEASE │ │ ├── ico │ │ │ ├── apple-touch-icon-114-precomposed.png │ │ │ ├── apple-touch-icon-144-precomposed.png │ │ │ ├── apple-touch-icon-57-precomposed.png │ │ │ └── apple-touch-icon-72-precomposed.png │ │ └── img │ │ │ └── spring │ │ │ └── spring-logo.png │ ├── descriptor.xml │ ├── org.springframework.integration.sts.templates_1.0.0.M3.jar │ ├── si-template-adapter-1.0.0.M3.zip │ ├── si-template-adapter-1.0.0.M4.zip │ ├── si-template-adapter-1.0.0.M5.zip │ ├── si-template-adapter-1.0.0.RELEASE.zip │ ├── si-template-adapter-1.0.1.RELEASE.zip │ ├── si-template-standalone-1.0.0.M2.zip │ ├── si-template-standalone-1.0.0.M3.zip │ ├── si-template-standalone-1.0.0.M4.zip │ ├── si-template-standalone-1.0.0.M5.zip │ ├── si-template-standalone-1.0.0.RELEASE.zip │ ├── si-template-standalone-1.0.1.RELEASE.zip │ ├── si-template-standalone-simple-1.0.0.M2.zip │ ├── si-template-standalone-simple-1.0.0.M3.zip │ ├── si-template-standalone-simple-1.0.0.M4.zip │ ├── si-template-standalone-simple-1.0.0.M5.zip │ ├── si-template-standalone-simple-1.0.0.RELEASE.zip │ ├── si-template-standalone-simple-1.0.1.RELEASE.zip │ ├── si-template-war-1.0.0.M2.zip │ ├── si-template-war-1.0.0.M3.zip │ ├── si-template-war-1.0.0.M4.zip │ ├── si-template-war-1.0.0.M5.zip │ ├── si-template-war-1.0.0.RELEASE.zip │ └── si-template-war-1.0.1.RELEASE.zip ├── pom.xml └── src │ └── main │ ├── assembly │ ├── adapter.xml │ ├── descriptor.xml │ ├── standalone-simple.xml │ ├── standalone.xml │ └── war.xml │ └── resources │ └── descriptor.xml └── si-template-projects ├── README.md ├── adapter ├── .classpath ├── .project ├── README.md ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── publish-maven.gradle ├── src │ ├── api │ │ └── overview.html │ ├── dist │ │ ├── changelog.txt │ │ ├── license.txt │ │ ├── notice.txt │ │ └── readme.txt │ ├── main │ │ ├── java │ │ │ └── sipackage │ │ │ │ ├── SIAdapterUpperPrefixHeaders.java │ │ │ │ ├── config │ │ │ │ └── xml │ │ │ │ │ ├── SIAdapterUpperPrefixInboundChannelAdapterParser.java │ │ │ │ │ ├── SIAdapterUpperPrefixNamespaceHandler.java │ │ │ │ │ ├── SIAdapterUpperPrefixOutboundChannelAdapterParser.java │ │ │ │ │ ├── SIAdapterUpperPrefixOutboundGatewayParser.java │ │ │ │ │ ├── SIAdapterUpperPrefixParserUtils.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── core │ │ │ │ ├── SIAdapterUpperPrefixExecutor.java │ │ │ │ └── package-info.java │ │ │ │ ├── inbound │ │ │ │ ├── SIAdapterUpperPrefixPollingChannelAdapter.java │ │ │ │ └── package-info.java │ │ │ │ ├── outbound │ │ │ │ ├── SIAdapterUpperPrefixOutboundGateway.java │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── support │ │ │ │ ├── SIAdapterUpperPrefixUtils.java │ │ │ │ └── package-info.java │ │ └── resources │ │ │ ├── META-INF │ │ │ ├── spring.handlers │ │ │ ├── spring.schemas │ │ │ └── spring.tooling │ │ │ └── org │ │ │ └── springframework │ │ │ └── integration │ │ │ └── config │ │ │ └── xml │ │ │ ├── spring-integration-siAdapterLowerPrefix-SI-TEMPLATE-VERSION.xsd │ │ │ └── spring-integration-siAdapterLowerPrefix.gif │ ├── reference │ │ └── docbook │ │ │ ├── SIAdapterLowerPrefix.xml │ │ │ ├── history.xml │ │ │ ├── images │ │ │ └── logo.png │ │ │ ├── index.xml │ │ │ ├── resources.xml │ │ │ └── whats-new.xml │ └── test │ │ ├── java │ │ └── sipackage │ │ │ └── config │ │ │ └── xml │ │ │ ├── SIAdapterUpperPrefixInboundChannelAdapterParserTests.java │ │ │ ├── SIAdapterUpperPrefixInboundChannelAdapterParserTests.xml │ │ │ ├── SIAdapterUpperPrefixInboundChannelAdapterParserTestsStopped.xml │ │ │ ├── SIAdapterUpperPrefixMessageHandlerParserTests.java │ │ │ ├── SIAdapterUpperPrefixMessageHandlerParserTests.xml │ │ │ ├── SIAdapterUpperPrefixOutboundGatewayParserTests.java │ │ │ └── SIAdapterUpperPrefixOutboundGatewayParserTests.xml │ │ └── resources │ │ └── log4j.properties ├── template.xml └── wizard.json ├── si-template-standalone-project ├── .classpath ├── .project ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pom.xml ├── publish-maven.gradle ├── src │ ├── data │ │ ├── file_0.xml │ │ ├── file_1.csv │ │ ├── file_2.csv │ │ ├── file_3.txt │ │ └── file_4.txt │ ├── main │ │ ├── java │ │ │ └── sipackage │ │ │ │ ├── Main.java │ │ │ │ ├── SpringIntegrationUtils.java │ │ │ │ └── TransformationHandler.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── integration │ │ │ │ └── spring-integration-context.xml │ │ │ └── log4j.xml │ └── test │ │ └── java │ │ └── sipackage │ │ └── SpringIntegrationProjectStartupTest.java ├── template.xml └── wizard.json ├── si-template-standalone-simple-project ├── .classpath ├── .project ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pom.xml ├── publish-maven.gradle ├── src │ ├── main │ │ ├── java │ │ │ └── sipackage │ │ │ │ ├── Main.java │ │ │ │ └── service │ │ │ │ └── StringConversionService.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── integration │ │ │ │ └── spring-integration-context.xml │ │ │ └── log4j.xml │ └── test │ │ └── java │ │ └── sipackage │ │ └── StringConversionServiceTest.java ├── template.xml └── wizard.json └── si-template-war-project ├── .classpath ├── .gitignore ├── .project ├── .settings ├── com.springsource.sts.config.flow.prefs ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.component └── org.eclipse.wst.common.project.facet.core.xml ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pom.xml ├── publish-maven.gradle ├── src ├── main │ ├── java │ │ └── sipackage │ │ │ ├── model │ │ │ ├── TwitterAdapterStatus.java │ │ │ ├── TwitterMessage.java │ │ │ └── TwitterMessages.java │ │ │ ├── mvc │ │ │ └── controller │ │ │ │ └── HomeController.java │ │ │ ├── service │ │ │ ├── TwitterService.java │ │ │ └── impl │ │ │ │ └── DefaultTwitterService.java │ │ │ └── support │ │ │ ├── JaxbJacksonObjectMapper.java │ │ │ └── SortOrder.java │ ├── resources │ │ ├── META-INF │ │ │ └── spring │ │ │ │ ├── integration │ │ │ │ └── spring-integration-context.xml │ │ │ │ └── mvc │ │ │ │ └── servlet-context.xml │ │ ├── log4j.xml │ │ └── oauth.properties │ └── webapp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ ├── views │ │ │ ├── errors │ │ │ │ └── 404.jsp │ │ │ ├── home.jsp │ │ │ └── includes │ │ │ │ └── taglibs.jsp │ │ ├── web.xml │ │ ├── wro.properties │ │ └── wro.xml │ │ └── assets │ │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap.css │ │ └── custom.css │ │ ├── ico │ │ └── favicon.ico │ │ └── js │ │ ├── bootstrap.js │ │ ├── custom.js │ │ ├── handlebars.js │ │ ├── jquery.js │ │ ├── jquery.periodicalupdater.js │ │ └── spin.js └── test │ └── java │ └── sipackage │ ├── JacksonTest.java │ └── SpringIntegrationTest.java ├── template.xml └── wizard.json /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .DS_Store 3 | .gradle 4 | .idea 5 | build 6 | si-gradle-plugin.iml 7 | si-gradle-plugin.ipr 8 | si-gradle-plugin.iws 9 | target/ 10 | template.zip 11 | .pmd 12 | bin 13 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | spring-integration-templates-root 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spring-integration-templates is no longer actively maintained by VMware, Inc. 2 | 3 | Spring Integration Templates 4 | ============================ 5 | 6 | This repository contains templates and plugins that will help you to get Spring Integration projects off the ground quickly. For right now the following sub-projects exist: 7 | 8 | * Spring Integration STS Plugin and Templates (**si-sts-templates**) 9 | * Spring Integration Gradle Plugin (**si-gradle-plugin**) 10 | 11 | Both the STS support and the Gradle Plugin use the same set of template projects, which are located under **si-template-projects** -------------------------------------------------------------------------------- /si-gradle-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath -------------------------------------------------------------------------------- /si-gradle-plugin/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ -------------------------------------------------------------------------------- /si-gradle-plugin/build.gradle: -------------------------------------------------------------------------------- 1 | import org.gradle.api.DefaultTask 2 | import org.gradle.api.tasks.TaskAction 3 | 4 | apply plugin: 'idea' 5 | apply plugin: 'groovy' 6 | 7 | dependencies { 8 | compile gradleApi() 9 | groovy localGroovy() 10 | } 11 | 12 | apply plugin: 'maven' 13 | 14 | repositories { 15 | maven { url 'https://repo.maven.apache.org/maven2/' } 16 | } 17 | 18 | dependencies { 19 | testCompile 'junit:junit:4.8.2' 20 | } 21 | 22 | group = 'org.springframework.integration.gradle' 23 | version = '1.0.0.M1.BUILD-SNAPSHOT' 24 | 25 | task zipTemplates(type: UpdateTemplateProjectsTask) 26 | 27 | class UpdateTemplateProjectsTask extends DefaultTask { 28 | @TaskAction 29 | def createBundle() { 30 | 31 | def ant = new groovy.util.AntBuilder() 32 | 33 | final String exclude = "target/**, build/**, .settings/**, .gradle/**, pom.xml, .project, .classpath, *.iml, .idea/**" 34 | final String templateBaseDir = "../si-template-projects"; 35 | final String templateDestDir = "src/main/resources/templates"; 36 | 37 | println 'Bundling Temaplate Projects' 38 | 39 | println "Zipping up 'si-template-war-project'" 40 | 41 | ant.jar(basedir: templateBaseDir + '/si-template-war-project', 42 | destfile: templateDestDir + '/si-template-war-project.jar', 43 | excludes: exclude) 44 | 45 | println "Zipping up 'si-template-standalone-simple'" 46 | 47 | ant.jar(basedir: templateBaseDir + '/si-template-standalone-simple-project', 48 | destfile: templateDestDir + '/si-template-standalone-simple-project.jar', 49 | excludes: exclude) 50 | 51 | println "Zipping up 'si-template-standalone'" 52 | 53 | ant.jar(basedir: templateBaseDir + '/si-template-standalone-project', 54 | destfile: templateDestDir + '/si-template-standalone-project.jar', 55 | excludes: exclude) 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /si-gradle-plugin/distribution/org/springframework/integration/gradle/si-gradle-plugin/1.0.0.M1.BUILD-SNAPSHOT/si-gradle-plugin-1.0.0.M1.BUILD-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-gradle-plugin/distribution/org/springframework/integration/gradle/si-gradle-plugin/1.0.0.M1.BUILD-SNAPSHOT/si-gradle-plugin-1.0.0.M1.BUILD-SNAPSHOT.jar -------------------------------------------------------------------------------- /si-gradle-plugin/distribution/org/springframework/integration/gradle/si-gradle-plugin/1.0.0.M1.BUILD-SNAPSHOT/si-gradle-plugin-1.0.0.M1.BUILD-SNAPSHOT.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.springframework.integration.gradle 6 | si-gradle-plugin 7 | 1.0.0.M1.BUILD-SNAPSHOT 8 | 9 | 10 | junit 11 | junit 12 | 4.8.2 13 | test 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /si-gradle-plugin/distribution/spring-integration-apply.groovy: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenRepo url: "https://raw.github.com/SpringSource/spring-integration-templates/master/si-gradle-plugin/distribution/" 4 | mavenLocal() 5 | } 6 | 7 | dependencies { 8 | classpath 'org.springframework.integration.gradle:si-gradle-plugin:1.0.0.M1.BUILD-SNAPSHOT' 9 | } 10 | } 11 | 12 | if (!project.plugins.findPlugin(org.springframework.integration.gradle.SpringIntegrationPlugin)) { 13 | project.apply(plugin: org.springframework.integration.gradle.SpringIntegrationPlugin) 14 | } 15 | 16 | -------------------------------------------------------------------------------- /si-gradle-plugin/gradle.properties: -------------------------------------------------------------------------------- 1 | version=1.0.0.M1.BUILD-SNAPSHOT -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/ProjectInformation.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle 17 | 18 | /** 19 | * 20 | * @author Gunnar Hillert 21 | * @since 1.0 22 | * 23 | */ 24 | class ProjectInformation { 25 | 26 | String projectName 27 | String basePackageName 28 | String projectGroup; 29 | String projectVersion; 30 | 31 | public ProjectInformation collect() { 32 | 33 | println("Please anser a few questions...") 34 | 35 | projectName = SpringIntegrationPluginUtils.prompt('Project Name:') 36 | basePackageName = SpringIntegrationPluginUtils.prompt('Base Package:') 37 | 38 | if (projectName) { 39 | projectGroup = SpringIntegrationPluginUtils.prompt('Group:', basePackageName.toLowerCase()) 40 | projectVersion = SpringIntegrationPluginUtils.prompt('Version:', '1.0.BUILD-SNAPSHOT') 41 | } else { 42 | println 'No project name provided.' 43 | return null; 44 | } 45 | 46 | return this; 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/SimpleProjectTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle 17 | 18 | import groovy.lang.Closure; 19 | 20 | import org.gradle.api.DefaultTask 21 | import org.gradle.api.Task; 22 | import org.gradle.api.tasks.TaskAction 23 | import org.springframework.integration.gradle.support.TemplateType; 24 | 25 | /** 26 | * 27 | * @author Gunnar Hillert 28 | * @since 1.0 29 | * 30 | */ 31 | class SimpleProjectTask extends DefaultTask { 32 | 33 | /** 34 | * Template Task 35 | */ 36 | @TaskAction 37 | def createIntegrationProject() { 38 | 39 | ProjectGenerator pg = new ProjectGenerator(); 40 | pg.createIntegrationProject(project, TemplateType.STANDALONE_SIMPLE); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/SpringIntegrationPlugin.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle 17 | 18 | import org.gradle.api.Project 19 | import org.gradle.api.Plugin 20 | import org.gradle.api.GradleException 21 | 22 | 23 | /** 24 | * 25 | * @author Gunnar Hillert 26 | * @since 1.0 27 | * 28 | */ 29 | class SpringIntegrationPlugin implements Plugin { 30 | 31 | void apply(Project project) { 32 | 33 | def group = "Spring Integration"; 34 | 35 | project.task('create-project-simple', group: group, type: SimpleProjectTask, description: 'Creates a very basic Spring Integration project (command line based)') 36 | project.task('create-project-standalone', group: group, type: SimpleProjectTask, description: 'Creates a command lined based project that uses file pollers') 37 | project.task('create-project-war', group: group, type: WarProjectTask, description: 'Creates a basic web-based (War) Spring Integration project.') 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/StandaloneProjectTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle 17 | 18 | import groovy.lang.Closure; 19 | 20 | import org.gradle.api.DefaultTask 21 | import org.gradle.api.Task; 22 | import org.gradle.api.tasks.TaskAction 23 | import org.springframework.integration.gradle.support.TemplateType; 24 | 25 | /** 26 | * 27 | * @author Gunnar Hillert 28 | * @since 1.0 29 | * 30 | */ 31 | class StandaloneProjectTask extends DefaultTask { 32 | 33 | /** 34 | * Template Task 35 | */ 36 | @TaskAction 37 | def createIntegrationProject() { 38 | 39 | ProjectGenerator pg = new ProjectGenerator(); 40 | pg.createIntegrationProject(project, TemplateType.STANDALONE); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/WarProjectTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle 17 | 18 | import org.gradle.api.DefaultTask 19 | import org.gradle.api.tasks.TaskAction 20 | import org.springframework.integration.gradle.support.TemplateType; 21 | 22 | /** 23 | * 24 | * @author Gunnar Hillert 25 | * @since 1.0 26 | * 27 | */ 28 | class WarProjectTask extends DefaultTask { 29 | 30 | /** 31 | * Template Task 32 | */ 33 | @TaskAction 34 | def createIntegrationProject() { 35 | 36 | ProjectGenerator pg = new ProjectGenerator(); 37 | pg.createIntegrationProject(project, TemplateType.WAR); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/groovy/org/springframework/integration/gradle/support/TemplateType.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.integration.gradle.support; 17 | 18 | /** 19 | * 20 | * @author Gunnar Hillert 21 | * @since 1.0 22 | * 23 | */ 24 | public enum TemplateType { 25 | 26 | STANDALONE_SIMPLE("si-template-standalone-simple-project"), 27 | STANDALONE("si-template-standalone-project"), 28 | WAR("si-template-war-project") 29 | 30 | TemplateType(String name) { this.templateName = name } 31 | 32 | private final String templateName; 33 | 34 | public int value() { return templateName } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/resources/META-INF/gradle-plugins/spring-integration.properties: -------------------------------------------------------------------------------- 1 | implementation-class=org.springframework.integration.gradle.SpringIntegrationPlugin 2 | -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/resources/templates/si-template-standalone-project.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-gradle-plugin/src/main/resources/templates/si-template-standalone-project.jar -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/resources/templates/si-template-standalone-simple-project.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-gradle-plugin/src/main/resources/templates/si-template-standalone-simple-project.jar -------------------------------------------------------------------------------- /si-gradle-plugin/src/main/resources/templates/si-template-war-project.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-gradle-plugin/src/main/resources/templates/si-template-war-project.jar -------------------------------------------------------------------------------- /si-maven-archetypes/archetype-standalone-simple/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | si-archetype-standalone-simple 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /si-sts-templates/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | -------------------------------------------------------------------------------- /si-sts-templates/README.md: -------------------------------------------------------------------------------- 1 | Spring Integration STS Templates 2 | ================================ 3 | 4 | This project provides various project templates for SpringSource Tool Suite™ (STS). 5 | 6 | # Requirements 7 | 8 | Starting with Spring Integration STS Template 1.0.0.M4, we rely on the template support provided by STS **3.0.0.M3** and later. The simplifications allowed us to significantly simplify the development and build process for the templates. 9 | 10 | # How to build the project 11 | 12 | In order to build the entire project run: 13 | 14 | $ mvn clean package 15 | 16 | This will result in *5 artifacts* being created under **target/out**: 17 | 18 | * descriptor.xml 19 | * si-template-adapter-1.0.0.RELEASE.zip 20 | * si-template-standalone-1.0.0.RELEASE.zip 21 | * si-template-standalone-simple-1.0.0.RELEASE.zip 22 | * si-template-war-1.0.0.RELEASE.zip 23 | 24 | In order to deploy to STS for **development** you have **2 options**: 25 | 26 | ## Use the Self-Hosted Templates feature in STS 27 | 28 | This approach is **Best for Development**. 29 | 30 | 1. In STS - Go to **Preferences...** --> **Spring** --> **Template Projects** 31 | 2. Mark the checkbox **Show self-hosted templates in New Template Wizard** 32 | 3. Import the individual template projects into STS, they will be immediately available as templates 33 | 34 | ## Tell STS to use the descriptor.xml file (Best for hosting your ) 35 | 36 | This approach is **Best for Deploying** your own templates. 37 | 38 | 1. In STS - Go to **Preferences...** --> **Spring** --> **Template Projects** 39 | 2. Press the **Add** Button 40 | 3. Enter the URL that points to the **descriptor.xml** (Currently only HTTP addresses are supported, local file support will be available soon - see: [STS-2666](https://issuetracker.springsource.com/browse/STS-2666)) 41 | 42 | ## Important 1 43 | 44 | A few files in the template project require absolute URLs. By default the pom is setup to use: 45 | 46 | file://${project.parent.basedir}/target/out 47 | 48 | Therefore, if you prefer a custom base location (e.g.: http://www.mysite.com/si-templates/), then you must set the 49 | base.location property such as: 50 | 51 | $ mvn package -Dbase.location=http://www.mysite.com/si-templates 52 | 53 | ## Important 2 54 | 55 | Templates are locally cached under *your_workspace/.metadata/.sts/content/*. At times during development you may need to delete the templates there for various reasons... 56 | 57 | -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.M5/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.M5/img/spring/SpringSource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.M5/img/spring/SpringSource-logo.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.RELEASE/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /si-sts-templates/builds/1.0.0.RELEASE/img/spring/spring-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/1.0.0.RELEASE/img/spring/spring-logo.png -------------------------------------------------------------------------------- /si-sts-templates/builds/org.springframework.integration.sts.templates_1.0.0.M3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/org.springframework.integration.sts.templates_1.0.0.M3.jar -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-adapter-1.0.0.M3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-adapter-1.0.0.M3.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-adapter-1.0.0.M4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-adapter-1.0.0.M4.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-adapter-1.0.0.M5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-adapter-1.0.0.M5.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-adapter-1.0.0.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-adapter-1.0.0.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-adapter-1.0.1.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-adapter-1.0.1.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.0.M2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.0.M2.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.0.M3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.0.M3.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.0.M4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.0.M4.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.0.M5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.0.M5.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.0.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.0.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-1.0.1.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-1.0.1.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.0.M2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.0.M2.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.0.M3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.0.M3.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.0.M4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.0.M4.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.0.M5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.0.M5.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.0.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.0.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-standalone-simple-1.0.1.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-standalone-simple-1.0.1.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.0.M2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.0.M2.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.0.M3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.0.M3.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.0.M4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.0.M4.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.0.M5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.0.M5.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.0.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.0.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/builds/si-template-war-1.0.1.RELEASE.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-sts-templates/builds/si-template-war-1.0.1.RELEASE.zip -------------------------------------------------------------------------------- /si-sts-templates/src/main/assembly/adapter.xml: -------------------------------------------------------------------------------- 1 | 5 | bin 6 | false 7 | 8 | zip 9 | 10 | 11 | 12 | ${project.basedir}/../si-template-projects/adapter 13 | 14 | true 15 | 16 | **/*.log 17 | **/.DS_Store 18 | **/.settings/** 19 | **/.pmd 20 | **/.gradle/** 21 | **/gradlew 22 | **/.idea/** 23 | **/build/** 24 | **/*.iml 25 | **/${project.build.directory}/** 26 | 27 | 28 | 29 | 30 | 31 | ${project.basedir}/../si-template-projects/adapter/template.xml 32 | 33 | true 34 | 35 | 36 | ${project.basedir}/../si-template-projects/adapter/.settings/org.eclipse.jdt.core.prefs 37 | .settings 38 | 39 | 40 | ${project.basedir}/../si-template-projects/adapter/gradlew 41 | 42 | 0755 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /si-sts-templates/src/main/assembly/descriptor.xml: -------------------------------------------------------------------------------- 1 | 5 | descriptor-dir 6 | false 7 | 8 | dir 9 | 10 | 11 | 12 | src/main/resources/descriptor.xml 13 | / 14 | true 15 | 16 | 17 | -------------------------------------------------------------------------------- /si-sts-templates/src/main/assembly/standalone-simple.xml: -------------------------------------------------------------------------------- 1 | 5 | bin 6 | false 7 | 8 | zip 9 | 10 | 11 | 12 | ${project.basedir}/../si-template-projects/si-template-standalone-simple-project 13 | 14 | true 15 | 16 | **/*.log 17 | **/.DS_Store 18 | **/.settings/** 19 | **/.pmd 20 | **/.idea/** 21 | **/gradle/** 22 | **/gradlew* 23 | **/publish-maven.gradle 24 | **/.gradle/** 25 | **/build.gradle 26 | **/build/** 27 | **/*.iml 28 | **/${project.build.directory}/** 29 | 30 | 31 | 32 | 33 | 34 | ${project.basedir}/../si-template-projects/si-template-standalone-simple-project/template.xml 35 | 36 | true 37 | 38 | 39 | ${project.basedir}/../si-template-projects/si-template-standalone-simple-project/.settings/org.eclipse.core.resources.prefs 40 | .settings 41 | 42 | 43 | ${project.basedir}/../si-template-projects/si-template-standalone-simple-project/.settings/org.eclipse.jdt.core.prefs 44 | .settings 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /si-sts-templates/src/main/assembly/standalone.xml: -------------------------------------------------------------------------------- 1 | 5 | bin 6 | false 7 | 8 | zip 9 | 10 | 11 | 12 | ${project.basedir}/../si-template-projects/si-template-standalone-project 13 | 14 | true 15 | 16 | **/*.log 17 | **/.DS_Store 18 | **/.settings/** 19 | **/.pmd 20 | **/.idea/** 21 | **/gradle/** 22 | **/gradlew* 23 | **/publish-maven.gradle 24 | **/.gradle/** 25 | **/build.gradle 26 | **/build/** 27 | **/*.iml 28 | **/${project.build.directory}/** 29 | 30 | 31 | 32 | 33 | 34 | ${project.basedir}/../si-template-projects/si-template-standalone-project/template.xml 35 | 36 | true 37 | 38 | 39 | ${project.basedir}/../si-template-projects/si-template-standalone-project/.settings/org.eclipse.core.resources.prefs 40 | .settings 41 | 42 | 43 | ${project.basedir}/../si-template-projects/si-template-standalone-project/.settings/org.eclipse.jdt.core.prefs 44 | .settings 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /si-sts-templates/src/main/assembly/war.xml: -------------------------------------------------------------------------------- 1 | 5 | bin 6 | false 7 | 8 | zip 9 | 10 | 11 | 12 | ${project.basedir}/../si-template-projects/si-template-war-project 13 | 14 | true 15 | 16 | **/*.log 17 | **/.DS_Store 18 | **/.settings/** 19 | **/.pmd 20 | **/.idea/** 21 | **/gradle/** 22 | **/gradlew* 23 | **/publish-maven.gradle 24 | **/.gradle/** 25 | **/build.gradle 26 | **/build/** 27 | **/*.iml 28 | **/${project.build.directory}/** 29 | 30 | 31 | 32 | 33 | 34 | ${project.basedir}/../si-template-projects/si-template-war-project/template.xml 35 | 36 | true 37 | 38 | 39 | ${project.basedir}/../si-template-projects/si-template-war-project/.settings/org.eclipse.core.resources.prefs 40 | .settings 41 | 42 | 43 | ${project.basedir}/../si-template-projects/si-template-war-project/.settings/org.eclipse.jdt.core.prefs 44 | .settings 45 | 46 | 47 | ${project.basedir}/../si-template-projects/si-template-war-project/.settings/org.eclipse.wst.common.project.facet.core.xml 48 | .settings 49 | 50 | 51 | ${project.basedir}/../si-template-projects/si-template-war-project/.settings/org.eclipse.wst.common.component 52 | .settings 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /si-template-projects/README.md: -------------------------------------------------------------------------------- 1 | Template Projects 2 | ================= 3 | 4 | This module contains the template projects that are used by the Spring Integration Gradle Plugin and the Spring Integration STS Support. These templates are individually fully functional can can be imported into your favorite IDE. The template projects support both [Maven](https://maven.apache/org) and [Gradle](https://www.gradle.org). 5 | -------------------------------------------------------------------------------- /si-template-projects/adapter/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /si-template-projects/adapter/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | adapter 4 | Spring Integration SIAdapterUpperPrefix Adapter 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.springsource.ide.eclipse.gradle.core.nature 21 | org.eclipse.jdt.core.javanature 22 | org.eclipse.jdt.groovy.core.groovyNature 23 | org.springframework.ide.eclipse.core.springnature 24 | org.eclipse.buildship.core.gradleprojectnature 25 | 26 | 27 | -------------------------------------------------------------------------------- /si-template-projects/adapter/gradle.properties: -------------------------------------------------------------------------------- 1 | version=SI-TEMPLATE-BUILD-VERSION 2 | -------------------------------------------------------------------------------- /si-template-projects/adapter/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/adapter/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /si-template-projects/adapter/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 11 12:12:48 EDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.6-bin.zip 7 | -------------------------------------------------------------------------------- /si-template-projects/adapter/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /si-template-projects/adapter/publish-maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | 3 | ext.optionalDeps = [] 4 | ext.providedDeps = [] 5 | 6 | ext.optional = { optionalDeps << it } 7 | ext.provided = { providedDeps << it } 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | customizePom(pom, project) 12 | } 13 | } 14 | 15 | def customizePom(pom, gradleProject) { 16 | pom.whenConfigured { generatedPom -> 17 | // respect 'optional' and 'provided' dependencies 18 | gradleProject.optionalDeps.each { dep -> 19 | generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true 20 | } 21 | gradleProject.providedDeps.each { dep -> 22 | generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' 23 | } 24 | 25 | // eliminate test-scoped dependencies (no need in maven central poms) 26 | generatedPom.dependencies.removeAll { dep -> 27 | dep.scope == 'test' 28 | } 29 | 30 | // add all items necessary for maven central publication 31 | generatedPom.project { 32 | name = gradleProject.description 33 | description = gradleProject.description 34 | url = 'https://github.com/SpringSource/spring-integration-extensions' 35 | organization { 36 | name = 'SpringSource' 37 | url = 'https://spring.io' 38 | } 39 | licenses { 40 | license { 41 | name 'The Apache Software License, Version 2.0' 42 | url 'https://www.apache.org/licenses/LICENSE-2.0.txt' 43 | distribution 'repo' 44 | } 45 | } 46 | scm { 47 | url = 'https://github.com/SpringSource/spring-integration-extensions' 48 | connection = 'scm:git:git://github.com/SpringSource/spring-integration-extensions' 49 | developerConnection = 'scm:git:git://github.com/SpringSource/spring-integration-extensions' 50 | } 51 | 52 | developers { 53 | developer { 54 | id = 'not specified' 55 | name = 'SI-TEMPLATE-AUTHOR' 56 | email = 'not specified' 57 | } 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /si-template-projects/adapter/src/api/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This document is the API specification for Spring Integration 4 |
5 |
6 |

7 | For further API reference and developer documentation, see the 8 | Spring 9 | Integration reference documentation. 10 | That documentation contains more detailed, developer-targeted 11 | descriptions, with conceptual overviews, definitions of terms, 12 | workarounds, and working code examples. 13 |

14 | 15 |

16 | If you are interested in commercial training, consultancy, and 17 | support for Spring Integration, please visit 18 | https://spring.io/ 19 |

20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/dist/changelog.txt: -------------------------------------------------------------------------------- 1 | Spring Integration SIAdapterUpperPrefix Adapter CHANGELOG 2 | ========================================= 3 | 4 | For the full detailed changelog, see: 5 | https://.... 6 | 7 | 8 | Changes in version SI-TEMPLATE-VERSION GA (insert date here) 9 | https://.... 10 | 11 | 12 | *** GENERAL *** 13 | 14 | Upgraded Spring Framework dependency to ... 15 | ... 16 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/dist/notice.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | == NOTICE file corresponding to section 4 d of the Apache License, == 3 | == Version 2.0, in this case for the Spring Integration distribution. == 4 | ======================================================================== 5 | 6 | This product includes software developed by 7 | the Apache Software Foundation (https://www.apache.org). 8 | 9 | The end-user documentation included with a redistribution, if any, 10 | must include the following acknowledgement: 11 | 12 | "This product includes software developed by the Spring Framework 13 | Project (https://spring.io/)." 14 | 15 | Alternatively, this acknowledgement may appear in the software itself, 16 | if and wherever such third-party acknowledgements normally appear. 17 | 18 | The names "Spring", "Spring Framework", and "Spring Integration" must 19 | not be used to endorse or promote products derived from this software 20 | without prior written permission. For written permission, please contact 21 | enquiries@springsource.com. 22 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/dist/readme.txt: -------------------------------------------------------------------------------- 1 | Spring Integration SIAdapterUpperPrefix Adapter 2 | ----------------------------------- 3 | 4 | To find out what has changed since any earlier releases, see 'changelog.txt'. 5 | 6 | Please consult the documentation located within the 'docs/reference' directory 7 | of this release and also visit the official Spring Integration home at 8 | https://spring.io/projects/spring-integration 9 | 10 | There you will find links to the forum, issue tracker, and several other resources. 11 | 12 | See https://github.com/SpringSource/spring-integration#readme for additional 13 | information including instructions on building from source. 14 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/SIAdapterUpperPrefixHeaders.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage; 18 | 19 | /** 20 | * SIAdapterUpperPrefix adapter specific message headers. 21 | * 22 | * @author SI-TEMPLATE-AUTHOR 23 | * @since SI-TEMPLATE-VERSION 24 | */ 25 | public class SIAdapterUpperPrefixHeaders { 26 | 27 | private static final String PREFIX = "siAdapterLowerPrefix_"; 28 | 29 | public static final String EXAMPLE = PREFIX + "example_"; 30 | 31 | /** Noninstantiable utility class */ 32 | private SIAdapterUpperPrefixHeaders() { 33 | throw new AssertionError(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/SIAdapterUpperPrefixInboundChannelAdapterParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.config.xml; 17 | 18 | import org.springframework.beans.BeanMetadataElement; 19 | import org.springframework.beans.factory.config.BeanDefinition; 20 | import org.springframework.beans.factory.parsing.BeanComponentDefinition; 21 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 22 | import org.springframework.beans.factory.xml.ParserContext; 23 | import org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser; 24 | import org.springframework.integration.config.xml.IntegrationNamespaceUtils; 25 | import org.w3c.dom.Element; 26 | 27 | import sipackage.inbound.SIAdapterUpperPrefixPollingChannelAdapter; 28 | 29 | /** 30 | * The SIAdapterUpperPrefix Inbound Channel adapter parser 31 | * 32 | * @author SI-TEMPLATE-AUTHOR 33 | * @since SI-TEMPLATE-VERSION 34 | * 35 | */ 36 | public class SIAdapterUpperPrefixInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser{ 37 | 38 | 39 | protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) { 40 | 41 | final BeanDefinitionBuilder siAdapterLowerPrefixPollingChannelAdapterBuilder = BeanDefinitionBuilder 42 | .genericBeanDefinition(SIAdapterUpperPrefixPollingChannelAdapter.class); 43 | 44 | final BeanDefinitionBuilder siAdapterLowerPrefixExecutorBuilder = SIAdapterUpperPrefixParserUtils.getSIAdapterUpperPrefixExecutorBuilder(element, parserContext); 45 | 46 | IntegrationNamespaceUtils.setValueIfAttributeDefined(siAdapterLowerPrefixExecutorBuilder, element, "example-property"); 47 | 48 | final BeanDefinition siAdapterLowerPrefixExecutorBuilderBeanDefinition = siAdapterLowerPrefixExecutorBuilder.getBeanDefinition(); 49 | final String channelAdapterId = this.resolveId(element, siAdapterLowerPrefixPollingChannelAdapterBuilder.getRawBeanDefinition(), parserContext); 50 | final String siAdapterLowerPrefixExecutorBeanName = channelAdapterId + ".siAdapterLowerPrefixExecutor"; 51 | 52 | parserContext.registerBeanComponent(new BeanComponentDefinition(siAdapterLowerPrefixExecutorBuilderBeanDefinition, siAdapterLowerPrefixExecutorBeanName)); 53 | 54 | siAdapterLowerPrefixPollingChannelAdapterBuilder.addConstructorArgReference(siAdapterLowerPrefixExecutorBeanName); 55 | 56 | return siAdapterLowerPrefixPollingChannelAdapterBuilder.getBeanDefinition(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/SIAdapterUpperPrefixNamespaceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.config.xml; 17 | 18 | import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHandler; 19 | 20 | /** 21 | * The namespace handler for the SIAdapterUpperPrefix namespace 22 | * 23 | * @author SI-TEMPLATE-AUTHOR 24 | * @since SI-TEMPLATE-VERSION 25 | * 26 | */ 27 | public class SIAdapterUpperPrefixNamespaceHandler extends AbstractIntegrationNamespaceHandler { 28 | 29 | /* (non-Javadoc) 30 | * @see org.springframework.beans.factory.xml.NamespaceHandler#init() 31 | */ 32 | public void init() { 33 | this.registerBeanDefinitionParser("inbound-channel-adapter", new SIAdapterUpperPrefixInboundChannelAdapterParser()); 34 | this.registerBeanDefinitionParser("outbound-channel-adapter", new SIAdapterUpperPrefixOutboundChannelAdapterParser()); 35 | this.registerBeanDefinitionParser("outbound-gateway", new SIAdapterUpperPrefixOutboundGatewayParser()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/SIAdapterUpperPrefixOutboundChannelAdapterParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.config.xml; 17 | 18 | import org.springframework.beans.factory.config.BeanDefinition; 19 | import org.springframework.beans.factory.parsing.BeanComponentDefinition; 20 | import org.springframework.beans.factory.support.AbstractBeanDefinition; 21 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 22 | import org.springframework.beans.factory.xml.ParserContext; 23 | import org.springframework.integration.config.xml.AbstractOutboundChannelAdapterParser; 24 | import org.springframework.integration.config.xml.IntegrationNamespaceUtils; 25 | import org.w3c.dom.Element; 26 | 27 | import sipackage.outbound.SIAdapterUpperPrefixOutboundGateway; 28 | 29 | /** 30 | * The parser for the SIAdapterUpperPrefix Outbound Channel Adapter. 31 | * 32 | * @author SI-TEMPLATE-AUTHOR 33 | * @since SI-TEMPLATE-VERSION 34 | * 35 | */ 36 | public class SIAdapterUpperPrefixOutboundChannelAdapterParser extends AbstractOutboundChannelAdapterParser { 37 | 38 | @Override 39 | protected boolean shouldGenerateId() { 40 | return false; 41 | } 42 | 43 | @Override 44 | protected boolean shouldGenerateIdAsFallback() { 45 | return true; 46 | } 47 | 48 | @Override 49 | protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) { 50 | 51 | final BeanDefinitionBuilder siAdapterLowerPrefixOutboundChannelAdapterBuilder = BeanDefinitionBuilder.genericBeanDefinition(SIAdapterUpperPrefixOutboundGateway.class); 52 | final BeanDefinitionBuilder siAdapterLowerPrefixExecutorBuilder = SIAdapterUpperPrefixParserUtils.getSIAdapterUpperPrefixExecutorBuilder(element, parserContext); 53 | 54 | IntegrationNamespaceUtils.setValueIfAttributeDefined(siAdapterLowerPrefixExecutorBuilder, element, "example-property"); 55 | 56 | final BeanDefinition siAdapterLowerPrefixExecutorBuilderBeanDefinition = siAdapterLowerPrefixExecutorBuilder.getBeanDefinition(); 57 | final String channelAdapterId = this.resolveId(element, siAdapterLowerPrefixOutboundChannelAdapterBuilder.getRawBeanDefinition(), parserContext); 58 | final String siAdapterLowerPrefixExecutorBeanName = channelAdapterId + ".siAdapterLowerPrefixExecutor"; 59 | 60 | parserContext.registerBeanComponent(new BeanComponentDefinition(siAdapterLowerPrefixExecutorBuilderBeanDefinition, siAdapterLowerPrefixExecutorBeanName)); 61 | 62 | siAdapterLowerPrefixOutboundChannelAdapterBuilder.addConstructorArgReference(siAdapterLowerPrefixExecutorBeanName); 63 | siAdapterLowerPrefixOutboundChannelAdapterBuilder.addPropertyValue("producesReply", Boolean.FALSE); 64 | 65 | return siAdapterLowerPrefixOutboundChannelAdapterBuilder.getBeanDefinition(); 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/SIAdapterUpperPrefixOutboundGatewayParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.config.xml; 17 | 18 | import org.springframework.beans.factory.config.BeanDefinition; 19 | import org.springframework.beans.factory.parsing.BeanComponentDefinition; 20 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 21 | import org.springframework.beans.factory.xml.ParserContext; 22 | import org.springframework.integration.config.xml.AbstractConsumerEndpointParser; 23 | import org.springframework.integration.config.xml.IntegrationNamespaceUtils; 24 | import org.springframework.util.StringUtils; 25 | import org.w3c.dom.Element; 26 | 27 | import sipackage.outbound.SIAdapterUpperPrefixOutboundGateway; 28 | 29 | /** 30 | * The Parser for SIAdapterUpperPrefix Outbound Gateway. 31 | * 32 | * @author SI-TEMPLATE-AUTHOR 33 | * @since SI-TEMPLATE-VERSION 34 | * 35 | */ 36 | public class SIAdapterUpperPrefixOutboundGatewayParser extends AbstractConsumerEndpointParser { 37 | 38 | @Override 39 | protected BeanDefinitionBuilder parseHandler(Element gatewayElement, ParserContext parserContext) { 40 | 41 | final BeanDefinitionBuilder siAdapterLowerPrefixOutboundGatewayBuilder = BeanDefinitionBuilder 42 | .genericBeanDefinition(SIAdapterUpperPrefixOutboundGateway.class); 43 | 44 | IntegrationNamespaceUtils.setValueIfAttributeDefined(siAdapterLowerPrefixOutboundGatewayBuilder, gatewayElement, "reply-timeout", "sendTimeout"); 45 | 46 | final String replyChannel = gatewayElement.getAttribute("reply-channel"); 47 | 48 | if (StringUtils.hasText(replyChannel)) { 49 | siAdapterLowerPrefixOutboundGatewayBuilder.addPropertyReference("outputChannel", replyChannel); 50 | } 51 | 52 | final BeanDefinitionBuilder siAdapterLowerPrefixExecutorBuilder = SIAdapterUpperPrefixParserUtils.getSIAdapterUpperPrefixExecutorBuilder(gatewayElement, parserContext); 53 | 54 | IntegrationNamespaceUtils.setValueIfAttributeDefined(siAdapterLowerPrefixExecutorBuilder, gatewayElement, "example-property"); 55 | 56 | final BeanDefinition siAdapterLowerPrefixExecutorBuilderBeanDefinition = siAdapterLowerPrefixExecutorBuilder.getBeanDefinition(); 57 | final String gatewayId = this.resolveId(gatewayElement, siAdapterLowerPrefixOutboundGatewayBuilder.getRawBeanDefinition(), parserContext); 58 | final String siAdapterLowerPrefixExecutorBeanName = gatewayId + ".siAdapterLowerPrefixExecutor"; 59 | 60 | parserContext.registerBeanComponent(new BeanComponentDefinition(siAdapterLowerPrefixExecutorBuilderBeanDefinition, siAdapterLowerPrefixExecutorBeanName)); 61 | 62 | siAdapterLowerPrefixOutboundGatewayBuilder.addConstructorArgReference(siAdapterLowerPrefixExecutorBeanName); 63 | 64 | return siAdapterLowerPrefixOutboundGatewayBuilder; 65 | 66 | } 67 | 68 | @Override 69 | protected String getInputChannelAttributeName() { 70 | return "request-channel"; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/SIAdapterUpperPrefixParserUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.config.xml; 17 | 18 | import org.springframework.beans.factory.config.BeanDefinition; 19 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 20 | import org.springframework.beans.factory.xml.ParserContext; 21 | import org.springframework.util.Assert; 22 | import org.w3c.dom.Element; 23 | 24 | import sipackage.core.SIAdapterUpperPrefixExecutor; 25 | 26 | /** 27 | * Contains various utility methods for parsing SIAdapterUpperPrefix Adapter 28 | * specific namesspace elements as well as for the generation of the the 29 | * respective {@link BeanDefinition}s. 30 | * 31 | * @author SI-TEMPLATE-AUTHOR 32 | * @since SI-TEMPLATE-VERSION 33 | * 34 | */ 35 | public final class SIAdapterUpperPrefixParserUtils { 36 | 37 | /** Prevent instantiation. */ 38 | private SIAdapterUpperPrefixParserUtils() { 39 | throw new AssertionError(); 40 | } 41 | 42 | /** 43 | * Create a new {@link BeanDefinitionBuilder} for the class {@link SIAdapterUpperPrefixExecutor}. 44 | * Initialize the wrapped {@link SIAdapterUpperPrefixExecutor} with common properties. 45 | * 46 | * @param element Must not be null 47 | * @param parserContext Must not be null 48 | * @return The BeanDefinitionBuilder for the SIAdapterUpperPrefixExecutor 49 | */ 50 | public static BeanDefinitionBuilder getSIAdapterUpperPrefixExecutorBuilder(final Element element, 51 | final ParserContext parserContext) { 52 | 53 | Assert.notNull(element, "The provided element must not be null."); 54 | Assert.notNull(parserContext, "The provided parserContext must not be null."); 55 | 56 | final BeanDefinitionBuilder siAdapterLowerPrefixExecutorBuilder = BeanDefinitionBuilder.genericBeanDefinition(SIAdapterUpperPrefixExecutor.class); 57 | 58 | return siAdapterLowerPrefixExecutorBuilder; 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/config/xml/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides parser classes to provide Xml namespace support for the SIAdapterUpperPrefix components. 3 | */ 4 | package sipackage.config.xml; -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/core/SIAdapterUpperPrefixExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.core; 17 | 18 | import org.apache.commons.logging.Log; 19 | import org.apache.commons.logging.LogFactory; 20 | import org.springframework.beans.factory.InitializingBean; 21 | import org.springframework.integration.Message; 22 | import org.springframework.integration.support.MessageBuilder; 23 | import org.springframework.util.Assert; 24 | 25 | /** 26 | * Bundles common core logic for the SIAdapterUpperPrefix components. 27 | * 28 | * @author SI-TEMPLATE-AUTHOR 29 | * @since SI-TEMPLATE-VERSION 30 | * 31 | */ 32 | public class SIAdapterUpperPrefixExecutor implements InitializingBean { 33 | 34 | private static final Log logger = LogFactory.getLog(SIAdapterUpperPrefixExecutor.class); 35 | 36 | private volatile String exampleProperty; 37 | 38 | /** 39 | * Constructor. 40 | */ 41 | public SIAdapterUpperPrefixExecutor() {} 42 | 43 | /** 44 | * Verifies and sets the parameters. E.g. initializes the to be used 45 | */ 46 | public void afterPropertiesSet() { 47 | Assert.hasText(this.exampleProperty, "exampleProperty must not be empty."); 48 | } 49 | 50 | /** 51 | * Executes the outbound SIAdapterUpperPrefix Operation. 52 | * 53 | * @param message The Spring Integration input message 54 | * @return The result message payload 55 | * 56 | */ 57 | public Object executeOutboundOperation(final Message message) { 58 | 59 | if (logger.isWarnEnabled()) { 60 | logger.warn("Logic not implemented, yet."); 61 | } 62 | 63 | return message.getPayload(); 64 | 65 | } 66 | 67 | /** 68 | * Execute the SIAdapterUpperPrefix operation. Delegates to 69 | * {@link SIAdapterUpperPrefixExecutor#poll(Message)}. 70 | * 71 | * @return The payload object, which may be null. 72 | */ 73 | public Object poll() { 74 | return poll(null); 75 | } 76 | 77 | /** 78 | * Execute a retrieving (polling) SIAdapterUpperPrefix operation. 79 | * 80 | * @param requestMessage May be null. 81 | * @return The payload object, which may be null. 82 | */ 83 | public Object poll(final Message requestMessage) { 84 | 85 | if (logger.isWarnEnabled()) { 86 | logger.warn("Logic not implemented, yet."); 87 | } 88 | 89 | if (requestMessage == null) { 90 | return null; 91 | } 92 | 93 | return MessageBuilder.fromMessage(requestMessage).build(); 94 | } 95 | 96 | /** 97 | * Example property to illustrate usage of properties in Spring Integration 98 | * components. Replace with your own logic. 99 | * 100 | * @param exampleProperty Must not be null 101 | */ 102 | public void setExampleProperty(String exampleProperty) { 103 | Assert.hasText(exampleProperty, "exampleProperty must be neither null nor empty"); 104 | this.exampleProperty = exampleProperty; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides core classes of the SIAdapterUpperPrefix module. 3 | */ 4 | package sipackage.core; -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/inbound/SIAdapterUpperPrefixPollingChannelAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.inbound; 17 | 18 | import org.springframework.integration.Message; 19 | import org.springframework.integration.context.IntegrationObjectSupport; 20 | import org.springframework.integration.core.MessageSource; 21 | import org.springframework.integration.support.MessageBuilder; 22 | import org.springframework.util.Assert; 23 | 24 | import sipackage.core.SIAdapterUpperPrefixExecutor; 25 | 26 | /** 27 | * @author SI-TEMPLATE-AUTHOR 28 | * @since SI-TEMPLATE-VERSION 29 | * 30 | */ 31 | public class SIAdapterUpperPrefixPollingChannelAdapter extends IntegrationObjectSupport implements MessageSource{ 32 | 33 | private final SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor; 34 | 35 | /** 36 | * Constructor taking a {@link SIAdapterUpperPrefixExecutor} that provide all required SIAdapterUpperPrefix 37 | * functionality. 38 | * 39 | * @param siAdapterLowerPrefixExecutor Must not be null. 40 | */ 41 | public SIAdapterUpperPrefixPollingChannelAdapter(SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor) { 42 | super(); 43 | Assert.notNull(siAdapterLowerPrefixExecutor, "siAdapterLowerPrefixExecutor must not be null."); 44 | this.siAdapterLowerPrefixExecutor = siAdapterLowerPrefixExecutor; 45 | } 46 | 47 | /** 48 | * Check for mandatory attributes 49 | */ 50 | @Override 51 | protected void onInit() throws Exception { 52 | super.onInit(); 53 | } 54 | 55 | /** 56 | * Uses {@link SIAdapterUpperPrefixExecutor#poll()} to executes the SIAdapterUpperPrefix operation. 57 | * 58 | * If {@link SIAdapterUpperPrefixExecutor#poll()} returns null, this method will return 59 | * null. Otherwise, a new {@link Message} is constructed and returned. 60 | */ 61 | public Message receive() { 62 | 63 | final Object payload = siAdapterLowerPrefixExecutor.poll(); 64 | 65 | if (payload == null) { 66 | return null; 67 | } 68 | 69 | return MessageBuilder.withPayload(payload).build(); 70 | } 71 | 72 | @Override 73 | public String getComponentType(){ 74 | return "siAdapterLowerPrefix:inbound-channel-adapter"; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/inbound/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides inbound Spring Integration SIAdapterUpperPrefix components. 3 | */ 4 | package sipackage.inbound; -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/outbound/SIAdapterUpperPrefixOutboundGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage.outbound; 18 | 19 | import org.springframework.integration.Message; 20 | import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; 21 | import org.springframework.integration.support.MessageBuilder; 22 | import org.springframework.util.Assert; 23 | 24 | import sipackage.core.SIAdapterUpperPrefixExecutor; 25 | 26 | /** 27 | * 28 | * @author SI-TEMPLATE-AUTHOR 29 | * @since SI-TEMPLATE-VERSION 30 | * 31 | */ 32 | public class SIAdapterUpperPrefixOutboundGateway extends AbstractReplyProducingMessageHandler { 33 | 34 | private final SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor; 35 | private boolean producesReply = true; //false for outbound-channel-adapter, true for outbound-gateway 36 | 37 | /** 38 | * Constructor taking an {@link SIAdapterUpperPrefixExecutor} that wraps common 39 | * SIAdapterUpperPrefix Operations. 40 | * 41 | * @param siAdapterLowerPrefixExecutor Must not be null 42 | * 43 | */ 44 | public SIAdapterUpperPrefixOutboundGateway(SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor) { 45 | Assert.notNull(siAdapterLowerPrefixExecutor, "siAdapterLowerPrefixExecutor must not be null."); 46 | this.siAdapterLowerPrefixExecutor = siAdapterLowerPrefixExecutor; 47 | } 48 | 49 | /** 50 | * 51 | */ 52 | @Override 53 | protected void onInit() { 54 | super.onInit(); 55 | } 56 | 57 | @Override 58 | protected Object handleRequestMessage(Message requestMessage) { 59 | 60 | final Object result; 61 | 62 | result = this.siAdapterLowerPrefixExecutor.executeOutboundOperation(requestMessage); 63 | 64 | if (result == null || !producesReply) { 65 | return null; 66 | } 67 | 68 | return MessageBuilder.withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); 69 | 70 | } 71 | 72 | /** 73 | * If set to 'false', this component will act as an Outbound Channel Adapter. 74 | * If not explicitly set this property will default to 'true'. 75 | * 76 | * @param producesReply Defaults to 'true'. 77 | * 78 | */ 79 | public void setProducesReply(boolean producesReply) { 80 | this.producesReply = producesReply; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/outbound/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides Spring Integration components for doing outbound operations. 3 | */ 4 | package sipackage.outbound; -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Root package of the SIAdapterUpperPrefix Module. 3 | */ 4 | package sipackage; -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/support/SIAdapterUpperPrefixUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.support; 17 | 18 | 19 | /** 20 | * Contains utility methods used by the SIAdapterUpperPrefix components. 21 | * 22 | * @author SI-TEMPLATE-AUTHOR 23 | * @since SI-TEMPLATE-VERSION 24 | * 25 | */ 26 | public final class SIAdapterUpperPrefixUtils { 27 | 28 | /** Prevent instantiation. */ 29 | private SIAdapterUpperPrefixUtils() { 30 | throw new AssertionError(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/java/sipackage/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides various support classes used across Spring Integration SIAdapterUpperPrefix Components. 3 | */ 4 | package sipackage.support; 5 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix=sipackage.config.xml.SIAdapterUpperPrefixNamespaceHandler -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/resources/META-INF/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix/spring-integration-siAdapterLowerPrefix-SI-TEMPLATE-VERSION.xsd=org/springframework/integration/config/xml/spring-integration-siAdapterLowerPrefix-SI-TEMPLATE-VERSION.xsd 2 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix/spring-integration-siAdapterLowerPrefix.xsd=org/springframework/integration/config/xml/spring-integration-siAdapterLowerPrefix-SI-TEMPLATE-VERSION.xsd -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/resources/META-INF/spring.tooling: -------------------------------------------------------------------------------- 1 | # Tooling related information for the integration SIAdapterUpperPrefix namespace 2 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix@name=integration SIAdapterUpperPrefix Namespace 3 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix@prefix=int-siAdapterLowerPrefix 4 | http\://www.springframework.org/schema/integration/siAdapterLowerPrefix@icon=org/springframework/integration/config/xml/spring-integration-siAdapterLowerPrefix.gif 5 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/main/resources/org/springframework/integration/config/xml/spring-integration-siAdapterLowerPrefix.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/adapter/src/main/resources/org/springframework/integration/config/xml/spring-integration-siAdapterLowerPrefix.gif -------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/SIAdapterLowerPrefix.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | SIAdapterUpperPrefix Adapter 5 | 6 | The Spring Integration SIAdapterUpperPrefix Adapter provides... 7 | 8 | 9 | 10 | Outbound Channel adapter 11 | 12 | 13 | Outbound Gateway 14 | 15 | 16 | Inbound Channel Adapter 17 | 18 | 19 | 20 |
21 | Java Implementation 22 | Each of the provided components will use the 23 | sipackage.core.SIAdapterUpperPrefixExecutor 24 | class... 25 | 26 |
27 |
28 | Common Configuration Attributes 29 | 30 | Certain configuration parameters are shared amongst all SIAdapterUpperPrefix 31 | components and are described below: 32 | 33 | 34 | auto-startup 35 | 36 | Lifecycle attribute signaling if this component should 37 | be started during Application Context startup. 38 | Defaults to true. 39 | Optional. 40 | 41 | 42 | id 43 | 44 | Identifies the underlying Spring bean definition, which 45 | is an instance of either EventDrivenConsumer 46 | or PollingConsumer. 47 | Optional. 48 | 49 | 50 |
51 | 52 |
53 | Outbound Channel Adapter 54 | 55 | The SIAdapterUpperPrefix Outbound channel adapter allows you to... 56 | 57 |
58 |
59 | Outbound Gateway 60 | 61 | Outbound gateways are similar to outbound channel adapters except that it can also be used to 62 | get a result on the reply channel after performing 63 | the given... 64 | 65 |
66 |
67 | Inbound Channel Adapter 68 | 69 | An inbound channel adapter is used to execute... 70 | 71 |
72 | 73 |
-------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/history.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | Change History 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/adapter/src/reference/docbook/images/logo.png -------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | Spring Integration SIAdapterUpperPrefix Adapter 7 | SIAdapterUpperPrefix Adapter ${version} 8 | Spring Integration 9 | ${version} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | SI-TEMPLATE-AUTHOR 24 | 25 | 26 | © SpringSource Inc., 2013 27 | 28 | 29 | 30 | 31 | 32 | 33 | What's new? 34 | 35 | 36 | For those who are already familiar with Spring Integration, this 37 | chapter 38 | provides a brief overview of the new features of version 2.2. If you are 39 | interested in the changes and features, that were introduced in 40 | earlier 41 | versions, please take a look at chapter: 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Integration Adapters 52 | 53 | This section covers the various Channel Adapters and Messaging 54 | Gateways provided 55 | by Spring Integration to support Message-based communication with 56 | external systems. 57 | 58 | 59 | 60 | 61 | 62 | Appendices 63 | 64 | Advanced Topics and Additional Resources 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Additional Resources 5 | 6 |
7 | Spring Integration Home 8 | 9 | The definitive source of information about Spring Integration is the 10 | Spring Integration Home at 11 | https://spring.io/. That site serves as a hub of 12 | information and is the best place to find up-to-date announcements about the project as well as links to 13 | articles, blogs, and new sample applications. 14 | 15 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/reference/docbook/whats-new.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | What's new? 6 | 7 | This chapter provides an overview of the new features and improvements 8 | that have been added to the SIAdapterUpperPrefix Adapter: 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixInboundChannelAdapterParserTests.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixInboundChannelAdapterParserTestsStopped.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixMessageHandlerParserTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * https://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package sipackage.config.xml; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | import static org.junit.Assert.assertNotNull; 17 | 18 | import org.junit.After; 19 | import org.junit.Test; 20 | import org.springframework.context.ConfigurableApplicationContext; 21 | import org.springframework.context.support.ClassPathXmlApplicationContext; 22 | import org.springframework.integration.channel.AbstractMessageChannel; 23 | import org.springframework.integration.endpoint.EventDrivenConsumer; 24 | import org.springframework.integration.test.util.TestUtils; 25 | 26 | import sipackage.core.SIAdapterUpperPrefixExecutor; 27 | 28 | /** 29 | * 30 | * @author SI-TEMPLATE-AUTHOR 31 | * @since SI-TEMPLATE-VERSION 32 | * 33 | */ 34 | public class SIAdapterUpperPrefixMessageHandlerParserTests { 35 | 36 | private ConfigurableApplicationContext context; 37 | 38 | private EventDrivenConsumer consumer; 39 | 40 | @Test 41 | public void testMessageHandlerParser() throws Exception { 42 | setUp("SIAdapterUpperPrefixMessageHandlerParserTests.xml", getClass()); 43 | 44 | 45 | final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class); 46 | 47 | assertEquals("target", inputChannel.getComponentName()); 48 | 49 | final SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor = TestUtils.getPropertyValue(this.consumer, "handler.siAdapterLowerPrefixExecutor", SIAdapterUpperPrefixExecutor.class); 50 | 51 | assertNotNull(siAdapterLowerPrefixExecutor); 52 | 53 | final String exsampleProperty = TestUtils.getPropertyValue(siAdapterLowerPrefixExecutor, "exampleProperty", String.class); 54 | 55 | assertEquals("I am a sample property", exsampleProperty); 56 | 57 | } 58 | 59 | @Test 60 | public void testExecutorBeanIdNaming() throws Exception { 61 | 62 | this.context = new ClassPathXmlApplicationContext("SIAdapterUpperPrefixMessageHandlerParserTests.xml", getClass()); 63 | assertNotNull(context.getBean("siAdapterLowerPrefixOutboundChannelAdapter.siAdapterLowerPrefixExecutor", SIAdapterUpperPrefixExecutor.class)); 64 | 65 | } 66 | 67 | @After 68 | public void tearDown(){ 69 | if(context != null){ 70 | context.close(); 71 | } 72 | } 73 | 74 | public void setUp(String name, Class cls){ 75 | context = new ClassPathXmlApplicationContext(name, cls); 76 | consumer = this.context.getBean("siAdapterLowerPrefixOutboundChannelAdapter", EventDrivenConsumer.class); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixMessageHandlerParserTests.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixOutboundGatewayParserTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * https://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package sipackage.config.xml; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | import static org.junit.Assert.assertNotNull; 17 | 18 | import org.junit.After; 19 | import org.junit.Test; 20 | import org.springframework.context.ConfigurableApplicationContext; 21 | import org.springframework.context.support.ClassPathXmlApplicationContext; 22 | import org.springframework.integration.channel.AbstractMessageChannel; 23 | import org.springframework.integration.endpoint.EventDrivenConsumer; 24 | import org.springframework.integration.test.util.TestUtils; 25 | 26 | import sipackage.core.SIAdapterUpperPrefixExecutor; 27 | import sipackage.outbound.SIAdapterUpperPrefixOutboundGateway; 28 | 29 | /** 30 | * @author SI-TEMPLATE-AUTHOR 31 | * @since SI-TEMPLATE-VERSION 32 | * 33 | */ 34 | public class SIAdapterUpperPrefixOutboundGatewayParserTests { 35 | 36 | private ConfigurableApplicationContext context; 37 | 38 | private EventDrivenConsumer consumer; 39 | 40 | @Test 41 | public void testOutboundGatewayParser() throws Exception { 42 | setUp("SIAdapterUpperPrefixOutboundGatewayParserTests.xml", getClass(), "siAdapterLowerPrefixOutboundGateway"); 43 | 44 | 45 | final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class); 46 | 47 | assertEquals("in", inputChannel.getComponentName()); 48 | 49 | final SIAdapterUpperPrefixOutboundGateway siAdapterLowerPrefixOutboundGateway = TestUtils.getPropertyValue(this.consumer, "handler", SIAdapterUpperPrefixOutboundGateway.class); 50 | 51 | long sendTimeout = TestUtils.getPropertyValue(siAdapterLowerPrefixOutboundGateway, "messagingTemplate.sendTimeout", Long.class); 52 | 53 | assertEquals(100, sendTimeout); 54 | 55 | final SIAdapterUpperPrefixExecutor siAdapterLowerPrefixExecutor = TestUtils.getPropertyValue(this.consumer, "handler.siAdapterLowerPrefixExecutor", SIAdapterUpperPrefixExecutor.class); 56 | 57 | assertNotNull(siAdapterLowerPrefixExecutor); 58 | 59 | final String exsampleProperty = TestUtils.getPropertyValue(siAdapterLowerPrefixExecutor, "exampleProperty", String.class); 60 | 61 | assertEquals("I am a sample property", exsampleProperty); 62 | 63 | 64 | } 65 | 66 | @Test 67 | public void testExecutorBeanIdNaming() throws Exception { 68 | 69 | this.context = new ClassPathXmlApplicationContext("SIAdapterUpperPrefixOutboundGatewayParserTests.xml", getClass()); 70 | assertNotNull(context.getBean("siAdapterLowerPrefixOutboundGateway.siAdapterLowerPrefixExecutor", SIAdapterUpperPrefixExecutor.class)); 71 | 72 | } 73 | 74 | @After 75 | public void tearDown() { 76 | if (context != null) { 77 | context.close(); 78 | } 79 | } 80 | 81 | public void setUp(String name, Class cls, String gatewayId) { 82 | context = new ClassPathXmlApplicationContext(name, cls); 83 | consumer = this.context.getBean(gatewayId, EventDrivenConsumer.class); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/java/sipackage/config/xml/SIAdapterUpperPrefixOutboundGatewayParserTests.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /si-template-projects/adapter/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=WARN, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p [%t][%c] %m%n 6 | 7 | log4j.category.org.springframework.integration=WARN 8 | log4j.category.sipackage=INFO -------------------------------------------------------------------------------- /si-template-projects/adapter/template.xml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /si-template-projects/adapter/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "elements" : { 4 | "element" : [ 5 | { 6 | "name" : "SIAdapterUpperPrefix", 7 | "description" : "Please enter the adapter name prefix (camel case)", 8 | "defaultValue": "MyAdapter", 9 | "type" : "java.lang.String", 10 | "page" : 0, 11 | "required" : true, 12 | }, 13 | { 14 | "name" : "siAdapterLowerPrefix", 15 | "description" : "Please enter the id prefix (lower case)", 16 | "defaultValue": "myadapter", 17 | "type" : "java.lang.String", 18 | "page" : 0, 19 | "required" : true, 20 | }, 21 | { 22 | "name" : "SI-TEMPLATE-GROUP-ID", 23 | "description" : "Please enter a 'groupId, e.g. org.springintegration.adapter'", 24 | "type" : "java.lang.String", 25 | "page" : 0, 26 | "required" : true, 27 | }, 28 | { 29 | "name" : "SI-TEMPLATE-BUILD-VERSION", 30 | "description" : "Please enter a build version e.g. '1.0.0.BUILD-SNAPSHOT'", 31 | "defaultValue": "1.0.0.BUILD-SNAPSHOT", 32 | "type" : "java.lang.String", 33 | "page" : 0, 34 | "required" : true, 35 | }, 36 | { 37 | "name" : "SI-TEMPLATE-VERSION", 38 | "description" : "Please enter a short version e.g. '1.0' (For JavaDocs, XSDs)", 39 | "defaultValue": "1.0", 40 | "type" : "java.lang.String", 41 | "page" : 0, 42 | "required" : true, 43 | "replaceKind" : "fixedtoken" 44 | }, 45 | { 46 | "name" : "SI-TEMPLATE-AUTHOR", 47 | "description" : "Please enter the author name", 48 | "defaultValue": "Your name", 49 | "type" : "java.lang.String", 50 | "page" : 0, 51 | "required" : true, 52 | }, 53 | { 54 | "name" : "topLevelPackage", 55 | "description" : "Please specify the top-level package e.g. com.mycompany.myapp", 56 | "type" : "java.lang.String", 57 | "page" : 0, 58 | "required" : true, 59 | "pattern" : "\\w+(\\.\\w+)*", 60 | "replaceKind" : "topLevelPackage" 61 | } 62 | ] 63 | }, 64 | "topLevelPackage" : "sipackage", 65 | "projectName" : "si-template-project-name", 66 | "pages" : { 67 | "page" : [ 68 | { 69 | "order" : 0, 70 | "description" : "Project Settings" 71 | } 72 | ] 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | si-template-project-name 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.springframework.ide.eclipse.core.springbuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.springframework.ide.eclipse.core.springnature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.m2e.core.maven2Nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/README.md: -------------------------------------------------------------------------------- 1 | Spring Integration - Standalone Template (Using the File Adapter) 2 | ================================================================================ 3 | 4 | This template includes a demonstration of Spring Integration's File support. The 5 | template includes commonly used components such as: 6 | 7 | * Transformers 8 | * Routers 9 | * Wire-taps (For logging) 10 | 11 | You can run the application by either 12 | 13 | * running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application) 14 | * or from the command line: 15 | - mvn package 16 | - mvn exec:java 17 | 18 | -------------------------------------------------------------------------------- 19 | 20 | For help please take a look at the Spring Integration documentation: 21 | 22 | https://spring.io/projects/spring-integration 23 | 24 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'application' 3 | apply plugin: 'eclipse' 4 | apply plugin: 'idea' 5 | apply from: 'publish-maven.gradle' 6 | 7 | repositories { 8 | maven { url 'https://repo.maven.apache.org/maven2/' } 9 | maven { url 'https://repo.springsource.org/libs-milestone' } 10 | } 11 | 12 | group = "SI-TEMPLATE-GROUP-ID" 13 | version = "SI-TEMPLATE-BUILD-VERSION" 14 | 15 | sourceCompatibility=1.6 16 | targetCompatibility=1.6 17 | 18 | ext { 19 | junitVersion = '4.11' 20 | log4jVersion = '1.2.17' 21 | springIntegrationVersion = '2.2.4.RELEASE' 22 | } 23 | 24 | eclipse { 25 | project { 26 | natures += 'org.springframework.ide.eclipse.core.springnature' 27 | } 28 | } 29 | 30 | mainClassName = "sipackage.Main" 31 | 32 | run{ 33 | standardInput = System.in 34 | } 35 | 36 | dependencies { 37 | compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion" 38 | compile "org.springframework.integration:spring-integration-file:$springIntegrationVersion" 39 | compile "log4j:log4j:$log4jVersion" 40 | compile "commons-io:commons-io:2.4" 41 | 42 | testCompile "junit:junit-dep:$junitVersion" 43 | } 44 | 45 | task wrapper(type: Wrapper) { 46 | description = 'Generates gradlew[.bat] scripts' 47 | gradleVersion = '1.6' 48 | } -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/si-template-standalone-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 05 18:07:53 EDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.5-bin.zip 7 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | SI-TEMPLATE-GROUP-ID 6 | SI-TEMPLATE-ARTIFACT-ID 7 | SI-TEMPLATE-BUILD-VERSION 8 | jar 9 | 10 | si-template-project-name 11 | https://www.springsource.org/spring-integration 12 | 13 | 14 | 2.2.1 15 | 16 | 17 | 18 | UTF-8 19 | 2.2.4.RELEASE 20 | 1.2.17 21 | 4.11 22 | 23 | 24 | 25 | 26 | repo.springsource.org.milestone 27 | Spring Framework Maven Milestone Repository 28 | https://repo.springsource.org/milestone 29 | 30 | 31 | 32 | 33 | 34 | 35 | maven-eclipse-plugin 36 | 2.9 37 | 38 | 39 | org.springframework.ide.eclipse.core.springnature 40 | 41 | 42 | org.springframework.ide.eclipse.core.springbuilder 43 | 44 | true 45 | true 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-compiler-plugin 51 | 3.0 52 | 53 | 1.6 54 | 1.6 55 | -Xlint:all 56 | true 57 | true 58 | 59 | 60 | 61 | org.codehaus.mojo 62 | exec-maven-plugin 63 | 1.2.1 64 | 65 | sipackage.Main 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | junit 77 | junit 78 | ${junit.version} 79 | test 80 | 81 | 82 | 83 | 84 | 85 | org.springframework.integration 86 | spring-integration-core 87 | ${spring.integration.version} 88 | 89 | 90 | 91 | org.springframework.integration 92 | spring-integration-file 93 | ${spring.integration.version} 94 | 95 | 96 | 97 | 98 | 99 | log4j 100 | log4j 101 | ${log4j.version} 102 | 103 | 104 | 105 | 106 | 107 | commons-io 108 | commons-io 109 | 2.4 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/publish-maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | 3 | ext.optionalDeps = [] 4 | ext.providedDeps = [] 5 | 6 | ext.optional = { optionalDeps << it } 7 | ext.provided = { providedDeps << it } 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | customizePom(pom, project) 12 | } 13 | } 14 | 15 | def customizePom(pom, gradleProject) { 16 | pom.whenConfigured { generatedPom -> 17 | // respect 'optional' and 'provided' dependencies 18 | gradleProject.optionalDeps.each { dep -> 19 | generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true 20 | } 21 | gradleProject.providedDeps.each { dep -> 22 | generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' 23 | } 24 | 25 | // eliminate test-scoped dependencies (no need in maven central poms) 26 | generatedPom.dependencies.removeAll { dep -> 27 | dep.scope == 'test' 28 | } 29 | 30 | // add all items necessary for maven central publication 31 | generatedPom.project { 32 | name = gradleProject.description 33 | description = gradleProject.description 34 | url = 'https://www.springsource.org/spring-integration' 35 | organization { 36 | name = 'SpringSource' 37 | url = 'https://spring.io' 38 | } 39 | 40 | licenses { 41 | license { 42 | name 'The Apache Software License, Version 2.0' 43 | url 'https://www.apache.org/licenses/LICENSE-2.0.txt' 44 | distribution 'repo' 45 | } 46 | } 47 | 48 | developers { 49 | developer { 50 | id = 'not specified' 51 | name = 'SI-TEMPLATE-AUTHOR' 52 | email = 'not specified' 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/data/file_0.xml: -------------------------------------------------------------------------------- 1 | 2 | welcome to spring integration 3 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/data/file_1.csv: -------------------------------------------------------------------------------- 1 | welcome,to,spring,integration -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/data/file_2.csv: -------------------------------------------------------------------------------- 1 | hello 2 -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/data/file_3.txt: -------------------------------------------------------------------------------- 1 | welcome to spring integration -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/data/file_4.txt: -------------------------------------------------------------------------------- 1 | welcome to spring integration -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/main/java/sipackage/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage; 17 | 18 | import java.util.Scanner; 19 | 20 | import org.apache.log4j.Logger; 21 | import org.springframework.context.support.AbstractApplicationContext; 22 | import org.springframework.context.support.ClassPathXmlApplicationContext; 23 | 24 | 25 | /** 26 | * Starts the Spring Context and will initialize the Spring Integration routes. 27 | * 28 | * @author SI-TEMPLATE-AUTHOR 29 | * @since SI-TEMPLATE-VERSION 30 | * 31 | */ 32 | public final class Main { 33 | 34 | private static final Logger LOGGER = Logger.getLogger(Main.class); 35 | 36 | private Main() { } 37 | 38 | /** 39 | * Load the Spring Integration Application Context 40 | * 41 | * @param args - command line arguments 42 | */ 43 | public static void main(final String... args) { 44 | 45 | if (LOGGER.isInfoEnabled()) { 46 | LOGGER.info("\n=========================================================" 47 | + "\n " 48 | + "\n Welcome to Spring Integration! " 49 | + "\n " 50 | + "\n For more information please visit: " 51 | + "\n https://spring.io/projects/spring-integration " 52 | + "\n " 53 | + "\n=========================================================" ); 54 | } 55 | 56 | final AbstractApplicationContext context = 57 | new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/*-context.xml"); 58 | 59 | context.registerShutdownHook(); 60 | 61 | SpringIntegrationUtils.displayDirectories(context); 62 | 63 | final Scanner scanner = new Scanner(System.in); 64 | 65 | if (LOGGER.isInfoEnabled()) { 66 | LOGGER.info("\n=========================================================" 67 | + "\n " 68 | + "\n Please press 'q + Enter' to quit the application. " 69 | + "\n " 70 | + "\n=========================================================" ); 71 | } 72 | 73 | while (!scanner.hasNext("q")) { 74 | //Do nothing unless user presses 'q' to quit. 75 | } 76 | 77 | if (LOGGER.isInfoEnabled()) { 78 | LOGGER.info("Exiting application...bye."); 79 | } 80 | 81 | System.exit(0); 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/main/java/sipackage/SpringIntegrationUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage; 18 | 19 | import java.io.File; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | import org.apache.commons.logging.Log; 25 | import org.apache.commons.logging.LogFactory; 26 | import org.springframework.beans.DirectFieldAccessor; 27 | import org.springframework.context.ApplicationContext; 28 | import org.springframework.expression.Expression; 29 | import org.springframework.integration.file.FileReadingMessageSource; 30 | import org.springframework.integration.file.FileWritingMessageHandler; 31 | 32 | /** 33 | * Displays the names of the input and output directories. 34 | * 35 | * @author SI-TEMPLATE-AUTHOR 36 | * @since SI-TEMPLATE-VERSION 37 | * 38 | */ 39 | public final class SpringIntegrationUtils { 40 | 41 | private static final Log logger = LogFactory.getLog(SpringIntegrationUtils.class); 42 | 43 | private SpringIntegrationUtils() { } 44 | 45 | /** 46 | * Helper Method to dynamically determine and display input and output 47 | * directories as defined in the Spring Integration context. 48 | * 49 | * @param context Spring Application Context 50 | */ 51 | public static void displayDirectories(final ApplicationContext context) { 52 | 53 | final File inDir = (File) new DirectFieldAccessor(context.getBean(FileReadingMessageSource.class)).getPropertyValue("directory"); 54 | 55 | final Map fileWritingMessageHandlers = context.getBeansOfType(FileWritingMessageHandler.class); 56 | 57 | final List outputDirectories = new ArrayList(); 58 | 59 | for (final FileWritingMessageHandler messageHandler : fileWritingMessageHandlers.values()) { 60 | final Expression outDir = (Expression) new DirectFieldAccessor(messageHandler).getPropertyValue("destinationDirectoryExpression"); 61 | outputDirectories.add(outDir.getExpressionString()); 62 | } 63 | 64 | final StringBuilder stringBuilder = new StringBuilder(); 65 | 66 | stringBuilder.append("\n========================================================="); 67 | stringBuilder.append("\n"); 68 | stringBuilder.append("\n Input directory is : '" + inDir.getAbsolutePath() + "'"); 69 | 70 | for (final String outputDirectory : outputDirectories) { 71 | stringBuilder.append("\n Output directory is: '" + outputDirectory + "'"); 72 | } 73 | 74 | stringBuilder.append("\n\n========================================================="); 75 | 76 | logger.info(stringBuilder.toString()); 77 | 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/main/java/sipackage/TransformationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.util.Locale; 22 | 23 | import org.apache.commons.io.FileUtils; 24 | import org.apache.commons.io.FilenameUtils; 25 | import org.springframework.integration.Message; 26 | import org.springframework.integration.annotation.Transformer; 27 | import org.springframework.integration.file.FileHeaders; 28 | import org.springframework.integration.support.MessageBuilder; 29 | 30 | /** 31 | * This Spring Integration transformation handler takes the input file, converts 32 | * the file into a string, converts the file contents into an upper-case string 33 | * and then sets a few Spring Integration message headers. 34 | * 35 | * @author SI-TEMPLATE-AUTHOR 36 | * @since SI-TEMPLATE-VERSION 37 | */ 38 | public class TransformationHandler { 39 | 40 | /** 41 | * Actual Spring Integration transformation handler. 42 | * 43 | * @param inputMessage Spring Integration input message 44 | * @return New Spring Integration message with updated headers 45 | */ 46 | @Transformer 47 | public Message handleFile(final Message inputMessage) { 48 | 49 | final File inputFile = inputMessage.getPayload(); 50 | final String filename = inputFile.getName(); 51 | final String fileExtension = FilenameUtils.getExtension(filename); 52 | 53 | final String inputAsString; 54 | 55 | try { 56 | inputAsString = FileUtils.readFileToString(inputFile); 57 | } catch (IOException e) { 58 | throw new IllegalStateException(e); 59 | } 60 | 61 | final Message message = MessageBuilder.withPayload(inputAsString.toUpperCase(Locale.ENGLISH)) 62 | .setHeader(FileHeaders.FILENAME, filename) 63 | .setHeader(FileHeaders.ORIGINAL_FILE, inputFile) 64 | .setHeader("file_size", inputFile.length()) 65 | .setHeader("file_extension", fileExtension) 66 | .build(); 67 | 68 | return message; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/main/resources/META-INF/spring/integration/spring-integration-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 20 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 36 | 37 | 38 | 39 | 40 | 42 | 45 | 46 | 49 | 50 | 53 | 54 | 56 | 57 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/src/test/java/sipackage/SpringIntegrationProjectStartupTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage; 18 | 19 | import org.junit.Test; 20 | import org.springframework.context.ApplicationContext; 21 | import org.springframework.context.support.ClassPathXmlApplicationContext; 22 | 23 | import sipackage.SpringIntegrationUtils; 24 | 25 | /** 26 | * Verify that the Spring Integration Application Context starts successfully. 27 | * 28 | * @author SI-TEMPLATE-AUTHOR 29 | * @since SI-TEMPLATE-VERSION 30 | * 31 | */ 32 | public class SpringIntegrationProjectStartupTest { 33 | 34 | @Test 35 | public void testStartupOfSpringInegrationContext() throws Exception{ 36 | final ApplicationContext context 37 | = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", 38 | SpringIntegrationProjectStartupTest.class); 39 | SpringIntegrationUtils.displayDirectories(context); 40 | Thread.sleep(2000); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/template.xml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-project/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "elements" : { 4 | "element" : [ 5 | { 6 | "name" : "SI-TEMPLATE-GROUP-ID", 7 | "description" : "Please enter a 'groupId'", 8 | "type" : "java.lang.String", 9 | "page" : 0, 10 | "required" : true, 11 | }, 12 | { 13 | "name" : "SI-TEMPLATE-ARTIFACT-ID", 14 | "description" : "Please enter an 'artifactId'", 15 | "type" : "java.lang.String", 16 | "page" : 0, 17 | "required" : true, 18 | }, 19 | { 20 | "name" : "SI-TEMPLATE-BUILD-VERSION", 21 | "description" : "Please enter a build version e.g. '1.0.0.BUILD-SNAPSHOT'", 22 | "defaultValue": "1.0.0.BUILD-SNAPSHOT", 23 | "type" : "java.lang.String", 24 | "page" : 0, 25 | "required" : true, 26 | }, 27 | { 28 | "name" : "SI-TEMPLATE-VERSION", 29 | "description" : "Please enter a short version e.g. '1.0' (For JavaDocs)", 30 | "defaultValue": "1.0", 31 | "type" : "java.lang.String", 32 | "page" : 0, 33 | "required" : true, 34 | }, 35 | { 36 | "name" : "SI-TEMPLATE-AUTHOR", 37 | "description" : "Please enter the author name", 38 | "defaultValue": "Your name", 39 | "type" : "java.lang.String", 40 | "page" : 0, 41 | "required" : true, 42 | }, 43 | { 44 | "name" : "topLevelPackage", 45 | "description" : "Please specify the top-level package e.g. com.mycompany.myapp", 46 | "type" : "java.lang.String", 47 | "page" : 0, 48 | "required" : true, 49 | "pattern" : "\\w+(\\.\\w+)*", 50 | "replaceKind" : "topLevelPackage" 51 | } 52 | ] 53 | }, 54 | "topLevelPackage" : "sipackage", 55 | "projectName" : "si-template-project-name", 56 | "pages" : { 57 | "page" : [ 58 | { 59 | "order" : 0, 60 | "description" : "Project Settings" 61 | } 62 | ] 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | si-template-project-name 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.springframework.ide.eclipse.core.springbuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.springframework.ide.eclipse.core.springnature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.m2e.core.maven2Nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/README.md: -------------------------------------------------------------------------------- 1 | Spring Integration - Simple Standalone Template 2 | ================================================================================ 3 | 4 | This template is meant for running Spring Integration standalone (No runtime 5 | container needed). This template by default only uses core Spring Integration 6 | components. 7 | 8 | You can run the application by either 9 | 10 | * running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application) 11 | * or from the command line: 12 | - mvn package 13 | - mvn exec:java 14 | 15 | -------------------------------------------------------------------------------- 16 | 17 | For help please take a look at the Spring Integration documentation: 18 | 19 | https://spring.io/projects/spring-integration 20 | 21 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'application' 3 | apply plugin: 'eclipse' 4 | apply plugin: 'idea' 5 | apply from: 'publish-maven.gradle' 6 | 7 | repositories { 8 | maven { url 'https://repo.maven.apache.org/maven2/' } 9 | maven { url 'https://repo.springsource.org/libs-milestone' } 10 | } 11 | 12 | group = "SI-TEMPLATE-GROUP-ID" 13 | version = "SI-TEMPLATE-BUILD-VERSION" 14 | 15 | sourceCompatibility=1.6 16 | targetCompatibility=1.6 17 | 18 | ext { 19 | junitVersion = '4.11' 20 | log4jVersion = '1.2.17' 21 | springIntegrationVersion = '2.2.4.RELEASE' 22 | } 23 | 24 | eclipse { 25 | project { 26 | natures += 'org.springframework.ide.eclipse.core.springnature' 27 | } 28 | } 29 | 30 | mainClassName = "sipackage.Main" 31 | 32 | run{ 33 | standardInput = System.in 34 | } 35 | 36 | dependencies { 37 | compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion" 38 | compile "log4j:log4j:$log4jVersion" 39 | 40 | testCompile "junit:junit-dep:$junitVersion" 41 | } 42 | 43 | task wrapper(type: Wrapper) { 44 | description = 'Generates gradlew[.bat] scripts' 45 | gradleVersion = '1.6' 46 | } -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/si-template-standalone-simple-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 05 18:06:37 EDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.5-bin.zip 7 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | SI-TEMPLATE-GROUP-ID 6 | SI-TEMPLATE-ARTIFACT-ID 7 | SI-TEMPLATE-BUILD-VERSION 8 | jar 9 | 10 | si-template-project-name 11 | https://www.springsource.org/spring-integration 12 | 13 | 14 | 2.2.1 15 | 16 | 17 | 18 | UTF-8 19 | 2.2.4.RELEASE 20 | 1.2.17 21 | 4.11 22 | 23 | 24 | 25 | 26 | repo.springsource.org.milestone 27 | Spring Framework Maven Milestone Repository 28 | https://repo.springsource.org/milestone 29 | 30 | 31 | 32 | 33 | 34 | 35 | maven-eclipse-plugin 36 | 2.9 37 | 38 | 39 | org.springframework.ide.eclipse.core.springnature 40 | 41 | 42 | org.springframework.ide.eclipse.core.springbuilder 43 | 44 | true 45 | true 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-compiler-plugin 51 | 3.1 52 | 53 | 1.6 54 | 1.6 55 | -Xlint:all 56 | true 57 | true 58 | 59 | 60 | 61 | org.codehaus.mojo 62 | exec-maven-plugin 63 | 1.2.1 64 | 65 | sipackage.Main 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | junit 77 | junit 78 | ${junit.version} 79 | test 80 | 81 | 82 | 83 | 84 | 85 | org.springframework.integration 86 | spring-integration-core 87 | ${spring.integration.version} 88 | 89 | 90 | 91 | 92 | 93 | log4j 94 | log4j 95 | ${log4j.version} 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/publish-maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | 3 | ext.optionalDeps = [] 4 | ext.providedDeps = [] 5 | 6 | ext.optional = { optionalDeps << it } 7 | ext.provided = { providedDeps << it } 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | customizePom(pom, project) 12 | } 13 | } 14 | 15 | def customizePom(pom, gradleProject) { 16 | pom.whenConfigured { generatedPom -> 17 | // respect 'optional' and 'provided' dependencies 18 | gradleProject.optionalDeps.each { dep -> 19 | generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true 20 | } 21 | gradleProject.providedDeps.each { dep -> 22 | generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' 23 | } 24 | 25 | // eliminate test-scoped dependencies (no need in maven central poms) 26 | generatedPom.dependencies.removeAll { dep -> 27 | dep.scope == 'test' 28 | } 29 | 30 | // add all items necessary for maven central publication 31 | generatedPom.project { 32 | name = gradleProject.description 33 | description = gradleProject.description 34 | url = 'https://www.springsource.org/spring-integration' 35 | organization { 36 | name = 'SpringSource' 37 | url = 'https://spring.io' 38 | } 39 | 40 | licenses { 41 | license { 42 | name 'The Apache Software License, Version 2.0' 43 | url 'https://www.apache.org/licenses/LICENSE-2.0.txt' 44 | distribution 'repo' 45 | } 46 | } 47 | 48 | developers { 49 | developer { 50 | id = 'not specified' 51 | name = 'SI-TEMPLATE-AUTHOR' 52 | email = 'not specified' 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/src/main/java/sipackage/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage; 17 | 18 | import java.util.Scanner; 19 | 20 | import org.apache.log4j.Logger; 21 | import org.springframework.context.support.AbstractApplicationContext; 22 | import org.springframework.context.support.ClassPathXmlApplicationContext; 23 | 24 | import sipackage.service.StringConversionService; 25 | 26 | 27 | /** 28 | * Starts the Spring Context and will initialize the Spring Integration routes. 29 | * 30 | * @author SI-TEMPLATE-AUTHOR 31 | * @since SI-TEMPLATE-VERSION 32 | * 33 | */ 34 | public final class Main { 35 | 36 | private static final Logger LOGGER = Logger.getLogger(Main.class); 37 | 38 | private Main() { } 39 | 40 | /** 41 | * Load the Spring Integration Application Context 42 | * 43 | * @param args - command line arguments 44 | */ 45 | public static void main(final String... args) { 46 | 47 | if (LOGGER.isInfoEnabled()) { 48 | LOGGER.info("\n=========================================================" 49 | + "\n " 50 | + "\n Welcome to Spring Integration! " 51 | + "\n " 52 | + "\n For more information please visit: " 53 | + "\n https://spring.io/projects/spring-integration " 54 | + "\n " 55 | + "\n=========================================================" ); 56 | } 57 | 58 | final AbstractApplicationContext context = 59 | new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/*-context.xml"); 60 | 61 | context.registerShutdownHook(); 62 | 63 | final Scanner scanner = new Scanner(System.in); 64 | 65 | final StringConversionService service = context.getBean(StringConversionService.class); 66 | 67 | if (LOGGER.isInfoEnabled()) { 68 | LOGGER.info("\n=========================================================" 69 | + "\n " 70 | + "\n Please press 'q + Enter' to quit the application. " 71 | + "\n " 72 | + "\n=========================================================" ); 73 | } 74 | 75 | System.out.print("Please enter a string and press : "); 76 | 77 | while (true) { 78 | 79 | final String input = scanner.nextLine(); 80 | 81 | if("q".equals(input.trim())) { 82 | break; 83 | } 84 | 85 | try { 86 | 87 | System.out.println("Converted to upper-case: " + service.convertToUpperCase(input)); 88 | 89 | } catch (Exception e) { 90 | LOGGER.error("An exception was caught: " + e); 91 | } 92 | 93 | System.out.print("Please enter a string and press :"); 94 | 95 | } 96 | 97 | if (LOGGER.isInfoEnabled()) { 98 | LOGGER.info("Exiting application...bye."); 99 | } 100 | 101 | System.exit(0); 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/src/main/java/sipackage/service/StringConversionService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.service; 17 | 18 | /** 19 | * Provides string manipulation services. 20 | * 21 | * @author SI-TEMPLATE-AUTHOR 22 | * @since SI-TEMPLATE-VERSION 23 | * 24 | */ 25 | public interface StringConversionService { 26 | 27 | /** 28 | * Converts a String to Upper Case. 29 | * 30 | * @param stringToConvert The string to convert to upper case 31 | * @return The converted upper case string. 32 | */ 33 | String convertToUpperCase(String stringToConvert); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/src/main/resources/META-INF/spring/integration/spring-integration-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 19 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/src/test/java/sipackage/StringConversionServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sipackage; 18 | 19 | import static org.junit.Assert.*; 20 | 21 | import org.junit.Test; 22 | import org.springframework.context.ApplicationContext; 23 | import org.springframework.context.support.ClassPathXmlApplicationContext; 24 | 25 | import sipackage.service.StringConversionService; 26 | 27 | /** 28 | * Verify that the Spring Integration Application Context starts successfully. 29 | * 30 | * @author SI-TEMPLATE-AUTHOR 31 | * @since SI-TEMPLATE-VERSION 32 | * 33 | */ 34 | public class StringConversionServiceTest { 35 | 36 | @Test 37 | public void testStartupOfSpringInegrationContext() throws Exception{ 38 | new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", 39 | StringConversionServiceTest.class); 40 | Thread.sleep(2000); 41 | } 42 | 43 | @Test 44 | public void testConvertStringToUpperCase() { 45 | final ApplicationContext context 46 | = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", 47 | StringConversionServiceTest.class); 48 | 49 | final StringConversionService service = context.getBean(StringConversionService.class); 50 | 51 | final String stringToConvert = "I love Spring Integration"; 52 | final String expectedResult = "I LOVE SPRING INTEGRATION"; 53 | 54 | final String convertedString = service.convertToUpperCase(stringToConvert); 55 | 56 | assertEquals("Expecting that the string is converted to upper case.", 57 | expectedResult, convertedString); 58 | 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/template.xml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /si-template-projects/si-template-standalone-simple-project/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "elements" : { 4 | "element" : [ 5 | { 6 | "name" : "SI-TEMPLATE-GROUP-ID", 7 | "description" : "Please enter a 'groupId'", 8 | "type" : "java.lang.String", 9 | "page" : 0, 10 | "required" : true, 11 | }, 12 | { 13 | "name" : "SI-TEMPLATE-ARTIFACT-ID", 14 | "description" : "Please enter an 'artifactId'", 15 | "type" : "java.lang.String", 16 | "page" : 0, 17 | "required" : true, 18 | }, 19 | { 20 | "name" : "SI-TEMPLATE-BUILD-VERSION", 21 | "description" : "Please enter a build version e.g. '1.0.0.BUILD-SNAPSHOT'", 22 | "defaultValue": "1.0.0.BUILD-SNAPSHOT", 23 | "type" : "java.lang.String", 24 | "page" : 0, 25 | "required" : true, 26 | }, 27 | { 28 | "name" : "SI-TEMPLATE-VERSION", 29 | "description" : "Please enter a short version e.g. '1.0' (For JavaDocs)", 30 | "defaultValue": "1.0", 31 | "type" : "java.lang.String", 32 | "page" : 0, 33 | "required" : true, 34 | }, 35 | { 36 | "name" : "SI-TEMPLATE-AUTHOR", 37 | "description" : "Please enter the author name", 38 | "defaultValue": "Your name", 39 | "type" : "java.lang.String", 40 | "page" : 0, 41 | "required" : true, 42 | }, 43 | { 44 | "name" : "topLevelPackage", 45 | "description" : "Please specify the top-level package e.g. com.mycompany.myapp", 46 | "type" : "java.lang.String", 47 | "page" : 0, 48 | "required" : true, 49 | "pattern" : "\\w+(\\.\\w+)*", 50 | "replaceKind" : "topLevelPackage" 51 | } 52 | ] 53 | }, 54 | "topLevelPackage" : "sipackage", 55 | "projectName" : "si-template-project-name", 56 | "pages" : { 57 | "page" : [ 58 | { 59 | "order" : 0, 60 | "description" : "Project Settings" 61 | } 62 | ] 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.gitignore: -------------------------------------------------------------------------------- 1 | !.settings 2 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | si-template-project-name 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.jsdt.core.javascriptValidator 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.springframework.ide.eclipse.core.springbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.wst.validation.validationbuilder 30 | 31 | 32 | 33 | 34 | org.eclipse.m2e.core.maven2Builder 35 | 36 | 37 | 38 | 39 | 40 | org.eclipse.jem.workbench.JavaEMFNature 41 | org.eclipse.wst.common.modulecore.ModuleCoreNature 42 | org.springframework.ide.eclipse.core.springnature 43 | org.eclipse.jdt.core.javanature 44 | org.eclipse.m2e.core.maven2Nature 45 | org.eclipse.wst.jsdt.core.jsNature 46 | org.eclipse.wst.common.project.facet.core.nature 47 | 48 | 49 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/com.springsource.sts.config.flow.prefs: -------------------------------------------------------------------------------- 1 | //com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/SI-TEMPLATE-ARTIFACT-ID/src/main/resources/META-INF/spring/integration/spring-integration-context.xml=\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 2 | //com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/si-template-war-artifactId/src/main/resources/META-INF/spring/integration/spring-integration-context.xml=\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 3 | eclipse.preferences.version=1 4 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/main/resources/rebel.xml=UTF-8 5 | encoding//src/test/java=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.6 6 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/README.md: -------------------------------------------------------------------------------- 1 | Spring Integration - War Template 2 | ================================= 3 | 4 | # Introduction 5 | 6 | This template is meant for running [Spring Integration][] inside Servlet Containers such as [Apache Tomcat][] or [Jetty][]. This template by default uses the Spring Integration [Twitter Adapters][] to show some basic functionality. 7 | 8 | Please keep in mind, that the provided Web UI is not necessary just to run *Spring Integration* applications. You can in fact run *Spring Integration* processes without any MVC integration. Thus, you can run your *Spring Integration* components and flows as mere backend processes within Servlet Containers. 9 | 10 | # Running the Template 11 | 12 | *Twitter Search* requires authentication. Therefore, you must update the following properties in **oauth.properties** located at `src/main/resources`: 13 | 14 | * twitter.oauth.consumerKey 15 | * twitter.oauth.consumerSecret 16 | * twitter.oauth.accessToken 17 | * twitter.oauth.accessTokenSecret 18 | 19 | Alternatively, you can also pass in those properties using system properties via the command-line, e.g.: 20 | 21 | mvn jetty:run -Dtwitter.oauth.consumerKey=12345 \ 22 | -Dtwitter.oauth.consumerSecret=12345 \ 23 | -Dtwitter.oauth.accessToken=12345 \ 24 | -Dtwitter.oauth.accessTokenSecret=12345 \ 25 | 26 | The keys can be setup at [https://dev.twitter.com/](https://dev.twitter.com/). 27 | 28 | ## Command Line using Tomcat 7 29 | 30 | mvn tomcat7:run 31 | 32 | ## Command Line using Jetty 33 | 34 | mvn jetty:run 35 | 36 | ## Eclipse 37 | 38 | If you are using [Spring Tool Suite][] (STS) and the project is imported as Eclipse project into your workspace, you can just execute 'Run on Server'. 39 | 40 | ## Limitations 41 | 42 | Due to [an issue](https://issuetracker.springsource.com/browse/STS-3301) in the STS template mechanism, all referenced *PNG* files are hosted, externally. 43 | 44 | -------------------------------------------------------------------------------- 45 | 46 | For help please take a look at the [Spring Integration documentation][]. The Template projects are hosted at: https://github.com/SpringSource/spring-integration-templates 47 | 48 | [Apache Tomcat]: https://tomcat.apache.org/ 49 | [Jetty]: https://www.eclipse.org/jetty/ 50 | [Spring Tool Suite]: https://www.springsource.org/sts 51 | [Spring Integration]: https://www.springintegration.org/ 52 | [Spring Integration documentation]: https://static.springsource.org/spring-integration/reference/html/ 53 | [Twitter Adapters]: https://github.com/spring-projects/spring-integration-extensions/tree/master/spring-integration-social-twitter#twitter-inbound-adapters 54 | 55 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'jetty' 3 | apply plugin: 'eclipse' 4 | apply plugin: 'idea' 5 | 6 | repositories { 7 | maven { url 'https://repo.maven.apache.org/maven2/' } 8 | maven { url 'https://repo.springsource.org/libs-milestone' } 9 | } 10 | 11 | group = "mavenGroupId" 12 | version = "mavenVersion" 13 | 14 | ext { 15 | sourceCompatibility=1.6 16 | targetCompatibility=1.6 17 | 18 | springIntegrationVersion = '2.2.4.RELEASE' 19 | springframeworkVersion = '3.2.3.RELEASE' 20 | guavaVersion = '14.0.1' 21 | jacksonVersion = '1.9.11' 22 | junitVersion = '4.11' 23 | log4jVersion = '1.2.17' 24 | wro4jVersion = '1.7.0' 25 | 26 | } 27 | 28 | eclipse { 29 | project { natures += 'org.springframework.ide.eclipse.core.springnature' } 30 | } 31 | 32 | dependencies { 33 | 34 | testCompile "junit:junit:$junitVersion" 35 | compile "org.springframework:spring-context:$springframeworkVersion" 36 | compile "org.springframework:spring-webmvc:$springframeworkVersion" 37 | compile "org.springframework:spring-oxm:$springframeworkVersion" 38 | compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion" 39 | compile "org.springframework.integration:spring-integration-twitter:$springIntegrationVersion" 40 | compile "log4j:log4j:$log4jVersion" 41 | compile "org.slf4j:slf4j-log4j12:1.7.3" 42 | compile "javax.servlet:jstl:1.2" 43 | compile "org.codehaus.jackson:jackson-xc:$jacksonVersion" 44 | compile "net.sf.ehcache:ehcache-web:2.0.4" 45 | compile "ro.isdc.wro4j:wro4j-core:$wro4jVersion" 46 | compile "ro.isdc.wro4j:wro4j-extensions:$wro4jVersion" 47 | compile "com.google.guava:guava:$guavaVersion" 48 | } 49 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/si-template-war-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 13 12:10:01 EST 2012 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.3-bin.zip 7 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/publish-maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | 3 | ext.optionalDeps = [] 4 | ext.providedDeps = [] 5 | 6 | ext.optional = { optionalDeps << it } 7 | ext.provided = { providedDeps << it } 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | customizePom(pom, project) 12 | } 13 | } 14 | 15 | def customizePom(pom, gradleProject) { 16 | pom.whenConfigured { generatedPom -> 17 | // respect 'optional' and 'provided' dependencies 18 | gradleProject.optionalDeps.each { dep -> 19 | generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true 20 | } 21 | gradleProject.providedDeps.each { dep -> 22 | generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' 23 | } 24 | 25 | // eliminate test-scoped dependencies (no need in maven central poms) 26 | generatedPom.dependencies.removeAll { dep -> 27 | dep.scope == 'test' 28 | } 29 | 30 | // add all items necessary for maven central publication 31 | generatedPom.project { 32 | name = gradleProject.description 33 | description = gradleProject.description 34 | url = 'https://www.springsource.org/spring-integration' 35 | organization { 36 | name = 'SpringSource' 37 | url = 'https://spring.io' 38 | } 39 | 40 | licenses { 41 | license { 42 | name 'The Apache Software License, Version 2.0' 43 | url 'https://www.apache.org/licenses/LICENSE-2.0.txt' 44 | distribution 'repo' 45 | } 46 | } 47 | 48 | developers { 49 | developer { 50 | id = 'not specified' 51 | name = 'SI-TEMPLATE-AUTHOR' 52 | email = 'not specified' 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/model/TwitterAdapterStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.model; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | import javax.xml.bind.annotation.XmlAttribute; 21 | import javax.xml.bind.annotation.XmlRootElement; 22 | 23 | /** 24 | * Represents some common Twitter related fields. 25 | * 26 | * @author SI-TEMPLATE-AUTHOR 27 | * @since SI-TEMPLATE-VERSION 28 | * 29 | */ 30 | @XmlRootElement 31 | @XmlAccessorType(XmlAccessType.FIELD) 32 | public class TwitterAdapterStatus { 33 | 34 | @XmlAttribute 35 | private boolean running; 36 | 37 | /** Default constructor. */ 38 | public TwitterAdapterStatus() { 39 | super(); 40 | } 41 | 42 | public boolean isRunning() { 43 | return running; 44 | } 45 | 46 | public void setRunning(boolean running) { 47 | this.running = running; 48 | } 49 | 50 | public TwitterAdapterStatus(boolean running) { 51 | this.running = running; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/model/TwitterMessages.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.model; 17 | 18 | import java.io.Serializable; 19 | import java.util.ArrayList; 20 | import java.util.Collection; 21 | 22 | import javax.xml.bind.annotation.XmlAccessType; 23 | import javax.xml.bind.annotation.XmlAccessorType; 24 | import javax.xml.bind.annotation.XmlAttribute; 25 | import javax.xml.bind.annotation.XmlElement; 26 | import javax.xml.bind.annotation.XmlRootElement; 27 | 28 | /** 29 | * Wrapper containing a {@link Collection} of Twitter messages. Used for 30 | * proper serialization via Jaxb. 31 | * 32 | * @author SI-TEMPLATE-AUTHOR 33 | * @since SI-TEMPLATE-VERSION 34 | * 35 | */ 36 | @XmlRootElement 37 | @XmlAccessorType(XmlAccessType.FIELD) 38 | public class TwitterMessages implements Serializable { 39 | 40 | private static final long serialVersionUID = 2350458102814527467L; 41 | 42 | @XmlElement(name="twitterMessage") 43 | private Collection twitterMessages = new ArrayList(0); 44 | 45 | @XmlAttribute 46 | private long latestTweetId = 0; 47 | 48 | @XmlAttribute 49 | private boolean adapterRunning = false; 50 | 51 | public Collection getTwitterMessages() { 52 | return twitterMessages; 53 | } 54 | 55 | public void setTwitterMessages(Collection twitterMessages) { 56 | 57 | for (TwitterMessage tweet : twitterMessages) { 58 | if (latestTweetId < tweet.getId()) { 59 | this.latestTweetId = tweet.getId(); 60 | } 61 | } 62 | 63 | this.twitterMessages = twitterMessages; 64 | } 65 | 66 | public long getLatestTweetId() { 67 | return latestTweetId; 68 | } 69 | 70 | public void setLatestTweetId(long latestTweetId) { 71 | this.latestTweetId = latestTweetId; 72 | } 73 | 74 | @XmlAttribute 75 | public String getLatestTweetIdAsString() { 76 | return String.valueOf(latestTweetId); 77 | } 78 | 79 | public boolean isAdapterRunning() { 80 | return adapterRunning; 81 | } 82 | 83 | public void setAdapterRunning(boolean adapterRunning) { 84 | this.adapterRunning = adapterRunning; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/mvc/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.mvc.controller; 17 | 18 | import java.util.SortedSet; 19 | 20 | import org.apache.log4j.Logger; 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.stereotype.Controller; 23 | import org.springframework.ui.Model; 24 | import org.springframework.web.bind.annotation.PathVariable; 25 | import org.springframework.web.bind.annotation.RequestMapping; 26 | import org.springframework.web.bind.annotation.RequestParam; 27 | import org.springframework.web.bind.annotation.ResponseBody; 28 | 29 | import sipackage.model.TwitterAdapterStatus; 30 | import sipackage.model.TwitterMessage; 31 | import sipackage.model.TwitterMessages; 32 | import sipackage.service.TwitterService; 33 | import sipackage.support.SortOrder; 34 | 35 | /** 36 | * Handles requests for the application home page. 37 | * 38 | * @author SI-TEMPLATE-AUTHOR 39 | * @since SI-TEMPLATE-VERSION 40 | * 41 | */ 42 | @Controller 43 | @RequestMapping 44 | public class HomeController { 45 | 46 | private static final Logger LOGGER = Logger.getLogger(HomeController.class); 47 | 48 | @Autowired 49 | private TwitterService twitterService; 50 | 51 | /** 52 | * Simply selects the home view to render by returning its name. 53 | */ 54 | @RequestMapping(value={"/", "/tweets"}) 55 | public String home(Model model, @RequestParam(required=false) Long latestTweetId, 56 | @RequestParam(defaultValue="DESCENDING", required=false) SortOrder sortOrder) { 57 | 58 | if (latestTweetId == null) { 59 | latestTweetId = 0L; 60 | } 61 | 62 | final SortedSet twitterMessages = twitterService.getTwitterMessages(latestTweetId, sortOrder); 63 | 64 | TwitterMessages twitterMessagesWrapper = new TwitterMessages(); 65 | 66 | if (twitterMessages == null || twitterMessages.isEmpty()) { 67 | twitterMessagesWrapper.setLatestTweetId(latestTweetId); 68 | } else { 69 | twitterMessagesWrapper.setTwitterMessages(twitterMessages); 70 | } 71 | 72 | twitterMessagesWrapper.setAdapterRunning(twitterService.isTwitterAdapterRunning()); 73 | 74 | if (LOGGER.isDebugEnabled()) { 75 | LOGGER.debug(String.format("Latest Tweet ID: '%s'; Adapter running: %s", 76 | twitterMessagesWrapper.getLatestTweetId(), 77 | twitterMessagesWrapper.isAdapterRunning())); 78 | } 79 | 80 | model.addAttribute("tweets", twitterMessagesWrapper); 81 | 82 | return "home"; 83 | } 84 | 85 | @ResponseBody 86 | @RequestMapping(value={"/adapter/{state}"}) 87 | public void state(@PathVariable String state) { 88 | 89 | if ("start".equalsIgnoreCase(state)) { 90 | twitterService.startTwitterAdapter(); 91 | } 92 | else if ("stop".equalsIgnoreCase(state)) { 93 | twitterService.stopTwitterAdapter(); 94 | } 95 | 96 | } 97 | 98 | @ResponseBody 99 | @RequestMapping(value={"/adapter-running"}) 100 | public TwitterAdapterStatus isRunning() { 101 | TwitterAdapterStatus status = new TwitterAdapterStatus(twitterService.isTwitterAdapterRunning()); 102 | return status; 103 | } 104 | } 105 | 106 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/service/TwitterService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.service; 17 | 18 | import java.util.SortedSet; 19 | 20 | import sipackage.model.TwitterMessage; 21 | import sipackage.support.SortOrder; 22 | 23 | /** 24 | * Provides some basic methods for controlling the flow of Twitter messages. 25 | * 26 | * @author SI-TEMPLATE-AUTHOR 27 | * @since SI-TEMPLATE-VERSION 28 | * 29 | */ 30 | public interface TwitterService { 31 | 32 | /** 33 | * Retrieve the already polled Twitter messages. Keep in mind this 34 | * method does not perform the actual Twitter search. It merely returns all 35 | * the Tweets that were previously polled through Spring Integration and 36 | * which have been cached for returning those to the web-frontend. */ 37 | SortedSet getTwitterMessages(Long tweetId, SortOrder sortOrder); 38 | /** 39 | * By default - After application startup, the Spring Integration Twitter 40 | * search-inbound-channel-adapter is stopped. Use this method to start 41 | * the adapter. 42 | */ 43 | void startTwitterAdapter(); 44 | 45 | /** 46 | * Allows for stopping the Spring Integration Twitter 47 | * search-inbound-channel-adapter. 48 | */ 49 | void stopTwitterAdapter(); 50 | 51 | /** 52 | * Returns true if the Twitter Adapter is running, 53 | * false otherwise. 54 | */ 55 | boolean isTwitterAdapterRunning(); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/support/JaxbJacksonObjectMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.support; 17 | 18 | import org.codehaus.jackson.map.AnnotationIntrospector; 19 | import org.codehaus.jackson.map.ObjectMapper; 20 | import org.codehaus.jackson.xc.JaxbAnnotationIntrospector; 21 | 22 | /** 23 | * Customized Jackson {@link ObjectMapper} to add Jaxb annoation support using the 24 | * {@link JaxbAnnotationIntrospector}. 25 | * 26 | * @author SI-TEMPLATE-AUTHOR 27 | * @since SI-TEMPLATE-VERSION 28 | * 29 | */ 30 | public class JaxbJacksonObjectMapper extends ObjectMapper { 31 | 32 | public JaxbJacksonObjectMapper() { 33 | final AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(); 34 | super.getDeserializationConfig().withAnnotationIntrospector(introspector); 35 | super.getSerializationConfig().withAnnotationIntrospector(introspector); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/java/sipackage/support/SortOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage.support; 17 | 18 | 19 | /** 20 | * 21 | * @author SI-TEMPLATE-AUTHOR 22 | * @since SI-TEMPLATE-VERSION 23 | * 24 | */ 25 | public enum SortOrder { 26 | ASCENDING, DESCENDING; 27 | } 28 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/resources/META-INF/spring/integration/spring-integration-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 36 | 39 | 40 | 41 | 42 | 44 | 45 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/resources/oauth.properties: -------------------------------------------------------------------------------- 1 | twitter.oauth.consumerKey= 2 | twitter.oauth.consumerSecret= 3 | twitter.oauth.accessToken= 4 | twitter.oauth.accessTokenSecret= -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/views/errors/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/WEB-INF/views/includes/taglibs.jsp"%> 2 | 3 | 4 | 5 | 6 | Spring Integration Template 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 41 | 42 |
43 | 46 |

47 | We were unable to render the requested view. Other representations 48 | of the data may however exist. 49 |

50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/views/home.jsp -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/views/includes/taglibs.jsp: -------------------------------------------------------------------------------- 1 | <%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" session="false"%> 2 | 3 | <% 4 | response.setHeader("Cache-Control","no-cache"); 5 | response.setHeader("Pragma","no-cache"); 6 | response.setHeader("Expires","0"); 7 | %> 8 | 9 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 10 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 11 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 12 | 13 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | contextConfigLocation 9 | classpath:META-INF/spring/integration/spring-integration-context.xml 10 | 11 | 12 | 13 | 14 | org.springframework.web.context.ContextLoaderListener 15 | 16 | 17 | 18 | gzipFilter 19 | net.sf.ehcache.constructs.web.filter.GzipFilter 20 | 21 | 22 | etagFilter 23 | org.springframework.web.filter.ShallowEtagHeaderFilter 24 | 25 | 26 | WebResourceOptimizer 27 | ro.isdc.wro.http.WroFilter 28 | 29 | gzipResources 30 | TRUE 31 | 32 | 33 | debug 34 | FALSE 35 | 36 | 37 | 38 | 39 | WebResourceOptimizer 40 | /wro/* 41 | 42 | 43 | 44 | gzipFilter 45 | /* 46 | 47 | 48 | etagFilter 49 | /* 50 | 51 | 52 | 53 | 54 | appServlet 55 | org.springframework.web.servlet.DispatcherServlet 56 | 57 | contextConfigLocation 58 | classpath:META-INF/spring/mvc/servlet-context.xml 59 | 60 | 1 61 | 62 | 63 | 64 | appServlet 65 | / 66 | 67 | 68 | 69 | 404 70 | /WEB-INF/views/errors/404.jsp 71 | 72 | 73 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/wro.properties: -------------------------------------------------------------------------------- 1 | managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory 2 | preProcessors=cssUrlRewriting,semicolonAppender,yuiCssMin 3 | postProcessors=cssVariables,jsMin 4 | hashStrategy=MD5 5 | namingStrategy=hashEncoder-CRC32 6 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/WEB-INF/wro.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | /assets/css/bootstrap.css 4 | /assets/css/custom.css 5 | /assets/css/bootstrap-responsive.css 6 | /assets/js/jquery.js 7 | /assets/js/bootstrap.js 8 | /assets/js/jquery.periodicalupdater.js 9 | /assets/js/handlebars.js 10 | /assets/js/spin.js 11 | /assets/js/custom.js 12 | 13 | 14 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/assets/css/custom.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ 3 | padding-bottom: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ 4 | } 5 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-integration-templates/dd07e370bcb154b64817630b80198c123a0eea41/si-template-projects/si-template-war-project/src/main/webapp/assets/ico/favicon.ico -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/main/webapp/assets/js/custom.js: -------------------------------------------------------------------------------- 1 | /** Contains custom scripts */ 2 | 3 | var tweetTemplate; 4 | 5 | $.PeriodicalUpdater(tweetsUrl, { 6 | method : 'get', 7 | data : function() { 8 | return {latestTweetId: window.latestTweetId}; 9 | }, 10 | minTimeout : 5000, 11 | maxTimeout : 20000, 12 | multiplier : 2, 13 | type : 'json', 14 | maxCalls : 0, 15 | autoStop : 0 16 | }, function(remoteData, success, xhr, handle) { 17 | 18 | if ("success" == success) { 19 | latestTweetId = remoteData.latestTweetIdAsString; 20 | var adapterRunning = remoteData.adapterRunning; 21 | 22 | if (adapterRunning) { 23 | $("#stopTwitterAdapter").removeClass("disabled"); 24 | $("#startTwitterAdapter").addClass("disabled"); 25 | } else { 26 | $("#startTwitterAdapter").removeClass("disabled"); 27 | $("#stopTwitterAdapter").addClass("disabled"); 28 | } 29 | 30 | console.log('Adapter Running: ' + adapterRunning + '; Latest Tweet Id ' + window.latestTweetId + '; Number of Tweets ' + remoteData.twitterMessages.length); 31 | 32 | if (remoteData.twitterMessages.length > 0) { 33 | var context = { 34 | tweets : remoteData.twitterMessages 35 | }; 36 | var html = tweetTemplate(context).trim(); 37 | $(html).prependTo("#tweets"); 38 | $('#tweets').spin(false); 39 | } 40 | } 41 | }); 42 | 43 | $(document).ready(function() { 44 | 45 | Handlebars.registerHelper('link', function(url) { 46 | url = Handlebars.Utils.escapeExpression(url); 47 | console.log(url); 48 | return url; 49 | }); 50 | 51 | var source = $("#tweet-template").html(); 52 | tweetTemplate = Handlebars.compile(source); 53 | 54 | $("body").on('click',".delete",function(event) { 55 | $(this).closest(".row").slideUp("normal", function() { 56 | $(this).remove(); 57 | 58 | if ($("#tweets div.row").length === 0) { 59 | $('#tweets').spin(true); 60 | } 61 | }); 62 | }); 63 | }); 64 | 65 | (function($) { 66 | 67 | $.fn.spin = function(opts, color) { 68 | var presets = { 69 | "tiny" : { 70 | lines : 8, 71 | length : 2, 72 | width : 2, 73 | radius : 3 74 | }, 75 | "small" : { 76 | lines : 8, 77 | length : 4, 78 | width : 3, 79 | radius : 5 80 | }, 81 | "large" : { 82 | lines : 10, 83 | length : 8, 84 | width : 4, 85 | radius : 8 86 | } 87 | }; 88 | if (Spinner) { 89 | return this.each(function() { 90 | var $this = $(this), data = $this.data(); 91 | 92 | if (data.spinner) { 93 | data.spinner.stop(); 94 | delete data.spinner; 95 | } 96 | if (opts !== false) { 97 | if (typeof opts === "string") { 98 | if (opts in presets) { 99 | opts = presets[opts]; 100 | } else { 101 | opts = {}; 102 | } 103 | if (color) { 104 | opts.color = color; 105 | } 106 | } 107 | data.spinner = new Spinner($.extend({ 108 | color : $this.css('color') 109 | }, opts)).spin(this); 110 | } 111 | }); 112 | } else { 113 | throw "Spinner class not available."; 114 | } 115 | }; 116 | })(jQuery); 117 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/test/java/sipackage/JacksonTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage; 17 | 18 | import java.util.Date; 19 | 20 | import org.junit.Test; 21 | import org.slf4j.Logger; 22 | import org.slf4j.LoggerFactory; 23 | 24 | import sipackage.model.TwitterMessage; 25 | import sipackage.model.TwitterMessages; 26 | import sipackage.support.JaxbJacksonObjectMapper; 27 | 28 | /** 29 | * 30 | * @author SI-TEMPLATE-AUTHOR 31 | * @since SI-TEMPLATE-VERSION 32 | * 33 | */ 34 | public class JacksonTest { 35 | 36 | private static final Logger LOGGER = LoggerFactory.getLogger(JacksonTest.class); 37 | 38 | @Test 39 | public void twitterMessageSerializationTest() throws Exception { 40 | 41 | final JaxbJacksonObjectMapper mapper = new JaxbJacksonObjectMapper(); 42 | 43 | final TwitterMessage message = new TwitterMessage(); 44 | 45 | message.setCreatedAt(new Date()); 46 | message.setFromUser("user"); 47 | message.setProfileImageUrl("profileImageUrl"); 48 | message.setText("some text"); 49 | message.setId(123456789L); 50 | 51 | final String json = mapper.writeValueAsString(message); 52 | 53 | LOGGER.info(json); 54 | 55 | final TwitterMessage message2 = new TwitterMessage(); 56 | message2.setCreatedAt(new Date()); 57 | message2.setFromUser("user"); 58 | message2.setProfileImageUrl("profileImageUrl"); 59 | message2.setText("some text"); 60 | message2.setId(77777L); 61 | 62 | final TwitterMessages list = new TwitterMessages(); 63 | list.getTwitterMessages().add(message); 64 | list.getTwitterMessages().add(message2); 65 | 66 | String json2 = mapper.writeValueAsString(list); 67 | 68 | LOGGER.info(json2); 69 | 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/src/test/java/sipackage/SpringIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sipackage; 17 | 18 | import org.codehaus.jackson.map.ObjectMapper; 19 | import org.codehaus.jackson.xc.JaxbAnnotationIntrospector; 20 | import org.junit.Test; 21 | import org.springframework.context.support.ClassPathXmlApplicationContext; 22 | 23 | /** 24 | * Customized Jackson {@link ObjectMapper} to add Jaxb annoation support using the 25 | * {@link JaxbAnnotationIntrospector}. 26 | * 27 | * @author SI-TEMPLATE-AUTHOR 28 | * @since SI-TEMPLATE-VERSION 29 | * 30 | */ 31 | public class SpringIntegrationTest { 32 | 33 | @Test 34 | public void testSpringIntegrationContextStartup() throws Exception{ 35 | 36 | ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", SpringIntegrationTest.class); 37 | Thread.sleep(4000); 38 | classPathXmlApplicationContext.close(); 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/template.xml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /si-template-projects/si-template-war-project/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "elements" : { 4 | "element" : [ 5 | { 6 | "name" : "SI-TEMPLATE-GROUP-ID", 7 | "description" : "Please enter a 'groupId'", 8 | "type" : "java.lang.String", 9 | "page" : 0, 10 | "required" : true, 11 | }, 12 | { 13 | "name" : "SI-TEMPLATE-ARTIFACT-ID", 14 | "description" : "Please enter an 'artifactId'", 15 | "type" : "java.lang.String", 16 | "page" : 0, 17 | "required" : true, 18 | }, 19 | { 20 | "name" : "SI-TEMPLATE-BUILD-VERSION", 21 | "description" : "Please enter a build version e.g. '1.0.0.BUILD-SNAPSHOT'", 22 | "defaultValue": "1.0.0.BUILD-SNAPSHOT", 23 | "type" : "java.lang.String", 24 | "page" : 0, 25 | "required" : true, 26 | }, 27 | { 28 | "name" : "SI-TEMPLATE-VERSION", 29 | "description" : "Please enter a short version e.g. '1.0' (For JavaDocs)", 30 | "defaultValue": "1.0", 31 | "type" : "java.lang.String", 32 | "page" : 0, 33 | "required" : true, 34 | }, 35 | { 36 | "name" : "SI-TEMPLATE-AUTHOR", 37 | "description" : "Please enter the author name", 38 | "defaultValue": "Your name", 39 | "type" : "java.lang.String", 40 | "page" : 0, 41 | "required" : true, 42 | }, 43 | { 44 | "name" : "topLevelPackage", 45 | "description" : "Please specify the top-level package e.g. com.mycompany.myapp", 46 | "type" : "java.lang.String", 47 | "page" : 0, 48 | "required" : true, 49 | "pattern" : "\\w+(\\.\\w+)*", 50 | "replaceKind" : "topLevelPackage" 51 | } 52 | ] 53 | }, 54 | "topLevelPackage" : "sipackage", 55 | "projectName" : "si-template-project-name", 56 | "pages" : { 57 | "page" : [ 58 | { 59 | "order" : 0, 60 | "description" : "Project Settings" 61 | } 62 | ] 63 | } 64 | } 65 | } 66 | --------------------------------------------------------------------------------