Permanently adds content from a H5P package to the system. This means that content is permanently added to storage and necessary libraries are installed from the package if they are not already installed.
This is NOT what you want if the user is just uploading a package in the editor client!
Throws errors if something goes wrong.
The full path to the H5P package file on the local disk.
The user who wants to upload the package.
Optional
contentId: string(optional) the content id to use for the package
the newly assigned content id, the metadata (=h5p.json) and parameters (=content.json) inside the package and a list of installed libraries.
Copies files inside the package into temporary storage and installs the necessary libraries from the package if they are not already installed. (This is what you want to do if the user uploads a package in the editor client.) Pass the information returned about the content back to the editor client. Throws errors if something goes wrong.
The full path to the H5P package file on the local disk.
The user who wants to upload the package.
the metadata and parameters inside the package and a list of installed libraries
Installs all libraries from the package. Assumes that the user calling this has the permission to install libraries! Throws errors if something goes wrong.
The full path to the H5P package file on the local disk.
a list of the installed libraries
Static
extractExtracts a H5P package to the specified directory.
The full path to the H5P package file on the local disk
The full path of the directory to which the package should be extracted
If true, the content folder inside the package will be extracted.
If true, the library directories inside the package will be extracted.
If true, the h5p.json file inside the package will be extracted.
Handles the installation of libraries and saving of content from a H5P package.