Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Js_Api_Standard_Function_List Class Reference

Static Public Member Functions

static paintJSFunctions (JS_Api $js_api_asset)
 

Detailed Description

Definition at line 30 of file js_api_standard_function_list.inc.

Member Function Documentation

static paintJSFunctions ( JS_Api  $js_api_asset)
static

+–——————————————————————+ | This MySource Matrix CMS file is Copyright (c) Squiz Pty Ltd | | ABN 77 084 670 600 | +–——————————————————————+ | IMPORTANT: Your use of this Software is subject to the terms of | | the Licence provided in the file licence.txt. If you cannot find | | this file please contact Squiz (www.squiz.com.au) so we may provide| | you a copy. | +–——————————————————————+

This will create an ajax request

Version
$Revision: 0.1

Checks to see if a variable is set

Parameters
stringobj The variable we check
Version
$Revision: 0.1

Turns JSON into a javascript object

Parameters
stringjson The JSON string to convert
Version
$Revision: 0.1

Our default callback

Parameters
stringajaxRequest The ajax function
stringdataCallback Callback that happens after success
Version
$Revision: 0.1

This will return our api key

Parameters
stringapi_key The api key of our Javascript API Asset
Version
$Revision: 0.1

Make our ajax request

Parameters
stringurl The url to send to the server
booleanreceive Should we even use a callback
functiondataCallback Custom callback function
Version
$Revision: 0.1

Recursive helper function to write out all properties of an object

Parameters
objectobj The JSON object
objectparent Parent JSON object
Version
$Revision: 0.2

This will return general information about the asset

Parameters
stringasset_id Id of the asset we are getting info for
booleanget_attributes if we are getting non standard attribute values of the assets(FALSE by default)
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will get the Child count for the passed in asset

Parameters
stringasset_id Id of the asset to get children of
numberlevel Number of levels to return, default all
functiondataCallback Custom callback function

This will return attributes of the specific asset

Parameters
stringasset_id Id of the asset we are getting info for
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will set an attribute value

Parameters
stringasset_id Id of the asset we are getting info for
stringattr_name Name of the attribute to change
stringattr_val Value to change the attribute to
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will set an multiple attributes value for an Asset

Parameters
stringasset_id Id of the asset we are getting info for
arrayfield_info Attribute name and their respective values to be changed to
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will return a metadata value for the passed metadata name

Parameters
stringasset_id Id of the asset we are getting info for
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will set a metadata value

Parameters
stringasset_id Id of the asset we are getting info for
functiondataCallback Custom callback function
Version
$Revision: 0.1

Set metadata values of multiple fields for an asset

Parameters
stringasset_id Id of asset to set metadata for
arrayfield_info Field Ids and their values
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will send an asset to the trash

Parameters
array| string asset_ids Id of the asset(s) to delete
functiondataCallback Custom callback function
Version
$Revision: 0.1

This will return child asset ids of the passed asset

Parameters
stringasset_id Id of the asset to get children of
numberlevels Number of levels to return
arraytype_codes asset type_code that we want back
arraylink_type type of links we are looking for Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
arraylink_values link values allowed on the asset returned
booleanget_attributes if we are getting non standard attribute values of the assets(FALSE by default)
functiondataCallback Custom callback function

NOTE : type_code, link_type and link_values are empty by default. So matrix will return everything also these options work for direct links only i.e. levels = 1

Version
$Revision: 0.2

This return parents of the passed id

Parameters
stringasset_id Id of the asset to get parents of
numberlevels Number of levels to return
arraytype_codes asset type_code that we want back
arraylink_type type of links we are looking for Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
arraylink_values link values allowed on the asset returned
booleanget_attributes if we are getting non standard attribute values of the assets(FALSE by default)
functiondataCallback Custom callback function

NOTE : type_code, link_type and link_values are empty by default. So matrix will return everything also these options work for direct links only i.e. levels = 1

Version
$Revision: 0.2

This returns permissions for an asset

Parameters
stringasset_id Id of the asset to get permissions for
stringlevel 1=READ 2=WRITE 3=ADMIN, default to READ
functiondataCallback Custom callback function
Version
$Revision: 0.2

Creates an asset

Parameters
integerparent_id Parentid of the new parent
stringtype_code Type code of new asset
stringasset_name Name for new asset
integerlink_type Type of link to create
stringlink_value Value of the link
integersort_order Order in the tree
integeris_dependant Dependant to parent
integeris_exclusive Exclusive to parent
integerextra_attributes Allows additional attributes
stringattributes String of additional query string containing key/pair values
Version
$Revision: 0.2

This function will create file type asset of the type_code provided

Parameters
stringparentID asset ID of parent where the new asset will be linked to
stringtype_code type_code of the new asset(default to 'file')
stringfriendly_name friendly name of the new asset to be created
stringlink_type type of link to create to the parent for this new asset(SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
stringlink_value value of link to create to the parent for this new asset('' by default)
functiondataCallback Custom callback function

Returns asset type codes installed on the system

Parameters
functiondataCallback Custom callback function
Version
$Revision: 0.2

Gets information for lock type passed

Parameters
stringasset_id Id of the asset to get locks for
stringscreen_name The screen to get locks for
functiondataCallback Custom callback function

Acquires locks on the given asset. if the locks were already acquired by current user then they are updated

Parameters
stringasset_id Id of the asset to get locks for
stringscreen_name The screen to get locks for
booleandependants_only whether dependants only or all children, defaults to true
booleanforce_acquire whether to attempt to forceably acquire the lock or not, defaults to false
functiondataCallback Custom callback function
Version
$Revision: 0.2

Releases a lock

Parameters
stringasset_id Id of the asset to release locks for
stringscreen_name The screen to release locks for
functiondataCallback Custom callback function
Version
$Revision: 0.2

Creates a link between two assets with passed information

Parameters
integerparent_id Major asset id we are linking from
integerchild_id Minor asset id we are linking to
integerlink_type Type of link to create
stringlink_value Value of the link
integersort_order Order in the tree
integeris_dependant Dependant to parent
integeris_exclusive Exclusive to parent
Version
$Revision: 0.2

Removes a link between a parent and child

Parameters
stringparent_id Id of the parent
stringchild_id Id of the child
stringlink_type type of link we are looking for (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
stringlink_value value of link we are looking for ('' by default)
functiondataCallback Custom callback function
Version
$Revision: 0.2

Removes multiple links between parent and child pairs

Parameters
jsonobject link_info array of link_info example : var link_info = { "links":[ { "parent": parent, "child": child, "link_type": link_type, "link_value": link_value, }, { "parent": parent_2, "child": child_2, "link_type": link_type_2, "link_value": link_value, }, { "parent": parent_3, "child": child_3, "link_type": link_type_3, "link_value": link_value, }, ] };

values in JSON object string parent Id of the parent string child Id of the child string link_type type of link we are looking for(SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE string link_value value of link we are looking for ('' by default)

Parameters
functiondataCallback Custom callback function

Moves a link from one parent to another

Parameters
stringold_parent_id Id of the old parent
stringchild_id Id of the child
stringold_link_type Type of link we are searching for between given assets (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3
stringold_link_value Value of link we are searching for between given assets ('' by default)
stringnew_parent_id Id of the new parent
stringnew_link_type Type of link to use (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3
stringnew_link_value Value of link to use ('' by default)
stringnew_position The new position
functiondataCallback Custom callback function
Version
$Revision: 0.2

Updates a link with provided information

Parameters
stringparent_id id of the parent
stringchild_id id of the child
stringexisting_link_type existing link type betweent the assets (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
stringexisting_link_value existing link value betweent the assets ('' by default)
stringlink_type link type to be updated to (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
stringlink_value link value to be updated to ('' by default)
stringnew_position the new position
stringlocked the asset link lock status(locked by default)
functiondataCallback custom callback function
Version
$Revision: 0.2

Updates multiple links

Parameters
jsonobject link_info Array of all the link information example : var link_info = { "links":[ { "parent": parent, "child": child, "existing_link_type": ext_link_type, "existing_link_value": ext_link_value, "link_type": link_type, "link_value": link_value, "sort_order": sort_order, "link_lock": link_lock, }, { "parent": parent_2, "child": child_2, "existing_link_type": ext_link_type_2, "existing_link_value": ext_link_value_2, "link_type": link_type_2, "link_value": link_value_2, "sort_order": sort_order_2, "link_lock": link_lock_2, }, { "parent": parent_3, "child": child_3, "existing_link_type": ext_link_type_3, "existing_link_value": ext_link_value_3, "link_type": link_type_3, "link_value": link_value_3, "sort_order": sort_order_3, "link_lock": link_lock_3, }, ] };

values in JSON object string parent Id of the parent string child Id of the child string existing_link_type type of link we are looking for(SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE string existing_link_value value of link we are looking for ('' by default) string link_type type of link we changing to (SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE string link_value value of link we are changing it to ('' by default) string sort_order sort order we want to update the link to boolean link_lock link lock value we want to set it to(default to TRUE)

Parameters
functiondataCallback Custom callback function
Version
$Revision: 0.2

Returns the link id between a parent and child

Parameters
stringparent_id Id of the parent
stringchild_id Id of the child
stringlink_type type of link we are looking for(SQ_LINK_TYPE_1 link by default) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3, SQ_LINK_NOTICE
stringlink_value value of link we are looking for ('' by default)
booleanall_info if we want all the link information or just linkid
functiondataCallback Custom callback function
Version
$Revision: 0.2

This will return tree information for children

Parameters
stringasset_id Id of the asset to get children of
numberlevels Number of levels to return
functiondataCallback Custom callback function
Version
$Revision: 0.2

This will get replacements for the passed in keywords

Parameters
stringasset_id Id of the asset to get keyword replacements for
arraykeywords Array of keywords to get replacements for
functiondataCallback Custom callback function

This will set Asset to the status that is passed in

Parameters
stringasset_id id of the asset to set status to
intstatus status tha asset is to be set to
booleancascade if to cascade the status to non-dependant children(false by default)
stringworkflow_stream workflow stream to be passed in
functiondataCallback custom callback function

This will get webpath(s) of the assetid supplied

Parameters
stringasset_id Id of the asset to get webpaths for
functiondataCallback Custom callback function

This will set webpath(s) of the assetid supplied

Parameters
stringasset_id Id of the asset to set webpaths for
arraypaths new web paths to be assigned to asset
booleanauto_remap if we auto remaping(default to TRUE)
functiondataCallback Custom callback function

This function will tell us if we have a runnig workflow on the passed assetid

Parameters
stringasset_id Id of the asset to get workflow schemas on
booleangranted what is the status of workflow we are trying to get (default to NULL) TRUE => granted, FALSE => denied, NULLL => get all
booleanrunning if we only are getting wokflows that are running (default to FALSE)
functiondataCallback Custom callback function

This function will let user edit content of Editable File type assets File type that can be edited - css_file, xml_file, css_file, text_file, xsl_file, js_file User needs to acquire locks before being able to edit the file

Parameters
stringassetID Id of the asset to update content for
stringcontent new content of the asset
functiondataCallback Custom callback function

This function will let user import assets into Matrix from a structured XML file For example for xml file look under System Tools > Import Assets from XML Tool > example.xml

Parameters
stringassetID Asset under which the assets are to be imported under
stringfilePath path to file on the file system
functiondataCallback Custom callback function

Returns an array of roles and the users/groups which can perform it

Parameters
intassetid the assetid of the asset the role is applied to
introleid the assetid of the the role that is applied
intuserid the assetid of the user performing the role
booleaninclude_assetid whether to include the assetid in the returned array
booleaninclude_globals whether to query the role view which includes expanded global roles as individual users
booleanexpand_groups when TRUE, any groups defined within a role will be replaced with the userids in that group. If FALSE, return the groupids
booleaninc_dependants If false it will filter out the dependant assets
booleaninclude_parents When userid is specified. This will include the roles applied directly to the user and indirectly to user parent groups.
arraytype_codes When include_assetid is TRUE. This is a type code filter for returned assetids.
booleanstrict_type_code Use strict type code for type code filter
functiondataCallback Custom callback function
Returns
array public

Performs HTMLTidy on the passed content and returns cleaned up code

Parameters
stringcontent the string content that needs to be cleaned up
functiondataCallback Custom callback function
Returns
string public

Gets lineage based on the url passed for the asset

Parameters
stringasset_url the asset url we are getting lineage from
booleansignificant_link_only if get to get back significant (type_1 and type_2) links only
functiondataCallback Custom callback function
Returns
string public

Returns an array of assets info in the order that they propagate out from the given URL.

Parameters
stringasset_url the asset url we are getting lineage from
functiondataCallback Custom callback function
Returns
string public

Given an array of asset ids in the order that they propagate out from site, it returns an array of URL(s) that matches the lineage.

Parameters
arraylineage asset id array to represent lineage from top to bottom
stringroot_url optional parameter to further filter results against multiple root urls
stringprotocol optional parameter to further filter results for protocol (http, https)
functiondataCallback Custom callback function
Returns
string public

batches multiple JS API calls and executs them in one HTTP Request

Parameters
jsonfunction json of all the function and its respective arguments to be passed in
functiondataCallback Custom callback function
Returns
string public

clones the passed asset under a new parent

Parameters
assetidstring id of asset we want to clone
new_parentstring assetid of the parent to clone under
clone_numint number of clones to create under new parent (default is 1)
new_positionint position to place the newly cloned asset at (default at the bottom)
link_typestring type of links we want to create for cloned asset(default is SQ_LINK_TYPE_1) Valid Values - SQ_LINK_TYPE_1, SQ_LINK_TYPE_2, SQ_LINK_TYPE_3
link_valuestring the value of new link we want (default '')
functiondataCallback Custom callback function
Returns
string public

gets the content (with or without paint layout) and check for the difference

Parameters
assetid_1string assetid of first asset
assetid_2string assetid of second asset
paint_layout_1string assetid of the paint layout you want to use on asset_1
paint_layout_2string assetid of the paint layout you want to use on asset_2
functiondataCallback Custom callback functio
Returns
string public

Returns the context we should be using based on the settings on the Context Configuration screen

Parameters
booleanall_info wheather to get all information of the context or just get the id/name pairs(by default set to FALSE)
functiondataCallback Custom callback function
Returns
string public

Returns details of all the contexts in a system

Parameters
booleanall_info wheather to get all information of the context of just get the id/name pairs(by default set to FALSE)
functiondataCallback Custom callback function
Returns
string public

Returns the current context active on the system

Parameters
booleanall_info wheather to get all information of the context of just get the id/name pairs(by default set to FALSE)
functiondataCallback Custom callback function
Returns
string public

Set the System to the Passed context

Parameters
stringcontext_id the id of the context we want to activate
functiondataCallback Custom callback functio
Returns
string public

Restores the previous context

Parameters
stringcontext_id the id of the context we want to activate
functiondataCallback Custom callback functio
Returns
string public

Definition at line 33 of file js_api_standard_function_list.inc.


The documentation for this class was generated from the following file: