<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: CAP - JAVA localized texts service expose in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaa-p/12468651#M4670902</link>
    <description>&lt;P&gt;The behaviour of CAP Java is the expected one here. The Books_texts entity in the ReviewService in the Java sample is not explicitly exposed by the service. It is implicitly auto-exposed. Implicitly auto-exposed entities are not accessible directly, but only via proper navigation paths. You would need to run one of the following requests to obtain the texts of books:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books?$expand=texts" target="test_blank"&gt;https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books?$expand=texts&lt;/A&gt;
&lt;A href="https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books(...)/texts" target="test_blank"&gt;https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books(...)/texts&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In case you directly want to make the entity available you need to explicitly declare it in the service, for example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;extend service ReviewService with { 
    @requires: 'any' // or any other appropriate authorization
    entity Books.texts as projection on my.Books.texts;
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;See also more information about this in our documentation: &lt;A href="https://cap.cloud.sap/docs/guides/authorization#events-and-auto-expose" target="test_blank"&gt;https://cap.cloud.sap/docs/guides/authorization#events-and-auto-expose&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 09:33:12 GMT</pubDate>
    <dc:creator>marcbecker</dc:creator>
    <dc:date>2021-07-20T09:33:12Z</dc:date>
    <item>
      <title>CAP - JAVA localized texts service expose</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaq-p/12468650</link>
      <description>&lt;P&gt;sample: &lt;A href="https://github.com/SAP-samples/cloud-cap-samples-java.git" target="test_blank"&gt;https://github.com/SAP-samples/cloud-cap-samples-java.git&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; - cds path: cloud-cap-samples-java/srv/review-service.cds&lt;/P&gt;
  &lt;P&gt;call odata url: &lt;A href="https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books_texts" target="test_blank"&gt;https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books_texts&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;return value:&lt;/P&gt;
  &lt;P&gt;{ "error": { "code": "403001", "message": "Not authorized to send event 'READ' to 'ReviewService.Books.texts'" } }&lt;/P&gt;
  &lt;P&gt;java stack error:&lt;/P&gt;
  &lt;P&gt;2021-07-20 17:33:59.428 INFO 1484 --- [nio-8080-exec-5] c.s.c.a.o.v4.processors.CdsProcessor : Exception marked the ChangeSet 16 as cancelled: Not authorized to send event 'READ' to 'ReviewService.Books.texts' (service 'ReviewService', event 'READ', entity 'ReviewService.Books.texts')&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 09:18:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaq-p/12468650</guid>
      <dc:creator>WonseokChoe</dc:creator>
      <dc:date>2021-07-20T09:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: CAP - JAVA localized texts service expose</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaa-p/12468651#M4670902</link>
      <description>&lt;P&gt;The behaviour of CAP Java is the expected one here. The Books_texts entity in the ReviewService in the Java sample is not explicitly exposed by the service. It is implicitly auto-exposed. Implicitly auto-exposed entities are not accessible directly, but only via proper navigation paths. You would need to run one of the following requests to obtain the texts of books:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books?$expand=texts" target="test_blank"&gt;https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books?$expand=texts&lt;/A&gt;
&lt;A href="https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books(...)/texts" target="test_blank"&gt;https://workspaces-ws-#####-app1.####.trial.applicationstudio.cloud.sap/api/review/Books(...)/texts&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In case you directly want to make the entity available you need to explicitly declare it in the service, for example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;extend service ReviewService with { 
    @requires: 'any' // or any other appropriate authorization
    entity Books.texts as projection on my.Books.texts;
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;See also more information about this in our documentation: &lt;A href="https://cap.cloud.sap/docs/guides/authorization#events-and-auto-expose" target="test_blank"&gt;https://cap.cloud.sap/docs/guides/authorization#events-and-auto-expose&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 09:33:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaa-p/12468651#M4670902</guid>
      <dc:creator>marcbecker</dc:creator>
      <dc:date>2021-07-20T09:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: CAP - JAVA localized texts service expose</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaa-p/12468652#M4670903</link>
      <description>&lt;P&gt;Dear Becker,&lt;/P&gt;&lt;P&gt;Thank you for the advice.&lt;/P&gt;&lt;P&gt;I solved it as below through your advice.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;annotate Books.texts with @cds.autoexpose;                  //In Node.js(cds watch) 
annotate Books.texts with @(cds.autoexpose,requires:'any'); //In Java(mvn spring-boot:run) //cds.services.version@1.15.3,@sap/cds@5.3.2

//Not Working//annotate Books.texts with @(cds.autoexpose,requires:'any'); //In Java(mvn spring-boot:run) //cds.services.version@1.15.3,@sap/cds@4.6.6
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 08:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-localized-texts-service-expose/qaa-p/12468652#M4670903</guid>
      <dc:creator>WonseokChoe</dc:creator>
      <dc:date>2021-07-21T08:00:47Z</dc:date>
    </item>
  </channel>
</rss>

