This class is used for communicating with the article, typically setting and getting values of metadata or in the article content itself.
Methods
-
addAuthors(authors, callback)
-
Add the given authors to the list of authors
Parameters:
Name Type Description authorsArray List of authors to add callbackfunction function(Boolean), called when it has been set -
addCategories(categories, callback)
-
Add the given categories to the list of categories
Parameters:
Name Type Description categoriesArray List of category IDs to add callbackfunction function(Boolean), called when the categories have been set -
addTag(tag, errorFunction, callback)
-
Add tag for the article
Parameters:
Name Type Description tagString Tag to be added errorFunctionfunction called if error callbackfunction function(Boolean), called when tag has been set -
clearMetaInfo(callback)
-
Clear the meta information summary
Parameters:
Name Type Description callbackfunction function(Boolean), called when meta data has been cleared -
focusApp(callback)
-
Give focus to yourself
Parameters:
Name Type Description callbackfunction function(Boolean), called as the app gets focus -
getArticletypeId(callback)
-
Get the article type of the current article
Parameters:
Name Type Description callbackfunction function(Int) -
getAuthors(callback)
-
Get the authors set in the article
Parameters:
Name Type Description callbackfunction function([String]), currently set authors -
getByline(callback)
-
Get the current byline
Parameters:
Name Type Description callbackfunction function(String), xml string with the current byline -
getCurrentContent(callback)
-
Gets the current article content
Parameters:
Name Type Description callbackfunction function(Object Content) -
getCustomMeta(name, callback)
-
Retrieve custom meta value for the article
Parameters:
Name Type Description nameString Name of the custom meta value callbackfunction function(Object), the parameter is an object containing the given custom meta value -
getGeolocations(callback)
-
Get geolocation
Parameters:
Name Type Description callbackfunction function(Object), retrieves the currently set geo location -
getId(callback)
-
Get the id of the article currently edited
Parameters:
Name Type Description callbackfunction function(Int), id of the current article -
getKeywords(callback)
-
Get the current set of keywords on the article
Parameters:
Name Type Description callbackfunction Function to call with the result -
getPackageGuid(callback)
-
Get the guid of the article package currently edited
Parameters:
Name Type Description callbackfunction function(Int), id of the current article -
getPackageId(callback)
-
Get the guid of the article package currently edited
Parameters:
Name Type Description callbackfunction function(Int), id of the current article -
getProperties(callback)
-
Fetches a list of all properties available to an article.
Parameters:
Name Type Description callbackfunction Callback called with an array of property objects. -
getPublishedDatetime(callback)
-
Get the published-date
Parameters:
Name Type Description callbackfunction function(String), current published datetime -
getSelectedCategories(callback)
-
Get the selected categories
Parameters:
Name Type Description callbackfunction function([String]), array with category ids -
getSource(callback)
-
Get the source set for the article
Parameters:
Name Type Description callbackfunction function(String), name of the source -
getStatus(callback)
-
Get the status for the article
Parameters:
Name Type Description callbackfunction function(String), current status -
getTags(callback)
-
Get tags used in the article
Parameters:
Name Type Description callbackfunction function([Object Tag]), array with tags connected to an article -
maximizeAppWindow(title, onClose)
-
Maximize the app view
Parameters:
Name Type Description titleString Title to give the maximized view onClosefunction Function to call when the window is closed/minimized -
removeAuthors(authors, callback)
-
Remove the given authors from the list of authors
Parameters:
Name Type Description authorsArray List of authors to remove callbackfunction function([String]), author list as it is after the authors has been removed -
removeCategories(categories, callback)
-
Remove the given categories from the list of categories
Parameters:
Name Type Description categoriesArray List of category IDs to remove callbackfunction function(Boolean), called when the categories have been removed -
removeTag(tag, callback)
-
Remove tag from article
Parameters:
Name Type Description tagString Tag to remove callbackfunction function(Boolean), called when tag has been removed -
restoreAppWindow(callback)
-
Restore the app pane to the default size
Parameters:
Name Type Description callbackfunction Callback to call after everything is done -
saveCategories(callback)
-
Save the currently selected categories
Parameters:
Name Type Description callbackfunction function(Boolean), called when categories has been saved -
setArticletypeId(articletypeId, callback)
-
Set the article type of the current article
Parameters:
Name Type Description articletypeIdNumber The new article type of the article callbackfunction function(Boolean), called when it has been set -
setAuthors(authors, callback)
-
Set authors for the article
Parameters:
Name Type Description authorsArray List of authors that should be set callbackfunction function(Boolean), called when it has been set -
setByline(byline, save, callback)
-
Set the byline
Parameters:
Name Type Description bylineString XML version of byline to use saveBoolean If true, force save after updating byline information callbackfunction function(Boolean), called when it has been set -
setCategories(categories, callback)
-
Set selected categories
Parameters:
Name Type Description categoriesArray List of category IDs that should be set callbackfunction function(Boolean), called when categories have been set -
setCurrentContent(content, callback)
-
Updates current article content
Parameters:
Name Type Description contentString The new content for the article callbackfunction function(Boolean), called when it has been set -
setCustomMeta(name, value, callback)
-
Set custom meta value for the article
Parameters:
Name Type Description nameString Name of the meta value valueObject Value to set callbackfunction function() -
setGeolocations(geolocations, callback)
-
Set geolocation
Parameters:
Name Type Description geolocationsObject The location to set callbackfunction function(Boolean), called when it has been set -
setKeywords(keywords, callback)
-
Set the keyword-list on the article
Parameters:
Name Type Description keywordsArray List of keywords to add callbackfunction Function to call when keywords have been set -
setMainCategory(category, callback)
-
Set the main category of the current article
Parameters:
Name Type Description categoryNumber The ID of the category to set as the main category callbackfunction function(Boolean), called when the main category has been set -
setProperties(properties, callback)
-
Updates and saves one or more property values. The input is a simple object with property names and their new value. The supplied callback is called with an updated list of properties.
Parameters:
Name Type Description propertiesObject An object of property names and corresponding values. callbackfunction Callback called with an updated list of properties. Example
PluginAPI.Article.setProperties({ fooProperty: "bar", barProperty: "foo" }, function(properties) { // Returns a complete and updated list of properties. }) -
setProperty(name, value, callback)
-
Updates and saves a single property.
Parameters:
Name Type Description nameString The property to update. valueString The updated value. callbackfunction Callback called with an updated list of properties. -
setPublishedDatetime(published, callback)
-
Set the published-date
Parameters:
Name Type Description publishedString Date to be set (YYYY-MM-DD HH:MM:SS) callbackfunction function(Boolean), called when done -
setSource(value, callback)
-
Set the source for the article
Parameters:
Name Type Description valueString The new value to be set as source callbackfunction function(Boolean), called when the source has been set -
setStatus(status, callback)
-
Set the status for the article
Parameters:
Name Type Description statusString The new status to be set (draft, waiting, published) callbackfunction function(Boolean), called when the source has been set -
setTags(tags, save, callback)
-
Set tags for the article
Parameters:
Name Type Description tagsArray List of tags that should be set saveBoolean Set to true to force save once the tags are updated callbackfunction function(Boolean), called when tags have been set -
startApp(name, options, callback)
-
Start the given app
Parameters:
Name Type Description nameString Name of the app from settings.php optionsObject Options for initializing the app callbackfunction function(Boolean), called after app is started -
stopApp(name)
-
Stop the given app
Parameters:
Name Type Description nameString Name of the app from settings.php