Restriction level <ON_SAVE/> (inhibit save)
Rules based on this restriction level inhibit the saving of invalid form content by the editor (and thus also the release of this content).
This restriction level thus represents a massive intervention into the editorial process. In the working area, the editor is informed about the rule violation during entry already (see Display in the working area) and must correct this violation before the (form) content is saved. Otherwise the saving procedure terminates with an error message.
For general information regarding the definition of a restriction level, see Controlling editorial processes (restriction levels).
Examples
Example: inhibiting the saving of an empty input component
The form has an “st_table” input component that must be filled by the editor. For this case, the restriction level <ON_SAVE/> can be assigned by the template developer. As soon as the condition (input component “st_table” is not empty) defined in the value determination is not fulfilled, the input component is marked by the FirstSpirit framework and a correction note appears underneath the input component. If the editor now tries to save the form in this invalid state, an error message will appear and the saving of the form will be inhibited.
<RULES>
<ON_SAVE>
<WITH>
<NOT>
<PROPERTY source="st_table" name="EMPTY"/>
</NOT>
</WITH>
<DO>
<VALIDATION>
<PROPERTY source="st_table" name="VALID"/>
<MESSAGE lang="*" text="The editor must not be empty!"/>
<MESSAGE lang="DE" text="Der Editor darf nicht leer sein!"/>
</VALIDATION>
</DO>
</ON_SAVE>
</RULES>
The restriction level <ON_SAVE/> represents a massive intervention in the editorial process. This can lead to problems during editing. Example: Since the conditions of the rule shown here are very generally defined, the editor must fill the corresponding entry field in all project languages during the creation or editing of a form based on this rule in order to save the form. This is probably not desired in all cases. This means that rules, especially when they intervene in the editorial process in a very restrictive manner, must be prudently defined. |
For the case specified above, for example, the definition of a precondition that the subsequent validation is performed only if the form is opened by the editor in the master language of the project would be helpful:
...
<IF>
<EQUAL>
<PROPERTY source="#global" name="LANG"/>
<PROPERTY source="#global" name="MASTER"/>
</EQUAL>
</IF>
...