iu-webtech/wcms-generic-tool
Composer 安装命令:
composer require iu-webtech/wcms-generic-tool
包简介
A generic tool to operation assets in WCMS
README 文档
README
This tool simplifies user's work on using WCMS WebService to manipulate assets.
Asset types supported
Before operating any asset, a WCMS SOAP client should initiated with url to WSDL, site name, and api key:
$wcms = new WCMSClient($wsdl, $sitename); $wcms->setAuthByKey($apikey);
Block: Data Definition
Read
$pathToBlock = "/Settings"; $block = new BlockXHTML($wcms, $pathToBlock); var_dump($block->oldAsset);
Update
Create
$assetPayload = []; //required $assetPayload['structuredData'] = [ 'definitionPath' => 'path-to-data-definition', // OR //'definitionId' => 'data definition id' ]; //OR required //$assetPayload['xhtml'] = ''; //required $assetPayload['parentFolderPath'] = "path-to-parent-folder"; //OR required //$assetPayload['parentFolderId'] = "parent-folder-id"; $assetPayload['name'] = "asset-name"; $assetPayload = (object) $assetPayload; $block = new BlockXHTML($wcms); $block->setNewAsset($assetPayload); $block->createAsset();
Delete
Block: Index
Block: Feed
Block: Text
File
Page
Folder
Content Type
Asset Factory
Data Definition
Format: Velocity
Symlink
Template
How-To
When creating new asset, how to check if new asset is created or the asset already exists?
By checking if $asset->oldAsset attribute is set and $asset->newAsset has a $id key set
- if $asset->getOldAsset() returns
null, or $asset->getNewAsset()->id is set, a new asset has been created by createAsset() - if $asset->getOldAsset() returns asset data or $asset->getNewAsset()->id is Not set, the asset meant to be created has already existed.
统计信息
- 总下载量: 177
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2022-03-24