cancel
Showing results for 
Search instead for 
Did you mean: 

onUpdateNode shows incorrect value for cm:name updates

mikel_asla1
Confirmed Champ
Confirmed Champ
Hi there!

Sorry if this topic allready exists but no luck searching…. also sorry for me poor english

Im trying to register node updates (node properties updates really) in an external php app. Comunications are made via REST.
So I implemented a custom behaviour with java for onUpdateProperties and onUpdateNode policies.
The code calls the external app to register the new properties vlaues.
It works fine when updating any propierties but not for cm:name, which is quite critic for the integration. The new value for cm:name cames like this

{{http://www.alfresco.org/model/content/1.0}name=1522aa8e-c43e-48f9-9b65-099fb4d2c1d8


This is an example simplified code for onUpdateProperties


   …   
   public void init() {
   ….
   this.onUpdateProperties = new JavaBehaviour(
            this,
            "onUpdateProperties",
            NotificationFrequency.FIRST_EVENT);
      
   this.policyComponent.bindClassBehaviour(
            QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"),
            ContentModel.TYPE_BASE;
            this.onUpdateProperties);
   …
   }



   @Override
   public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {
      String old_name = before.get(ContentModel.PROP_NAME);      
      String new_name = after.get(ContentModel.PROP_NAME);
      if(logger.isDebugEnabled())
         logger.debug("Old name was : " + old_name
            + " , new name is : " + new_name);
      return;
   }
   …

Suposing is only suitable to log the cm:name updates…. Smiley Tongue

When updating the name of any node, i get


Old name was: text.txt , new name is : 1522aa8e-c43e-48f9-9b65-099fb4d2c1d8

What i'm doing wrong?

Thanks
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
Can't see anything wrong with your code.    Is that the new name? Check the node in the node browser to see what the cm:name property is after the update.

How is the node being updated ?

mikel_asla1
Confirmed Champ
Confirmed Champ
I'm updating throught Share, normal operation with the edit properties ui action.
The new name is not that, I tried with dummy things like

before.txt and after.txt

and I allways get an ugly hexadecimal string Smiley Very Happy


The only "diferent" thing from a normal Alfresco Share instalation is that I'm authenticating in Share with and custom external cookie based SSOAuthenticationFilter, i guess that's nothing to do with my issue….

This is debug output from one try (old_name=AC Stairs.dwf , new_name=Stairs.dwf)


Before: {{http://www.alfresco.org/model/content/1.0}name=AC Stairs.dwf, {http://www.alfresco.org/model/system/1.0}node-dbid=918, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/system/1.0}locale=es_ES, {http://www.alfresco.org/model/content/1.0}content=contentUrl=store://2013/9/30/17/45/2d1013f8-5f0a-4..., {http://www.alfresco.org/model/content/1.0}title={es=}, {http://www.alfresco.org/model/system/1.0}node-uuid=0e35a30a-2f3c-4a70-b56a-585847de2c33, {http://www.alfresco.org/model/content/1.0}author=, {http://www.alfresco.org/model/content/1.0}taggable=null, {http://www.alfresco.org/model/content/1.0}modified=Wed Oct 02 12:48:59 CEST 2013, {http://www.entelgy.com/model/content/1.0}docType=No Clasificado, {http://www.alfresco.org/model/content/1.0}created=Mon Sep 30 17:45:05 CEST 2013, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}description={es=}, {http://www.alfresco.org/model/content/1.0}creator=mikel, {http://www.alfresco.org/model/content/1.0}categories=null, {http://www.alfresco.org/model/content/1.0}modifier=mikel}

After: {{http://www.alfresco.org/model/content/1.0}name=1522aa8e-c43e-48f9-9b65-099fb4d2c1d8, {http://www.alfresco.org/model/system/1.0}node-dbid=918, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/system/1.0}locale=es_ES, {http://www.alfresco.org/model/content/1.0}content=contentUrl=store://2013/9/30/17/45/2d1013f8-5f0a-4..., {http://www.alfresco.org/model/content/1.0}title={es=}, {http://www.alfresco.org/model/content/1.0}modified=Wed Oct 02 12:48:59 CEST 2013, {http://www.alfresco.org/model/content/1.0}author=, {http://www.alfresco.org/model/content/1.0}taggable=null, {http://www.alfresco.org/model/system/1.0}node-uuid=0e35a30a-2f3c-4a70-b56a-585847de2c33, {http://www.entelgy.com/model/content/1.0}docType=No Clasificado, {http://www.alfresco.org/model/content/1.0}created=Mon Sep 30 17:45:05 CEST 2013, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}creator=mikel, {http://www.alfresco.org/model/content/1.0}description={es=}, {http://www.alfresco.org/model/content/1.0}modifier=mikel, {http://www.alfresco.org/model/content/1.0}categories=null}


Thanks

mikel_asla1
Confirmed Champ
Confirmed Champ
I forget to mention that after every test I can see the correct value of cm:name in the node browser, it looks to me like the value returned in the behaviour is an intermediate/temporal name ….

mrogers
Star Contributor
Star Contributor
That looks like a bug. So please raise an issue in JIRA.

But its not possible since it would cause chaos if it were true.  8-)     Needs investigating.

mikel_asla1
Confirmed Champ
Confirmed Champ
Ok! Thanks, I'll post the link
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.