<?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 How to recognize if a user views or edits a node in a repository form filter? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292540#M245670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to edit some values of form fields when a user views an existing node (view mode). In edit mode I don´t want to modify these values... My&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I have configured a form filter for changing some form field values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="line-numbers language-markup"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;bean&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;formFilter&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="attr-name token"&gt;class&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;xxx&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="attr-name token"&gt;parent&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;baseFormFilter&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;property&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;filterRegistry&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;ref&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;nodeFilterRegistry&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;bean&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have implemented the method, but this method runs in view and edit mode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;afterGenerate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;final&lt;/SPAN&gt; ItemType item&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;final&lt;/SPAN&gt; List&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;String&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;final&lt;/SPAN&gt; List&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;String&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; forcedFields&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword token"&gt;final&lt;/SPAN&gt; Form form&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;final&lt;/SPAN&gt; Map&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;String&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Object&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; context&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;P&gt;How can I differentiate these two modes?&lt;/P&gt;&lt;P&gt;I know that it is possible to define fields for certain modes (example: &amp;lt;show id="cm:creator" for-mode="view" /&amp;gt;) in the share-config.xml, but maybe this information (if the user views or edit a node) is only available in Share, not in the repository?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Dec 2016 10:21:26 GMT</pubDate>
    <dc:creator>jego</dc:creator>
    <dc:date>2016-12-02T10:21:26Z</dc:date>
    <item>
      <title>How to recognize if a user views or edits a node in a repository form filter?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292540#M245670</link>
      <description>I want to edit some values of form fields when a user views an existing node (view mode). In edit mode I don´t want to modify these values... MyCurrently, I have configured a form filter for changing some form field values.&amp;nbsp;&amp;lt;bean id="formFilter" class="xxx" parent="baseFormFilter"&amp;gt; &amp;lt;propert</description>
      <pubDate>Fri, 02 Dec 2016 10:21:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292540#M245670</guid>
      <dc:creator>jego</dc:creator>
      <dc:date>2016-12-02T10:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to recognize if a user views or edits a node in a repository form filter?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292541#M245671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot - the Repository-tier filters are oblivious to the mode the form is to be displayed in. That information is not even passed to the Repository-tier. What I typically do when I need some specially constructed values for read-only views is to generate transient fields in the form and configure those fields (instead of the actual property) in the view form in Share.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 10:36:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292541#M245671</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-12-02T10:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to recognize if a user views or edits a node in a repository form filter?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292542#M245672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="73554" __jive_macro_name="user" _jive_internal="true" data-id="73554" data-objecttype="3" data-type="person" href="https://community.alfresco.com/people/afaust" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;‌ Interesting.&lt;/P&gt;&lt;P&gt;Do you have any sample code to share?&lt;/P&gt;&lt;P&gt;I never thought about that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 12:40:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292542#M245672</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2016-12-02T12:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to recognize if a user views or edits a node in a repository form filter?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292543#M245673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really. But it is effectively not different to what a &lt;A href="https://github.com/Alfresco/community-edition/blob/2c1eff9953d3105e738f7b06ba9ba8a079ca4c24/projects/repository/source/java/org/alfresco/repo/forms/processor/node/TransientFieldProcessor.java" rel="nofollow noopener noreferrer"&gt;transient field processor&lt;/A&gt; would do - create the &lt;A href="https://github.com/Alfresco/community-edition/blob/2c1eff9953d3105e738f7b06ba9ba8a079ca4c24/projects/repository/source/java/org/alfresco/repo/forms/processor/node/SizeFieldProcessor.java#L61" rel="nofollow noopener noreferrer"&gt;field definition&lt;/A&gt; and add it to the form, and additionally add the data for it to the form as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 12:57:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-recognize-if-a-user-views-or-edits-a-node-in-a-repository/m-p/292543#M245673</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-12-02T12:57:56Z</dc:date>
    </item>
  </channel>
</rss>

