我有一个objectId,我想用Apache Chemistry Library更改他的名字(例如)。
我尝试使用化学库提供的updateProperties方法。但我看不出有什么变化。?发生了什么?
$test = new CMISService($repo_url, $repo_username, $repo_password);
$id = 'ddb6eabd-a862-4e6b-9251-32b6e73300d7'; //existing objectId of the document that his name now is PRUEBAS.
$obj = $test->updateProperties($id, array('cmis:name' => 'PRUEBAS_MODIFIED'));
var_dump($cmis_repo->getObject($obj->id)); // I see that cmis:name continue PRUEBAS instead of PRUEBAS_MODIFIED ¿why?是否可以更改文档的名称?
但是,我可以完美地更改cmis:description属性...为什么cmis:名称我不能?
发布于 2017-03-04 07:51:30
我比较了cmislib (python)和github上的Apache Chemistry客户端fork发送的请求,发现后者发送了以下atom请求:
<atom:title>PRUEBAS</atom:title>
<atom:summary>PRUEBAS</atom:summary>
<cmisra:object>
<cmis:properties>
<cmis:propertyString propertyDefinitionId="cmis:name">
<cmis:value>PRUEBAS_MODIFIED</cmis:value>
</cmis:propertyString>
</cmis:properties>
</cmisra:object>python客户机在<atom:title>标记中发送新名称。我尝试删除<atom:title>和<atom:summary>标签,并通过curl --upload-file将文本发送到Alfresco,但工作正常。
所以我的猜测是,Alfresco首先考虑<atom:title>标记的值(当尝试更新cmis:name属性时),然后退回到<cmis:value>标记的值。
我的天,它可以被认为是php客户端库的一个bug,应该不是很难修复。
发布于 2017-06-02 21:39:46
厄尼是在正确的轨道上。
public function renameObject($objectId, $name)
{
$properties = array(
'cmis:name' => $name
);
$options = array(
'title' => $name,
'summary' => $name,
);
return $this->repository->updateProperties($objectId, $properties, $options);
}这对我来说很有效,实际上您只需要选项数组中的标题就可以更改名称
https://stackoverflow.com/questions/39100254
复制相似问题