SitesSDK.setProperty('componentAssets', [assets])

此函数用于更新代表定制组件存储的站点资产列表。

参数

名称 类型 说明

componentAssets

字符串

创建组件资产列表。

assets

JSON 对象

返回选定资产的列表。

参数

属性名称 说明

filetypes

支持的文件类型列表。

multiSelect

选择单个或多个文件。

用法

// get/set list of assets
SitesSDK.getProperty('componentAssets', callback);
SitesSDK.setProperty('componentAssets', [assets]);  
  
// invoking list creator
// after calling this, the developer needs to call setProperty against
// 'componentAssets' to persist all currently used assets
//
// args:
//  fileTypes - list of supported file types
//  multiSelect - single or multiple file select
// 
// returns a list of selected assets. If user cancels out of the picker, 
// the callback is never called
SitesSDK.filePicker({options}, callback);
  
//
// example 'componentAssets' JSON returned:
//
'componentAssets': [{ 
   'name': <nameOfAssetInContentFolder>,    // this is used to uniquely and persistently identify the asset.  It is typically prefixed by the ¿originalName¿ followed by a 16 digit string
   'originalName': <originalName>,          // name of the asset as selected from DOCS
   'description': <description>,            // description/other attributes that are available from DOCS
   'url': <fully qualified url to the asset>
}]