cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Aspect Value from Custom Action

erictice
Champ in-the-making
Champ in-the-making
I have a custom action that is working well.   The next step is to set a custom action that I created with the value that is created in the action.  Does anyone know what the API for this is?  I have tried the following:

…….

      QName urlQname = QName.createQName(filePath.substring(0, filePath.indexOf("}")+1) + "S3URL");
               Map<QName, Serializable> properties = nodeService.getProperties(actionedUponNodeRef);
               properties.put(urlQname, url);
               nodeService.addProperties(actionedUponNodeRef, properties);
               
               action.setParameterValue("S3URL", url);

…….

It would seem that one of those is supposed to do that, but I am at a loss as to why it is not working.  I really need this asap, so any thoughts on this would be appreciated.  As I am doing this from a custom action that is running in Alfresco, I do not want to make a web service call.  There should be another way to do this.  I am also doing this all with Java, no webscripts.  Thank you
1 REPLY 1

derek
Star Contributor
Star Contributor
Hi,

addProperties should be used for adding (or modifying) properties.  In other words, just use your custom property with addProperties rather than doing a get/add.

Secondly, your property name appears to be dynamic i.e. your namespace is a file path.  Don't do this; the namespace tables and use-cases are designed for handling namespaces not ad-hoc data.  Declare the property names you wish to use in a dictionary and set the values as required; I can't think of a use-case that needs dynamic namespaces or dynamic property names; if this is one, then change your approach.

A high-level overview of what you are trying to achieve would be helpful.  It appears that you are trying to push/store content in S3 or something.

Regards