Naviga Writer
6.3.3
6.3.3
  • Naviga Writer
  • Release notes
    • 6.3.3
    • 6.3.2
    • 6.3.1
    • 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
    • User stories and reference cases
  • User Guide
    • Writer User Guide
      • The Content Area and Tabs
        • Help menu
        • Language menu
        • Article name
        • Writing teasers
        • Content area
        • Information
        • Search and replace words
        • History Button
        • Save and publish flow
        • Tabs
          • Meta Tab
            • Author
            • Channels
          • Integrations Tab
          • Image and Article search Tab
        • Locked article
      • Text management
      • Writer Keyboard Shortcuts
      • Personal Writer template
      • Channels to control access
      • Images User Guide
      • Common questions when starting using Writer
  • Admin Guide
    • Configuration files
    • Configurations Guide
    • Configuration of Writer templates
    • Publish Flow
      • Default configuration definitions
      • Starting part of the configuration
      • Publish flow config details
      • Configuration of calendarLocale
      • Preconditions for roles in the publish flow
    • Generic properties for Objects
      • Generic properties configuration
    • Image Services
      • Photo uploader
      • Binary Service Light
      • ImEngine
      • Imgix
    • Available Plugins
      • Naviga developed plugins
        • Plugins in earlier versions of Writer
      • Third-party plugins
  • Developer guide
    • Writer plugin development
      • Quickstart
      • Plugin overview
      • Creating an 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
    • Infomaker NewsML
      • Overview
      • 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)](point)](point)](point)](point)](point)](point)](point)](point)](point)]
        • ConceptItem - Place (polygon)](polygon)](polygon)](polygon)](polygon)](polygon)](polygon)](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
    • UI Components
      • UIAvatar
      • UIButton
      • UIByline
      • UICheckbox
      • UIChip
      • UIDatePicker
      • UIDatetimeFieldEditor
      • UIDropdown
      • UIFieldEditor
      • UIIconButton
      • UIInlineImage
      • UIPagination
      • UISelect
      • UITimePicker
      • UIToggle
      • UITooltip
      • UIInputText
      • UITextarea
Powered by GitBook
On this page
  • postBinary(path, file, onProgress, onLoad, onError, params)
  • Parameters
  • post(path, parameters) ⇒ Promise.<Response>
  • Parameters
  • put(path, parameters) ⇒ Promise.<Response>
  • Parameters
  • get(path, parameters) ⇒ Promise.<Response>
  • Parameters
  • Example
  • head(path, parameters) ⇒ Promise.<Response>
  • Parameters
  • Example
  • del(path, parameters) ⇒ Promise.<Response>
  • Parameters
  • proxy(path, op) ⇒ object
  • Parameters
  • getConceptItem(id, imType) ⇒ *
  • Parameters
  • getNewsItem(id, imType) ⇒ *
  • Parameters
  • updateConceptItem(uuid, concept) ⇒
  • Parameters
  • createConceptItem(concept) ⇒ * | Promise.<TResult>
  • Parameters
  • checkForOKStatus(response) ⇒ *
  • Parameters
  • Example
  • ~~toJson() ~~
  • authorizedFetch(url, params) ⇒ Promise.<*>
  • Parameters

Was this helpful?

  1. API Reference
  2. Writer Api

Router

Router api class with functions for communication with the backend.

All router functions are available through the context.api.router object.

postBinary(path, file, onProgress, onLoad, onError, params)

Post a binary file object to the backend

Parameters

Param

Type

Description

path

string

Required -

file

object

Required - File object from file input or file drop

onProgress

function

Required - Callback function for progress event

onLoad

function

Required - Callback function for onload event

onError

function

Required -

params

function

Required -

post(path, parameters) ⇒ Promise.<Response>

Post data to specified backend endpoint

Parameters

Param

Type

path

string

parameters

object

put(path, parameters) ⇒ Promise.<Response>

Put data to specified backend endpoint

Parameters

Param

Type

path

string

parameters

object

get(path, parameters) ⇒ Promise.<Response>

Get data from specified backend endpoint

Parameters

Param

Type

Description

path

string

Required -

parameters

object

Required - Could contain headers that will be passed along parameters.headers

Example

import {api} from 'writer'

api.router.get('/api/binary/url/' + uuid)
    .then((url) => {
        // Handle url
    })
    .catch((error) => {
        console.error(error);
    });

head(path, parameters) ⇒ Promise.<Response>

Fetch specified backend endpoint using a http HEAD request. This is silent and will not produce any error messages.

Parameters

Param

Type

Description

path

string

Required -

parameters

object

Required - Could contain headers that will be passed along parameters.headers

Example

import {api} from 'writer'

api.router.head('/api/binary/url/' + uuid)
    .then((url) => {
        // Handle url
    })
    .catch((error) => {
        console.error(error);
    });

del(path, parameters) ⇒ Promise.<Response>

Make a DELETE call to a specified backend endpoint

Parameters

Param

Type

Description

path

string

Required - Backend endpoint

parameters

object

Required - Key value request parameters

proxy(path, op) ⇒ object

Deprecated

Proxy ajax call to external backend

Returns: object - jQuery ajax object

Parameters

Param

Type

path

string

op

object

getConceptItem(id, imType) ⇒ *

Fetch a ConceptItem from the backend

Parameters

Param

Description

id

Required - The id of the concept

imType

Required - The x-im/type

getNewsItem(id, imType) ⇒ *

Fetch a NewsItem from the backend

Parameters

Param

Description

id

Required - The id of the news item

imType

Required - The x-im/type

updateConceptItem(uuid, concept) ⇒

Updates a Concept Item

Returns: A promise with no data

Parameters

Param

Description

uuid

Required - The uuid of the Concept Item to update

concept

Required - The updated XML

createConceptItem(concept) ⇒ * | Promise.<TResult>

Creates a Concept Item

Returns: * | Promise.<TResult> - containing the resulting UUID

Parameters

Param

Description

concept

Required - The concept to create

checkForOKStatus(response) ⇒ *

Method checks for a status code between 200 and 299 Throws error if otherwise.

Use for example when you want to reject a fetch promise

Parameters

Param

response

Example

router.authorizedFetch(...)
    .then(response => checkForOKStatus(response))
    .then(response => toJson(response))
    .then(json => ...)
    .catch(error => ...)

~~toJson() ~~

Deprecated

Use native response.json() instead

authorizedFetch(url, params) ⇒ Promise.<*>

Parameters

Param

Type

url

params

object

PreviousNewsItemNextUi

Last updated 5 years ago

Was this helpful?