Editor Metadata Section cueInterface Properties
A cueInterface
object is passed to both the main
metadata section component and to the icon component. In addition to
the basic properties described in
Creating a Web Component, this
cueInterface
object has the following properties
in each case:
For the editor metadata section component
editor
-
An object representing the current editor. The properties and functions exposed by this object vary according to the type of editor as follows:
- Story editor
-
Actually, any editor with an
x-ece/*
MIME type for which there is no more specific match. This, is in other words, the fallback case. The following properties and functions are exposed:type
-
The editor type: always
story
. getLink()
-
Returns the link object opened in the editor. A
GET
request to the URI contained in the object will return an XML document describing the content. Escenic credentials must be included in the request as an Authorization header (see general web component information). These credentials are provided in thecueInterface
object (see Creating a Web Component). getTitle()
-
Returns the title of the editor.
getArticleId()
-
Returns the ID of the content item opened in the editor.
getContentType()
-
Returns the type of the content item opened in the editor.
getState()
-
Returns the state (draft, published etc.) of the content item opened in the editor.
getPublishedDate()
-
Returns the published date of the content item opened in the editor. The date is returned as a
moment
object. getTags()
-
Returns an array containing any tags assigned to the content item opened in the editor.
getContent()
-
Returns the entire content item opened in the editor.
updateContentValue(key: string, value: string)
-
Updates the content item opened in the editor by assigning
value
to the field identified bykey
. addContentWatcher(watcher: Function)
-
Adds a watcher that will be notified when the content item changes.
- List editor
-
An editor with the MIME type
x-ece/list
. The following properties and functions are exposed:type
-
The editor type: always
list
. getLink()
-
Returns the link object opened in the editor. A
GET
request to the URI contained in the object will return an XML document describing the list. Escenic credentials must be included in the request as an Authorization header (see general web component information). These credentials are provided in thecueInterface
object (see Creating a Web Component). getTitle()
-
Returns the title of the editor.
addListWatcher(watcher: Function)
-
Adds a watcher that will be notified when the list changes.
- Section editor
-
An editor with the MIME type
x-ece/section
orx-ece/section-page
. The following properties and functions are exposed:type
-
The editor type: always
section
. getLink()
-
Returns the link object opened in the editor. A
GET
request to the URI contained in the object will return an XML document describing the section. Escenic credentials must be included in the request as an Authorization header (see general web component information). These credentials are provided in thecueInterface
object (see Creating a Web Component). getTitle()
-
Returns the title of the editor.
getSection()
-
Returns the section that the opened section page belongs to.
getSectionPage()
-
Returns the section page opened in the editor.
addSectionWatcher(watcher: Function)
-
Adds a watcher that will be notified when the section page changes.
- Assignment editor
-
An editor with the MIME type
x-cci/assignment; type=picture
. The following properties and functions are exposed:type
-
The editor type: always
assignment
. getLink()
-
Returns the link object opened in the editor.
getTitle()
-
Returns the title of the editor.
getAssignment()
-
Returns the assignment object opened in the editor.
getStory()
-
Returns the story folder object that the assignment belongs to.
- Story folder editor
-
An editor with the MIME type
x-cci/storyfolder
. The following properties and functions are exposed:type
-
The editor type: always
storyFolder
. getLink()
-
Returns the link object opened in the editor.
getTitle()
-
Returns the title of the editor.
getStoryFolder()
-
Returns the story folder object opened in the editor.
addStoryFolderWatcher(watcher: Function)
-
Adds a watcher that will be notified when the story folder changes.
For the icon component
active
-
A boolean property that indicates whether or not the metadata section is currently active.
addActiveWatcher(watcher: Function)
-
A function that adds a watcher that will be notified when the active state of the editor metadata section changes. The watcher will be invoked with the new state.
removeActiveWatcher(watcher: Function)
-
A function that removes a previously added watcher.