cancel
Showing results for 
Search instead for 
Did you mean: 

Update custom properties

luca
Star Contributor
Star Contributor
Hi all,
I have a custom property 'State' in my documents that is updated by a rule that extract the value from the document that I'm uploading.

The rule is setted to be executed in inbound and update because I want to refresh the property if I upload a new version of the document.

The problem is that I can't change manually the custom property from the web client because when I edit it and click ok the rule is executed and it overwrite  it.

What can I do? Can I distinguish the upload or the manual edit through Web Client action that start the rule?

Thanks,
Luca
4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
Luca,

Have you considered using a behavior to accomplish this? Behaviors happen at a lower level than rules so, for example, they would take place regardless of what folder the content lived in. That can be a good thing or bad thing depending on what you want.

But the reason I mention it is because inside a behavior you can distinguish between a content write and a property update so you could have finer-grained control over when that field gets populated.

Jeff

luca
Star Contributor
Star Contributor
Thank you very much!

Now I'll try to see what you suggested to me, I think it will work!

But I think that it could be usefull to specify some custom type also for the rules in case I want to restrict that behaviour only to a specified folder, but for now behavoiur is enough.  Smiley Happy

luca
Star Contributor
Star Contributor
I have some problems because the behaviour I just created it is trigger only on update of the document through the WebClient interface. If I update the document using webdav the behaviour isn't triggered!

The behaviour is bound to onContentUpdate and on TRANSACTION_COMMIT, should I add something else or change the frequency?

luca
Star Contributor
Star Contributor
Sorry, there was an error in the code…  Smiley Surprisedops:

I added a wrong if to compare the StoreRef of the node, this is the CORRECT version  Smiley Happy  :
if (nodeRef.getStoreRef().getIdentifier().equals(Repository.getStoreRef().getIdentifier()) &&
            nodeRef.getStoreRef().getProtocol().equals(Repository.getStoreRef().getProtocol())) {