chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From richa...@apache.org
Subject svn commit: r1040010 - /incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php
Date Mon, 29 Nov 2010 03:49:54 GMT
Author: richardm
Date: Mon Nov 29 03:49:54 2010
New Revision: 1040010

URL: http://svn.apache.org/viewvc?rev=1040010&view=rev
Log:
CMIS-273 -- repositoryInfo parsing for ACL handling -- Patch provided by Patrice Collardez

Modified:
    incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php

Modified: incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php
URL: http://svn.apache.org/viewvc/incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php?rev=1040010&r1=1040009&r2=1040010&view=diff
==============================================================================
--- incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php (original)
+++ incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php Mon Nov 29 03:49:54 2010
@@ -526,6 +526,8 @@ class CMISRepositoryWrapper
         $retval->collections = array ();
         $retval->capabilities = array ();
         $retval->repositoryInfo = array ();
+        $retval->permissions = array();
+        $retval->permissionsMapping = array();
         $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmisra:uritemplate");
         foreach ($result as $node)
         {
@@ -541,13 +543,31 @@ class CMISRepositoryWrapper
         {
             $retval->capabilities[$node->nodeName] = $node->nodeValue;
         }
-        $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmisra:repositoryInfo/*");
+        $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmisra:repositoryInfo/*[name()!='cmis:capabilities'
and name()!='cmis:aclCapability']");
         foreach ($result as $node)
         {
-            if ($node->nodeName != "cmis:capabilities")
+            $retval->repositoryInfo[$node->nodeName] = $node->nodeValue;
+        }
+        $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmis:aclCapability/cmis:permissions");
+        foreach ($result as $node)
+        {
+            $retval->permissions[$node->getElementsByTagName("permission")->item(0)->nodeValue]
= $node->getElementsByTagName("description")->item(0)->nodeValue;
+        }
+        $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmis:aclCapability/cmis:mapping");
+        foreach ($result as $node)
+        {
+            $key = $node->getElementsByTagName("key")->item(0)->nodeValue;
+            $values = array();
+            foreach ($node->getElementsByTagName("permission") as $value)
             {
-                $retval->repositoryInfo[$node->nodeName] = $node->nodeValue;
+                array_push($values, $value->nodeValue);
             }
+            $retval->permissionsMapping[$key] = $values;
+        }
+        $result = CMISRepositoryWrapper :: doXQueryFromNode($xmlnode, "//cmis:aclCapability/*[name()!='cmis:permissions'
and name()!='cmis:mapping']");
+        foreach ($result as $node)
+        {
+            $retval->repositoryInfo[$node->nodeName] = $node->nodeValue;
         }
 
         return $retval;



Mime
View raw message