如何通过 nuxeo/nuxeo-php-client 标记 Nuxeo 文档

问题描述

我正在 symfony 项目中使用依赖项“nuxeo/nuxeo-PHP-client”。 自 2 天以来,我一直在尝试向 Nuxeo 文档添加标签。 我成功设置了字符串类型的属性,但标签是数组类型,文档非常少,因为它是社区维护的依赖项。

如果有人知道使用数组设置类似属性标签的语法,欢迎提供任何帮助!

谢谢。

设置字符串类型属性的语法:

$this->client->automation('Document.Update')->param('properties','dc:title=Mon nouveau titre')->input($nuxeodocument->getUid())->execute();

编辑:此依赖项不支持标签分配

解决方法

您可能会发现 this answer 相关。它使用的是 v1.5,但可以轻松修改为 2.0+:

$answer = $client
  ->operation()
  ->input('doc:/default-domain/workspaces/Default Workspace')
  ->param('type','Article')
  ->param('name','doc01')
  ->param('properties','dc:title=doc01 article:exampleList=[{"field01":"val001","field02":"val002","field03":"val003"}]')
  ->execute('Document.Create');

注:代码没有测试,这里直接修改,可能有错别字。