You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/01/17 15:10:46 UTC
[04/22] git commit: [OLINGO-88] Added archetype project for
'annotation-processor'
[OLINGO-88] Added archetype project for 'annotation-processor'
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/ff286bad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/ff286bad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/ff286bad
Branch: refs/heads/olingo-117
Commit: ff286bad2c61fb1658960d4bfed8727e14e8249f
Parents: 5d75f6a
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Jan 9 10:20:34 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Thu Jan 9 14:01:43 2014 +0100
----------------------------------------------------------------------
odata2-sample/cars-annotation-archetype/pom.xml | 70 +++++++
.../META-INF/maven/archetype-metadata.xml | 41 ++++
.../main/resources/archetype-resources/pom.xml | 148 ++++++++++++++
.../src/main/java/model/Address.java | 79 ++++++++
.../src/main/java/model/Car.java | 115 +++++++++++
.../src/main/java/model/Driver.java | 104 ++++++++++
.../src/main/java/model/Manufacturer.java | 98 ++++++++++
.../src/main/java/model/ResourceHelper.java | 96 +++++++++
.../AnnotationSampleServiceFactory.java | 195 +++++++++++++++++++
.../src/main/resources/log4j.xml | 47 +++++
.../src/main/version/version.html | 29 +++
.../src/main/webapp/WEB-INF/web.xml | 51 +++++
.../src/main/webapp/index.jsp | 115 +++++++++++
.../projects/basic/archetype.properties | 5 +
.../src/test/resources/projects/basic/goal.txt | 0
odata2-sample/pom.xml | 1 +
16 files changed, 1194 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
new file mode 100644
index 0000000..f275010
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -0,0 +1,70 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
+ <name>${project.artifactId}</name>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+
+ <parent>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-sample-incubating</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..81286c8
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+ name="olingo-odata2-sample-cars-annotation-incubating"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/version</directory>
+ <includes>
+ <include>**/*.html</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory></directory>
+ <includes>
+ <include>.classpath</include>
+ <include>.project</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..100d87b
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,148 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <name>${project.artifactId}</name>
+
+ <packaging>war</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- Plugin Versions -->
+ <version.compiler-plugin>2.3.2</version.compiler-plugin>
+ <version.deploy-plugin>2.8.1</version.deploy-plugin>
+ <version.eclipse-plugin>2.9</version.eclipse-plugin>
+ <version.jetty-plugin>9.0.6.v20130930</version.jetty-plugin>
+ <!-- Dependency Versions -->
+ <version.cxf>2.7.6</version.cxf>
+ <version.servlet-api>2.5</version.servlet-api>
+ <version.jaxrs-api>2.0-m10</version.jaxrs-api>
+ <version.slf4j>1.7.1</version.slf4j>
+ <version.olingo>1.1.0-SNAPSHOT</version.olingo>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <defaultGoal>package jetty:run</defaultGoal>
+ <resources>
+ <resource>
+ <directory>src/main/version</directory>
+ <filtering>true</filtering>
+ <targetPath>../${project.build.finalName}/gen</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>target/maven-shared-archive-resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${version.compiler-plugin}</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>${version.deploy-plugin}</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>${version.eclipse-plugin}</version>
+ <configuration>
+ <addGroupIdToProjectName>true</addGroupIdToProjectName>
+ <addVersionToProjectName>true</addVersionToProjectName>
+ <wtpversion>2.0</wtpversion>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${version.jetty-plugin}</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- Apache Olingo Library dependencies -->
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-api-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <type>jar</type>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-core-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <!-- Apache Olingo Annotation Processor Extension dependencies -->
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <!-- Additional dependencies -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+ <!-- Servlet/REST dependencies -->
+ <dependency>
+ <!-- required because of auto detection of web facet 2.5 -->
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet-api}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${version.jaxrs-api}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${version.cxf}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
new file mode 100644
index 0000000..66ea6b9
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import org.apache.olingo.odata2.api.annotation.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmComplexType(name = "Address", namespace = "MyFormula")
+public class Address {
+
+ @EdmProperty
+ private String street;
+ @EdmProperty
+ private String city;
+ @EdmProperty
+ private String zipCode;
+ @EdmProperty
+ private String country;
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getZipCode() {
+ return zipCode;
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @Override
+ public String toString() {
+ return "Address{" + "street=" + street + ", city=" + city + ", zipCode=" + zipCode + ", country=" + country + '}';
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
new file mode 100644
index 0000000..26deb78
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.Date;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Cars")
+public class Car {
+
+ @EdmKey
+ @EdmProperty
+ private String id;
+ @EdmProperty
+ private String model;
+ @EdmNavigationProperty
+ private Manufacturer manufacturer;
+ @EdmNavigationProperty
+ private Driver driver;
+ @EdmProperty
+ private Double price;
+ @EdmProperty
+ private Integer modelYear;
+ @EdmProperty
+ private Date updated;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public Manufacturer getManufacturer() {
+ return manufacturer;
+ }
+
+ public void setManufacturer(Manufacturer manufacturer) {
+ this.manufacturer = manufacturer;
+ }
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
+
+ public int getModelYear() {
+ return modelYear;
+ }
+
+ public void setModelYear(int modelYear) {
+ this.modelYear = modelYear;
+ }
+
+ public Date getUpdated() {
+ return updated;
+ }
+
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ public Driver getDriver() {
+ return driver;
+ }
+
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
+
+ @Override
+ public String toString() {
+ return "Car{" + "id=" + id + ", model=" + model + ", manufacturer id=" + manufacturer.getId() + ", driver id=" + driver.getId() +
+ ", price=" + price + ", modelYear=" + modelYear + ", updated=" + updated + '}';
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
new file mode 100644
index 0000000..594e002
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.Calendar;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Drivers")
+public class Driver {
+
+ @EdmKey
+ @EdmProperty
+ private Long id;
+
+ @EdmProperty
+ private String name;
+ @EdmProperty
+ private String lastname;
+ @EdmProperty
+ private String nickname;
+ @EdmNavigationProperty(name = "Car")
+ private Car car;
+ @EdmProperty(type = EdmType.DATE_TIME)
+ private Calendar birthday;
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getNickname() {
+ return nickname;
+ }
+
+ public void setNickname(String nickname) {
+ this.nickname = nickname;
+ }
+
+ public Car getCar() {
+ return car;
+ }
+
+ public void setCar(Car car) {
+ this.car = car;
+ }
+
+ public Calendar getUpdated() {
+ return birthday;
+ }
+
+ public void setBirthday(Calendar birthday) {
+ this.birthday = birthday;
+ }
+
+ @Override
+ public String toString() {
+ return "Driver{id=" + id + ", name=" + name + ", lastname=" + lastname + ", nickname=" + nickname
+ + ", car id=" + car.getId() + ", updated=" + birthday + '}';
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
new file mode 100644
index 0000000..2e8163c
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty.Multiplicity;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Manufacturers")
+public class Manufacturer {
+
+ @EdmKey
+ @EdmProperty
+ private String id;
+ @EdmProperty
+ private String name;
+ @EdmProperty
+ private Calendar founded;
+ @EdmProperty
+ private Address address;
+ @EdmNavigationProperty(name = "Cars", toType = Car.class, toMultiplicity = Multiplicity.MANY)
+ private List<Car> cars = new ArrayList<Car>();
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Calendar getUpdated() {
+ return founded;
+ }
+
+ public void setFounded(Calendar updated) {
+ this.founded = updated;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public List<Car> getCars() {
+ return cars;
+ }
+
+ public void setCars(List<Car> cars) {
+ this.cars = cars;
+ }
+
+ @Override
+ public String toString() {
+ return "Manufacturer{" + "id=" + id + ", name=" + name + ", updated=" + founded +
+ ", address=" + address + ", cars=" + cars.size() + '}';
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
new file mode 100644
index 0000000..d509d28
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.WritableRaster;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.imageio.ImageIO;
+
+/**
+ *
+ */
+public class ResourceHelper {
+
+ public static byte[] loadAsByte(String resource) {
+ return load(resource, new byte[0]);
+ }
+
+ public static byte[] load(String resource, byte[] defaultResult) {
+ InputStream instream = null;
+ try {
+ instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ if (instream == null) {
+ return defaultResult;
+ }
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ int b = 0;
+ while ((b = instream.read()) != -1) {
+ stream.write(b);
+ }
+
+ return stream.toByteArray();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if(instream != null) {
+ try {
+ instream.close();
+ } catch (IOException ex) { }
+ }
+ }
+ }
+
+ public enum Format {BMP, JPEG, PNG, GIF};
+
+ public static byte[] generateImage() {
+ return generateImage(Format.PNG);
+ }
+
+ public static byte[] generateImage(Format format) {
+ try {
+ int width = 320;
+ int height = 320;
+ BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
+ WritableRaster raster = image.getRaster();
+
+ int mod = format.ordinal() + 2;
+ for (int h = 0; h < height; h++) {
+ for (int w = 0; w < width; w++) {
+ if (((h / 32) + (w / 32)) % mod == 0) {
+ raster.setSample(w, h, 0, 0);
+ } else {
+ raster.setSample(w, h, 0, 1);
+ }
+ }
+ }
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+ ImageIO.write(image, format.name(), out);
+ return out.toByteArray();
+ } catch (IOException ex) {
+ return new byte[0];
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
new file mode 100644
index 0000000..5b346cc
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.processor;
+
+import ${package}.model.Address;
+import ${package}.model.Car;
+import ${package}.model.Driver;
+import ${package}.model.Manufacturer;
+import java.util.Calendar;
+import java.util.Locale;
+import org.apache.olingo.odata2.annotation.processor.api.AnnotationServiceFactory;
+import org.apache.olingo.odata2.annotation.processor.core.datasource.DataStore;
+import org.apache.olingo.odata2.api.ODataCallback;
+import org.apache.olingo.odata2.api.ODataDebugCallback;
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.exception.ODataApplicationException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataErrorCallback;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class AnnotationSampleServiceFactory extends ODataServiceFactory {
+
+ /**
+ * Instance holder for all annotation relevant instances which should be used as singleton
+ * instances within the ODataApplication (ODataService)
+ */
+ private static class AnnotationInstances {
+ final static String MODEL_PACKAGE = "${package}.model";
+ final static ODataService ANNOTATION_ODATA_SERVICE;
+
+ static {
+ try {
+ ANNOTATION_ODATA_SERVICE = AnnotationServiceFactory.createAnnotationService(MODEL_PACKAGE);
+ initializeSampleData();
+ } catch (ODataApplicationException ex) {
+ throw new RuntimeException("Exception during sample data generation.", ex);
+ } catch (ODataException ex) {
+ throw new RuntimeException("Exception during data source initialization generation.", ex);
+ }
+ }
+ }
+
+ @Override
+ public ODataService createService(final ODataContext context) throws ODataException {
+ // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
+ return AnnotationInstances.ANNOTATION_ODATA_SERVICE;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T extends ODataCallback> T getCallback(final Class<? extends ODataCallback> callbackInterface) {
+ return (T) (callbackInterface.isAssignableFrom(ScenarioErrorCallback.class)
+ ? new ScenarioErrorCallback() : callbackInterface.isAssignableFrom(ODataDebugCallback.class)
+ ? new ScenarioDebugCallback() : super.getCallback(callbackInterface));
+ }
+
+ /*
+ * Helper classes and methods
+ */
+ private final class ScenarioDebugCallback implements ODataDebugCallback {
+
+ @Override
+ public boolean isDebugEnabled() {
+ return true;
+ }
+ }
+
+ private class ScenarioErrorCallback implements ODataErrorCallback {
+
+ private final Logger LOG = LoggerFactory.getLogger(ScenarioErrorCallback.class);
+
+ @Override
+ public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
+ if (context.getHttpStatus() == HttpStatusCodes.INTERNAL_SERVER_ERROR) {
+ LOG.error("Internal Server Error", context.getException());
+ }
+
+ return EntityProvider.writeErrorDocument(context);
+ }
+
+ }
+
+ private static <T> DataStore<T> getDataStore(Class<T> clz) throws DataStore.DataStoreException {
+ return DataStore.createInMemory(clz, true);
+ }
+
+ private static void initializeSampleData() throws ODataApplicationException {
+ DataStore<Car> carDs = getDataStore(Car.class);
+ Calendar updated = Calendar.getInstance();
+ Car c1 = createCar("F1 W02", 167189.00, 2011, updated);
+ carDs.create(c1);
+ Car c2 = createCar("F1 W04", 242189.99, 2013, updated);
+ carDs.create(c2);
+ Car c3 = createCar("FF2013", 199189.11, 2013, updated);
+ carDs.create(c3);
+ Car c4 = createCar("FF2014", 299189.11, 2014, updated);
+ carDs.create(c4);
+
+ DataStore<Driver> driverDs = getDataStore(Driver.class);
+ Driver d1 = createDriver("Mic", "Shoemaker", "The Fast", createDateTime(1985, 6, 27), c1);
+ driverDs.create(d1);
+ Driver d2 = createDriver("Nico", "Mulemountain", null, createDateTime(1969, 1, 3), c2);
+ driverDs.create(d2);
+ Driver d3 = createDriver("Kimi", "Heikkinen", "Iceman", createDateTime(1979, 10, 17), c3);
+ driverDs.create(d3);
+
+ Address addressStar = createAddress("Star Street 137", "Stuttgart", "70173", "Germany");
+ Manufacturer manStar = createManufacturer("Star Powered Racing", addressStar, createDateTime(1954, 7, 4), c1, c2);
+
+ Address addressHorse = createAddress("Horse Street 1", "Maranello", "41053", "Italy");
+ Manufacturer manHorse = createManufacturer("Horse Powered Racing", addressHorse, createDateTime(1929, 11, 16), c3, c4);
+
+ DataStore<Manufacturer> manDs = getDataStore(Manufacturer.class);
+ manDs.create(manStar);
+ manDs.create(manHorse);
+ }
+
+ private static Calendar createDateTime(int year, int month, int day) {
+ Calendar cal = Calendar.getInstance(Locale.ENGLISH);
+ cal.clear();
+ cal.set(year, month - 1, day);
+ return cal;
+ }
+
+ private static Car createCar(String name, double price, int modelyear, Calendar updated) {
+ Car car = new Car();
+ car.setModel(name);
+ car.setModelYear(modelyear);
+ car.setPrice(price);
+ car.setUpdated(updated.getTime());
+ return car;
+ }
+
+ private static Driver createDriver(String name, String lastname, String nickname, Calendar birthday, Car car) {
+ Driver driver = new Driver();
+ driver.setName(name);
+ driver.setLastname(lastname);
+ driver.setNickname(nickname);
+ driver.setBirthday(birthday);
+ driver.setCar(car);
+ car.setDriver(driver);
+ return driver;
+ }
+
+ private static Manufacturer createManufacturer(String name, Address address, Calendar founded, Car... cars) {
+ Manufacturer m = new Manufacturer();
+ m.setName(name);
+ m.setAddress(address);
+ m.setFounded(founded);
+ for (Car car : cars) {
+ car.setManufacturer(m);
+ m.getCars().add(car);
+ }
+ return m;
+ }
+
+ private static Address createAddress(final String street, final String city, final String zipCode,
+ final String country) {
+ Address address = new Address();
+ address.setStreet(street);
+ address.setCity(city);
+ address.setZipCode(zipCode);
+ address.setCountry(country);
+ return address;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
new file mode 100644
index 0000000..6e3ec59
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %c{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <logger name="${package}" additivity="false">
+ <level value="trace" />
+ <appender-ref ref="console" />
+ </logger>
+
+ <logger name="org.apache.olingo.odata2" additivity="false">
+ <level value="debug" />
+ <appender-ref ref="console" />
+ </logger>
+
+ <root>
+ <priority value="error" />
+ <appender-ref ref="console" />
+ </root>
+</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
new file mode 100644
index 0000000..512ae83
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
@@ -0,0 +1,29 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!--
+
+ 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.
+
+-->
+<table border="1">
+ <tr><td>name</td><td>${symbol_dollar}{name}</td></tr>
+ <tr><td>version</td><td>${symbol_dollar}{version}</td></tr>
+ <tr><td>timestamp</td><td>${symbol_dollar}{timestamp}</td></tr>
+ <tr><td>project.build.finalName</td><td>${symbol_dollar}{project.build.finalName}</td></tr>
+</table>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..1a22906
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" 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"
+ id="WebApp_ID" version="2.5">
+ <display-name>${package}</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <servlet>
+ <servlet-name>CarServiceServlet</servlet-name>
+ <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
+ <init-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.olingo.odata2.core.rest.app.ODataApplication</param-value>
+ </init-param>
+ <init-param>
+ <param-name>org.apache.olingo.odata2.service.factory</param-name>
+ <param-value>${package}.processor.AnnotationSampleServiceFactory</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CarServiceServlet</servlet-name>
+ <url-pattern>/MyFormula.svc/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
new file mode 100644
index 0000000..b6f892d
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
@@ -0,0 +1,115 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!--
+
+ 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.
+
+-->
+<%@ page language="java" contentType="text/html; UTF-8" pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Apache Olingo - OData2 Library</title>
+<style type="text/css">
+body { font-family: Arial, sans-serif; font-size: 13px; line-height: 18px;
+ color: blue; background-color: ${symbol_pound}ffffff; }
+a { color: blue; text-decoration: none; }
+a:focus { outline: thin dotted ${symbol_pound}4076cb; outline-offset: -1px; }
+a:hover, a:active { outline: 0; }
+a:hover { color: ${symbol_pound}404a7e; text-decoration: underline; }
+h1, h2, h3, h4, h5, h6 { margin: 9px 0; font-family: inherit; font-weight: bold;
+ line-height: 1; color: blue; }
+h1 { font-size: 36px; line-height: 40px; }
+h2 { font-size: 30px; line-height: 40px; }
+h3 { font-size: 24px; line-height: 40px; }
+h4 { font-size: 18px; line-height: 20px; }
+h5 { font-size: 14px; line-height: 20px; }
+h6 { font-size: 12px; line-height: 20px; }
+.logo { float: right; }
+ul { padding: 0; margin: 0 0 9px 25px; }
+ul ul { margin-bottom: 0; }
+li { line-height: 18px; }
+hr { margin: 18px 0;
+ border: 0; border-top: 1px solid ${symbol_pound}cccccc; border-bottom: 1px solid ${symbol_pound}ffffff; }
+table { border-collapse: collapse; border-spacing: 10px; }
+th, td { border: 1px solid; padding: 20px; }
+.code { font-family: "Courier New", monospace; font-size: 13px; line-height: 18px; }
+</style>
+</head>
+<body>
+ <h1>Apache Olingo - OData2 Library</h1>
+ <hr />
+ <h2>Reference Scenario</h2>
+ <table>
+ <tr>
+ <td valign="top">
+ <h3>Service Document and Metadata</h3>
+ <ul>
+ <li><a href="MyFormula.svc?_wadl" target="_blank">wadl</a></li>
+ <li><a href="MyFormula.svc/" target="_blank">service document</a></li>
+ <li><a href="MyFormula.svc/${symbol_dollar}metadata" target="_blank">metadata</a></li>
+ </ul>
+ <h3>EntitySets</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers" target="_blank">Manufacturers</a></li>
+ <li><a href="MyFormula.svc/Manufacturers/?${symbol_dollar}expand=Cars" target="_blank">Manufacturers/?${symbol_dollar}expand=Cars</a></li>
+ <li><a href="MyFormula.svc/Cars" target="_blank">Cars</a></li>
+ <li><a href="MyFormula.svc/Cars/?${symbol_dollar}expand=Driver" target="_blank">Cars/?${symbol_dollar}expand=Driver</a></li>
+ <li><a href="MyFormula.svc/Drivers" target="_blank">Drivers</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}expand=Car" target="_blank">Drivers/?${symbol_dollar}expand=Car</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}orderby=Lastname" target="_blank">Drivers/?${symbol_dollar}orderby=Lastname</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}filter=year(Birthday)%20gt%201981" target="_blank">Drivers/?${symbol_dollar}filter=year(Birthday) gt 1981</a></li>
+ </ul>
+ <h3>Entities</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers('1')" target="_blank">Manufacturers('1')</a></li>
+ <li><a href="MyFormula.svc/Manufacturers('1')/Cars" target="_blank">Manufacturers('1')/Cars</a></li>
+ <li><a href="MyFormula.svc/Cars('1')" target="_blank">Cars('1')</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/Driver" target="_blank">Cars('1')/Driver</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/?${symbol_dollar}expand=Manufacturer" target="_blank">Cars('1')/?${symbol_dollar}expand=Manufacturer</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)" target="_blank">Drivers(1)</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)/Car" target="_blank">Drivers(1)/Car</a></li>
+ </ul>
+ </td>
+ <td valign="top">
+
+ </td>
+ <td valign="bottom">
+ <div class="code">
+ <%
+ String version = "gen/version.html";
+ %>
+ <%
+ try {
+ %>
+ <jsp:include page='<%=version%>' />
+ <%
+ } catch (Exception e) {
+ %>
+ <p>IDE Build</p>
+ <%
+ }
+ %>
+ </div>
+ </td>
+ </tr>
+ </table>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..5bb9a2b
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,5 @@
+#Thu Jan 09 06:21:45 CET 2014
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff286bad/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index 576d4f0..8082976 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -23,5 +23,6 @@
<modules>
<module>cars-service-archetype</module>
+ <module>cars-annotation-archetype</module>
</modules>
</project>