[
https://issues.apache.org/jira/browse/CMIS-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998799#comment-12998799
]
Paul Edmondson edited comment on CMIS-320 at 2/24/11 10:43 AM:
---------------------------------------------------------------
Index: /Users/hootbah/src/fndoc/external/cmis/cmis_repository_wrapper.php
===================================================================
--- /Users/hootbah/src/fndoc/external/cmis/cmis_repository_wrapper.php
(revision 1073825)
+++ /Users/hootbah/src/fndoc/external/cmis/cmis_repository_wrapper.php
(working copy)
@@ -377,15 +377,19 @@
$retval = new stdClass();
$retval->links = CMISRepositoryWrapper :: getLinksArray($xmlnode);
$retval->properties = array ();
- $prop_nodes =
$xmlnode->getElementsByTagName("object")->item(0)->getElementsByTagName("properties")->item(0)->childNodes;
- foreach ($prop_nodes as $pn)
- {
- if ($pn->attributes)
+ $properties_nodes =
$xmlnode->getElementsByTagName("object")->item(0)->getElementsByTagName("properties");
+
+ foreach ($properties_nodes as $properties_node) {
+ $prop_nodes = $properties_node->childNodes;
+ foreach ($prop_nodes as $pn)
{
- $propDefId =
$pn->attributes->getNamedItem("propertyDefinitionId");
- if (!is_null($propDefId) && $pn->getElementsByTagName("value")
&& $pn->getElementsByTagName("value")->item(0))
+ if ($pn->attributes)
{
- $retval->properties[$propDefId->nodeValue] =
$pn->getElementsByTagName("value")->item(0)->nodeValue;
+ $propDefId =
$pn->attributes->getNamedItem("propertyDefinitionId");
+ if (!is_null($propDefId) &&
$pn->getElementsByTagName("value") &&
$pn->getElementsByTagName("value")->item(0))
+ {
+ $retval->properties[$propDefId->nodeValue] =
$pn->getElementsByTagName("value")->item(0)->nodeValue;
+ }
}
}
}
was (Author: hootbah):
A patch to get all nodes of propertyDefinitionId
> Added support for extra properties added by Alfresco aspects
> -------------------------------------------------------------
>
> Key: CMIS-320
> URL: https://issues.apache.org/jira/browse/CMIS-320
> Project: Chemistry
> Issue Type: Improvement
> Components: cmis-phplib
> Reporter: Paul Edmondson
> Priority: Minor
>
> Alfresco adds aspects that can contain properties to the CMIS XML feed.
> A cut down example below:
> <cmis:properties>
> <cmis:propertyString propertyDefinitionId="cmis:name" displayName="Name"
> queryName="cmis:name">
>
> <cmis:value>GUID-0050677A-845F-4123-A7EE-CCAC07F634FC.dita</cmis:value>
> </cmis:propertyString>
> ...
> <alf:aspects>
> <alf:appliedAspects>P:cm:titled</alf:appliedAspects>
> <alf:appliedAspects>P:fn:dita</alf:appliedAspects>
> <alf:appliedAspects>P:app:inlineeditable</alf:appliedAspects>
> <alf:properties>
> <cmis:propertyString propertyDefinitionId="cm:description"
> displayName="Description" queryName="cm:description"/>
> <cmis:propertyString propertyDefinitionId="cm:title"
> displayName="Title" queryName="cm:title">
> <cmis:value>Using tabs or folders in the second
> level</cmis:value>
> </cmis:propertyString>
> <cmis:propertyString propertyDefinitionId="fn:myproperty"
> displayName="my display name" queryName="fn:myproperty">
> <cmis:value>my value</cmis:value>
> </cmis:propertyString>
> </alf:properties>
> </alf:aspects>
> </cmis:properties>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira