-
public final class PublicationOpenerOpens a Publication from an Asset.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPublicationOpener.OpenError
-
Constructor Summary
Constructors Constructor Description PublicationOpener(PublicationParser publicationParser, List<ContentProtection> contentProtections, Function1<Publication.Builder, Unit> onCreatePublication)
-
Method Summary
Modifier and Type Method Description final Try<Publication, PublicationOpener.OpenError>open(Asset asset, String credentials, Boolean allowUserInteraction, Function1<Publication.Builder, Unit> onCreatePublication, WarningLogger warnings)Opens a Publication from the given asset. -
-
Constructor Detail
-
PublicationOpener
PublicationOpener(PublicationParser publicationParser, List<ContentProtection> contentProtections, Function1<Publication.Builder, Unit> onCreatePublication)
- Parameters:
publicationParser- Parses the content of a publication Asset.contentProtections- Opens DRM-protected publications.onCreatePublication- Called on every parsed Publication.Builder.
-
-
Method Detail
-
open
final Try<Publication, PublicationOpener.OpenError> open(Asset asset, String credentials, Boolean allowUserInteraction, Function1<Publication.Builder, Unit> onCreatePublication, WarningLogger warnings)
Opens a Publication from the given asset.
If you are opening the publication to render it in a Navigator, you must set allowUserInteraction to true to prompt the user for its credentials when the publication is protected. However, set it to false if you just want to import the Publication without reading its content, to avoid prompting the user.
The warnings logger can be used to observe non-fatal parsing warnings, caused by publication authoring mistakes. This can be useful to warn users of potential rendering issues.
- Parameters:
asset- Digital medium (e.g.credentials- Credentials that Content Protections can use to attempt to unlock a publication, for example a password.allowUserInteraction- Indicates whether the user can be prompted, for example for its credentials.onCreatePublication- Transformation which will be applied on the Publication Builder.warnings- Logger used to broadcast non-fatal parsing warnings.
-
-
-
-