GDPR export from my page

How can I add the same GDPR export functionality that is avaliable in Litium backoffice to my page in the accelerator to allow the customer to trigger the export for themselves?

Litium version: 6

The simple way is to use the GdprService from the Litium.GDPR namespace.

            // Create the identity for the person
            // this can also be an OrderSystemIdIdentity to fetch related information by an order.
            var identity = new PersonSystemIdIdentity(personSystemId);
            // Fetch all identity items that should be handled
            var records = _gdprService.Search(identity);
            // Export all data
            var document = _gdprService.Export(records);

Now the document will contain all the information that is found. To return this to the requested customer you can use JSON.NET to serialize the information in a machine readable format.

Read more about how you can extend the GDPR functionality to also collect information from third party systems on https://docs.litium.com/documentation/architecture/gdpr-support

Hi!

How do I get an instance of GdrpService in Litium 5 and WebForms?
I tried:
IoC.Resolve< GdprService >();
and
IoC.Resolve< GdprServiceImpl >();
and
var s = new GdprService();

But that dis not work.

Thanks!

You should be able to use IoC.Resolve< GdprService>() to get the GdrpService.

What is the error/exception message you are getting?

NullException, I used it just for test in the Page_Load of the StartPage maybe that is not possible?
We got it to work now using IoC anyway like this:

private readonly GdprService _gdrpService = IoC.Resolve < GdprService >();

Thanks!

Do you mean that IoC.Resolve<GdprService>() was result in an NRE or that the field was null when you used it?

It should be possible to set/use the IoC.Resolve<GdprService>() also in the Page_Load but it can be a safer bet to initialize the field in the constructor or with direct assignment that you pointed out was working.