Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
bad9a575
Commit
bad9a575
authored
7 years ago
by
Carsten Rose
Browse files
Options
Downloads
Patches
Plain Diff
Doc: move donwload from CODING to PROTOCOL
parent
d649c20e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/CODING.md
+1
-36
1 addition, 36 deletions
doc/CODING.md
doc/PROTOCOL.md
+57
-1
57 additions, 1 deletion
doc/PROTOCOL.md
with
58 additions
and
37 deletions
doc/CODING.md
+
1
−
36
View file @
bad9a575
...
...
@@ -194,42 +194,7 @@ Form save
Download
--------
A download might be:
*
a single file (any type, will be detected on the fly),
*
an export of several files as a ZIP archive,
*
an export of a T3-'XML'-Page converted to Excel,
*
a converted HTML page to PDF,
*
a PDF file, concatenated on single PDF files and/or converted HTML page to PDF.
'api/download.php' will be called with a SIP (no other vars used). The SIP contains:
*
DOWNLOAD_EXPORT_FILENAME - any target filename, if none given take DOWNLOAD_OUTPUT_PDF ('output.pdf').
*
DONWLOAD_MODE - file / pdf / excel / zip. If not specified:
a) 'file' is the default if only one is given and if this is a file.
b) 'pdf' is the default if there are multiple TOKEN_URL, TOKEN_URL_PARAM, TOKEN_FILE in SIP_DOWNLOAD_PARAMETER found.
*
SIP_DOWNLOAD_PARAMETER (base64 encoded) - contains all parameter to source elements.
Format:
<format 1>
:
<element 1>
|
<format 2>
:
<element 2>
|...|
<format n>
:
<element n>
|
<format>
: TOKEN_URL, TOKEN_URL_PARAM, TOKEN_FILE
<element>
: depending on the token - see below
URL: a) 'u:http://w3c.org', b) 'u:w3c.org/', c) 'u:w3c.org/2017/index.php?issue=23'
URL_PARAM: a) 'U:id=export&r=123', b) 'U:id=export&r=123&
_orientation=landscape&_
page-size=a3'
FILE: a) 'f:fileadmin/example.png'
*
In URL_PARAM extra parameter used by
`wkhtmltopdf`
can be specified. All Parameter, starting with '-'
will be extracted from the regular URL_PARAM and instead forwarded as options to
`wkhtmlpdf`
*
The base64 encoding is necessary:
*
to deliver multiple elements with the same token (e.g. multiple PDF files to concatenate).
*
special parameter names, like 'id', should not force the regular interpretation of 'id' during conversion to a SIP.
During preparing and delivering the download, a popup shows a spinning gear by default. The popup itself will display an
individual message. The popup needs some HTML code (only once per T3 page).
Download links might be generated in
`report`
as well as in
`subrecords of forms`
. To trigger the generation of the HTML
popup code, a variable DOWNLOAD_POPUP_REQUEST in STORE_SYSTEM will be set to 'true' (string) in class Link(), as soon as
the first download link is rendered. During internal rendering of the download link, the const text token
DOWNLOAD_POPUP_REPLACE_TEXT and DOWNLOAD_POPUP_REPLACE_TITLE will be replaced with individual texts, defined per download link.
See PROTOCOL.md > Download
Print
-----
...
...
This diff is collapsed.
Click to expand it.
doc/PROTOCOL.md
+
57
−
1
View file @
bad9a575
...
...
@@ -21,7 +21,7 @@ JSON Response from the server containing at least:
{
"status": "success"|"error",
"message": "<message>"
}
}
`status`
indicates whether or not the request has been fullfiled by
the server (
`"success"`
) or encountered an error (
`"error"`
). On
...
...
@@ -336,6 +336,62 @@ Server Response
: The response contains a [Minimal Response].
[Redirection Response] may be included.
### Download
Request
: api/download.php
Request Method
: GET
URL Parameters
:
`s=<SIP>`
Server Response
: header("Content-type: $mimetype");
header("Content-Length: $length");
header("Content-Disposition: inline; filename=
\"
$outputFilename
\"
");
header("Pragma: no-cache");
header("Expires: 0");
file_get_contents($file);
A download might be:
*
a single file (any type, will be detected on the fly),
*
an export of several files as a ZIP archive,
*
an export of a T3-'XML'-Page converted to Excel,
*
a converted HTML page to PDF,
*
a PDF file, concatenated on single PDF files and/or converted HTML page to PDF.
'api/download.php' will be called with a SIP (no other vars used). The SIP contains:
*
DOWNLOAD_EXPORT_FILENAME - any target filename, if none given take DOWNLOAD_OUTPUT_PDF ('output.pdf').
*
DONWLOAD_MODE - file / pdf / excel / zip. If not specified:
a) 'file' is the default if only one is given and if this is a file.
b) 'pdf' is the default if there are multiple TOKEN_URL, TOKEN_URL_PARAM, TOKEN_FILE in SIP_DOWNLOAD_PARAMETER found.
*
SIP_DOWNLOAD_PARAMETER (base64 encoded) - contains all parameter to source elements.
Format:
<format
1
>
:
<element
1
>
|
<format
2
>
:
<element
2
>
|...|
<format
n
>
:
<element
n
>
|
<format>
: TOKEN_URL, TOKEN_URL_PARAM, TOKEN_FILE
<element>
: depending on the token - see below
URL: a) 'u:http://w3c.org', b) 'u:w3c.org/', c) 'u:w3c.org/2017/index.php?issue=23'
URL_PARAM: a) 'U:id=export&r=123', b) 'U:id=export&r=123&
_orientation=landscape&_
page-size=a3'
FILE: a) 'f:fileadmin/example.png'
*
In URL_PARAM extra parameter used by
`wkhtmltopdf`
can be specified. All Parameter, starting with '-'
will be extracted from the regular URL_PARAM and instead forwarded as options to
`wkhtmlpdf`
*
The base64 encoding is necessary:
*
to deliver multiple elements with the same token (e.g. multiple PDF files to concatenate).
*
special parameter names, like 'id', should not force the regular interpretation of 'id' during conversion to a SIP.
During preparing and delivering the download, a popup shows a spinning gear by default. The popup itself will display an
individual message. The popup needs some HTML code (only once per T3 page).
Download links might be generated in
`report`
as well as in
`subrecords of forms`
. To trigger the generation of the HTML
popup code, a variable DOWNLOAD_POPUP_REQUEST in STORE_SYSTEM will be set to 'true' (string) in class Link(), as soon as
the first download link is rendered. During internal rendering of the download link, the const text token
DOWNLOAD_POPUP_REPLACE_TEXT and DOWNLOAD_POPUP_REPLACE_TITLE will be replaced with individual texts, defined per download link.
### Typeahead
The Client initiates Typeahead actions via a GET request. A JSON key/value dict will we be send back as response.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment