Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1025

Issue in Excel with relative context URI

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • (Java) V4 4.3.0
    • V2 2.0.9
    • odata4-server
    • None
    • Important

    Description

      Hi Olingo Team,

      I'm trying out your library to publish an odata v4 stream to Excel Power Query.

      I started with your tutorial and ran into this first issue : Excel requires absolute metadata URL in service document which I solved by creating a custom processor as indicated here : https://issues.apache.org/jira/browse/OLINGO-758

      That enabled me to go one step further but I got stuck again when I requested /Products because of the m:context which also seems to be relative : m:context="$metadata#Products"

      I tried playing with the ContextURL but I only managed to come up with this which Excel doesn't like either : m:context="../../../../$metadata#Products

      Here is the code in the DemoEntityCollectionProcessor.java :
      ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).oDataPath(request.getRawBaseUri()).build();
      EntitySerializerOptions options = EntitySerializerOptions.with().contextURL(contextUrl).build();

      Here is the message I get in Excel :
      DataSource.Error: OData : The top level context URL '$metadata#Products' should be an absolute Uri.
      Détails :
      DataSourceKind=OData
      DataSourcePath=http://mydomain.net/Developpement/SettOData.nsf/odata.xsp/Products

      Could anyone please help me to solve this issue ?

      Regards,

      Attachments

        Activity

          People

            chrisam Christian Amend
            overmont Olivier VERMONT
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: