Skip to content

Integration that creates Article content in Enonic XP based on data from NTB

License

Notifications You must be signed in to change notification settings

ItemConsulting/xp-ntb-import

Repository files navigation

NTB Import

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.

Installation

Install this application from Enonic Market.

Usage

Configuration

When you add the NTB Import application to your site, you have to configure three fields.

  1. Folder where articles are stored
  2. Publisher id (8 digit number from NTB)
  3. Channels (8 digit number from NTB)

Manual Article Import

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

Automatic Article 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.

Displaying NTB Article

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;
}

Deploying

Building

To build he project run the following code

enonic project build

Deploy locally

Deploy locally for testing purposes:

./gradlew publishToMavenLocal

Deploy to Jitpack

Go to the Jitpack page for xp-ntb-import to deploy from Github.