Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-20040

Cannot get properties in javascript backed behaviour in onUpdateProperties Policy


    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.2.d Community
    • Fix Version/s: None
    • Component/s: JavaScript API
    • Security Level: external (External user)
    • Labels:
    • Environment:
      Standard community installer, no modifications to behaviours/policies installed apart from this one
    • Resource:
    • Resolution Time Custom Field:
      149 weeks, 4 days, 1 hour, 51 minutes, 8 seconds


      It looks like the 'before' and 'after' arguments of onUpdateProperties are being marshalled incorrectly from Java.

      It's not possible to iterate through the object using 'for( var o in before)

      { ... }

      ' as it will throw complaining Qname cannot be cast to integer. This seems to be what ALF-10196 was complaining about

      The issue also seems similar to ALF-7506, although I am not seeing nulls.

      From NodeServicePolicies.java I see that the onUpdateProperties 'event' should come with three args: a NodeRef and two of Map<QName, Serializable> containing properties before and after updating.

      What I think I am getting in place of the before and after args being properly converted to javascript is some kind of direct representation of the Map<QName, Serializable>, but because the key is a QName the iteration doesn't work properly. I can see no way to get the keys from this map.

      If treated as an array, you can see the values only. e.g. before[0] gives the first value, but no access to the key.

      Trying to get to the underlying java methods does not work, e.g. trying to get before.entrySet().





              • Assignee:
                closedissues Closed Issues
                marsbard Martin Cosgrave
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created:
                  Date of First Response:

                  Structure Helper Panel