Article
Article
clear(disableWarning)
Clear the article and create a new based on the configured base template.
Parameters
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
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
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
data
Required - The change specification
Example
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
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
removeService(data)
Removes a service from the itemMeta section of the article.
Parameters
data
Required - The change specification
Example
setPubStart(data)
Sets the publish start time, using ISO_8601 standard. If value is null, pubStart will be unset.
Parameters
data
Required - The change specification
Example
setPubStop(data)
Sets the publish stop time, using ISO_8601 standard.
Parameters
data
Required - The change specification
Example
setTitle(data)
Sets the value of the title.
Parameters
data
Required - The change specification
Example
setEdNote(data)
Sets the value of editor note
Parameters
data
Required - The change specification
Example
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
data
Required - The change specification
Example
addItemMetaLink(data)
Adds a link to the itemMeta section of the article.
Parameters
data
Required - The change specification
Example
removeItemMetaLink(data)
Removes a link from itemMeta section
Parameters
data
Required - The change specification
Example
setAltId(data)
Deprecated
Sets the alternative ID for the article. If null, the element will be removed.
Parameters
data
Required - The change specification
Example
setSlugline(data)
Deprecated
Sets the slugline for the article. If null, the element will be removed.
Parameters
data
Required - The change specification
Example
setDescription(data)
Deprecated
Sets the description of the article. If null, the element will be removed.
Parameters
data
Required - The change specification
Example
setBy(data)
Deprecated
Sets the byline for the article. If null, the element will be removed.
Parameters
data
Required - The change specification
Example
setHeadline(data)
Deprecated
Sets the headline of the article. If null, the element will be removed.
Parameters
data
Required - The change specification
Example
addContentMetaLink(data)
Deprecated
Adds a link to the contentMeta section of the article.
Parameters
data
Required - The change specification
Example
removeContentMetaLink(data)
Deprecated
Removes a link from contentMeta section
Parameters
data
Required - The change specification
Example
addContentMetadata(data)
Deprecated
Adds an object element to the metadata section in contentMeta
Parameters
data
Required - The change specification
Example
removeContentMetadata(data)
Deprecated
Removes an object in the contentMeta metadata section of the article.
Parameters
data
Required - The change specification
Example
itemMeta(path)⇒ DocumentNode
DocumentNode
Returns the itemMeta node
Returns: DocumentNode
- A node instance
Throws:
Error when node does not exist
Parameters
path
Required - Optional path to find node under itemMeta
contentMeta(path)⇒ DocumentNode
DocumentNode
Returns the contentMeta node
Returns: DocumentNode
- A node instance
Throws:
Error when node does not exist
Parameters
path
Required - Optional path to find node under contentMeta
Types
TimeChange: object
object
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
object
change
string
Required -
eventType
string
Type of event to be sent when data has changed. default "document:changed"
LanguageChange
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
object
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
object
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
object
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
object
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
object
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"
Last updated