AnsweredAssumed Answered

How to recognize if a user views or edits a node in a repository form filter?

Question asked by jego on Dec 2, 2016
Latest reply on Dec 2, 2016 by afaust

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

 

Currently, I have configured a form filter for changing some form field values. 

 

<bean id="formFilter"
class="xxx"
parent="baseFormFilter">

<property name="filterRegistry" ref="nodeFilterRegistry" />
</bean>

 

I have implemented the method, but this method runs in view and edit mode

 

public void afterGenerate(final ItemType item, final List<String> fields, final List<String> forcedFields,
final Form form, final Map<String, Object> context) {

How can I differentiate these two modes?

I know that it is possible to define fields for certain modes (example: <show id="cm:creator" for-mode="view" />) 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?

 

 

Thanks

Jens

Outcomes