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

Ajax-Endpoint #4

Closed
JPSchellenberg opened this issue May 27, 2019 · 0 comments
Closed

Ajax-Endpoint #4

JPSchellenberg opened this issue May 27, 2019 · 0 comments

Comments

@JPSchellenberg
Copy link
Member

JPSchellenberg commented May 27, 2019

The Ajax-Endpoint is the endpoint that the Editor uses to load and save data from the server. Instead of providing different endpoints the H5P-Team used one endpoint which can be configured via the ajaxPath-field in the Editor-Integration-Object

As far as my research goes, it works like this:

GET or POST /ajaxPath?action=

1. Get Content-Type-Cache

See #5

Method:
GET /ajaxPath?action=content-type-cache

Response:

{
"outdated": boolean,
"libraries": Array<Library>
}

Example

2. Get Libraries

See #6

Method:
GET /ajaxPath?action=libraries?machineName=<machine_name>&majorVersion=<major_version>&minorVersion=<minor_version>

Response:

{
"semantics": LibrarySemantics,
"language": LibraryLanguage,
"javascript": Array<JSDependency>,
"css": Array<CSSDependency>,
"translation": LibraryTranslation
}

3. Post Libraries

See #7

Method:
POST /ajaxPath?action=libraries

Body:

Array<LibraryName>

Example:
["H5P.AdvancedText 1.1", "H5P.AppearIn 1.0"]

Response:

Array<Library>

4. Post files

See #8

Method:
POST /ajaxPath?action=files

Body: file

Response:

{
mime: MimeType,
path: Path
}

I hope this makes it a little bit clearer and helps you understand how the H5P-Editor works. There might be other mechanisms that I am not aware of, so please feel free to contribute and share your knowledge about the H5P-Structure.

@JPSchellenberg JPSchellenberg added this to inbox in H5P via automation May 27, 2019
@JPSchellenberg JPSchellenberg moved this from inbox to todo in H5P May 27, 2019
@JPSchellenberg JPSchellenberg changed the title Implement ajax-endpoint Implement ajax-endpoint-handler May 27, 2019
@JPSchellenberg JPSchellenberg changed the title Implement ajax-endpoint-handler Ajax-Endpoint May 27, 2019
@JPSchellenberg JPSchellenberg removed this from todo in H5P May 27, 2019
@sr258 sr258 mentioned this issue Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant