You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Josh Fenlason <jo...@fenlason.net> on 2018/02/19 21:50:01 UTC
FilterRestrictions
I'm working on trying to restrict filtering on certain entity
properties. I've been looking at this blog entry,
http://www.odata.org/blog/introducing-a-capabilities-vocabulary/, as my
guide and have added the "NonFilterableProperties" annotation to my
EntitySet.
<EntitySet Name="MyObjects" EntityType="ACME.MyObject">
<Annotation>
<Record>
<PropertyValue Property="NonFilterableProperties">
<Collection>
<String>EntityPropOne</String>
<String>EntityPropTwo</String>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</EntitySet>
I was kinda hoping that Olingo would automatically enforce the
annotation and provide an error response if any of the properties
annotated as NonfilterableProperties were included in the filter. I
believe I added the annotations correctly, but I'm not 100% sure. I'm
fairly new to Odata and Olingo though so I've got a few questions. Does
enforcing annotations such as these fall under the umbrella of what the
Olingo library can be expected to handle? Or is it expected that I
would need to do that myself in my service? If the former, am I doing
something wrong in defining my annotations? Or is this just a
gap/enhancement that needs to be supported in Olingo? If the ideal
solution is for this to be supported in Olingo, is this something that I
could take a crack at implementing and submit it for being included with
Olingo?
Thanks
,
Josh.
Re: FilterRestrictions
Posted by Josh Fenlason <jo...@fenlason.net>.
Thanks a bunch for the quick and clear response Christian!
,
Josh.
On 02/21/2018 03:19 AM, Amend, Christian wrote:
> Hi Josh,
>
> you are using the annotation correctly but Olingo does not automatically block those requests. Having the annotation just tells a client that the service does not support the behavior.
>
> You can limit your filter behavior in your implementation of the Entity Collection Processor.
>
> Best Regards,
> Christian
>
> -----Original Message-----
> From: Josh Fenlason [mailto:josh@fenlason.net]
> Sent: Montag, 19. Februar 2018 22:50
> To: user@olingo.apache.org
> Subject: FilterRestrictions
>
> I'm working on trying to restrict filtering on certain entity
> properties. I've been looking at this blog entry,
> http://www.odata.org/blog/introducing-a-capabilities-vocabulary/, as my
> guide and have added the "NonFilterableProperties" annotation to my
> EntitySet.
>
> <EntitySet Name="MyObjects" EntityType="ACME.MyObject">
> <Annotation>
> <Record>
> <PropertyValue Property="NonFilterableProperties">
> <Collection>
> <String>EntityPropOne</String>
> <String>EntityPropTwo</String>
> </Collection>
> </PropertyValue>
> </Record>
> </Annotation>
> </EntitySet>
>
> I was kinda hoping that Olingo would automatically enforce the
> annotation and provide an error response if any of the properties
> annotated as NonfilterableProperties were included in the filter. I
> believe I added the annotations correctly, but I'm not 100% sure. I'm
> fairly new to Odata and Olingo though so I've got a few questions. Does
> enforcing annotations such as these fall under the umbrella of what the
> Olingo library can be expected to handle? Or is it expected that I
> would need to do that myself in my service? If the former, am I doing
> something wrong in defining my annotations? Or is this just a
> gap/enhancement that needs to be supported in Olingo? If the ideal
> solution is for this to be supported in Olingo, is this something that I
> could take a crack at implementing and submit it for being included with
> Olingo?
> Thanks
> ,
> Josh.
RE: FilterRestrictions
Posted by "Amend, Christian" <ch...@sap.com>.
Hi Josh,
you are using the annotation correctly but Olingo does not automatically block those requests. Having the annotation just tells a client that the service does not support the behavior.
You can limit your filter behavior in your implementation of the Entity Collection Processor.
Best Regards,
Christian
-----Original Message-----
From: Josh Fenlason [mailto:josh@fenlason.net]
Sent: Montag, 19. Februar 2018 22:50
To: user@olingo.apache.org
Subject: FilterRestrictions
I'm working on trying to restrict filtering on certain entity
properties. I've been looking at this blog entry,
http://www.odata.org/blog/introducing-a-capabilities-vocabulary/, as my
guide and have added the "NonFilterableProperties" annotation to my
EntitySet.
<EntitySet Name="MyObjects" EntityType="ACME.MyObject">
<Annotation>
<Record>
<PropertyValue Property="NonFilterableProperties">
<Collection>
<String>EntityPropOne</String>
<String>EntityPropTwo</String>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</EntitySet>
I was kinda hoping that Olingo would automatically enforce the
annotation and provide an error response if any of the properties
annotated as NonfilterableProperties were included in the filter. I
believe I added the annotations correctly, but I'm not 100% sure. I'm
fairly new to Odata and Olingo though so I've got a few questions. Does
enforcing annotations such as these fall under the umbrella of what the
Olingo library can be expected to handle? Or is it expected that I
would need to do that myself in my service? If the former, am I doing
something wrong in defining my annotations? Or is this just a
gap/enhancement that needs to be supported in Olingo? If the ideal
solution is for this to be supported in Olingo, is this something that I
could take a crack at implementing and submit it for being included with
Olingo?
Thanks
,
Josh.