olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rare...@apache.org
Subject olingo-odata4 git commit: OLINGO-1318: adding a way to load more vocabularies into single edm provider
Date Tue, 20 Nov 2018 17:48:27 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master b1640c596 -> fd481c11d


OLINGO-1318: adding a way to load more vocabularies into single edm provider


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/fd481c11
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/fd481c11
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/fd481c11

Branch: refs/heads/master
Commit: fd481c11d89dc3b13d2582ad7da78a8e24c80ab5
Parents: b1640c5
Author: Ramesh Reddy <rareddy@jboss.org>
Authored: Tue Nov 20 11:48:15 2018 -0600
Committer: Ramesh Reddy <rareddy@jboss.org>
Committed: Tue Nov 20 11:48:15 2018 -0600

----------------------------------------------------------------------
 .../apache/olingo/server/core/MetadataParser.java  | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd481c11/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
index 825ec13..e29ff7b 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
@@ -168,6 +168,14 @@ public class MetadataParser {
             this.useLocalCoreVocabularies, true, null);
   }
   
+  public SchemaBasedEdmProvider addToEdmProvider(SchemaBasedEdmProvider existing, Reader
csdl)
+      throws XMLStreamException {
+    XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
+    XMLEventReader reader = xmlInputFactory.createXMLEventReader(csdl);
+    return addToEdmProvider(existing, reader, this.referenceResolver, this.implicitlyLoadCoreVocabularies,
+        this.useLocalCoreVocabularies, true, null);
+  }
+  
   protected SchemaBasedEdmProvider buildEdmProvider(Reader csdl, ReferenceResolver resolver,
                                                     boolean loadCore, boolean useLocal,
                                                     boolean loadReferenceSchemas, String
namespace)
@@ -185,11 +193,16 @@ public class MetadataParser {
     XMLEventReader reader = xmlInputFactory.createXMLEventReader(csdl);
     return buildEdmProvider(reader, resolver, loadCore, useLocal, loadReferenceSchemas, namespace);
   } 
+
+  protected SchemaBasedEdmProvider buildEdmProvider(XMLEventReader reader, ReferenceResolver
resolver, boolean loadCore,
+      boolean useLocal, boolean loadReferenceSchemas, String namespace) throws XMLStreamException
{
+    SchemaBasedEdmProvider provider = new SchemaBasedEdmProvider();
+    return addToEdmProvider(provider, reader, resolver, loadCore, useLocal, loadReferenceSchemas,
namespace);
+  }
   
-  protected SchemaBasedEdmProvider buildEdmProvider(XMLEventReader reader,
+  protected SchemaBasedEdmProvider addToEdmProvider(SchemaBasedEdmProvider provider, XMLEventReader
reader,
       ReferenceResolver resolver, boolean loadCore, boolean useLocal, boolean loadReferenceSchemas,
String namespace)
       throws XMLStreamException {
-    SchemaBasedEdmProvider provider = new SchemaBasedEdmProvider();
     
     final StringBuilder xmlBase = new StringBuilder();
     


Mime
View raw message