Page tree
Skip to end of metadata
Go to start of metadata

This page describes how to configure a content app to be privacy-aware, for example in the context of GDPR regulations. The Contacts app, a Magnolia demo content app, is an example of an app adapted to comply with privacy regulations. An existing content app can be made privacy-aware almost on-the-fly. You just need to configure the app in accordance with the following guidelines.

Add mgnl:visitorReference to content node type

Define a privacy-related node type the app is expected to handle. In the case of the Contacts app it is the mgnl:visitorReference (mixin):


  <nodeType name="mgnl:privacyContact" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">


(warning) Please be aware that the mgnl:visitorReference node type has a mandatory property called visitorId.  Without it you cannot save a  mgnl:visitorReference node. See below its definition in the Visitor manager submodule:

  <nodeType name="mgnl:visitorReference" isMixin="true" hasOrderableChildNodes="true" primaryItemName="">
    <propertyDefinition name="visitorId" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>

The Visitor manager submodule is where most of the configuration of the Privacy module is done.

Use a dedicated subapp class and field

In your app use a dedicated privacy-enabling subapp class and field(s). In the Contacts app this is done with the info.magnolia.privacy.sample.contentapp.PrivacyAwareContactDetailSubapp class (line 1), the visitorId field (from line 9). The field is linked to the visitors repository (line 11), a dedicated repository which stores visitor consent information:

subAppClass: info.magnolia.privacy.sample.contentapp.PrivacyAwareContactDetailSubapp
    name: mgnl:privacyContact
            class: info.magnolia.ui.form.field.definition.SelectFieldDefinition
            repository: visitors
            path: /
            textInputAllowed: true
            filteringMode: CONTAINS
            pageLength: 100
            valueProperty: visitorId
            labelProperty: visitorId

(info) Lines 3 and 4 make sure the app (subapp) uses the newly defined node type. Because of MGNLPRIV-35 we actually don't set the mgnl:privacyContact node type in the Detail subapp's definition decoration.

The field label "Visitor" is defined in the message bundle of the privacy-ui module: