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
  • getPropertyMap()⇒ object
  • on(conceptType, operation, handler)
  • Parameters
  • Example
  • off(conceptType, operation, handler)
  • Parameters
  • Example
  • has(conceptType, operation)⇒ boolean
  • Parameters
  • Example
  • trigger(operation, conceptItem)
  • Parameters
  • Example
  • getArticleConceptByUUID(uuid)
  • Parameters
  • getArticleConceptsByType(conceptType, multipleTypes, subtypes)⇒ array
  • Parameters
  • addArticleConcept(conceptItem, triggerDocumentChanged)
  • Parameters
  • addArticleConcepts(conceptItems, triggerDocumentChanged)
  • Parameters
  • updateArticleChannelRel(conceptItem)
  • Parameters
  • updateArticleConcept(conceptItem, triggerDocumentChanged)
  • Parameters
  • removeArticleConceptItem()
  • removeArticleConcept(conceptItem)
  • Parameters
  • removeArticleConcepts(conceptItems)
  • Parameters
  • removeAllArticleLinksOfType(conceptType)
  • Parameters
  • extractBroaderText(conceptItem, [truncated])⇒ string
  • Parameters
  • getConceptItemXml(conceptItem)⇒ string
  • Parameters
  • getConceptItemConfigJson(conceptItem)
  • Parameters
  • createConceptItemXml(xml)
  • Parameters
  • updateConceptItemXml(uuid, xml)
  • Parameters
  • fetchConceptItemProperties(conceptItem, string)⇒ object
  • Parameters
  • Example
  • searchForConceptSuggestions(args, conceptTypes, term, subtypes, associatedWith, allowedStatuses, customQuery)⇒ array
  • Parameters
  • Example
  • search(query)⇒ array
  • Parameters
  • getRemoteConceptsByType(conceptType)⇒ array
  • Parameters
  • getGroupConcepts(groupType, includeConceptsWithoutGroup)
  • Parameters

Was this helpful?

  1. API Reference
  2. Writer Api

ConceptService

Top level api object from which all other api modules are available. ConceptService class

A Service class filled with utility functions for Concept items and enhanced data loading. ConceptService is accessed through the writer

Available operations to register callback handlers

getPropertyMap()⇒ object

Get loaded property map

Returns: object - PropertyMap

on(conceptType, operation, handler)

Function to register handlers for specific ConceptType operations

Parameters

Param
Type
Description

conceptType

string

Required - ex. 'x-im/category'

operation

number

Required - ex. ConceptService.operations.ADD

handler

function

Required - function that will be called when operation is triggered

Example

ConceptService.on(
    'x-im/category',
    ConceptService.operations.ADD,
    this.handleNewCategory
)

off(conceptType, operation, handler)

Function to remove registered handler

Parameters

Param
Type
Description

conceptType

string

Required - ex. 'x-im/category'

operation

number

Required - ex. ConceptService.operations.ADD

handler

function

Required - function that was registered as callback for the operation

Example

ConceptService.off(
    'x-im/category',
     ConceptService.operations.ADD,
     this.handleNewCategory
)

has(conceptType, operation)⇒ boolean

Function to check if a specific conceptType has a registered handler for a specific operation

Returns: boolean - if a handler has been registered

Parameters

Param
Type
Description

conceptType

string

Required - ex. 'x-im/category'

operation

number

Required - ex. 'ADD' or ConceptService.operations.ADD

Example

if (ConceptService.has('x-im/category', ConceptService.operations.ADD)) {
    // Do stuff
}

trigger(operation, conceptItem)

Function to trigger registered handler for conceptType operations

Parameters

Param
Type
Description

operation

number

Required - ex. 'ADD' or ConceptService.operations.ADD

conceptItem

object

Required - POJSO representation of a x-im concept

Example

ConceptService.trigger(
    ConceptService.operations.ADD,
    conceptItem = {
        uuid: xxx,
        create: true,
        ....
    }
)

getArticleConceptByUUID(uuid)

Get article concept by uuid

Parameters

Param
Type

uuid

sting

getArticleConceptsByType(conceptType, multipleTypes, subtypes)⇒ array

Get concepts of a specific type, currently in the article

Returns: array - ConceptItems

Parameters

Param
Type
Description

conceptType

string

Required - 'x-im/xxx'

multipleTypes

array

Required - ex. ['x-im/xxx', 'x-im/yyy']

subtypes

array

Required - ex. ['position', 'polygon']

addArticleConcept(conceptItem, triggerDocumentChanged)

Add concept link to article

Parameters

Param
Type
Default
Description

conceptItem

object

Required - POJSO representation of a x-im concept

triggerDocumentChanged

boolean

true

Required - set to false to suppress document changed event, default is set to true

addArticleConcepts(conceptItems, triggerDocumentChanged)

Add an array of concept links to article

Parameters

Param
Type
Default
Description

conceptItems

Array.<object>

Required - Array of POJSOs representation of a x-im concept

triggerDocumentChanged

boolean

true

Required - set to false to suppress document changed event, default is set to true

updateArticleChannelRel(conceptItem)

Update concept rel

Parameters

Param
Type
Description

conceptItem

object

Required - POJSO representation of a x-im concept

updateArticleConcept(conceptItem, triggerDocumentChanged)

Update existing concept link in article

Parameters

Param
Type
Default
Description

conceptItem

object

Required - POJSO representation of a x-im concept

triggerDocumentChanged

boolean

true

Required - set to false to suppress document changed event, default is set to true

removeArticleConceptItem()

Deprecated

removeArticleConcept(conceptItem)

Remove concept link from article

Parameters

Param
Type
Description

conceptItem

object

Required - POJSO representation of a x-im concept

removeArticleConcepts(conceptItems)

Remove an array of concept links from article

Parameters

Param
Type
Description

conceptItems

Array.<object>

Required - Array of POJSOs representations of a x-im concepts

removeAllArticleLinksOfType(conceptType)

Remove all links of a specific type from the article

Parameters

Param
Type
Description

conceptType

string

Required - the concept type to remove from document

extractBroaderText(conceptItem, [truncated])⇒ string

Recursive function to extract n number of parent names

Returns: string - Broader names combine

Parameters

Param
Type
Default
Description

conceptItem

object

Required - POJSO representation of a x-im concept

truncated

boolean

false

getConceptItemXml(conceptItem)⇒ string

Get the actual concept XML from storage

Returns: string - XML response

Parameters

Param
Type
Description

conceptItem

object

Required - POJSO representation of a x-im concept

getConceptItemConfigJson(conceptItem)

Get the concept type config, cached or remote

Parameters

Param
Type
Description

conceptItem

object

Required - POJSO representation of a concept

createConceptItemXml(xml)

Create a new concept item in storage

Parameters

Param
Type

xml

string

updateConceptItemXml(uuid, xml)

Update the actual concept item in storage

Parameters

Param
Type

uuid

string

xml

string

fetchConceptItemProperties(conceptItem, string)⇒ object

fetch remaining props (not stored on the article) from oc

Returns: object - conceptItem

Parameters

Param
Type
Description

conceptItem

object

Required - POJSO representation of a x-im concept

string

object.uuid

Required - must be a valid OC uuid

Example

import {ConceptService} from 'writer'

ConceptService.fetchConceptItemProperties({
     'uuid': '12345678-1234-4567-7891-789456123456'
})

searchForConceptSuggestions(args, conceptTypes, term, subtypes, associatedWith, allowedStatuses, customQuery)⇒ array

Search for concepts

Returns: array - response An array with result objects

Parameters

Param
Type
Description

args

object

Required - Objects with search-related properties optional Arg-props

conceptTypes

string | array

Required - string or array, like 'x-im/story' or ['x-im/tag', 'x-im/category']

term

string

Required - the term to look for in Concept name and description

subtypes

object

Required - ['position', 'polygon']

associatedWith

string

Required - x-im concept-type to which current type is associated, like 'x-im/channel'

allowedStatuses

array | string

Required - Optional array with allowed statuses

customQuery

string

Required - Optional string with OC query to be included in search (like: Active:false)

Example

const result = await ConceptService.searchForConceptSuggestions(
     conceptTypes: 'x-im/section',
     term: '*',
     subtypes: null,
     associatedWith: 'x-im/channel',
     allowedConceptStatuses = ["draft", "usable"]
)

search(query)⇒ array

A search Concept function Will use submitted query to search for items with contenttype concept

Returns: array - searchResult

Parameters

Param
Type
Description

query

string

Required - a open content query like "ConceptAuthorEmail:robert.reporter@example.com"

getRemoteConceptsByType(conceptType)⇒ array

Get concepts from remote storage by concept-type

Returns: array - array of concepts with matching type

Parameters

Param
Type
Description

conceptType

string

Required - eg x-im/category

getGroupConcepts(groupType, includeConceptsWithoutGroup)

Get all concept-groups by group-type (subType), optionally include all concepts of subtype, that does not have an associated group

Parameters

Param
Type
Default
Description

groupType

string

Required - what type should the group be set to handle (ConceptGroupSubTypeFull)

includeConceptsWithoutGroup

boolean

false

Required - include all concepts of subtype, that does not have an associated group, defaults to false

PreviousConceptNextDocument

Was this helpful?