Enonic XP Application that imports articles from NTB Kommunikasjon and creates Content
in XP.
ℹ️ You need to have a subscription from NTB Kommunikasjon to use this library. |
---|
Install this application from Enonic Market.
When you add the NTB Import application to your site, you have to configure three fields.
- Folder where articles are stored
- Publisher id (8 digit number from NTB)
- Channels (8 digit number from NTB)
You can manually run an import by running the ntb-import
service, which can be found on the following url-path:
/_/service/no.item.ntb/ntb-import
The application has a cron job that runs an import job every hour on the hour. If there are new articles on your NTB Channel, they will be imported into XP as NTB Article content. The su user is set as the owner of the new content.
You have to write the code generate the HTML based on the NTB Article
in your own application.
If you are using TypeScript, you can use this interface to interact with the objects created by this library.
export interface NtbArticle {
title: string;
leadtext: string;
body: string;
imageId?: string;
images?: Array<string>;
links?: Array<{
url: string;
description: string;
}>;
keywords?: Array<string>;
ntbId: number;
published: string;
url: string;
type: string;
publisherId: number;
channelId: number;
language: string;
}
To build he project run the following code
enonic project build
Deploy locally for testing purposes:
./gradlew publishToMavenLocal
Go to the Jitpack page for xp-ntb-import to deploy from Github.