You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by tb...@apache.org on 2013/12/06 17:53:24 UTC
[42/50] [abbrv] Renamed project
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/ResourceHelper.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/ResourceHelper.java
new file mode 100644
index 0000000..73d1218
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/ResourceHelper.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.annotation.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 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/39485c57/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
new file mode 100644
index 0000000..7c9e486
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2013 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.olingo.odata2.core.annotation.model;
+
+import java.util.ArrayList;
+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.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Rooms")
+public class Room extends RefBase {
+
+ @EdmProperty
+ private Integer seats;
+ @EdmProperty
+ private Integer version;
+ @EdmNavigationProperty(name = "nr_Building", association = "BuildingRooms")
+ private Building building;
+ @EdmNavigationProperty(name = "nr_Employees")
+ private List<Employee> employees = new ArrayList<Employee>();
+
+ public Room(final int id, final String name) {
+ super(id, name);
+ }
+
+ public void setSeats(final int seats) {
+ this.seats = seats;
+ }
+
+ public int getSeats() {
+ return seats;
+ }
+
+ public void setVersion(final int version) {
+ this.version = version;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setBuilding(final Building building) {
+ this.building = building;
+ }
+
+ public Building getBuilding() {
+ return building;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && id == ((Room) obj).id;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Id\":\"" + id + "\",\"Name\":\"" + name + "\",\"Seats\":" + seats + ",\"Version\":" + version + "}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
new file mode 100644
index 0000000..e9b296f
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.annotation.model;
+
+import java.util.ArrayList;
+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.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty.Multiplicity;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+*
+*/
+@EdmEntityType(name = "Team", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Teams")
+public class Team extends RefBase {
+ @EdmProperty(type = EdmType.BOOLEAN)
+ private Boolean isScrumTeam;
+ @EdmNavigationProperty(name = "nt_Employees", association = "TeamEmployees", toMultiplicity = Multiplicity.MANY)
+ private List<Employee> employees = new ArrayList<Employee>();
+
+ public Team() {
+ super(-1, null);
+ }
+
+ public Team(final int id, final String name) {
+ super(id, name);
+ }
+
+ public Boolean isScrumTeam() {
+ return isScrumTeam;
+ }
+
+ public void setScrumTeam(final Boolean isScrumTeam) {
+ this.isScrumTeam = isScrumTeam;
+ }
+
+ public void addEmployee(Employee e) {
+ this.employees.add(e);
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && id == ((Team) obj).id;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Id\":\"" + id + "\",\"Name\":\"" + name + "\",\"IsScrumTeam\":" + isScrumTeam + "}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/pom.xml b/odata2-annotation-processor/annotation-processor-webref/pom.xml
new file mode 100644
index 0000000..9f31106
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/pom.xml
@@ -0,0 +1,120 @@
+<?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>
+
+ <artifactId>olingo-odata2-annotation-processor-webref-incubating</artifactId>
+ <packaging>war</packaging>
+ <name>${project.artifactId}</name>
+
+ <parent>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <properties>
+ <version.slf4j>1.7.1</version.slf4j>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <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>com.sap.research</groupId>
+ <artifactId>nwcloud-maven-plugin</artifactId>
+ <version>1.0.0.RELEASE</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <dependencies>
+ <dependency>
+ <!-- required because of auto detection of web facet 2.5 -->
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-api-incubating</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-core-incubating</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <build>
+ <defaultGoal>cargo:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.4.2</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
new file mode 100644
index 0000000..668ac86
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+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;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+ *
+ */
+@EdmEntityType(name = "Building", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Buildings")
+public class Building {
+ @EdmKey
+ @EdmProperty(type = EdmType.INT32)
+ private int id;
+ @EdmProperty
+ private String name;
+ @EdmProperty(name = "Image", type = EdmType.BINARY)
+ private byte[] image;
+ @EdmNavigationProperty(name = "nb_Rooms", toType = Room.class,
+ association = "BuildingRooms", toMultiplicity = Multiplicity.MANY)
+ private List<Room> rooms = new ArrayList<Room>();
+
+ public String getId() {
+ return Integer.toString(id);
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setImage(final byte[] byteArray) {
+ image = byteArray;
+ }
+
+ public byte[] getImage() {
+ if (image == null) {
+ return null;
+ } else {
+ return image.clone();
+ }
+ }
+
+ public void addRoom(Room room) {
+ rooms.add(room);
+ }
+
+ public List<Room> getRooms() {
+ return rooms;
+ }
+
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && id == ((Building) obj).id;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Id\":\"" + id + "\",\"Name\":\"" + name + "\",\"Image\":\"" + Arrays.toString(image) + "\"}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/City.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/City.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/City.java
new file mode 100644
index 0000000..a4d5a56
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/City.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import org.apache.olingo.odata2.api.annotation.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmComplexType(name="c_City", namespace = ModelSharedConstants.NAMESPACE_1)
+public class City {
+
+ @EdmProperty
+ private String postalCode;
+ @EdmProperty
+ private String cityName;
+
+ public City(final String postalCode, final String name) {
+ this.postalCode = postalCode;
+ cityName = name;
+ }
+
+ public void setPostalCode(final String postalCode) {
+ this.postalCode = postalCode;
+ }
+
+ public String getPostalCode() {
+ return postalCode;
+ }
+
+ public void setCityName(final String cityName) {
+ this.cityName = cityName;
+ }
+
+ public String getCityName() {
+ return cityName;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s, %s", cityName, postalCode);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
new file mode 100644
index 0000000..2204ee8
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.text.DateFormat;
+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.EdmFacets;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceContent;
+import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceMimeType;
+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(name = "Employee", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Employees")
+public class Employee {
+ @EdmKey
+ @EdmProperty(name = "EmployeeId", type = EdmType.STRING)
+ private String employeeId;
+ @EdmProperty(name = "EmployeeName")
+ private String employeeName;
+ @EdmProperty
+ private int age;
+ @EdmNavigationProperty(name = "ne_Manager", association = "ManagerEmployees")
+ private Manager manager;
+ @EdmNavigationProperty(name = "ne_Team", association = "TeamEmployees")
+ private Team team;
+ @EdmNavigationProperty(name = "ne_Room")
+ private Room room;
+ @EdmMediaResourceMimeType
+ private String imageType;
+ @EdmMediaResourceContent
+ private byte[] image;
+ @EdmProperty(name = "ImageUrl")
+ private String imageUrl;
+ @EdmProperty(name = "EntryDate", type = EdmType.DATE_TIME,
+ facets = @EdmFacets(nullable = true))
+ private Calendar entryDate;
+ @EdmProperty(name = "Location", facets = @EdmFacets(nullable = false))
+ private Location location;
+
+ public String getId() {
+ return employeeId;
+ }
+
+ public void setEmployeeName(final String employeeName) {
+ this.employeeName = employeeName;
+ }
+
+ public String getEmployeeName() {
+ return employeeName;
+ }
+
+ public void setAge(final int age) {
+ this.age = age;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setManager(final Manager manager) {
+ this.manager = manager;
+ }
+
+ public Manager getManager() {
+ return manager;
+ }
+
+ public void setTeam(final Team team) {
+ this.team = team;
+ }
+
+ public Team getTeam() {
+ return team;
+ }
+
+ public void setRoom(final Room room) {
+ this.room = room;
+ }
+
+ public Room getRoom() {
+ return room;
+ }
+
+ public void setImageUri(final String imageUri) {
+ imageUrl = imageUri;
+ }
+
+ public String getImageUri() {
+ return imageUrl;
+ }
+
+ public void setLocation(final Location location) {
+ this.location = location;
+ }
+
+ public Location getLocation() {
+ return location;
+ }
+
+ public void setEntryDate(final Calendar date) {
+ entryDate = date;
+ }
+
+ public Calendar getEntryDate() {
+ return entryDate;
+ }
+
+ public void setImageType(final String imageType) {
+ this.imageType = imageType;
+ }
+
+ public String getImageType() {
+ return imageType;
+ }
+
+ public void setImage(final byte[] image) {
+ this.image = image;
+ }
+
+ public void setImage(final String imageUrl) {
+ image = loadImage(imageUrl);
+ }
+
+ private static byte[] loadImage(final String imageUrl) {
+ return ResourceHelper.loadAsByte(imageUrl);
+ }
+
+ public byte[] getImage() {
+ if (image == null) {
+ return null;
+ }
+ return image.clone();
+ }
+
+ @Override
+ public int hashCode() {
+ if (employeeId == null) {
+ return 0;
+ }
+ return employeeId.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && employeeId == ((Employee) obj).employeeId;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"EmployeeId\":\"" + employeeId + "\","
+ + "\"EmployeeName\":\"" + employeeName + "\","
+ + "\"ManagerId\":" + (manager == null ? "null" : "\"" + manager.getId() + "\"") + ","
+ + "\"RoomId\":" + (room == null ? "null" : "\"" + room.getId() + "\"") + ","
+ + "\"TeamId\":" + (team == null ? "null" : "\"" + team.getId() + "\"") + ","
+ + "\"Location\":"
+ + (location == null ? "null" :
+ "{\"City\":" + (location.getCity() == null ? "null" :
+ "{\"PostalCode\":\"" + location.getCity().getPostalCode() + "\","
+ + "\"CityName\":\"" + location.getCity().getCityName() + "\"}") + ","
+ + "\"Country\":\"" + location.getCountry() + "\"}") + ","
+ + "\"Age\":" + age + ","
+ + "\"EntryDate\":"
+ + (entryDate == null ? "null" : "\"" + DateFormat.getInstance().format(entryDate.getTime()) + "\"") + ","
+ + "\"ImageUrl\":\"" + imageUrl + "\"}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
new file mode 100644
index 0000000..9b0785c
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import org.apache.olingo.odata2.api.annotation.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmComplexType(name = "c_Location", namespace = ModelSharedConstants.NAMESPACE_1)
+public class Location {
+ @EdmProperty
+ private String country;
+ @EdmProperty
+ private City city;
+
+ public Location(final String country, final String postalCode, final String cityName) {
+ this.country = country;
+ city = new City(postalCode, cityName);
+ }
+
+ public void setCountry(final String country) {
+ this.country = country;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCity(final City city) {
+ this.city = city;
+ }
+
+ public City getCity() {
+ return city;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s, %s", country, city.toString());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
new file mode 100644
index 0000000..57e6d78
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.util.ArrayList;
+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.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty.Multiplicity;
+
+/**
+ *
+ */
+@EdmEntityType(name = "Manager", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Managers")
+public class Manager extends Employee {
+
+ @EdmNavigationProperty(name = "nm_Employees", association = "ManagerEmployees",
+ toMultiplicity = Multiplicity.MANY)
+ private List<Employee> employees = new ArrayList<Employee>();
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ModelSharedConstants.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ModelSharedConstants.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ModelSharedConstants.java
new file mode 100644
index 0000000..ab17fbb
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ModelSharedConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+public interface ModelSharedConstants {
+
+ String NAMESPACE_1 = "RefScenario";
+ String CONTAINER_1 = "Container1";
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
new file mode 100644
index 0000000..52971cd
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.util.Arrays;
+
+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.EdmMediaResourceContent;
+import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceMimeType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceSource;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+ *
+ */
+@EdmEntityType(name = "Photo", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Photos")
+public class Photo {
+ @EdmKey
+ @EdmProperty
+ private String name;
+ @EdmKey
+ @EdmProperty
+ private String type;
+ @EdmProperty
+ @EdmMediaResourceMimeType
+ private String mimeType;
+ @EdmProperty
+ @EdmMediaResourceSource
+ private String imageUrl = "http://localhost/someResource.png";
+ @EdmProperty(type = EdmType.BINARY)
+ @EdmMediaResourceContent
+ private byte[] image = ResourceHelper.generateImage();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getImageUri() {
+ return imageUrl;
+ }
+
+ public void setImageUri(final String uri) {
+ imageUrl = uri;
+ }
+
+ public byte[] getImage() {
+ return image.clone();
+ }
+
+ public void setImage(final byte[] image) {
+ this.image = image;
+ }
+
+ public String getImageType() {
+ return mimeType;
+ }
+
+ public void setImageType(final String imageType) {
+ this.mimeType = imageType;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0);
+ hash = 83 * hash + (this.type != null ? this.type.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Photo other = (Photo) obj;
+ if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
+ return false;
+ }
+ if ((this.type == null) ? (other.type != null) : !this.type.equals(other.type)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Name\":\"" + name + "\","
+ + "\"Type\":\"" + type + "\","
+ + "\"ImageUrl\":\"" + imageUrl + "\","
+ + "\"Image\":\"" + Arrays.toString(image) + "\","
+ + "\"MimeType\":\"" + mimeType + "\"";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/RefBase.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/RefBase.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/RefBase.java
new file mode 100644
index 0000000..727b8c3
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/RefBase.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+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.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+ *
+ */
+@EdmEntityType(name="Base", namespace=ModelSharedConstants.NAMESPACE_1)
+public abstract class RefBase {
+ @EdmProperty(name="Name")
+ protected String name;
+ @EdmProperty(name="Id", type = EdmType.STRING)
+ @EdmKey
+ protected String id;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setId(int id) {
+ this.id = String.valueOf(id);
+ }
+
+ @Override
+ public int hashCode() {
+ if(id == null) {
+ return -1;
+ }
+ return id.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final RefBase other = (RefBase) obj;
+ if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
+ return false;
+ }
+ if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
+ return false;
+ }
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ResourceHelper.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ResourceHelper.java
new file mode 100644
index 0000000..948f6e5
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/ResourceHelper.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.WritableRaster;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+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) { }
+ }
+ }
+ }
+
+ static byte[] generateImage() {
+ try {
+ // ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+// String format = "PNG";
+// int width = 200;
+// int height = 200;
+// int imageType = BufferedImage.TYPE_BYTE_BINARY;
+// BufferedImage image = new BufferedImage(width, height, imageType);
+// ImageIO.write(image, format, outStream);
+// return null;
+
+ return test();
+ } catch (IOException ex) {
+ return new byte[0];
+ }
+ }
+
+ private static byte[] test() throws IOException {
+ int width = 400; // Dimensions of the image
+ int height = 400;
+ // Let's create a BufferedImage for a binary image.
+ BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
+ // We need its raster to set the pixels' values.
+ WritableRaster raster = im.getRaster();
+ // Put the pixels on the raster. Note that only values 0 and 1 are used for the pixels.
+ // You could even use other values: in this type of image, even values are black and odd
+ // values are white.
+ for (int h = 0; h < height; h++) {
+ for (int w = 0; w < width; w++) {
+ if (((h / 50) + (w / 50)) % 2 == 0) {
+ raster.setSample(w, h, 0, 0); // checkerboard pattern.
+ } else {
+ raster.setSample(w, h, 0, 1);
+ }
+ }
+ }
+ // Store the image using the PNG format.
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024*10);
+ ImageIO.write(im, "PNG", out);
+ return out.toByteArray();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
new file mode 100644
index 0000000..2d9f48e
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.util.ArrayList;
+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.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Rooms")
+public class Room extends RefBase {
+
+ @EdmProperty
+ private Integer seats;
+ @EdmProperty
+ private Integer version;
+ @EdmNavigationProperty(name = "nr_Building", association = "BuildingRooms")
+ private Building building;
+ @EdmNavigationProperty(name = "nr_Employees")
+ private List<Employee> employees = new ArrayList<Employee>();
+
+ public void setSeats(final int seats) {
+ this.seats = seats;
+ }
+
+ public int getSeats() {
+ return seats;
+ }
+
+ public void setVersion(final int version) {
+ this.version = version;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setBuilding(final Building building) {
+ this.building = building;
+ }
+
+ public Building getBuilding() {
+ return building;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && id == ((Room) obj).id;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Id\":\"" + id + "\",\"Name\":\"" + name + "\",\"Seats\":" + seats + ",\"Version\":" + version + "}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
new file mode 100644
index 0000000..50d2ad2
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.olingo.odata2.ref.annotation.model;
+
+import java.util.ArrayList;
+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.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty.Multiplicity;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+*
+*/
+@EdmEntityType(name = "Team", namespace = ModelSharedConstants.NAMESPACE_1)
+@EdmEntitySet(name = "Teams")
+public class Team extends RefBase {
+ @EdmProperty(type = EdmType.BOOLEAN)
+ private Boolean isScrumTeam;
+ @EdmNavigationProperty(name = "nt_Employees", association = "TeamEmployees", toMultiplicity = Multiplicity.MANY)
+ private List<Employee> employees = new ArrayList<Employee>();
+
+ public Boolean isScrumTeam() {
+ return isScrumTeam;
+ }
+
+ public void setScrumTeam(final Boolean isScrumTeam) {
+ this.isScrumTeam = isScrumTeam;
+ }
+
+ public void addEmployee(Employee e) {
+ this.employees.add(e);
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj
+ || obj != null && getClass() == obj.getClass() && id == ((Team) obj).id;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"Id\":\"" + id + "\",\"Name\":\"" + name + "\",\"IsScrumTeam\":" + isScrumTeam + "}";
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/processor/AnnotationPocServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/processor/AnnotationPocServiceFactory.java b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/processor/AnnotationPocServiceFactory.java
new file mode 100644
index 0000000..3870119
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/processor/AnnotationPocServiceFactory.java
@@ -0,0 +1,202 @@
+/**
+ * *****************************************************************************
+ * 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.olingo.odata2.ref.annotation.processor;
+
+import java.util.Calendar;
+
+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.apache.olingo.odata2.core.annotation.data.AnnotationInMemoryDs;
+import org.apache.olingo.odata2.core.annotation.data.AnnotationValueAccess;
+import org.apache.olingo.odata2.core.annotation.data.DataStore;
+import org.apache.olingo.odata2.core.annotation.edm.AnnotationEdmProvider;
+import org.apache.olingo.odata2.core.annotation.processor.ListsProcessor;
+import org.apache.olingo.odata2.ref.annotation.model.Building;
+import org.apache.olingo.odata2.ref.annotation.model.Employee;
+import org.apache.olingo.odata2.ref.annotation.model.Location;
+import org.apache.olingo.odata2.ref.annotation.model.Manager;
+import org.apache.olingo.odata2.ref.annotation.model.Photo;
+import org.apache.olingo.odata2.ref.annotation.model.ResourceHelper;
+import org.apache.olingo.odata2.ref.annotation.model.Room;
+import org.apache.olingo.odata2.ref.annotation.model.Team;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class AnnotationPocServiceFactory extends ODataServiceFactory {
+
+ private static boolean isInitialized = false;
+
+ @Override
+ public ODataService createService(final ODataContext context) throws ODataException {
+
+ String modelPackage = "org.apache.olingo.odata2.ref.annotation.model";
+ AnnotationEdmProvider annotationEdmProvider = new AnnotationEdmProvider(modelPackage);
+ AnnotationInMemoryDs annotationScenarioDs = new AnnotationInMemoryDs(modelPackage);
+ AnnotationValueAccess annotationValueAccess = new AnnotationValueAccess();
+
+ if (!isInitialized) {
+ initializeSampleData(annotationScenarioDs);
+ isInitialized = true;
+ }
+
+ // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
+ return createODataSingleProcessorService(annotationEdmProvider,
+ new ListsProcessor(annotationScenarioDs, annotationValueAccess));
+ }
+
+ @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 void initializeSampleData(AnnotationInMemoryDs dataSource) throws ODataApplicationException {
+ DataStore<Team> teamDs = dataSource.getDataStore(Team.class);
+ teamDs.create(createTeam("Team Alpha", true));
+ teamDs.create(createTeam("Team Beta", false));
+ teamDs.create(createTeam("Team Gamma", false));
+ teamDs.create(createTeam("Team Omega", true));
+ teamDs.create(createTeam("Team Zeta", true));
+
+ DataStore<Building> buildingsDs = dataSource.getDataStore(Building.class);
+ Building redBuilding = createBuilding("Red Building");
+ buildingsDs.create(redBuilding);
+ Building greenBuilding = createBuilding("Green Building");
+ buildingsDs.create(greenBuilding);
+ Building blueBuilding = createBuilding("Blue Building");
+ buildingsDs.create(blueBuilding);
+ Building yellowBuilding = createBuilding("Yellow Building");
+ buildingsDs.create(yellowBuilding);
+
+ DataStore<Photo> photoDs = dataSource.getDataStore(Photo.class);
+ photoDs.create(createPhoto("Small picture", ResourceHelper.Format.GIF));
+ photoDs.create(createPhoto("Medium picture", ResourceHelper.Format.PNG));
+ photoDs.create(createPhoto("Big picture", ResourceHelper.Format.JPEG));
+ photoDs.create(createPhoto("Huge picture", ResourceHelper.Format.BMP));
+
+ DataStore<Room> roomDs = dataSource.getDataStore(Room.class);
+ roomDs.create(createRoom("Tiny red room", 5, 1, redBuilding));
+ roomDs.create(createRoom("Small red room", 20, 1, redBuilding));
+ roomDs.create(createRoom("Small green room", 20, 1, greenBuilding));
+ roomDs.create(createRoom("Big blue room", 40, 1, blueBuilding));
+ roomDs.create(createRoom("Huge blue room", 120, 1, blueBuilding));
+ roomDs.create(createRoom("Huge yellow room", 120, 1, yellowBuilding));
+
+ DataStore<Employee> employeeDataStore = dataSource.getDataStore(Employee.class);
+ employeeDataStore.create(createEmployee("first Employee",
+ new Location("Norge", "8392", "Ä"), 42, null,
+ photoDs.read().iterator().next().getImage(), photoDs.read().iterator().next().getImageType(),
+ "http://localhost/image/first.png",
+ null, teamDs.read().iterator().next(), roomDs.read().iterator().next()));
+ }
+
+ private Employee createEmployee(final String name,
+ Location location, final int age, final Calendar date,
+ final byte[] image, final String imageType, final String imageUrl,
+ Manager manager, Team team, Room room) {
+ Employee employee = new Employee();
+ employee.setEmployeeName(name);
+ employee.setLocation(location);
+ employee.setAge(age);
+ employee.setEntryDate(date);
+ employee.setImage(image);
+ employee.setImageType(imageType);
+ employee.setImageUri(imageUrl);
+ employee.setManager(manager);
+ employee.setTeam(team);
+ employee.setRoom(room);
+ return employee;
+ }
+
+ private Team createTeam(String teamName, boolean isScrumTeam) {
+ Team team = new Team();
+ team.setName(teamName);
+ team.setScrumTeam(isScrumTeam);
+ return team;
+ }
+
+ private Building createBuilding(String buildingName) {
+ Building b = new Building();
+ b.setName(buildingName);
+ return b;
+ }
+
+ private Photo createPhoto(String name, ResourceHelper.Format format) {
+ Photo p = new Photo();
+ p.setName(name);
+ p.setImageUri("http://localhost/image/" + name);
+ p.setType(format.name());
+ p.setImageType("image/" + format.name().toLowerCase());
+ p.setImage(ResourceHelper.generateImage(format));
+ return p;
+ }
+
+ private Room createRoom(String name, int seats, int version, Building building) {
+ Room r = new Room();
+ r.setName(name);
+ r.setSeats(seats);
+ r.setVersion(version);
+ r.setBuilding(building);
+
+ building.addRoom(r);
+
+ return r;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/resources/log4j.xml b/odata2-annotation-processor/annotation-processor-webref/src/main/resources/log4j.xml
new file mode 100644
index 0000000..90a4706
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/resources/log4j.xml
@@ -0,0 +1,39 @@
+<?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="org.apache.olingo.odata2.ref" additivity="false">
+ <level value="trace" />
+ <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/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/version/version.html
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/version/version.html b/odata2-annotation-processor/annotation-processor-webref/src/main/version/version.html
new file mode 100644
index 0000000..6d76d0b
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/version/version.html
@@ -0,0 +1,27 @@
+<!--
+
+ 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>${name}</td></tr>
+<tr><td>version</td><td>${version}</td></tr>
+<tr><td>timestamp</td><td>${timestamp}</td></tr>
+<tr><td>project.build.finalName</td><td>${project.build.finalName}</td></tr>
+</table>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/WEB-INF/web.xml b/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..5f7264c
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,48 @@
+<?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>org.apache.olingo.odata2.ref.annotations.web</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <servlet>
+ <servlet-name>ReferenceScenarioServlet</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>org.apache.olingo.odata2.ref.annotation.processor.AnnotationPocServiceFactory</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ReferenceScenarioServlet</servlet-name>
+ <url-pattern>/ReferenceScenario.svc/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/index.jsp b/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/index.jsp
new file mode 100644
index 0000000..49cf364
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-webref/src/main/webapp/index.jsp
@@ -0,0 +1,116 @@
+<%@ page language="java" contentType="text/html; UTF-8" pageEncoding="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 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: #ffffff; }
+a { color: blue; text-decoration: none; }
+a:focus { outline: thin dotted #4076cb; outline-offset: -1px; }
+a:hover, a:active { outline: 0; }
+a:hover { color: #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 #cccccc; border-bottom: 1px solid #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="ReferenceScenario.svc?_wadl" target="_blank">wadl</a></li>
+ <li><a href="ReferenceScenario.svc/" target="_blank">service
+ document</a></li>
+ <li><a href="ReferenceScenario.svc/$metadata" target="_blank">metadata</a></li>
+ </ul>
+ <h3>EntitySets</h3>
+ <ul>
+ <li><a href="ReferenceScenario.svc/Employees" target="_blank">Employees</a></li>
+ <li><a href="ReferenceScenario.svc/Managers" target="_blank">Managers</a></li>
+ <li><a href="ReferenceScenario.svc/Buildings" target="_blank">Buildings</a></li>
+ <li><a href="ReferenceScenario.svc/Buildings/?$expand=nb_Rooms"
+ target="_blank">Buildings/?$expand=nb_Rooms</a></li>
+ <li><a href="ReferenceScenario.svc/Rooms" target="_blank">Rooms</a></li>
+ <li><a href="ReferenceScenario.svc/Rooms/?$orderby=Name" target="_blank">Rooms/?$orderby=Name</a></li>
+ <li><a href="ReferenceScenario.svc/Photos" target="_blank">Photos</a></li>
+ <li><a href="ReferenceScenario.svc/Photos/?$filter=Type%20eq%20'PNG'"
+ target="_blank">Photos/?$filter=Type eq 'PNG'</a></li>
+ </ul>
+ <h3>Entities</h3>
+ <ul>
+ <li><a href="ReferenceScenario.svc/Employees('1')" target="_blank">Employees('1')</a></li>
+ <li><a href="ReferenceScenario.svc/Managers('1')" target="_blank">Managers('1')</a></li>
+ <li><a href="ReferenceScenario.svc/Buildings(1)" target="_blank">Buildings(1)</a></li>
+ <li><a href="ReferenceScenario.svc/Buildings(1)/nb_Rooms" target="_blank">Buildings(1)/nb_Rooms</a></li>
+ <li><a href="ReferenceScenario.svc/Rooms('1')" target="_blank">Rooms('1')</a></li>
+ <li><a href="ReferenceScenario.svc/Rooms('1')/nr_Building" target="_blank">Rooms('1')/nr_Building</a></li>
+ <li><a href="ReferenceScenario.svc/Photos(Name='Small%20picture',Type='GIF')"
+ target="_blank">Photos(Name='Small%20picture',Type='GIF')</a></li>
+ <li><a href="ReferenceScenario.svc/Photos(Name='Big%20picture',Type='JPEG')/$value"
+ target="_blank">Photos(Name='Big%20picture',Type='JPEG')/$value</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/39485c57/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
new file mode 100644
index 0000000..d763047
--- /dev/null
+++ b/odata2-annotation-processor/pom.xml
@@ -0,0 +1,30 @@
+<?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-annotation-processor-incubating</artifactId>
+ <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
+
+ <parent>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-parent-incubating</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <modules>
+ <module>annotation-processor-api</module>
+ <module>annotation-processor-core</module>
+ <module>annotation-processor-webref</module>
+ </modules>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/39485c57/odata2-edm-annotation/edm-annotation-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/pom.xml b/odata2-edm-annotation/edm-annotation-api/pom.xml
deleted file mode 100644
index 5d697f2..0000000
--- a/odata2-edm-annotation/edm-annotation-api/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.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.
--->
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.olingo</groupId>
- <artifactId>olingo-odata2-edm-annotation-incubating</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>olingo-odata2-edm-annotation-api-incubating</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.olingo</groupId>
- <artifactId>olingo-odata2-api-incubating</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>