cancel
Showing results for 
Search instead for 
Did you mean: 

How to get properties from php webservice node?

cperez
Champ in-the-making
Champ in-the-making
Hi all!

I have a php code to get some documents through a query.
I want to show some properties of the node, but I'm not able to.

This is the query:

$nodes = $session->query($currentStore, $path."/cm:".$cif."/cm:".$space_riegos."\"");


And this where I show all the child node properties

foreach ($nodes[0]->children as $node)
{
?>
        <tr>
           <td><?php echo $node->child->id; ?></td>
      <td><?php echo $node->child->cm_name; ?></td>
      <td><?php echo $node->child->properties["dig:Doc_name"]; ?></td>
   </tr>
<?php
}


I only see the 'id' and 'cm_name' property, and trying to show the property "digSmiley Very Happyoc_name" shows me the following error:

Notice: Undefined index: dig:Doc_name in C:\xampp\htdocs\api\queryExecuter.php on line 229


I've tried the following properties but all shows me the same message (But with the corresponding property).

<td><?php echo $node->child->properties["Doc_name"]; ?></td>
<td><?php echo $node->child->properties["cm:name"]; ?></td>
<td><?php echo $node->child->properties["name"]; ?></td>
<td><?php echo $node->child->properties["title"]; ?></td>
<td><?php echo $node->child->properties["cm:title"]; ?></td>


Anyone know how I fix this ?
Is it possible to add as a filter in the query some property (like "[diff: doc_id] == '789fe12'")?


Thank you very much in advance
3 REPLIES 3

cperez
Champ in-the-making
Champ in-the-making
I found the solution to get the node properties.

the code used are:

<td><?php echo $node->child->properties['{digitModel.model}Doc_name']; ?></td>
<td><?php echo $node->child->properties['{http://www.alfresco.org/model/content/1.0}name']; ?></td>


Now, I need to know how to specified the previous property in "session->query" to filter the results.

Does anyone know how to do this type of query?
Thanks a lot in advance!!

kaynezhang
World-Class Innovator
World-Class Innovator
You can use cmis api and execute cmis query ,about cmis query please refer to <url>https://docs.alfresco.com/4.1/concepts/cmis-query.html</url>

cperez
Champ in-the-making
Champ in-the-making
Thanks for your comment.

Finally I'm using lucene search query which gives me all I need.