Uploaded image for project: 'Chemistry'
  1. Chemistry
  2. CMIS-320

Added support for extra properties added by Alfresco aspects

    Details

    • Type: Improvement
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: PHPCMIS 0.2
    • Component/s: cmis-phplib
    • Labels:
      None

      Description

      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>

        Activity

        Hide
        richardm Richard McKnight added a comment -

        Does the patch look for extensions similar to OpenCMIS.... I think that that is how Aspects are added.
        http://chemistry.apache.org/java/examples/example-get-extension.html

        I will take a look but thought I would ask first.

        Show
        richardm Richard McKnight added a comment - Does the patch look for extensions similar to OpenCMIS.... I think that that is how Aspects are added. http://chemistry.apache.org/java/examples/example-get-extension.html I will take a look but thought I would ask first.
        Hide
        richardm Richard McKnight added a comment -

        Paul
        Sorry for the delay in getting to this – thanks for the patch – investigating now.
        Rich

        Show
        richardm Richard McKnight added a comment - Paul Sorry for the delay in getting to this – thanks for the patch – investigating now. Rich
        Hide
        hootbah Paul Edmondson added a comment - - edited

        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; + }

          }
          }
          }

        Show
        hootbah Paul Edmondson added a comment - - edited 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; + } } } }

          People

          • Assignee:
            richardm Richard McKnight
            Reporter:
            hootbah Paul Edmondson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development