Does the Microsoft Graph API metadata confirm the OData Protocol specification? - odata

Microsoft Graph API metadata
https://graph.microsoft.com/v1.0/$metadata?detailed=true
ll.6791 - 6795
<Action Name="createSession" IsBound="true">
<Parameter Name="this" Type="microsoft.graph.workbook"/>
<Parameter Name="persistChanges" Type="Edm.Boolean" Nullable="false"/>
<ReturnType Type="microsoft.graph.workbookSessionInfo"/>
</Action>
11.5.1 Binding an Operation to a Resource
http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752308
Actions and Functions MAY be bound to an entity type, primitive type, complex type, or a collection. The first parameter of a bound operation is the binding parameter.
"createSession" Action does not have "bindingParameter".
Is this a correct specification for the Microsoft Graph API metadata?
How can I report this to the Microsoft Graph team if this is an incorrect specification?

As you quoted, the spec says:
The first parameter of a bound operation is the binding parameter.
So in this case the parameter named "this" is the binding parameter. It is not necessary for the parameter to be named "bindingParameter".

Related

Microsoft Graph: List of possible modifiedProperty values

The descriptions of the property modifiedProperty do not contain a list of (or a link to) its possible values, which makes it difficult to utilize APIs that return this resource type.
Document Details
Content: modifiedProperty resource type - Microsoft Graph v1.0
Content Source: api-reference/v1.0/resources/modifiedproperty.md
Product: microsoft-identity-platform
Technology: microsoft-graph
Link : https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/v1.0/resources/modifiedproperty.md
It would be helpful if the list of possible values could be provided.
I highly doubt you're going to be able to find such a list. The values of the modifiedProperty property are going to vary based on which type of Azure resource you're looking at and which property on that resource was modified. The only thing you can be certain of is that the modifiedProperty will be empty or it will contain a property name, the old value, and the new value, according to the documentation you linked.
If you are trying to code for a particular type of Azure resource or a particular type of property, you should look into the documentation for that resource or property instead of the documentation for getting that information.

Writable OData V2 service from odata.org: "Products" from an expanded Entity not visible

Using this writable OData v2 sample service (not Northwind), I'm binding a single Category entity to a container control while expanding to the entity set Products. Inside the container control, I have a list which has an aggregation binding to the items with the products coming from the expand.
<Page binding="{
path: 'odataModel>/Categories(1)',
parameters: {
expand: 'Products'
}
}">
<List items="{odataModel>Products}">
<StandardListItem title="{odataModel>Name}" />
</List>
</Page>
The problem is that the list doesn't show the names of the products, although I get the correct length of the collection. And there are no error messages either.
Here is the example implementing the sample OData service: https://embed.plnkr.co/bC2KPe/.
Weirdly, the binding path of each item is reported as "/[object Object]" instead of something like "/Products(1)".
The properties of the products are visible if...
I do the same with the Northwind service instead, which is readable only (But what I need is a writable service)
I bind the products directly to the list without the parent's element binding.
I delete a single product (e.g. manually "/Products(0)" as it can be seen in the plunker example). After that, the product names are visible.
What's wrong with this sample service? Do I have to configure my ODataModel according to that service specifically? Is it just the service that is not working properly?
Also I wanted to replace Products with a different entity set but all the other entity sets (Suppliers and Categories) navigate to Products only.
Is there any other free writable sample OData V2 service I can test?
I see that the resulting structure on odata.svc is not as expected in the service. The resulting structure is missing the 'results' parameter.
If you see the northwind service, it has the 'results' parameter.
As of version 1.52.1, the ODataModel (v2) can handle broken service implementation as well:
E.g. the above service is missing the results parameter as indicated by krisho.

Struts2 equivalent for <bean:parameter> tag

What is the equivalent in Struts2 for tag:
<bean:parameter id="myId" name="name"/>
<bean:parameter>
Define a scripting variable based on the value(s) of the specified
request parameter.
You don't need scripting variables in JSP. Request parameters available to OGNL or JSP EL expression engines. You can use either of them (where it's applicable) to retrieve parameters. Learn more about ParameterAware interface which allows you to inject parameters to the action. This answer will help you in this direction.
Also if you have action properties that can be populated (have setters for parameter names) then it's done automatically by params interceptor. It also applies type conversions to convert parameter values to the corresponding data type.

O365 MS Graph Unified API - how to get information on entity properties

I know that it is possible to retrieve whole metadata structure in edmx format through the OData $metadata. But these metadata's EntityType Property items are missing some interesting things - for example if property is filterable, updatable, or mandatory/optional for creating new objects. Maybe some description would come handy too.
Is it possible to retrieve this information through the API?
Most of what you're asking for can be expressed in $metadata by using the OData Capabilities vocabulary annotations (http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/vocabularies/Org.OData.Capabilities.V1.xml). There is a limited set of such annotations already present in https://graph.microsoft.com/v1.0/$metadata, for example:
<Annotations Target="microsoft.graph.directoryObject">
<Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
<Record>
<PropertyValue Bool="false" Property="Filterable"/>
</Record>
</Annotation>
</Annotations>
More such annotations will be added in the future.
Mandatory properties are normally marked with Nullable="false" attribute (http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397955)

jsf2 converter usage for update model or render

I am new bee to jsf , I am using prime faces, I did not understand how converter works, in case of single select menu.
My confusion is, is it called for converting from request parameter to object in formBean or is it called for rendering my list?
In my list If I specify
<f:selectItems
value="#{granteeSelectionManager.getGrantProgramDTOs()}"
var="grantProgramDTO" itemLabel="#{grantProgramDTO.name}"
itemValue="#{grantProgramDTO.id}" />
how to render my list and specify a converter, the converter is beign called for every item in the list?
Please help me understand if it is called for updating selection in my managed bean or for rendering or both ?
It's used for both cases.
When the list is rendered, the converter's getAsString() is used to convert the Java object behind <f:selectItem(s) itemValue> to a String which in turn is rendered as <option value> (which in turn is used as HTTP request parameter). This is indeed done on a per-item basis.
When the form is submitted, the converter's getAsObject() is used to convert the submitted value (the <option value> which appears as HTTP request parameter) back to the concrete Java object so that it can be set in the model (the backing bean) via <x:selectOneMenu value>.
In your particular case you seem to use object's own id property as item value. In such case a converter is completely unnecessary. You only need to make sure that <x:selectOneMenu value> is bound to a property of exactly the same type as <f:selectItem(s) itemValue>, which is probably Integer or Long.
If you however want to get and set a concrete Java object as value like so
<h:selectOneMenu value="#{bean.grantProgramDTO}">
<f:selectItems ... itemValue="#{grantProgramDTO}" />
</h:selectOneMenu>
then you definitely need a converter for the simple reason that Java objects can't be represented in HTML output and HTTP request parameters without converting them to their unique String representation first. In Java perspective, HTML output is basically one large String and HTTP request parameters are per definition Strings.
See also:
Our selectOneMenu wiki page
Why selectOneMenu Send ItemLabel to the converter?
Is a custom JSF converter needed for this simple class?
Conversion Error setting value for 'null Converter'
Strategy for mapping entity relationships and converting entities
How create a custom coverter in JSF 2?

Resources