AnsweredAssumed Answered

Updating multi-value properties with php

Question asked by bweiss on Jul 22, 2010
Latest reply on Sep 16, 2010 by romain.lamarche
Is it possible to update a multi-value property using the php api? 

Here is what I am trying to do:
    I have created a custom aspect with the multi-value property partnumref.
    I can update this properly via the Alfresco explorer client and also via javascript.
    I would like to create a rule to query an external datasource and add values to partnumref when a document is added or updated.
    I could not figure out how to perform an httpget type function in javascript (seems to only be possible in webscripts).
    In php, it is very simple to call an external page via cURL.
    Unfortunately, I have been unable to set or update a mult-value property in php
This works:
  //Apply the aspects to the file ($httpresults is an array of values)
    //Define the properties
    //Add the aspect
    $document->addAspect("custom_stdref", $props);

This does not:
  //Apply the aspects to the file ($httpresults is an array of values)
    //Define the properties
    //Add the aspect
    $document->addAspect("custom_stdref", $props);

Nor does updating:
    $props = $document->properties;

I am using community 3.2r
Typical error might be:

error executing script…

Caused by: java.lang.UnsupportedOperationException: openRead:com.caucho.vfs.NullPath
        at com.caucho.vfs.Path.openReadImpl(
        at com.caucho.vfs.Path.openRead(
        at com.caucho.quercus.env.Env.getSourceLine(
        at com.caucho.quercus.parser.QuercusParser.error(
        at com.caucho.quercus.expr.Expr.createAssign(
        at com.caucho.quercus.parser.QuercusParser.parseAssignExpr(QuercusParse

Any ideas on how to get values from an external data source into a multi-value property based on a rule action (php or otherwise welcome)?