Naviga Writer
8.1.7
8.1.7
  • Naviga Writer
  • Release notes
    • 8.1.7
    • 8.1.6
    • 8.1.5
    • 8.1.4
    • 8.1.3
    • 8.1.2
    • 8.1.1
    • 8.1
    • 8.0
    • 7.2
    • 7.1.0
    • 7.0.0
    • 6.5.x
    • 6.5.0
    • 6.4.1
    • 6.4.0
    • 6.3.5
    • 6.3.4
    • 6.3.3
    • 6.3.2
    • 6.3.1
    • 6.2.2
    • 6.2.1
    • 6.2.0
    • 6.1.2
    • 6.1.1
    • 6.1.0
    • 6.0.0
    • 5.3.0
  • Introduction
    • Authoring
    • Developing
    • Publishing
    • History
  • User Guide
    • Writer User Guide
      • Create a new article
      • Top bar
        • Setting menu
        • Article name
        • Search and replace words
        • Version history of an article
          • List of versions
          • Changes in each version
          • Restore to an older version
        • Locked article
        • Active Users
        • Copy article url
        • Save and publish flow
        • History Button
      • Content area
        • Image gallery
        • Embed map
        • Table
        • Teaser
        • Content part
        • HTML embed
        • Upload image
        • Upload PDF
        • Textstyles
        • Lists
        • Special character
        • Marker tool
      • Right Sidebar
        • Meta
          • Author
          • Channels
        • Integrations
        • Image and Article search
      • Bottom bar
        • Article information
        • Edit metadata on linked images
        • Article size
        • Text information
        • Language menu
      • Images User Guide
        • Upload images
        • Metadata of the image
        • Cropping images
        • Download
      • Personal Writer Template
      • Writer Keyboard Shortcuts
      • Text Management
      • Common questions when starting using Writer
  • Admin Guide
    • Configuration Files
    • Configurations Guide
      • Right Sidebar
      • Text Information
      • Content menu
    • Article Templates Configuration
    • Byline configuration
    • Language Configuration
    • Publish Flow
      • Default configuration definitions
      • Publish flow config details
      • Preconditions for roles in the publish flow
    • Generic Properties
      • Configuration
    • Image Services
      • ImEngine
      • Imgix
    • Plugins
      • Naviga developed plugins
        • Plugins in earlier versions of Writer
      • Deprecated Plugins
      • Third-party plugins
  • Developer guide
    • Upgrade Guides
      • 8.0 - Image/PDF upload changes
      • 8.0 - Opening an Article
    • Writer Plugin Development
      • Quickstart
      • Type Definitions (beta)
      • Plugin overview
      • Creating a content object plugin
      • Validation and hooks
      • Interacting with external resources
    • Writer Plugin Building Blocks
      • Package
      • Component
      • Node
      • Converter
      • Events
    • Writer Plugin Style Guide
      • CSS Guidelines
      • CSS variables, colors and fonts
      • UI Components
    • Tutorials
      • Popover & text analysis
      • Search & replace
      • Concept interaction
      • Integrating External Spell Checking
    • Infomaker NewsML
      • Overview
      • Important: About inline notes
      • Document relations and types
      • Extensions XSD
      • NewsItem
      • ConceptItem
      • PlanningItem
      • Examples
        • NewsItem - Text
        • NewsItem - Picture
        • NewsItem - PDF
        • ConceptItem - Author
        • ConceptItem - Category
        • ConceptItem - Channel
        • ConceptItem - Content Profile
        • ConceptItem - Event
        • ConceptItem - Organisation
        • ConceptItem - Person
        • ConceptItem - Place (point)
        • ConceptItem - Place (polygon)
        • ConceptItem - Section
        • ConceptItem - Story
        • ConceptItem - Topic
        • PlanningItem
    • Media Enrichment
      • Images
  • API Reference
    • Writer Api
      • Api
      • Article
      • Browser
      • Concept
      • ConceptService
      • Document
      • Events
      • NewsItem
      • Router
      • Ui
      • Upload
      • User
      • settings
      • History
      • Settings
    • UI Components
      • UIAvatar
      • UIButton
      • UIByline
      • UICheckbox
      • UIChip
      • UIDatePicker
      • UIDatetimeFieldEditor
      • UIDropdown
      • UIFieldEditor
      • UIIconButton
      • UIInlineImage
      • UIPagination
      • UISelect
      • UITimePicker
      • UIToggle
      • UITooltip
      • UIInputText
      • UITextarea
      • UIButtonGroup
      • UIConceptSearch
      • UIDateTimePicker
      • UIInputSearch
      • UIIcon
      • UIPill
      • UISpinner
      • UIButtonList
      • UIIconBadge
      • UIIconButtonMenu
      • UIInputPassword
Powered by GitBook
On this page
  • Article
  • clear(disableWarning)
  • copy(name)
  • setSourceArticle(sourceArticleUuid)
  • setPubStatus(data)
  • addService(data)
  • removeService(data)
  • setPubStart(data)
  • setPubStop(data)
  • setTitle(data)
  • setEdNote(data)
  • setItemMetaExtProperty(data)
  • addItemMetaLink(data)
  • removeItemMetaLink(data)
  • setAltId(data)
  • setSlugline(data)
  • setDescription(data)
  • setBy(data)
  • setHeadline(data)
  • addContentMetaLink(data)
  • removeContentMetaLink(data)
  • addContentMetadata(data)
  • removeContentMetadata(data)
  • itemMeta(path)⇒ DocumentNode
  • contentMeta(path)⇒ DocumentNode
  • Types
  • TimeChange: object
  • StringChange: object
  • LanguageChange
  • AddContentMetaObjectChange: object
  • RemoveContentMetaObjectChange: object
  • ExtTypeObjectChange: object
  • AddMetaLinkObjectChange: object
  • RemoveMetaLinkObjectChange: object

Was this helpful?

  1. API Reference
  2. Writer Api

Article

Article

clear(disableWarning)

Clear the article and create a new based on the configured base template.

Parameters

Param
Type
Description

disableWarning

boolean

Required - Optional, default false. If true, the article will be cleared without warning

copy(name)

Attempt to execute copy hooks if at least one exists, then create a new, unsaved, article based on the current article.

Parameters

Param
Type
Description

name

string

Required - Name or identifier of caller

setSourceArticle(sourceArticleUuid)

Remove any itemMeta links with rel "source", and add a new itemMeta link with rel "source" using supplied article uuid

Parameters

Param
Type

sourceArticleUuid

string

setPubStatus(data)

Sets the publication status for this document. The value is one of what is defined in the NewsML G2 standard: https://www.iptc.org/std/NewsML-G2/latest/QuickStart-NewsML-G2-ItemBasics under the Publication Status section, together with custom extension in the format [customExtensionPrefix]:[customValue], such as imext:draft

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.Article.setPubStatus({
     change: 'stat:withheld'
})

<itemMeta>
  <pubStatus qcode="stat:withheld"/>
</itemMeta>

addService(data)

Deprecated

Adds a service to the itemMeta section of the article. The service tag concists of a mandatory 'qcode' value and an optional 'why' attribute with extra information.

Parameters

Param
Type
Description

data

object

Required - The change specification

data.eventType

string

Type of event to be sent when data has changed. default "document:changed"

data.change

object

Required - The change specification

data.change.qcode

string

Required - The value to be set in the qcode for the service. Expected value is in the form "xxx:yyy"

data.change.why

string

Required - Optional parameter for the 'why' attribute for service.

Example

import {api} from 'writer'

api.article.addService({
    change: {
     qcode: "imchn:abc",
     why: "imext:main"
   }
});


<contentMeta>
    <service qcode="imchn:abc" why="imext:main"/>
</contentMeta>

removeService(data)

Removes a service from the itemMeta section of the article.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.removeService({
    change: "imchn:abc"
});

setPubStart(data)

Sets the publish start time, using ISO_8601 standard. If value is null, pubStart will be unset.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setPubStart({
     'change': '2018-04-21T00:00:00+02:00'
  });
<itemMeta>
  <itemMetaExtProperty type="imext:pubstart" value="2018-04-21T00:00:00+02:00"/>
</itemMeta>

setPubStop(data)

Sets the publish stop time, using ISO_8601 standard.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setPubStop({
     'change': '2018-04-21T00:00:00+02:00'
  });
<itemMeta>
  <itemMetaExtProperty type="imext:pubstop" value="2018-04-21T00:00:00+02:00"/>
</itemMeta>

setTitle(data)

Sets the value of the title.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setTitle({
     "change": "Document title"
  });
<itemMeta>
  <title>Document title</title>
</itemMeta>

setEdNote(data)

Sets the value of editor note

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setEdNote({
     "change": "Instructions to editor"
  });
<itemMeta>
  <edNote>Instructions to editor</edNote>
</itemMeta>

setItemMetaExtProperty(data)

Sets the value of a property. If value is null, the property will be removed. The type of property to change is specified by the type argument.

The type is defined by the [customPrefix]:[type] syntax, such as imext:url

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setItemMetaExtProperty({
     "change": {
         type: "imext:haspublishedversion",
         value: "true"
     }
  });
<itemMeta>
  <itemMetaExtProperty type="imext:haspublishedversion" value="true"/>
</itemMeta>

addItemMetaLink(data)

Adds a link to the itemMeta section of the article.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.addItemMetaLink({
     change: {
         rel: "subject",
         title: "Mora",
         type: "x-im/category",
         uuid: "7b8461e8-4a22-11e8-aa12-b79c05b8e6d5",
         links: [
             {
                 rel: "broader",
                 title: "Dalarna",
                 uuid: "03d22994-91e4-11e5-8994-feff819cdc9f",
                 type: "x-im/category",
                 data: {
                     "placement": {
                         attributes: {
                             "type": "position"
                         },
                         value: "left"
                     }
                 }
             }
         ]
     }
  });

<itemMeta>
  <links>
      <link rel="subject" title="Mora" type="x-im/category" uuid="7b8461e8-4a22-11e8-aa12-b79c05b8e6d5">
          <links>
              <link rel="broader" title="Dalarna" uuid="03d22994-91e4-11e5-8994-feff819cdc9f" type="x-im/category">
                  <data>
                      <placement type="position>left</placement>
                  </data>
          </links>
      </link>
  </links>
</itemMeta>

removeItemMetaLink(data)

Removes a link from itemMeta section

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.removeItemMetaLink({
     change: {
         rel: 'subject',
         uuid: '320938f8-db94-11e5-b5d2-0a1d41d68578'
     }
  });

setAltId(data)

Deprecated

Sets the alternative ID for the article. If null, the element will be removed.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setAltId({
     "change": "854575"
  });

<contentMeta>
  <altId>854575</altId>
</contentMeta>

setSlugline(data)

Deprecated

Sets the slugline for the article. If null, the element will be removed.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setSlugline({
     "change": "This article is all about"
  });

<contentMeta>
  <slugline>This article is all about</slugline>
</contentMeta>

setDescription(data)

Deprecated

Sets the description of the article. If null, the element will be removed.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setDescription({
     "change": "Description of the article"
  });

<contentMeta>
  <description>Description of the article</description>
</contentMeta>

setBy(data)

Deprecated

Sets the byline for the article. If null, the element will be removed.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setBy({
     "change": "Boris Byline"
  });

<contentMeta>
  <by>Boris Byline</by>
</contentMeta>

setHeadline(data)

Deprecated

Sets the headline of the article. If null, the element will be removed.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.setHeadline({
     "change": "Article headline"
  });

<contentMeta>
  <headline>Article headline</headline>
</contentMeta>

addContentMetaLink(data)

Deprecated

Adds a link to the contentMeta section of the article.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.addContentMetaLink({
  change: {
    rel: "articlesource",
    title: "Online",
    type: "x-im/articlesource",
    uri: "im://articlesource/online"
  }
});

<contentMeta>
    <links>
        <link rel="articlesource" title="Online" type="x-im/articlesource" uri="im://articlesource/online"/>
    </links>
</contentMeta>

removeContentMetaLink(data)

Deprecated

Removes a link from contentMeta section

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.removeContentMetaLink({
     change: {
         rel: 'subject',
         uuid: '320938f8-db94-11e5-b5d2-0a1d41d68578'
     }
  });

addContentMetadata(data)

Deprecated

Adds an object element to the metadata section in contentMeta

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.addContentMetadata({
    change: {
        id: "8400c74d667e",
        type: "x-im/teaser",
        title: "Sed sit amet turpis a purus fringilla",
        data: {
            subject: "In sodales lectus vel egestas rhoncus",
            text: "Duis eget magna lacus. In sodales lectus vel egestas rhoncus."
        }
        links: [
            {
                rel: "image",
                type: "x-im/image",
                uri: "im://image/znX8U1CU124n26zu7gb40_jBzSk.jpeg",
                uuid: "c382c937-8511-5d48-9677-55658c2bbb32",
                data: {
                    width: "1536",
                    height: "1024"
                }
            }
        ]
    }
})

<contentMeta>
    <metadata>
        <object id="8400c74d667e" type="x-im/teaser" title="Sed sit amet turpis a purus fringilla">
           <data>
               <subject>In sodales lectus vel egestas rhoncus</subject>
               <text>Duis eget magna lacus. In sodales lectus vel egestas rhoncus.</text>
           </data>
           <links>
               <link rel="image"
                         type="x-im/image"
                         uri="im://image/znX8U1CU124n26zu7gb40_jBzSk.jpeg"
                         uuid="c382c937-8511-5d48-9677-55658c2bbb32">
                   <data>
                       <width>1536</width>
                       <height>1024</height>
                   </data>
               </link>
           </links>
        </object>
    </metadata>
</contentMeta>

removeContentMetadata(data)

Deprecated

Removes an object in the contentMeta metadata section of the article.

Parameters

Param
Type
Description

data

Required - The change specification

Example

import {api} from 'writer'

api.article.removeContentMetadata({
     change: {
         id: 'A8567B335'
     }
  });

itemMeta(path)⇒ DocumentNode

Returns the itemMeta node

Returns: DocumentNode - A node instance

Throws:

  • Error when node does not exist

Parameters

Param
Description

path

Required - Optional path to find node under itemMeta

contentMeta(path)⇒ DocumentNode

Returns the contentMeta node

Returns: DocumentNode - A node instance

Throws:

  • Error when node does not exist

Parameters

Param
Description

path

Required - Optional path to find node under contentMeta

Types

TimeChange: object

Name
Type
Description

change

string

Required - The time, in ISO_8601

eventType

string

Type of event to be sent when data has changed. default "document:changed"

StringChange: object

Name
Type
Description

change

string

Required -

eventType

string

Type of event to be sent when data has changed. default "document:changed"

LanguageChange

Name
Type
Description

lang

string

Required - The language specification, see https://www.w3.org/2005/05/font-size-test/starhtml-test.html for valid language codes.

dir

string

Required - The text direction

change

LanguageChangeObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

AddContentMetaObjectChange: object

Name
Type
Description

id

string

Required - A mandatory id of the object

type

string

Required - A mandatory type of object

title

string

A an optional title of the object

data

object

Optional data element, with custom tags.

links

Array.<AddMetaLinkChangeObject>

Required - Optional array with link elements. The link follows the same format as with #addContentMetaLink

change

AddContentMetaObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

RemoveContentMetaObjectChange: object

Name
Type
Description

id

string

Required - The ID for the tag to remove. This argument is required

change

RemoveContentMetaObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

ExtTypeObjectChange: object

Name
Type
Description

type

string

Required - The identification of the property

value

string

Required - The value of the property. If null, the property will be removed.

change

ExtTypeObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

AddMetaLinkObjectChange: object

Name
Type
Description

rel

string

Required - The 'rel' attribute of the link. Example: "author". This parameter is mandatory and must be defined. Must not contain spaces

type

string

Required - The 'type' attribute of the link. Example: "x-im/person". This parameter is mandatory and must be defined.

uri

string

The 'uri' pointing to an external resource. This OR the 'uuid' parameter must be present.

uuid

string

The 'uuid', which is an ID of a resource in the writer repository. This OR the 'uri' parameter must be present.

title

string

Set the title attribute for the link

data

object

An optional data block with custom tags.

links

Array.<AddMetaLinkChangeObject>

Optional links for the link to be created. Should be of the same format as the top-most link.

change

AddMetaLinkObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

RemoveMetaLinkObjectChange: object

Name
Type
Description

rel

string

Required - The rel attribute of the link

uri

string

The URI that identifies the link. 'uri' OR the 'uuid' parameter must be present.

uuid

string

The uuid that identifies the link. 'uuid' OR the 'uri' parameter must be present.

change

RemoveMetaLinkObject

Required - Change specification

eventType

string

Type of event to be sent when data has changed. default "document:changed"

PreviousApiNextBrowser

Was this helpful?

StringChange
StringChange
TimeChange
TimeChange
StringChange
StringChange
ExtTypeObjectChange
AddMetaLinkObjectChange
RemoveMetaLinkObjectChange
StringChange
StringChange
StringChange
StringChange
StringChange
AddMetaLinkObjectChange
RemoveMetaLinkObjectChange
AddContentMetaObjectChange
RemoveContentMetaObjectChange