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/05/23 12:58:12 UTC
[17/59] [abbrv] [partial] Removing /ODataJClient: merge complete
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/primitiveKeysService/pom.xml
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/primitiveKeysService/pom.xml b/ODataJClient/maven-plugin/src/it/primitiveKeysService/pom.xml
deleted file mode 100644
index 996663b..0000000
--- a/ODataJClient/maven-plugin/src/it/primitiveKeysService/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-maven-plugin</artifactId>
- <version>@project.version@</version>
-
- <description>A simple IT verifying the basic use case.</description>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>@velocity.version@</version>
- </dependency>
-
- <dependency>
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-proxy</artifactId>
- <version>@project.version@</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>process-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/generated-sources</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>@project.groupId@</groupId>
- <artifactId>@project.artifactId@</artifactId>
- <version>@project.version@</version>
- <executions>
- <execution>
- <configuration>
- <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
- <serviceRootURL>@serviceRootURL@/PrimitiveKeys.svc</serviceRootURL>
- <basePackage>com.msopentech.odatajclient.proxy.primitivekeysservice</basePackage>
- </configuration>
- <id>pojosV3</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>pojosV3</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/primitiveKeysService/verify.groovy
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/primitiveKeysService/verify.groovy b/ODataJClient/maven-plugin/src/it/primitiveKeysService/verify.groovy
deleted file mode 100644
index a19cf4d..0000000
--- a/ODataJClient/maven-plugin/src/it/primitiveKeysService/verify.groovy
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" );
-assert basepkg.isDirectory() && basepkg.listFiles().length>0;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/settings.xml
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/settings.xml b/ODataJClient/maven-plugin/src/it/settings.xml
deleted file mode 100644
index 894ce18..0000000
--- a/ODataJClient/maven-plugin/src/it/settings.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<settings>
- <profiles>
- <profile>
- <id>it-repo</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>local.central</id>
- <url>@localRepositoryUrl@</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>local.central</id>
- <url>@localRepositoryUrl@</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
- </profile>
- </profiles>
-</settings>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/staticServiceV3/pom.xml
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/staticServiceV3/pom.xml b/ODataJClient/maven-plugin/src/it/staticServiceV3/pom.xml
deleted file mode 100644
index fdcdee2..0000000
--- a/ODataJClient/maven-plugin/src/it/staticServiceV3/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-maven-plugin</artifactId>
- <version>@project.version@</version>
-
- <description>A simple IT verifying the basic use case.</description>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>@velocity.version@</version>
- </dependency>
-
- <dependency>
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-proxy</artifactId>
- <version>@project.version@</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>process-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/generated-sources</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>@project.groupId@</groupId>
- <artifactId>@project.artifactId@</artifactId>
- <version>@project.version@</version>
- <executions>
- <execution>
- <configuration>
- <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
- <serviceRootURL>http://localhost:9080/StaticService/V3/Static.svc</serviceRootURL>
- <basePackage>com.msopentech.odatajclient.proxy.staticservice</basePackage>
- </configuration>
- <id>pojosV3</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>pojosV3</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/staticServiceV3/verify.groovy
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/staticServiceV3/verify.groovy b/ODataJClient/maven-plugin/src/it/staticServiceV3/verify.groovy
deleted file mode 100644
index a19cf4d..0000000
--- a/ODataJClient/maven-plugin/src/it/staticServiceV3/verify.groovy
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" );
-assert basepkg.isDirectory() && basepkg.listFiles().length>0;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/staticServiceV4/pom.xml
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/staticServiceV4/pom.xml b/ODataJClient/maven-plugin/src/it/staticServiceV4/pom.xml
deleted file mode 100644
index 60a1e2c..0000000
--- a/ODataJClient/maven-plugin/src/it/staticServiceV4/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-maven-plugin</artifactId>
- <version>@project.version@</version>
-
- <description>A simple IT verifying the basic use case.</description>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>@velocity.version@</version>
- </dependency>
-
- <dependency>
- <groupId>com.msopentech.odatajclient</groupId>
- <artifactId>odatajclient-proxy</artifactId>
- <version>@project.version@</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>process-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/generated-sources</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>@project.groupId@</groupId>
- <artifactId>@project.artifactId@</artifactId>
- <version>@project.version@</version>
- <executions>
- <execution>
- <configuration>
- <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
- <serviceRootURL>http://localhost:9080/StaticService/V4/Static.svc</serviceRootURL>
- <basePackage>com.msopentech.odatajclient.proxy.staticservice</basePackage>
- </configuration>
- <id>pojosV3</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>pojosV4</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/it/staticServiceV4/verify.groovy
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/it/staticServiceV4/verify.groovy b/ODataJClient/maven-plugin/src/it/staticServiceV4/verify.groovy
deleted file mode 100644
index a19cf4d..0000000
--- a/ODataJClient/maven-plugin/src/it/staticServiceV4/verify.groovy
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" );
-assert basepkg.isDirectory() && basepkg.listFiles().length>0;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractMetadataMojo.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractMetadataMojo.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractMetadataMojo.java
deleted file mode 100644
index 64715f2..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractMetadataMojo.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Parameter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-
-public abstract class AbstractMetadataMojo extends AbstractMojo {
-
- /**
- * Generated files base root.
- */
- @Parameter(property = "outputDirectory", required = true)
- protected String outputDirectory;
-
- /**
- * OData service root URL.
- */
- @Parameter(property = "serviceRootURL", required = true)
- protected String serviceRootURL;
-
- /**
- * Base package.
- */
- @Parameter(property = "basePackage", required = true)
- protected String basePackage;
-
- protected final Set<String> namespaces = new HashSet<String>();
-
- protected static String TOOL_DIR = "ojc-plugin";
-
- protected AbstractUtility utility;
-
- protected abstract AbstractUtility getUtility();
-
- protected abstract String getVersion();
-
- protected File mkdir(final String path) {
- final File dir = new File(outputDirectory + File.separator + TOOL_DIR + File.separator + path);
-
- if (dir.exists()) {
- if (!dir.isDirectory()) {
- throw new IllegalArgumentException("Invalid path '" + path + "': it is not a directory");
- }
- } else {
- dir.mkdirs();
- }
-
- return dir;
- }
-
- protected File mkPkgDir(final String path) {
- return mkdir(basePackage.replace('.', File.separatorChar) + File.separator + path);
- }
-
- protected void writeFile(final String name, final File path, final VelocityContext ctx, final Template template,
- final boolean append) throws MojoExecutionException {
-
- if (!path.exists()) {
- throw new IllegalArgumentException("Invalid base path '" + path.getAbsolutePath() + "'");
- }
-
- FileWriter writer = null;
- try {
- final File toBeWritten = new File(path, name);
- if (!append && toBeWritten.exists()) {
- throw new IllegalStateException("File '" + toBeWritten.getAbsolutePath() + "' already exists");
- }
- writer = new FileWriter(toBeWritten, append);
- template.merge(ctx, writer);
- } catch (IOException e) {
- throw new MojoExecutionException("Error creating file '" + name + "'", e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
- }
-
- protected VelocityContext newContext() {
-
- final VelocityContext ctx = new VelocityContext();
-
- ctx.put("utility", getUtility());
- ctx.put("basePackage", basePackage);
- ctx.put("schemaName", getUtility().getSchemaName());
- ctx.put("namespace", getUtility().getNamespace());
- ctx.put("namespaces", namespaces);
- ctx.put("odataVersion", getVersion());
-
- return ctx;
- }
-
- protected void parseObj(final File base, final String pkg, final String name, final String out)
- throws MojoExecutionException {
-
- parseObj(base, false, pkg, name, out, Collections.<String, Object>emptyMap());
- }
-
- protected void parseObj(
- final File base,
- final String pkg,
- final String name,
- final String out,
- final Map<String, Object> objs)
- throws MojoExecutionException {
-
- parseObj(base, false, pkg, name, out, objs);
- }
-
- protected void parseObj(
- final File base,
- final boolean append,
- final String pkg,
- final String name,
- final String out,
- final Map<String, Object> objs)
- throws MojoExecutionException {
-
- final VelocityContext ctx = newContext();
- ctx.put("package", pkg);
-
- if (objs != null) {
- for (Map.Entry<String, Object> obj : objs.entrySet()) {
- if (StringUtils.isNotBlank(obj.getKey()) && obj.getValue() != null) {
- ctx.put(obj.getKey(), obj.getValue());
- }
- }
- }
-
- final Template template = Velocity.getTemplate(name + ".vm");
- writeFile(out, base, ctx, template, append);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractUtility.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractUtility.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractUtility.java
deleted file mode 100644
index 9397f1e..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/AbstractUtility.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import com.msopentech.odatajclient.engine.utils.NavigationPropertyBindingDetails;
-import com.msopentech.odatajclient.engine.metadata.AbstractEdmMetadata;
-import com.msopentech.odatajclient.engine.metadata.EdmType;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractEntityContainer;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractEntitySet;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractEntityType;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractNavigationProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractSchema;
-import com.msopentech.odatajclient.engine.metadata.edm.EdmSimpleType;
-import com.msopentech.odatajclient.engine.metadata.edm.PropertyRef;
-import com.msopentech.odatajclient.engine.utils.MetadataUtils;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.lang.StringUtils;
-
-public abstract class AbstractUtility {
-
- protected static final String FC_TARGET_PATH = "fcTargetPath";
-
- protected static final String FC_SOURCE_PATH = "fcSourcePath";
-
- protected static final String FC_KEEP_IN_CONTENT = "fcKeepInContent";
-
- protected static final String FC_CONTENT_KIND = "fcContentKind";
-
- protected static final String FC_NS_PREFIX = "fcNSPrefix";
-
- protected static final String FC_NS_URI = "fcNSURI";
-
- protected static final String TYPE_SUB_PKG = "types";
-
- protected final String basePackage;
-
- protected final String schemaName;
-
- protected final String namespace;
-
- protected final Map<String, List<AbstractEntityType>> allEntityTypes =
- new HashMap<String, List<AbstractEntityType>>();
-
- public AbstractUtility(final String namespace, final String schemaName, final String basePackage) {
- this.basePackage = basePackage;
- this.schemaName = schemaName == null ? getNameFromNS(namespace) : schemaName;
- this.namespace = namespace;
- }
-
- public abstract EdmType getEdmType(
- final AbstractEdmMetadata<?, ?, ?, ?, ?, ?, ?> metadata, final String expression);
-
- protected abstract AbstractEdmMetadata<?, ?, ?, ?, ?, ?, ?> getMetadata();
-
- protected abstract AbstractSchema<?, ?, ?, ?> getSchema();
-
- protected void collectEntityTypes() {
- for (AbstractSchema<?, ?, ?, ?> _schema : getMetadata().getSchemas()) {
- allEntityTypes.put(_schema.getNamespace(), new ArrayList<AbstractEntityType>(_schema.getEntityTypes()));
- if (StringUtils.isNotBlank(_schema.getAlias())) {
- allEntityTypes.put(_schema.getAlias(), new ArrayList<AbstractEntityType>(_schema.getEntityTypes()));
- }
- }
- }
-
- public String getJavaType(final String typeExpression) {
- final StringBuilder res = new StringBuilder();
-
- final EdmType edmType = getEdmType(getMetadata(), typeExpression);
-
- if (edmType.isCollection() && !edmType.isEntityType()) {
- res.append("Collection<");
- }
-
- if ("Edm.Stream".equals(typeExpression)) {
- res.append(InputStream.class.getName());
- } else if (edmType.isSimpleType()) {
- res.append(edmType.getSimpleType().javaType().getSimpleName());
- } else if (edmType.isComplexType()) {
- res.append(basePackage).append('.').append(edmType.getNamespaceOrAlias().toLowerCase()).append('.').
- append(TYPE_SUB_PKG).append('.').append(capitalize(edmType.getComplexType().getName()));
- } else if (edmType.isEntityType()) {
- res.append(basePackage).append('.').append(edmType.getNamespaceOrAlias().toLowerCase()).append('.').
- append(TYPE_SUB_PKG).append('.').append(capitalize(edmType.getEntityType().getName()));
- } else if (edmType.isEnumType()) {
- res.append(basePackage).append('.').append(edmType.getNamespaceOrAlias().toLowerCase()).
- append('.').append(TYPE_SUB_PKG).append('.').append(capitalize(edmType.getEnumType().getName()));
- } else {
- throw new IllegalArgumentException("Invalid type expression '" + typeExpression + "'");
- }
-
- if (edmType.isCollection()) {
- if (edmType.isEntityType()) {
- res.append("Collection");
- } else {
- res.append(">");
- }
- }
-
- return res.toString();
- }
-
- public EdmSimpleType getEdmSimpleType(final String expression) {
- return EdmSimpleType.fromValue(expression);
- }
-
- public EdmType getEdmType(final AbstractEntitySet entitySet) {
- return getEdmType(getMetadata(), entitySet.getEntityType());
- }
-
- public Map<String, String> getEntityKeyType(final AbstractEntitySet entitySet) {
- return getEntityKeyType(getEdmType(entitySet).getEntityType());
- }
-
- public Map<String, String> getEntityKeyType(final AbstractEntityType entityType) {
- AbstractEntityType baseType = entityType;
- while (baseType.getKey() == null && baseType.getBaseType() != null) {
- baseType = getEdmType(getMetadata(), baseType.getBaseType()).getEntityType();
- }
-
- final List<String> properties = new ArrayList<String>();
- for (PropertyRef pref : baseType.getKey().getPropertyRefs()) {
- properties.add(pref.getName());
- }
- final Map<String, String> res = new HashMap<String, String>();
-
- for (AbstractProperty prop : baseType.getProperties()) {
- if (properties.contains(prop.getName())) {
- res.put(prop.getName(), getJavaType(prop.getType()));
- }
- }
- return res;
- }
-
- public final String getNameInNamespace(final String name) {
- return getSchema().getNamespace() + "." + name;
- }
-
- public final String getNameInNamespace(final EdmType entityType) {
- return entityType.getNamespaceOrAlias() + "." + entityType.getEntityType().getName();
- }
-
- public boolean isSameType(
- final String entityTypeExpression, final String fullTypeExpression, final boolean collection) {
-
- final Set<String> types = new HashSet<String>(2);
-
- types.add((collection ? "Collection(" : StringUtils.EMPTY)
- + getNameInNamespace(entityTypeExpression)
- + (collection ? ")" : StringUtils.EMPTY));
- if (StringUtils.isNotBlank(getSchema().getAlias())) {
- types.add((collection ? "Collection(" : StringUtils.EMPTY)
- + getSchema().getAlias() + "." + entityTypeExpression
- + (collection ? ")" : StringUtils.EMPTY));
- }
-
- return types.contains(fullTypeExpression);
- }
-
- private void populateDescendants(final EdmType base, final List<String> descendants) {
- for (Map.Entry<String, List<AbstractEntityType>> entry : allEntityTypes.entrySet()) {
- for (AbstractEntityType type : entry.getValue()) {
- if (StringUtils.isNotBlank(type.getBaseType())
- && base.getEntityType().getName().equals(getNameFromNS(type.getBaseType()))) {
-
- final EdmType entityType = getEdmType(getMetadata(), entry.getKey() + "." + type.getName());
-
- descendants.add(getNameInNamespace(entityType));
- populateDescendants(entityType, descendants);
- }
- }
- }
- }
-
- public List<String> getDescendantsOrSelf(final EdmType entityType) {
- final List<String> descendants = new ArrayList<String>();
-
- descendants.add(getNameInNamespace(entityType));
- populateDescendants(entityType, descendants);
-
- return descendants;
- }
-
- public String getBasePackage() {
- return basePackage;
- }
-
- public String getSchemaName() {
- return schemaName;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public String capitalize(final String str) {
- return StringUtils.capitalize(str);
- }
-
- public String uncapitalize(final String str) {
- return StringUtils.uncapitalize(str);
- }
-
- public Map<String, String> getFcProperties(final AbstractProperty property) {
- final Map<String, String> fcProps = new HashMap<String, String>();
-
- if (StringUtils.isNotBlank(property.getFcTargetPath())) {
- fcProps.put(FC_TARGET_PATH, property.getFcTargetPath());
- }
- if (StringUtils.isNotBlank(property.getFcSourcePath())) {
- fcProps.put(FC_SOURCE_PATH, property.getFcSourcePath());
- }
- if (StringUtils.isNotBlank(property.getFcNSPrefix())) {
- fcProps.put(FC_NS_PREFIX, property.getFcNSPrefix());
- }
- if (StringUtils.isNotBlank(property.getFcNSURI())) {
- fcProps.put(FC_NS_URI, property.getFcNSURI());
- }
- fcProps.put(FC_CONTENT_KIND, property.getFcContentKind().name());
- fcProps.put(FC_KEEP_IN_CONTENT, Boolean.toString(property.isFcKeepInContent()));
-
- return fcProps;
- }
-
- public final String getNameFromNS(final String ns) {
- return getNameFromNS(ns, false);
- }
-
- public final String getNameFromNS(final String ns, final boolean toLowerCase) {
- String res = null;
-
- if (StringUtils.isNotBlank(ns)) {
- final int lastpt = ns.lastIndexOf('.');
- res = ns.substring(lastpt < 0 ? 0 : lastpt + 1);
- res = toLowerCase ? res.toLowerCase() : res;
- }
-
- return res;
- }
-
- protected NavigationPropertyBindingDetails getNavigationBindingDetails(
- final AbstractNavigationProperty property,
- final String targetPath,
- final AbstractSchema<?, ?, ?, ?> bindingInfoSchema,
- final AbstractEntityContainer<?> bindingInfoContainer) {
-
- final String[] target = targetPath.split("/");
- final AbstractEntityContainer<?> targetContainer;
- final AbstractSchema<?, ?, ?, ?> targetSchema;
- final AbstractEntitySet targetES;
-
- if (target.length > 1) {
- int lastDot = target[0].lastIndexOf(".");
- final String targetSchemaNamespace = target[0].substring(0, lastDot);
- final String containerName = target[0].substring(lastDot + 1);
-
- targetSchema = MetadataUtils.getSchemaByNamespaceOrAlias(getMetadata(), targetSchemaNamespace);
- targetContainer = MetadataUtils.getContainerByName(targetSchema, containerName);
- targetES = MetadataUtils.getEntitySet(targetContainer, target[1]);
- } else {
- targetContainer = bindingInfoContainer;
- targetSchema = bindingInfoSchema;
- targetES = MetadataUtils.getEntitySet(targetContainer, target[0]);
- }
- return new NavigationPropertyBindingDetails(property, targetES, targetContainer, targetSchema);
- }
-
- public abstract String getNavigationType(final AbstractNavigationProperty property);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3MetadataMojo.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3MetadataMojo.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3MetadataMojo.java
deleted file mode 100644
index fc26577..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3MetadataMojo.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import com.msopentech.odatajclient.engine.client.ODataClientFactory;
-import com.msopentech.odatajclient.engine.communication.request.retrieve.ODataV3MetadataRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataRetrieveResponse;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Metadata;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.ComplexType;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.EntityContainer;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.EntitySet;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.EntityType;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.EnumType;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.Schema;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-
-/**
- * POJOs generator.
- */
-@Mojo(name = "pojosV3", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
-public class V3MetadataMojo extends AbstractMetadataMojo {
-
- @Override
- protected V3Utility getUtility() {
- return (V3Utility) utility;
- }
-
- @Override
- protected String getVersion() {
- return ODataVersion.V3.name().toLowerCase();
- }
-
- @Override
- public void execute() throws MojoExecutionException {
- if (new File(outputDirectory + File.separator + TOOL_DIR).exists()) {
- getLog().info("Nothing to do because " + TOOL_DIR + " directory already exists. Clean to update.");
- return;
- }
-
- try {
- Velocity.addProperty(Velocity.RESOURCE_LOADER, "class");
- Velocity.addProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
-
- final ODataV3MetadataRequest req = ODataClientFactory.getV3().
- getRetrieveRequestFactory().getMetadataRequest(serviceRootURL);
-
- final ODataRetrieveResponse<EdmV3Metadata> res = req.execute();
- final EdmV3Metadata metadata = res.getBody();
-
- if (metadata == null) {
- throw new IllegalStateException("Metadata not found");
- }
-
- for (Schema schema : metadata.getSchemas()) {
- namespaces.add(schema.getNamespace().toLowerCase());
- }
-
- final Set<String> complexTypeNames = new HashSet<String>();
- final File services = mkdir("META-INF/services");
-
- for (Schema schema : metadata.getSchemas()) {
- utility = new V3Utility(metadata, schema, basePackage);
-
- // write package-info for the base package
- final String schemaPath = utility.getNamespace().toLowerCase().replace('.', File.separatorChar);
- final File base = mkPkgDir(schemaPath);
- final String pkg = basePackage + "." + utility.getNamespace().toLowerCase();
- parseObj(base, pkg, "package-info", "package-info.java");
-
- // write package-info for types package
- final File typesBaseDir = mkPkgDir(schemaPath + "/types");
- final String typesPkg = pkg + ".types";
- parseObj(typesBaseDir, typesPkg, "package-info", "package-info.java");
-
- final Map<String, Object> objs = new HashMap<String, Object>();
-
- // write types into types package
- for (EnumType enumType : schema.getEnumTypes()) {
- final String className = utility.capitalize(enumType.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("enumType", enumType);
- parseObj(typesBaseDir, typesPkg, "enumType", className + ".java", objs);
- }
-
- for (ComplexType complex : schema.getComplexTypes()) {
- final String className = utility.capitalize(complex.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("complexType", complex);
- parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
- }
-
- for (EntityType entity : schema.getEntityTypes()) {
- objs.clear();
- objs.put("entityType", entity);
-
- final Map<String, String> keys;
-
- EntityType baseType = null;
- if (entity.getBaseType() == null) {
- keys = getUtility().getEntityKeyType(entity);
- } else {
- baseType = schema.getEntityType(utility.getNameFromNS(entity.getBaseType()));
- objs.put("baseType", getUtility().getJavaType(entity.getBaseType()));
- while (baseType.getBaseType() != null) {
- baseType = schema.getEntityType(utility.getNameFromNS(baseType.getBaseType()));
- }
- keys = getUtility().getEntityKeyType(baseType);
- }
-
- if (keys.size() > 1) {
- // create compound key class
- final String keyClassName = utility.capitalize(baseType == null
- ? entity.getName()
- : baseType.getName()) + "Key";
- objs.put("keyRef", keyClassName);
-
- if (entity.getBaseType() == null) {
- objs.put("keys", keys);
- parseObj(typesBaseDir, typesPkg, "entityTypeKey", keyClassName + ".java", objs);
- }
- }
-
- parseObj(typesBaseDir, typesPkg, "entityType",
- utility.capitalize(entity.getName()) + ".java", objs);
- parseObj(typesBaseDir, typesPkg, "entityCollection",
- utility.capitalize(entity.getName()) + "Collection.java", objs);
- }
-
- // write container and top entity sets into the base package
- for (EntityContainer container : schema.getEntityContainers()) {
- objs.clear();
- objs.put("container", container);
- parseObj(base, pkg, "container",
- utility.capitalize(container.getName()) + ".java", objs);
-
- for (EntitySet entitySet : container.getEntitySets()) {
- objs.clear();
- objs.put("entitySet", entitySet);
- parseObj(base, pkg, "entitySet",
- utility.capitalize(entitySet.getName()) + ".java", objs);
- }
- }
-
- parseObj(services, true, null, "services", "com.msopentech.odatajclient.proxy.api.AbstractComplexType",
- Collections.singletonMap("services", (Object) complexTypeNames));
- }
- } catch (Throwable t) {
- final StringWriter stringWriter = new StringWriter();
- final PrintWriter printWriter = new PrintWriter(stringWriter);
- t.printStackTrace(printWriter);
- getLog().error(stringWriter.toString());
-
- throw (t instanceof MojoExecutionException)
- ? (MojoExecutionException) t
- : new MojoExecutionException("While executin mojo", t);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3Utility.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3Utility.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3Utility.java
deleted file mode 100644
index f4aaca1..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V3Utility.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import com.msopentech.odatajclient.engine.utils.NavigationPropertyBindingDetails;
-import com.msopentech.odatajclient.engine.metadata.AbstractEdmMetadata;
-import com.msopentech.odatajclient.engine.metadata.EdmType;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Metadata;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Type;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractNavigationProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.Association;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.AssociationEnd;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.EntityContainer;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.FunctionImport;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.NavigationProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.Schema;
-import com.msopentech.odatajclient.engine.utils.AssociationSetBindingDetails;
-import com.msopentech.odatajclient.engine.utils.MetadataUtils;
-import java.util.ArrayList;
-import java.util.List;
-
-public class V3Utility extends AbstractUtility {
-
- private final EdmV3Metadata metadata;
-
- private final Schema schema;
-
- public V3Utility(final EdmV3Metadata metadata, final Schema schema, final String basePackage) {
- super(schema.getNamespace(), schema.getAlias(), basePackage);
- this.metadata = metadata;
- this.schema = schema;
-
- collectEntityTypes();
- }
-
- @Override
- public EdmType getEdmType(final AbstractEdmMetadata<?, ?, ?, ?, ?, ?, ?> metadata, final String expression) {
- return new EdmV3Type((EdmV3Metadata) metadata, expression);
- }
-
- @Override
- protected EdmV3Metadata getMetadata() {
- return metadata;
- }
-
- @Override
- protected Schema getSchema() {
- return schema;
- }
-
- @Override
- public String getNavigationType(final AbstractNavigationProperty property) {
- final NavigationProperty navigationProperty = (NavigationProperty) property;
-
- final String name = getNameFromNS(navigationProperty.getRelationship());
- final Association association = schema.getAssociation(name);
- if (association != null) {
- for (AssociationEnd end : association.getEnds()) {
- if (end.getRole().equalsIgnoreCase(navigationProperty.getToRole())) {
- return "*".equals(end.getMultiplicity())
- ? "Collection(" + end.getType() + ")"
- : end.getType();
- }
- }
- }
-
- return navigationProperty.getToRole();
- }
-
- public NavigationPropertyBindingDetails getNavigationBindingDetails(final AbstractNavigationProperty property) {
- final NavigationProperty navProperty = (NavigationProperty) property;
-
- // 1) get association
- final Association association = MetadataUtils.getAssociation(schema, navProperty.getRelationship());
-
- // 2) get schema, entity container and association set
- final AssociationSetBindingDetails associationSetDetails =
- MetadataUtils.getAssociationSetBindingDetails(association, schema.getNamespace(), metadata);
-
- // 3) get navigation property binding details
- return getNavigationBindingDetails(
- property,
- MetadataUtils.getEntitySetName(associationSetDetails.getAssociationSet(), navProperty.getToRole()),
- associationSetDetails.getSchema(),
- associationSetDetails.getContainer());
- }
-
- public List<FunctionImport> getFunctionImportsBoundTo(
- final String typeExpression, final boolean collection) {
-
- final List<FunctionImport> result = new ArrayList<FunctionImport>();
-
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- for (FunctionImport functionImport : entityContainer.getFunctionImports()) {
- if (functionImport.isBindable()) {
- for (int i = 0; i < functionImport.getParameters().size(); i++) {
- if (isSameType(typeExpression, functionImport.getParameters().get(i).getType(), collection)) {
- result.add(functionImport);
- }
- }
- }
- }
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4MetadataMojo.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4MetadataMojo.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4MetadataMojo.java
deleted file mode 100644
index 911cdb2..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4MetadataMojo.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import com.msopentech.odatajclient.engine.client.ODataClientFactory;
-import com.msopentech.odatajclient.engine.communication.request.retrieve.ODataV4MetadataRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataRetrieveResponse;
-import com.msopentech.odatajclient.engine.metadata.EdmV4Metadata;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.ComplexType;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.EntityContainer;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.EntitySet;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.EntityType;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.EnumType;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Schema;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Singleton;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-
-/**
- * POJOs generator.
- */
-@Mojo(name = "pojosV4", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
-public class V4MetadataMojo extends AbstractMetadataMojo {
-
- @Override
- protected V4Utility getUtility() {
- return (V4Utility) utility;
- }
-
- @Override
- protected String getVersion() {
- return ODataVersion.V4.name().toLowerCase();
- }
-
- @Override
- public void execute() throws MojoExecutionException {
- if (new File(outputDirectory + File.separator + TOOL_DIR).exists()) {
- getLog().info("Nothing to do because " + TOOL_DIR + " directory already exists. Clean to update.");
- return;
- }
-
- try {
- Velocity.addProperty(Velocity.RESOURCE_LOADER, "class");
- Velocity.addProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
-
- final ODataV4MetadataRequest req = ODataClientFactory.getV4().
- getRetrieveRequestFactory().getMetadataRequest(serviceRootURL);
-
- final ODataRetrieveResponse<EdmV4Metadata> res = req.execute();
- final EdmV4Metadata metadata = res.getBody();
-
- if (metadata == null) {
- throw new IllegalStateException("Metadata not found");
- }
-
- for (Schema schema : metadata.getSchemas()) {
- namespaces.add(schema.getNamespace().toLowerCase());
- }
-
- final Set<String> complexTypeNames = new HashSet<String>();
- final File services = mkdir("META-INF/services");
-
- for (Schema schema : metadata.getSchemas()) {
- utility = new V4Utility(metadata, schema, basePackage);
-
- // write package-info for the base package
- final String schemaPath = utility.getNamespace().toLowerCase().replace('.', File.separatorChar);
- final File base = mkPkgDir(schemaPath);
- final String pkg = basePackage + "." + utility.getNamespace().toLowerCase();
- parseObj(base, pkg, "package-info", "package-info.java");
-
- // write package-info for types package
- final File typesBaseDir = mkPkgDir(schemaPath + "/types");
- final String typesPkg = pkg + ".types";
- parseObj(typesBaseDir, typesPkg, "package-info", "package-info.java");
-
- final Map<String, Object> objs = new HashMap<String, Object>();
-
- // write types into types package
- for (EnumType enumType : schema.getEnumTypes()) {
- final String className = utility.capitalize(enumType.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("enumType", enumType);
- parseObj(typesBaseDir, typesPkg, "enumType", className + ".java", objs);
- }
-
- for (ComplexType complex : schema.getComplexTypes()) {
- final String className = utility.capitalize(complex.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("complexType", complex);
- parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
- }
-
- for (EntityType entity : schema.getEntityTypes()) {
- objs.clear();
- objs.put("entityType", entity);
-
- final Map<String, String> keys;
-
- EntityType baseType = null;
- if (entity.getBaseType() == null) {
- keys = getUtility().getEntityKeyType(entity);
- } else {
- baseType = schema.getEntityType(utility.getNameFromNS(entity.getBaseType()));
- objs.put("baseType", getUtility().getJavaType(entity.getBaseType()));
- while (baseType.getBaseType() != null) {
- baseType = schema.getEntityType(utility.getNameFromNS(baseType.getBaseType()));
- }
- keys = getUtility().getEntityKeyType(baseType);
- }
-
- if (keys.size() > 1) {
- // create compound key class
- final String keyClassName = utility.capitalize(baseType == null
- ? entity.getName()
- : baseType.getName()) + "Key";
- objs.put("keyRef", keyClassName);
-
- if (entity.getBaseType() == null) {
- objs.put("keys", keys);
- parseObj(typesBaseDir, typesPkg, "entityTypeKey", keyClassName + ".java", objs);
- }
- }
-
- parseObj(typesBaseDir, typesPkg, "entityType",
- utility.capitalize(entity.getName()) + ".java", objs);
- parseObj(typesBaseDir, typesPkg, "entityCollection",
- utility.capitalize(entity.getName()) + "Collection.java", objs);
- }
-
- // write container and top entity sets into the base package
- for (EntityContainer container : schema.getEntityContainers()) {
- objs.clear();
- objs.put("container", container);
- parseObj(base, pkg, "container",
- utility.capitalize(container.getName()) + ".java", objs);
-
- for (EntitySet entitySet : container.getEntitySets()) {
- objs.clear();
- objs.put("entitySet", entitySet);
- parseObj(base, pkg, "entitySet",
- utility.capitalize(entitySet.getName()) + ".java", objs);
- }
-
- for (Singleton singleton : container.getSingletons()) {
- objs.clear();
- objs.put("singleton", singleton);
- parseObj(base, pkg, "singleton",
- utility.capitalize(singleton.getName()) + ".java", objs);
- }
- }
-
- parseObj(services, true, null, "services", "com.msopentech.odatajclient.proxy.api.AbstractComplexType",
- Collections.singletonMap("services", (Object) complexTypeNames));
- }
- } catch (Throwable t) {
- final StringWriter stringWriter = new StringWriter();
- final PrintWriter printWriter = new PrintWriter(stringWriter);
- t.printStackTrace(printWriter);
- getLog().error(stringWriter.toString());
-
- throw (t instanceof MojoExecutionException)
- ? (MojoExecutionException) t
- : new MojoExecutionException("While executin mojo", t);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4Utility.java
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4Utility.java b/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4Utility.java
deleted file mode 100644
index 01482bd..0000000
--- a/ODataJClient/maven-plugin/src/main/java/com/msopentech/odatajclient/plugin/V4Utility.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.plugin;
-
-import com.msopentech.odatajclient.engine.metadata.AbstractEdmMetadata;
-import com.msopentech.odatajclient.engine.metadata.EdmType;
-import com.msopentech.odatajclient.engine.metadata.EdmV4Metadata;
-import com.msopentech.odatajclient.engine.metadata.EdmV4Type;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractEntityContainer;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractEntitySet;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractNavigationProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.AbstractSchema;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Action;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.EntitySet;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Function;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.NavigationProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.NavigationPropertyBinding;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Schema;
-import com.msopentech.odatajclient.engine.metadata.edm.v4.Singleton;
-import com.msopentech.odatajclient.engine.utils.MetadataUtils;
-import com.msopentech.odatajclient.engine.utils.NavigationPropertyBindingDetails;
-import com.msopentech.odatajclient.engine.utils.QualifiedName;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class V4Utility extends AbstractUtility {
-
- private final EdmV4Metadata metadata;
-
- private final Schema schema;
-
- public V4Utility(final EdmV4Metadata metadata, final Schema schema, final String basePackage) {
- super(schema.getNamespace(), schema.getAlias(), basePackage);
- this.metadata = metadata;
- this.schema = schema;
-
- collectEntityTypes();
- }
-
- @Override
- public EdmType getEdmType(final AbstractEdmMetadata<?, ?, ?, ?, ?, ?, ?> metadata, final String expression) {
- return new EdmV4Type((EdmV4Metadata) metadata, expression);
- }
-
- public EdmType getEdmType(final Singleton singleton) {
- return getEdmType(getMetadata(), singleton.getType());
- }
-
- public Map<String, String> getEntityKeyType(final Singleton singleton) {
- return getEntityKeyType(getEdmType(metadata, singleton.getType()).getEntityType());
- }
-
- @Override
- protected EdmV4Metadata getMetadata() {
- return metadata;
- }
-
- @Override
- protected Schema getSchema() {
- return schema;
- }
-
- @Override
- public String getNavigationType(final AbstractNavigationProperty property) {
- return ((NavigationProperty) property).getType();
- }
-
- public NavigationPropertyBindingDetails getNavigationBindingDetails(
- final String sourceEntityType, final AbstractNavigationProperty property) {
-
- NavigationPropertyBindingDetails bindingDetails = null;
- final List<Schema> schemas = getMetadata().getSchemas();
- for (int i = 0; bindingDetails == null && i < schemas.size(); i++) {
- final Schema sc = schemas.get(i);
- if (sc.getEntityContainer() != null) {
- bindingDetails = getNavigationBindingDetails(sc, sourceEntityType, property);
- }
- }
- return bindingDetails;
- }
-
- public Function getFunctionByName(final String name) {
- final QualifiedName qname = new QualifiedName(name);
-
- final Schema targetSchema =
- (Schema) MetadataUtils.getSchemaByNamespaceOrAlias(metadata, qname.getNamespace());
-
- if (targetSchema != null) {
- for (Function function : targetSchema.getFunctions()) {
- if (function.getName().equals(qname.getName())) {
- return function;
- }
- }
- }
-
- return null;
- }
-
- public Action getActionByName(final String name) {
- final QualifiedName qname = new QualifiedName(name);
-
- final Schema targetSchema =
- (Schema) MetadataUtils.getSchemaByNamespaceOrAlias(metadata, qname.getNamespace());
-
- if (targetSchema != null) {
- for (Action action : targetSchema.getActions()) {
- if (action.getName().equals(qname.getName())) {
- return action;
- }
- }
- }
-
- return null;
- }
-
- public List<Function> getFunctionsBoundTo(final String typeExpression, final boolean collection) {
-
- final List<Function> result = new ArrayList<Function>();
-
- for (Schema sch : getMetadata().getSchemas()) {
- for (Function function : sch.getFunctions()) {
- if (function.isBound()) {
- if (!function.getParameters().isEmpty() && isSameType(
- new QualifiedName(namespace, typeExpression).toString(),
- function.getParameters().get(0).getType(), collection)) {
- result.add(function);
- }
- }
- }
- }
-
- return result;
- }
-
- public List<Action> getActionsBoundTo(final String typeExpression, final boolean collection) {
-
- final List<Action> result = new ArrayList<Action>();
-
- for (Schema sch : getMetadata().getSchemas()) {
- for (Action action : sch.getActions()) {
- if (action.isBound()) {
- if (!action.getParameters().isEmpty()
- && isSameType(typeExpression, action.getParameters().get(0).getType(), collection)) {
- result.add(action);
- }
- }
- }
- }
-
- return result;
- }
-
- private NavigationPropertyBindingDetails getNavigationBindingDetails(
- final AbstractSchema<?, ?, ?, ?> schema,
- final String sourceEntityType,
- final AbstractNavigationProperty property) {
-
- for (AbstractEntityContainer<?> container : schema.getEntityContainers()) {
- for (AbstractEntitySet es : container.getEntitySets()) {
- if (es.getEntityType().equals(sourceEntityType)) {
- final NavigationPropertyBinding binding =
- MetadataUtils.getNavigationBindingByPath(((EntitySet) es).getNavigationPropertyBindings(),
- property.getName());
- if (binding != null) {
- return getNavigationBindingDetails(
- property, binding.getTarget(), schema, container);
- }
- }
- }
- }
-
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/resources/complexType.vm
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/resources/complexType.vm b/ODataJClient/maven-plugin/src/main/resources/complexType.vm
deleted file mode 100644
index ecb2c64..0000000
--- a/ODataJClient/maven-plugin/src/main/resources/complexType.vm
+++ /dev/null
@@ -1,63 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *#
-package ${package};
-
-import com.msopentech.odatajclient.proxy.api.annotations.Namespace;
-import com.msopentech.odatajclient.proxy.api.annotations.ComplexType;
-import com.msopentech.odatajclient.proxy.api.annotations.Property;
-import com.msopentech.odatajclient.proxy.api.AbstractComplexType;
-#foreach($ns in $namespaces)
-import ${basePackage}.${ns}.*;
-import ${basePackage}.${ns}.types.*;
-#end
-
-// EdmSimpleType property imports
-import com.msopentech.odatajclient.engine.data.ODataDuration;
-import com.msopentech.odatajclient.engine.data.ODataTimestamp;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Geospatial;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.GeospatialCollection;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.LineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiLineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPoint;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPolygon;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Point;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Polygon;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.UUID;
-import java.io.Serializable;
-import java.util.Collection;
-
-@Namespace("$namespace")
-@ComplexType("$complexType.Name")
-public class $utility.capitalize($complexType.Name) extends AbstractComplexType {
-
-#foreach ($property in $complexType.Properties)
- private $utility.getJavaType($property.Type) _$utility.uncapitalize($property.Name);
-
- @Property(name = "$property.Name", type = "$property.Type", nullable = $property.Nullable)
- public $utility.getJavaType($property.Type) get$utility.capitalize($property.Name)() {
- return _$utility.uncapitalize($property.Name);
- }
-
- public void set$utility.capitalize($property.Name)(final $utility.getJavaType($property.Type) _$utility.uncapitalize($property.Name)) {
- this._$utility.uncapitalize($property.Name) = _$utility.uncapitalize($property.Name);
- }
-#end
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/resources/container.vm
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/resources/container.vm b/ODataJClient/maven-plugin/src/main/resources/container.vm
deleted file mode 100644
index f918fe4..0000000
--- a/ODataJClient/maven-plugin/src/main/resources/container.vm
+++ /dev/null
@@ -1,67 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *#
-#set( $clsSuffix = ".class" )
-package ${package};
-
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.proxy.api.annotations.Namespace;
-import com.msopentech.odatajclient.proxy.api.annotations.EntityContainer;
-import com.msopentech.odatajclient.proxy.api.annotations.Operation;
-import com.msopentech.odatajclient.proxy.api.annotations.Parameter;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.ParameterMode;
-import com.msopentech.odatajclient.proxy.api.AbstractContainer;
-#foreach($ns in $namespaces)
-import ${basePackage}.${ns}.*;
-import ${basePackage}.${ns}.types.*;
-#end
-
-// EdmSimpleType property imports
-import com.msopentech.odatajclient.engine.data.ODataDuration;
-import com.msopentech.odatajclient.engine.data.ODataTimestamp;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Geospatial;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.GeospatialCollection;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.LineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiLineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPoint;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPolygon;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Point;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Polygon;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.UUID;
-import java.io.Serializable;
-import java.util.Collection;
-
-@Namespace("$namespace")
-@EntityContainer(name = "$container.Name",
- isDefaultEntityContainer = $container.DefaultEntityContainer)
-public interface $utility.capitalize($container.Name) extends AbstractContainer {
-
-#foreach($entitySet in $container.EntitySets)
- $utility.capitalize($entitySet.Name) get$utility.capitalize($entitySet.Name)();
-
-#end
-
-#foreach($singleton in $container.Singletons)
- $utility.capitalize($singleton.Name) get$utility.capitalize($singleton.Name)();
-
-#end
-
-#parse( "${odataVersion}/container.vm" )
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/resources/entityCollection.vm
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/resources/entityCollection.vm b/ODataJClient/maven-plugin/src/main/resources/entityCollection.vm
deleted file mode 100644
index 55de790..0000000
--- a/ODataJClient/maven-plugin/src/main/resources/entityCollection.vm
+++ /dev/null
@@ -1,50 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *#
-package ${package};
-
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.proxy.api.AbstractEntityCollection;
-import com.msopentech.odatajclient.proxy.api.annotations.Operation;
-import com.msopentech.odatajclient.proxy.api.annotations.Parameter;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.ParameterMode;
-#foreach($ns in $namespaces)
-import ${basePackage}.${ns}.*;
-import ${basePackage}.${ns}.types.*;
-#end
-
-// EdmSimpleType property imports
-import com.msopentech.odatajclient.engine.data.ODataDuration;
-import com.msopentech.odatajclient.engine.data.ODataTimestamp;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Geospatial;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.GeospatialCollection;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.LineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiLineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPoint;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPolygon;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Point;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Polygon;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.UUID;
-import java.io.Serializable;
-import java.util.Collection;
-
-public interface $utility.capitalize($entityType.Name)Collection extends AbstractEntityCollection<$utility.capitalize($entityType.Name)> {
-#parse( "${odataVersion}/entityCollection.vm" )
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/maven-plugin/src/main/resources/entitySet.vm
----------------------------------------------------------------------
diff --git a/ODataJClient/maven-plugin/src/main/resources/entitySet.vm b/ODataJClient/maven-plugin/src/main/resources/entitySet.vm
deleted file mode 100644
index e2eb60c..0000000
--- a/ODataJClient/maven-plugin/src/main/resources/entitySet.vm
+++ /dev/null
@@ -1,65 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *#
-package ${package};
-
-import com.msopentech.odatajclient.proxy.api.AbstractEntitySet;
-import com.msopentech.odatajclient.proxy.api.annotations.EntitySet;
-import com.msopentech.odatajclient.proxy.api.annotations.CompoundKey;
-import com.msopentech.odatajclient.proxy.api.annotations.CompoundKeyElement;
-#foreach($ns in $namespaces)
-import ${basePackage}.${ns}.*;
-import ${basePackage}.${ns}.types.*;
-#end
-
-// EdmSimpleType property imports
-import com.msopentech.odatajclient.engine.data.ODataDuration;
-import com.msopentech.odatajclient.engine.data.ODataTimestamp;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Geospatial;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.GeospatialCollection;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.LineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiLineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPoint;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPolygon;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Point;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Polygon;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.UUID;
-import java.io.Serializable;
-import java.util.Collection;
-
-#set( $keys = $utility.getEntityKeyType($entitySet) )
-#if( $keys.size() > 1 )
- #set( $type = $utility.getEdmType($entitySet).EntityType.Name + "Key" )
-#elseif( $keys.size() == 1 )
- #set( $type = $keys.values().iterator().next() )
-#else
- #set( $type = "" )
-#end
-
-#parse( "${odataVersion}/entitySet.vm" )
-public interface $utility.capitalize($entitySet.Name) extends AbstractEntitySet<$utility.getJavaType($entitySet.EntityType), $type, $utility.getJavaType($entitySet.EntityType)Collection> {
-
-#foreach( $dos in $utility.getDescendantsOrSelf($utility.getEdmType($entitySet)) )
- #set( $djt = $utility.getJavaType($dos) )
- #set( $sIdx = $djt.lastIndexOf('.') + 1 )
- $djt new$djt.substring($sIdx)();
- ${djt}Collection new$djt.substring($sIdx)Collection();
-#end
-}