http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-inbound.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-inbound.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-inbound.xml deleted file mode 100644 index ba7b8d7..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-inbound.xml +++ /dev/null @@ -1,34 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <camel:jmxAgent id="agent" disabled="true"/> - <camel:routeBuilder ref="routeBuilder"/> - </camel:camelContext> - - <bean id="routeBuilder" class="org.apache.camel.component.gae.http.GHttpInboundRouteBuilder"/> - -</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-outbound.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-outbound.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-outbound.xml deleted file mode 100644 index eaa1bea..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/context-outbound.xml +++ /dev/null @@ -1,34 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <camel:jmxAgent id="agent" disabled="true"/> - <camel:routeBuilder ref="routeBuilder"/> - </camel:camelContext> - - <bean id="routeBuilder" class="org.apache.camel.component.gae.http.GHttpOutboundRouteBuilder"/> - -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-combined.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-combined.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-combined.xml deleted file mode 100644 index 1dbdafd..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-combined.xml +++ /dev/null @@ -1,43 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<web-app> - - <!-- tell Spring where it should load the XML file --> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath:org/apache/camel/component/gae/http/context-combined.xml</param-value> - </context-param> - - <!-- spring context listener which loads the XML file --> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>CamelServlet</servlet-name> - <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>CamelServlet</servlet-name> - <url-pattern>/camel/*</url-pattern> - </servlet-mapping> - -</web-app> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-inbound.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-inbound.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-inbound.xml deleted file mode 100644 index 287b656..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/http/web-inbound.xml +++ /dev/null @@ -1,43 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<web-app> - - <!-- tell Spring where it should load the XML file --> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath:org/apache/camel/component/gae/http/context-inbound.xml</param-value> - </context-param> - - <!-- spring context listener which loads the XML file --> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>CamelServlet</servlet-name> - <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>CamelServlet</servlet-name> - <url-pattern>/camel/*</url-pattern> - </servlet-mapping> - -</web-app> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/login/context.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/login/context.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/login/context.xml deleted file mode 100644 index 169fd55..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/login/context.xml +++ /dev/null @@ -1,36 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <camel:jmxAgent id="agent" disabled="true"/> - <camel:routeBuilder ref="routeBuilder"/> - </camel:camelContext> - - <bean id="routeBuilder" class="org.apache.camel.component.gae.login.GLoginRouteBuilder"/> - - <bean id="testService" class="org.apache.camel.component.gae.login.GLoginServiceMock"/> - -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/mail/context-outbound.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/mail/context-outbound.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/mail/context-outbound.xml deleted file mode 100644 index d1e4e47..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/mail/context-outbound.xml +++ /dev/null @@ -1,34 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <camel:jmxAgent id="agent" disabled="true" /> - <camel:routeBuilder ref="routeBuilder"/> - </camel:camelContext> - - <bean id="routeBuilder" class="org.apache.camel.component.gae.mail.GMailOutboundRouteBuilder"/> - -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/context-combined.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/context-combined.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/context-combined.xml deleted file mode 100644 index 1052a7e..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/context-combined.xml +++ /dev/null @@ -1,34 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <camel:jmxAgent id="agent" disabled="true" /> - <camel:routeBuilder ref="routeBuilder"/> - </camel:camelContext> - - <bean id="routeBuilder" class="org.apache.camel.component.gae.task.GTaskCombinedRouteBuilder"/> - -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/web-combined.xml ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/web-combined.xml b/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/web-combined.xml deleted file mode 100644 index 60910d2..0000000 --- a/components/camel-gae/src/test/resources/org/apache/camel/component/gae/task/web-combined.xml +++ /dev/null @@ -1,44 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<web-app> - - <!-- tell Spring where it should load the XML file --> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath:org/apache/camel/component/gae/task/context-combined.xml</param-value> - </context-param> - - <!--spring context listener which loads the XML file --> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>CamelServlet</servlet-name> - <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>CamelServlet</servlet-name> - <url-pattern>/camel/*</url-pattern> - </servlet-mapping> - -</web-app> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/components/pom.xml ---------------------------------------------------------------------- diff --git a/components/pom.xml b/components/pom.xml index 2624e0c..91103f4 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -107,7 +107,6 @@ <module>camel-fop</module> <module>camel-freemarker</module> <module>camel-ftp</module> - <module>camel-gae</module> <module>camel-ganglia</module> <module>camel-geocoder</module> <module>camel-git</module> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 2659938..fa64210 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -132,7 +132,6 @@ * [FOP](fop.adoc) * [Freemarker](freemarker.adoc) * [FTP](ftp.adoc) - * [GAE](gae.adoc) * [Ganglia](ganglia.adoc) * [Geocoder](geocoder.adoc) * [Ironmq](ironmq.adoc) http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/README.md ---------------------------------------------------------------------- diff --git a/examples/README.md b/examples/README.md index 4edde7e..9e7795c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -74,8 +74,6 @@ All examples have been sort by type/category ##### Social * [camel-example-box-osgi](camel-example-box-osgi/README.md) -* [camel-example-gae](camel-example-gae/README.md) -* [camel-example-gauth](camel-example-gauth/README.md) * [camel-example-simplejirabot](camel-example-simplejirabot/README.md) * [camel-example-twitter-websocket](camel-example-twitter-websocket/README.md) * [camel-example-twitter-websocket-blueprint](camel-example-twitter-websocket-blueprint/README.md) http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/README.md ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/README.md b/examples/camel-example-gae/README.md deleted file mode 100644 index 287a477..0000000 --- a/examples/camel-example-gae/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# GAE Example - -### Introduction - -Building, deplyoing and running this example is described in detail at [http://camel.apache.org/tutorial-for-camel-on-google-app-engine.html](http://camel.apache.org/tutorial-for-camel-on-google-app-engine.html) - -### Forum, Help, etc - -If you hit an problems please let us know on the Camel Forums - <http://camel.apache.org/discussion-forums.html> - -Please help us make Apache Camel better - we appreciate any feedback you may -have. Enjoy! - - -The Camel riders! http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/pom.xml b/examples/camel-example-gae/pom.xml deleted file mode 100644 index 6a85d73..0000000 --- a/examples/camel-example-gae/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>examples</artifactId> - <version>2.18-SNAPSHOT</version> - </parent> - - <artifactId>camel-example-gae</artifactId> - <name>Camel :: Example :: GAE (deprecated)</name> - <description>Demonstrates how to get Camel running on Google App Engine</description> - <packaging>war</packaging> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-gae</artifactId> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - </dependency> - <dependency> - <groupId>com.google.appengine.orm</groupId> - <artifactId>datanucleus-appengine</artifactId> - <version>1.0.5</version> - </dependency> - <!-- Set up the log which will be used by camel --> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <version>${slf4j-version}</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportData.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportData.java b/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportData.java deleted file mode 100644 index e4d08f9..0000000 --- a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportData.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gae; - -import java.io.Serializable; - -import org.w3c.dom.Document; - -import org.apache.camel.Exchange; -import org.apache.camel.Expression; - -public class ReportData implements Serializable { - - private static final long serialVersionUID = -468314239950430108L; - - private String city; - private String recipient; - private String requestor; - private Document weather; - - public ReportData(String city, String recipient, String requestor) { - this.city = city; - this.recipient = recipient; - this.requestor = requestor; - } - - public String getCity() { - return city; - } - - public String getRecipient() { - return recipient; - } - - public String getRequestor() { - return requestor; - } - - public Document getWeather() { - return weather; - } - - public void setWeather(Document weather) { - this.weather = weather; - } - - public static Expression city() { - return new Expression() { - public <T> T evaluate(Exchange exchange, Class<T> type) { - return type.cast(exchange.getIn().getBody(ReportData.class).getCity()); - } - }; - } - - public static Expression recipient() { - return new Expression() { - public <T> T evaluate(Exchange exchange, Class<T> type) { - return type.cast(exchange.getIn().getBody(ReportData.class).getRecipient()); - } - }; - } - - public static Expression requestor() { - return new Expression() { - public <T> T evaluate(Exchange exchange, Class<T> type) { - return type.cast(exchange.getIn().getBody(ReportData.class).getRequestor()); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java b/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java deleted file mode 100644 index fa1d177..0000000 --- a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gae; - -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathFactory; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ReportGenerator implements Processor { - - private static final Logger LOGGER = LoggerFactory.getLogger(RequestProcessor.class); - - public void process(Exchange exchange) throws Exception { - ReportData data = exchange.getIn().getBody(ReportData.class); - - XPathFactory xpfactory = XPathFactory.newInstance(); - XPath xpath = xpfactory.newXPath(); - - // Extract result values via XPath - String city = xpath.evaluate("//forecast_information/city/@data", data.getWeather()); - String cond = xpath.evaluate("//current_conditions/condition/@data", data.getWeather()); - String temp = xpath.evaluate("//current_conditions/temp_c/@data", data.getWeather()); - - if (city == null || city.length() == 0) { - city = data.getCity(); - cond = "<error retrieving current condition>"; - temp = "<error retrieving current temperature>"; - } - - String result = new StringBuilder() - .append("\n").append("Weather report for: ").append(city) - .append("\n").append("Current condition: ").append(cond) - .append("\n").append("Current temperature: ").append(temp).append(" (Celsius)").toString(); - - LOGGER.info("Get the result" + result); - exchange.getIn().setBody(result); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/RequestProcessor.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/RequestProcessor.java b/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/RequestProcessor.java deleted file mode 100644 index 6201e53..0000000 --- a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/RequestProcessor.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gae; - -import com.google.appengine.api.users.UserService; -import com.google.appengine.api.users.UserServiceFactory; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RequestProcessor implements Processor { - - private static final Logger LOGGER = LoggerFactory.getLogger(RequestProcessor.class); - - public void process(Exchange exchange) throws Exception { - UserService userService = UserServiceFactory.getUserService(); - String city = (String)exchange.getIn().removeHeader("city"); - String requestor = userService.getCurrentUser().getEmail(); - String recipient = requestor; - - if (exchange.getIn().removeHeader("mailtocurrent") == null) { - recipient = (String)exchange.getIn().removeHeader("mailto"); - } - exchange.getIn().setBody(new ReportData(city, recipient, requestor)); - LOGGER.info(requestor + " requested weather data for " + city + ". Report will be sent to " + recipient); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ResponseProcessor.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ResponseProcessor.java b/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ResponseProcessor.java deleted file mode 100644 index 5bea1f1..0000000 --- a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ResponseProcessor.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gae; - -import com.google.appengine.api.users.UserServiceFactory; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -public class ResponseProcessor implements Processor { - - public void process(Exchange exchange) throws Exception { - ReportData request = exchange.getIn().getBody(ReportData.class); - - String logoutUrl = UserServiceFactory.getUserService().createLogoutURL("/"); - String logoutLink = "<a href=\"" + logoutUrl + "\">" + "logout</a>"; - String homeLink = "<a href=\"/\">home</a>"; - - String body = "Weather report for " + request.getCity() + " will be sent to " - + request.getRecipient() + " (" + homeLink + ", " + logoutLink + ")"; - - exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "text/html"); - exchange.getOut().setBody(body); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/TutorialRouteBuilder.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/TutorialRouteBuilder.java b/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/TutorialRouteBuilder.java deleted file mode 100644 index a39093c..0000000 --- a/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/TutorialRouteBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gae; - -import java.io.InputStream; - -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; - -import org.apache.camel.Exchange; -import org.apache.camel.RuntimeCamelException; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.gae.mail.GMailBinding; -import org.apache.camel.processor.aggregate.AggregationStrategy; - - -public class TutorialRouteBuilder extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("ghttp:///weather") - .process(new RequestProcessor()) - .marshal().serialization() - .to("gtask://default") - .unmarshal().serialization() - .process(new ResponseProcessor()); - - from("gtask://default") - .unmarshal().serialization() - .setHeader(Exchange.HTTP_QUERY, constant("weather=").append(ReportData.city())) - .enrich("ghttp://www.google.com/ig/api", reportDataAggregator()) - .setHeader(GMailBinding.GMAIL_SUBJECT, constant("Weather report")) - .setHeader(GMailBinding.GMAIL_SENDER, ReportData.requestor()) - .setHeader(GMailBinding.GMAIL_TO, ReportData.recipient()) - .process(new ReportGenerator()) - .to("gmail://default"); - } - - private static AggregationStrategy reportDataAggregator() { - return new AggregationStrategy() { - public Exchange aggregate(Exchange reportExchange, Exchange weatherExchange) { - ReportData reportData = reportExchange.getIn().getBody(ReportData.class); - reportData.setWeather(toDocument(weatherExchange.getIn().getBody(InputStream.class))); - return reportExchange; - } - }; - } - - // As GAE have trouble to load the javax.xml.transform.stax.StAXSource which is used the XmlConverter - // Now we just do the transformation ourself. - private static DocumentBuilderFactory createDocumentBuilderFactory() { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - factory.setIgnoringElementContentWhitespace(true); - factory.setIgnoringComments(true); - return factory; - } - - private static Document toDocument(InputStream stream) { - DocumentBuilderFactory factory = createDocumentBuilderFactory(); - try { - Document doc = factory.newDocumentBuilder().parse(stream); - return doc; - } catch (Exception ex) { - throw new RuntimeCamelException(ex); - } - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-gae/src/main/resources/META-INF/LICENSE.txt deleted file mode 100755 index 6b0b127..0000000 --- a/examples/camel-example-gae/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-gae/src/main/resources/META-INF/NOTICE.txt deleted file mode 100644 index 2e215bf..0000000 --- a/examples/camel-example-gae/src/main/resources/META-INF/NOTICE.txt +++ /dev/null @@ -1,11 +0,0 @@ - ========================================================================= - == NOTICE file corresponding to the section 4 d of == - == the Apache License, Version 2.0, == - == in this case for the Apache Camel distribution. == - ========================================================================= - - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - - Please read the different LICENSE files present in the licenses directory of - this distribution. http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/resources/context.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/resources/context.xml b/examples/camel-example-gae/src/main/resources/context.xml deleted file mode 100644 index c8d94eb..0000000 --- a/examples/camel-example-gae/src/main/resources/context.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camel:camelContext id="camelContext"> - <!-- JMX is not supported in GAE --> - <camel:jmxAgent id="agent" disabled="true"/> - <!-- refer to the route to use --> - <camel:routeBuilder ref="tutorialRouteBuilder"/> - </camel:camelContext> - - <!-- this is our route --> - <bean id="tutorialRouteBuilder" class="org.apache.camel.example.gae.TutorialRouteBuilder"/> - -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml b/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml deleted file mode 100644 index 7d6cc56..0000000 --- a/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> - <application>replaceme</application> - <version>1</version> - - <static-files> - <exclude path="/index.html" /> - </static-files> - - <threadsafe>true</threadsafe> - - <system-properties> - <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> - </system-properties> - -</appengine-web-app> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/webapp/WEB-INF/logging.properties ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/webapp/WEB-INF/logging.properties b/examples/camel-example-gae/src/main/webapp/WEB-INF/logging.properties deleted file mode 100644 index 971f066..0000000 --- a/examples/camel-example-gae/src/main/webapp/WEB-INF/logging.properties +++ /dev/null @@ -1,32 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- - -.level = WARNING -org.apache.camel.example.gae.level=INFO -DataNucleus.JDO.level=WARNING -DataNucleus.Persistence.level=WARNING -DataNucleus.Cache.level=WARNING -DataNucleus.MetaData.level=WARNING -DataNucleus.General.level=WARNING -DataNucleus.Utility.level=WARNING -DataNucleus.Transaction.level=WARNING -DataNucleus.Datastore.level=WARNING -DataNucleus.ClassLoading.level=WARNING -DataNucleus.Plugin.level=WARNING -DataNucleus.ValueGeneration.level=WARNING -DataNucleus.Enhancer.level=WARNING -DataNucleus.SchemaTool.level=WARNING http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml b/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index cc3a9a2..0000000 --- a/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - xsi:schemaLocation=" - http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - version="2.5"> - - <!-- tell Spring where it should load the XML file --> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath:context.xml</param-value> - </context-param> - - <!-- spring context listener which loads the XML file --> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>CamelServlet</servlet-name> - <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>CamelServlet</servlet-name> - <url-pattern>/camel/*</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>CamelServlet</servlet-name> - <url-pattern>/worker/*</url-pattern> - </servlet-mapping> - - <security-constraint> - <web-resource-collection> - <url-pattern>/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>*</role-name> - </auth-constraint> - </security-constraint> - <security-constraint> - <web-resource-collection> - <url-pattern>/worker/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>admin</role-name> - </auth-constraint> - </security-constraint> - -</web-app> - http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gae/src/main/webapp/index.html ---------------------------------------------------------------------- diff --git a/examples/camel-example-gae/src/main/webapp/index.html b/examples/camel-example-gae/src/main/webapp/index.html deleted file mode 100644 index dde3b73..0000000 --- a/examples/camel-example-gae/src/main/webapp/index.html +++ /dev/null @@ -1,61 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="expires" content="0"> -<meta http-equiv="content-type" content="text/html; charset=UTF-8"> -<title>Weather Report</title> -<script type="text/javascript"> -function toggleMailto() { - in1 = document.getElementById("input1") - in2 = document.getElementById("input2") - in1.disabled = in2.checked -} -</script> -</head> - -<body> -<h1>Weather Report</h1> -Generates a simple weather report for a city and sends the report via email.<br> -This application is described in the <a href="http://camel.apache.org/tutorial-for-camel-on-google-app-engine.html">Camel tutorial for Google App Engine</a>. -<p/> -<form action="camel/weather" method="post"> -<table> - <tr> - <td>City:</td> - <td><input type="text" name="city" /></td> - <td></td> - <td></td> - </tr> - <tr> - <td>Mailto:</td> - <td><input id="input1" type="text" name="mailto" disabled /></td> - <td><input id="input2" type="checkbox" name="mailtocurrent" - checked onclick="toggleMailto()" /></td> - <td>Send report to me</td> - </tr> - <tr> - <td></td> - <td align="right"><input type="submit" value="Submit" /></td> - <td></td> - <td></td> - </tr> -</table> -</form> -</body> -</html> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/README.md ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/README.md b/examples/camel-example-gauth/README.md deleted file mode 100644 index 6f4136a..0000000 --- a/examples/camel-example-gauth/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# GAuth Example - -### Introduction -Building, deploying and running this example is described in detail at [http://camel.apache.org/tutorial-oauth.html](http://camel.apache.org/tutorial-oauth.html) - -### Forum, Help, etc - -If you hit an problems please let us know on the Camel Forums - <http://camel.apache.org/discussion-forums.html> - -Please help us make Apache Camel better - we appreciate any feedback you may -have. Enjoy! - - -The Camel riders! http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/pom.xml b/examples/camel-example-gauth/pom.xml deleted file mode 100644 index 2f704f4..0000000 --- a/examples/camel-example-gauth/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>examples</artifactId> - <version>2.18-SNAPSHOT</version> - </parent> - - <artifactId>camel-example-gauth</artifactId> - <name>Camel :: Example :: GAuth</name> - <description>Demonstrates how to implement Camel's OAuth support for GAE</description> - <packaging>war</packaging> - - <properties> - <!-- application properties --> - <gae.application.name>replaceme</gae.application.name> - <gae.consumer.key>replaceme</gae.consumer.key> - <gae.consumer.secret>replaceme</gae.consumer.secret> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-gae</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring-version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring-version}</version> - </dependency> - - <!-- testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <webResources> - <!-- - Copied from root pom.xml because it is not combined - with custom resource configuration below. - --> - <resource> - <directory>${project.build.outputDirectory}</directory> - <includes> - <include>META-INF/LICENSE*</include> - <include>META-INF/NOTICE*</include> - <include>META-INF/DEPENDENCIES*</include> - </includes> - </resource> - <resource> - <directory>src/main/resources</directory> - <targetPath>WEB-INF</targetPath> - <filtering>true</filtering> - <includes> - <include>appengine-web.xml</include> - </includes> - </resource> - </webResources> - </configuration> - </plugin> - </plugins> - - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <excludes> - <exclude>appengine-web.xml</exclude> - </excludes> - </resource> - </resources> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialController.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialController.java b/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialController.java deleted file mode 100644 index 520e38a..0000000 --- a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialController.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gauth; - - -import java.util.List; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.google.gdata.util.AuthenticationException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -/** - * Single controller for the demo application that handles GET requests. Obtains OAuth access - * token and access token secret from cookies and uses them to obtain calendar names from the - * Google Calendar API. If the interaction with the calendar API fails due to invalid or non- - * existing OAuth tokens an error message is displayed in authorize.jsp. If it succeeds the - * calendar names are displayed in calendar.jsp. - * <p> - * In production systems it is <em>not</em> recommended to store access tokens in cookies. The - * recommended approach is to store them in a database. The demo application is only doing that - * to keep the example as simple as possible. However, an attacker could not use an access token - * alone to get access to a user's calendar data because the application's consumer secret is - * necessary for that as well. The consumer secret never leaves the demo application. - */ -@Controller -@RequestMapping("/calendar") -public class TutorialController { - - @Autowired - private TutorialService service; - - @RequestMapping(method = RequestMethod.GET) - public String handleGet( - HttpServletRequest request, - HttpServletResponse response, - ModelMap model) throws Exception { - - List<String> calendarNames = null; - - // Get OAuth tokens from cookies - String accessToken = getAccessToken(request); - String accessTokenSecret = getAccessTokenSecret(request); - - if (accessToken == null) { - model.put("message", "No OAuth access token available"); - return "/WEB-INF/jsp/authorize.jsp"; - } - - try { - // Get calendar names from Google Calendar API - calendarNames = service.getCalendarNames(accessToken, accessTokenSecret); - } catch (AuthenticationException e) { - model.put("message", "OAuth access token invalid"); - return "/WEB-INF/jsp/authorize.jsp"; - } - - model.put("calendarNames", calendarNames); - return "/WEB-INF/jsp/calendar.jsp"; - } - - private static String getAccessToken(HttpServletRequest request) { - return getCookieValue(request.getCookies(), "TUTORIAL-ACCESS-TOKEN"); - } - - private static String getAccessTokenSecret(HttpServletRequest request) { - return getCookieValue(request.getCookies(), "TUTORIAL-ACCESS-TOKEN-SECRET"); - } - - private static String getCookieValue(Cookie[] cookies, String name) { - if (cookies == null) { - return null; - } - for (Cookie cookie : cookies) { - if (name.equals(cookie.getName())) { - return cookie.getValue(); - } - } - return null; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialRouteBuilder.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialRouteBuilder.java b/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialRouteBuilder.java deleted file mode 100644 index 4478b1e..0000000 --- a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialRouteBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gauth; - -import java.net.URLEncoder; - -import org.apache.camel.builder.RouteBuilder; - -/** - * Builds the OAuth-specific routes (implements the OAuth integration layer) of the demo application. - */ -public class TutorialRouteBuilder extends RouteBuilder { - - private String application; - - /** - * Sets the name of the GAE application. - * - * @param application a GAE application name. - */ - public void setApplication(String application) { - this.application = application; - } - - @Override - public void configure() throws Exception { - - // Callback URL for sending back an authorized access token. - String encodedCallback = URLEncoder.encode(String.format("https://%s.appspot.com/camel/handler", application), "UTF-8"); - // Google should issue an access token that is scoped to calendar feeds. - String encodedScope = URLEncoder.encode("http://www.google.com/calendar/feeds/", "UTF-8"); - - // Route for obtaining an unauthorized request token from Google Accounts. The - // response redirects the browser to an authorization page provided by Google. - from("ghttp:///authorize") - .to("gauth:authorize?callback=" + encodedCallback + "&scope=" + encodedScope); - - - // Handles callbacks from Google Accounts which contain an authorized request token. - // The authorized request token is upgraded to an access token which is stored in - // the response message header. The TutorialTokenProcessor is application-specific - // and stores the access token (plus access token secret) is cookies. It further - // redirects the user to the application's main location (/oauth/calendar). - from("ghttp:///handler") - .to("gauth:upgrade") - .process(new TutorialTokenProcessor()); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialService.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialService.java b/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialService.java deleted file mode 100644 index 205d640..0000000 --- a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialService.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gauth; - -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer; -import com.google.gdata.client.authn.oauth.OAuthParameters; -import com.google.gdata.client.calendar.CalendarService; -import com.google.gdata.data.calendar.CalendarEntry; -import com.google.gdata.data.calendar.CalendarFeed; - -/** - * Facade for getting calendar names from the Google Calendar API. The access is made on - * behalf of a user by providing an OAuth access token and access token secret. - */ -public class TutorialService { - - private Properties credentials; - - /** - * Sets properties that contains the application's consumer key and consumer secret. - * - * @param credentials consumer key and consumer secret. - */ - public void setCredentials(Properties credentials) { - this.credentials = credentials; - } - - /** - * Obtains a list of names of a user's public and private calendars from the Google - * Calendar API. - * - * @param accessToken OAuth access token. - * @param accessTokenSecret OAuth access token secret. - * @return list of names of a user's public and private calendars. - */ - public List<String> getCalendarNames(String accessToken, String accessTokenSecret) throws Exception { - CalendarService calendarService = new CalendarService("apache-camel-2.3"); - OAuthParameters params = getOAuthParams(accessToken, accessTokenSecret); - calendarService.setOAuthCredentials(params, new OAuthHmacSha1Signer()); - URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/"); - CalendarFeed resultFeed = calendarService.getFeed(feedUrl, CalendarFeed.class); - - List<String> result = new ArrayList<String>(); - for (int i = 0; i < resultFeed.getEntries().size(); i++) { - CalendarEntry entry = resultFeed.getEntries().get(i); - result.add(entry.getTitle().getPlainText()); - } - return result; - } - - private OAuthParameters getOAuthParams(String accessToken, String accessTokenSecret) { - OAuthParameters params = new OAuthParameters(); - params.setOAuthConsumerKey(credentials.getProperty("consumer.key")); - params.setOAuthConsumerSecret(credentials.getProperty("consumer.secret")); - params.setOAuthToken(accessToken); - params.setOAuthTokenSecret(accessTokenSecret); - return params; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/8f0bcd80/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialTokenProcessor.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialTokenProcessor.java b/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialTokenProcessor.java deleted file mode 100644 index d94cc59..0000000 --- a/examples/camel-example-gauth/src/main/java/org/apache/camel/example/gauth/TutorialTokenProcessor.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.gauth; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; - -import static org.apache.camel.component.gae.auth.GAuthUpgradeBinding.GAUTH_ACCESS_TOKEN; -import static org.apache.camel.component.gae.auth.GAuthUpgradeBinding.GAUTH_ACCESS_TOKEN_SECRET; - -/** - * Reads an OAuth access token plus access token secret from a Camel message and stores them in - * cookies. These cookies are needed by {@link org.apache.camel.example.gauth.TutorialController} - * for accessing a user's calendar via the Google Calendar API. The cookies are valid for one - * hour. Finally, it generates an HTTP 302 response that redirects the user to the application's - * main location (/oauth/calendar). - * <p> - * In production systems it is <em>not</em> recommended to store access tokens in cookies. The - * recommended approach is to store them in a database. The demo application is only doing that - * to keep the example as simple as possible. However, an attacker could not use an access token - * alone to get access to a user's calendar data because the application's consumer secret is - * necessary for that as well. The consumer secret never leaves the demo application. - */ -public class TutorialTokenProcessor implements Processor { - - private static final int ONE_HOUR = 3600; - - public void process(Exchange exchange) throws Exception { - String accessToken = exchange.getIn().getHeader(GAUTH_ACCESS_TOKEN, String.class); - String accessTokenSecret = exchange.getIn().getHeader(GAUTH_ACCESS_TOKEN_SECRET, String.class); - - if (accessToken != null) { - HttpServletResponse servletResponse = exchange.getIn().getHeader( - Exchange.HTTP_SERVLET_RESPONSE, HttpServletResponse.class); - - Cookie accessTokenCookie = new Cookie("TUTORIAL-ACCESS-TOKEN", accessToken); - Cookie accessTokenSecretCookie = new Cookie("TUTORIAL-ACCESS-TOKEN-SECRET", accessTokenSecret); - - accessTokenCookie.setPath("/oauth/"); - accessTokenCookie.setMaxAge(ONE_HOUR); - - accessTokenSecretCookie.setPath("/oauth/"); - accessTokenSecretCookie.setMaxAge(ONE_HOUR); - - servletResponse.addCookie(accessTokenCookie); - servletResponse.addCookie(accessTokenSecretCookie); - } - - exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 302); - exchange.getOut().setHeader("Location", "/oauth/calendar"); - } - -}