Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF: support document description in request header #268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion vocabularies/PDF.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@
},
"FeaturesType": {
"$Kind": "ComplexType",
"DocumentDescriptionLocation": {
"$Type": "PDF.DocumentDescriptionLocation",
"$Nullable": true,
"$DefaultValue": 0,
"@Core.Description": "Whether the document description is given in an entity set or in a request header",
"@Core.LongDescription": "If value is 'entitySet', also set property 'DocumentDescriptionReference' and 'DocumentDescriptionCollection'. If value is 'header', set request header 'SAP-Document-Description' to base64-encoded JSON string of the document description."
},
"DocumentDescriptionReference": {
"$Nullable": true,
"@Core.IsURL": true,
"@Core.Description": "Reference of the Service for the DocumentDescription"
},
"DocumentDescriptionCollection": { "@Core.Description": "Name of entity set containing the DocumentDescription" },
"DocumentDescriptionCollection": {
"$Nullable": true,
"@Core.Description": "Name of entity set containing the DocumentDescription"
},
"ArchiveFormat": {
"$Type": "Edm.Boolean",
"$DefaultValue": false,
Expand Down Expand Up @@ -81,6 +92,13 @@
"@Core.Description": "Maximum result size",
"@Core.LongDescription": "Max result size for PDF documents. Used if $top has been provided and $top > ResultSizeMaximum"
}
},
"DocumentDescriptionLocation": {
"$Kind": "EnumType",
"entitySet": 0,
"[email protected]": "Document description is given as entity set",
"header": 1,
"[email protected]": "Document description is given in a request header"
}
}
}
38 changes: 24 additions & 14 deletions vocabularies/PDF.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,27 @@ Term|Type|Description

Property|Type|Description
:-------|:---|:----------
[DocumentDescriptionReference](./PDF.xml#L43:~:text=<ComplexType%20Name="-,FeaturesType,-")|URL|Reference of the Service for the DocumentDescription
[DocumentDescriptionCollection](./PDF.xml#L47:~:text=<ComplexType%20Name="-,FeaturesType,-")|String|Name of entity set containing the DocumentDescription
[ArchiveFormat](./PDF.xml#L50:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|PDF/A conformant format supported
[Signature](./PDF.xml#L53:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Signing the document supported
[CoverPage](./PDF.xml#L56:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Cover Page supported
[FontName](./PDF.xml#L59:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Font name supported
[FontSize](./PDF.xml#L62:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Font size supported
[Margin](./PDF.xml#L65:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Margin size supported
[Border](./PDF.xml#L68:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Border size of the table supported
[FitToPage](./PDF.xml#L71:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Fit to page supported<br>If this option is selected, the font size is automatically selected in such a way that all columns of a table fit on one page. Other layout options like margin, border and composite cell spacing are adapted accordingly, with respect to the chose scaling factor.
[Padding](./PDF.xml#L77:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Padding of document supported<br>Is padding (left, right, bottom, top) supported?
[HeaderFooter](./PDF.xml#L83:~:text=<ComplexType%20Name="-,FeaturesType,-") *([Experimental](Common.md#Experimental))*|Boolean|Page header and footer supported<br>Headers and footers are areas in the top and the bottom page margins, where you can add page number and date information
[ResultSizeDefault](./PDF.xml#L90:~:text=<ComplexType%20Name="-,FeaturesType,-")|Int32?|Default result size<br>Default result size for PDF documents. Used if $top has not been provided.
[ResultSizeMaximum](./PDF.xml#L96:~:text=<ComplexType%20Name="-,FeaturesType,-")|Int32?|Maximum result size<br>Max result size for PDF documents. Used if $top has been provided and $top > ResultSizeMaximum
[DocumentDescriptionLocation](./PDF.xml#L43:~:text=<ComplexType%20Name="-,FeaturesType,-")|[DocumentDescriptionLocation?](#DocumentDescriptionLocation)|Whether the document description is given in an entity set or in a request header<br>If value is 'entitySet', also set property 'DocumentDescriptionReference' and 'DocumentDescriptionCollection'. If value is 'header', set request header 'SAP-Document-Description' to base64-encoded JSON string of the document description.
[DocumentDescriptionReference](./PDF.xml#L49:~:text=<ComplexType%20Name="-,FeaturesType,-")|URL?|Reference of the Service for the DocumentDescription
[DocumentDescriptionCollection](./PDF.xml#L53:~:text=<ComplexType%20Name="-,FeaturesType,-")|String?|Name of entity set containing the DocumentDescription
[ArchiveFormat](./PDF.xml#L56:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|PDF/A conformant format supported
[Signature](./PDF.xml#L59:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Signing the document supported
[CoverPage](./PDF.xml#L62:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Cover Page supported
[FontName](./PDF.xml#L65:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Font name supported
[FontSize](./PDF.xml#L68:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Font size supported
[Margin](./PDF.xml#L71:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Margin size supported
[Border](./PDF.xml#L74:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Border size of the table supported
[FitToPage](./PDF.xml#L77:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Fit to page supported<br>If this option is selected, the font size is automatically selected in such a way that all columns of a table fit on one page. Other layout options like margin, border and composite cell spacing are adapted accordingly, with respect to the chose scaling factor.
[Padding](./PDF.xml#L83:~:text=<ComplexType%20Name="-,FeaturesType,-")|Boolean|Padding of document supported<br>Is padding (left, right, bottom, top) supported?
[HeaderFooter](./PDF.xml#L89:~:text=<ComplexType%20Name="-,FeaturesType,-") *([Experimental](Common.md#Experimental))*|Boolean|Page header and footer supported<br>Headers and footers are areas in the top and the bottom page margins, where you can add page number and date information
[ResultSizeDefault](./PDF.xml#L96:~:text=<ComplexType%20Name="-,FeaturesType,-")|Int32?|Default result size<br>Default result size for PDF documents. Used if $top has not been provided.
[ResultSizeMaximum](./PDF.xml#L102:~:text=<ComplexType%20Name="-,FeaturesType,-")|Int32?|Maximum result size<br>Max result size for PDF documents. Used if $top has been provided and $top > ResultSizeMaximum

<a name="DocumentDescriptionLocation"></a>
## [DocumentDescriptionLocation](./PDF.xml#L109:~:text=<EnumType%20Name="-,DocumentDescriptionLocation,-")


Member|Value|Description
:-----|----:|:----------
[entitySet](./PDF.xml#L110:~:text=<EnumType%20Name="-,DocumentDescriptionLocation,-")|0|Document description is given as entity set
[header](./PDF.xml#L113:~:text=<EnumType%20Name="-,DocumentDescriptionLocation,-")|1|Document description is given in a request header
18 changes: 16 additions & 2 deletions vocabularies/PDF.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@
</Term>

<ComplexType Name="FeaturesType">
<Property Name="DocumentDescriptionReference" Type="Edm.String" Nullable="false">
<Property Name="DocumentDescriptionLocation" Type="PDF.DocumentDescriptionLocation" DefaultValue="0">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure here if value 0 is correct. Would rather like to read it entitySet.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this points to an enum, don't we need a value help for it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen value helps in the other documents either, so would guess this is not a use case here.

For concrete DocumentDescription... properties, they are not user-facing, but only filled programmatically. One application, for example, will set DocumentDescriptionLocation to header, the other will set it to entitySet. But it's not the user that decides it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Property Name="DocumentDescriptionLocation" Type="PDF.DocumentDescriptionLocation" DefaultValue="0">

<Annotation Term="Core.Description" String="Whether the document description is given in an entity set or in a request header" />
<Annotation Term="Core.LongDescription">
<String>If value is 'entitySet', also set property 'DocumentDescriptionReference' and 'DocumentDescriptionCollection'. If value is 'header', set request header 'SAP-Document-Description' to base64-encoded JSON string of the document description.</String>
</Annotation>
</Property>
<Property Name="DocumentDescriptionReference" Type="Edm.String">
<Annotation Term="Core.IsURL" Bool="true" />
<Annotation Term="Core.Description" String="Reference of the Service for the DocumentDescription" />
</Property>
<Property Name="DocumentDescriptionCollection" Type="Edm.String" Nullable="false">
<Property Name="DocumentDescriptionCollection" Type="Edm.String">
<Annotation Term="Core.Description" String="Name of entity set containing the DocumentDescription" />
</Property>
Comment on lines +53 to 55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Property Name="DocumentDescriptionCollection" Type="Edm.String">
<Annotation Term="Core.Description" String="Name of entity set containing the DocumentDescription" />
</Property>
<Property Name="DocumentDescriptionCollection" Type="Edm.String">
<Annotation Term="Core.Description" String="Name of entity set containing the DocumentDescription" />
<Annotation Term="Core.LongDescription">
<String>If this is null, the request header 'SAP-Document-Description' must contain the base64-encoded JSON string of the document description.</String>
</Annotation>
</Property>

<Property Name="ArchiveFormat" Type="Edm.Boolean" Nullable="false" DefaultValue="false">
Expand Down Expand Up @@ -100,6 +106,14 @@
</Annotation>
</Property>
</ComplexType>
<EnumType Name="DocumentDescriptionLocation">
<Member Name="entitySet" Value="0">
<Annotation Term="Core.Description" String="Document description is given as entity set" />
</Member>
<Member Name="header" Value="1">
<Annotation Term="Core.Description" String="Document description is given in a request header" />
</Member>
</EnumType>
Comment on lines +109 to +116
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<EnumType Name="DocumentDescriptionLocation">
<Member Name="entitySet" Value="0">
<Annotation Term="Core.Description" String="Document description is given as entity set" />
</Member>
<Member Name="header" Value="1">
<Annotation Term="Core.Description" String="Document description is given in a request header" />
</Member>
</EnumType>


</Schema>
</edmx:DataServices>
Expand Down