<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Format property before commit using Behavior in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105948#M29950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to ensure that a given property is always set as uppercase string.&lt;/P&gt;&lt;P&gt;I tried to use a java Behavior&amp;nbsp;to update property value before commit, but this has no effect (see below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;behavior declaration:&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;eventManager.bindClassBehaviour(&lt;BR /&gt; NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, &lt;BR /&gt;myModel.myAspect,&amp;nbsp;&lt;BR /&gt; new JavaBehaviour(this, "onUpdateProperties", Behaviour.NotificationFrequency.FIRST_EVENT)&lt;BR /&gt; );&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;public void onUpdateProperties(NodeRef nodeRef, Map&amp;lt;QName, Serializable&amp;gt; before, Map&amp;lt;QName, Serializable&amp;gt; after) {&lt;/P&gt;&lt;P&gt;// modifying property value of '&lt;SPAN&gt;after' map has no effect&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Idea suggestion ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 May 2019 22:09:42 GMT</pubDate>
    <dc:creator>vincent-kali</dc:creator>
    <dc:date>2019-05-25T22:09:42Z</dc:date>
    <item>
      <title>Format property before commit using Behavior</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105948#M29950</link>
      <description>I'd like to ensure that a given property is always set as uppercase string.I tried to use a java Behavior&amp;nbsp;to update property value before commit, but this has no effect (see below).&amp;nbsp;Any&amp;nbsp;behavior declaration:&amp;lt;code&amp;gt;eventManager.bindClassBehaviour( NodeServicePolicies.OnUpdatePropertiesPolicy.QNA</description>
      <pubDate>Sat, 25 May 2019 22:09:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105948#M29950</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2019-05-25T22:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Format property before commit using Behavior</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105949#M29951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Modifying the after map NEVER has any effect. The after map is just a shallow copy of the node properties state provided to the behaviour - it does not allow for direct mutation. You have to use the NodeService to make actual, persistent changes to nodes from within your behaviour.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2019 08:00:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105949#M29951</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2019-05-27T08:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Format property before commit using Behavior</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105950#M29952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. I'd like to apply some string 'normalization' to specific properties when set by the user in UI (either share or any other external custom UI).&lt;/P&gt;&lt;P&gt;I was thinking about using behaviors to do that: 1) test if the value set is a normalized value, if not reset the value with the normalize value (which will trigger again the behavior….).&lt;/P&gt;&lt;P&gt;Do you think there's a more efficient way to do that ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2019 10:26:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/format-property-before-commit-using-behavior/m-p/105950#M29952</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2019-05-27T10:26:52Z</dc:date>
    </item>
  </channel>
</rss>

