| /** |
| * Copyright (c)2020 CEA LIST, Committer Name, and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr |
| * Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr |
| */ |
| package org.eclipse.papyrus.pdp4eng.req.metareq; |
| |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Accuracy; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.DataMinimisation; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Fairly; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Lawful; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.LawfulByConsent; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.PersonalDataRequirement; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.ProcessPrinciple; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.PurposeLimitation; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.SecuritySafety; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.StorageLimitation; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Transparency; |
| import org.eclipse.xtend2.lib.StringConcatenation; |
| |
| @SuppressWarnings("all") |
| public class GDPRRequirements { |
| /** |
| * get Description for lawfull requirements from rticle5.1 |
| */ |
| public CharSequence getDescriptionForLawfulRequirement(final Lawful lawful) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IF process \"�lawful.process.base_NamedElement.name�\" processes \"�getPersonalDataFromProcess(lawful)�\" of \"�lawful.dataSubject.base_NamedElement.name�\" THEN the Process \"�lawful.process.base_NamedElement.name�\" shall be lawfull."); |
| return _builder; |
| } |
| |
| public CharSequence getDescriptionForLawfulByConsent(final LawfulByConsent lawfulByConsent) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Processing \"�lawfulByConsent.process.base_NamedElement.name�\" shall be lawful if the data subject \"�lawfulByConsent.dataSubject.base_NamedElement.name�\" has given consent \"�lawfulByConsent.consent.base_NamedElement.name�\" to the processing of his or her personal data \"�getPersonalDataFromProcess(lawfulByConsent)�\" for one or more specific purposes �lawfulByConsent.process.contributedTo.base_NamedElement.name�"); |
| return _builder; |
| } |
| |
| /** |
| * get Description for fairly requirements from article5.1 |
| */ |
| public CharSequence getDescriptionForFairlyRequirement(final Fairly fairly) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IF process \"�fairly.process.base_NamedElement.name�\" processes \"�getPersonalDataFromProcess(fairly)�\" of \"�fairly.dataSubject.base_NamedElement.name�\" THEN the Process \"�fairly.process.base_NamedElement.name�\" shall be fairly."); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1 |
| */ |
| public CharSequence getDescriptionForTransparentRequirement(final Transparency transparency) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("IF process \"�transparency.process.base_NamedElement.name�\" processes \"�getPersonalDataFromProcess(transparency)�\" of \"�transparency.dataSubject.base_NamedElement.name�\" THEN the Process \"�transparency.process.base_NamedElement.name�\" shall be transparent."); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.b |
| */ |
| public CharSequence getDescriptionForPurposeLimitation(final PurposeLimitation purposeLimitation) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("The purpose \"�purposeLimitation.purpose.base_NamedElement.name�\" of the PersonalData \"�purposeLimitation.personalData.base_NamedElement.name�\" shall be specified, explicit, legimate, and compatible."); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.c |
| */ |
| public CharSequence getDescriptionForDataMinimisation(final DataMinimisation dataMinimisation) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Personal Data \"�dataMinimisation.personalData.base_NamedElement.name�\" shall be adequate, relevant and limited to what is necessary in relation to the purpose \"�dataMinimisation.purpose.base_NamedElement.name�\" for which they are processed"); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.d |
| */ |
| public CharSequence getDescriptionForAccurate(final Accuracy accuracy) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Personal Data \"�accuracy.personalData.base_NamedElement.name�\" shall be accurate and, where necessary, kept up to date. If personal data \"�accuracy.personalData.base_NamedElement.name�\" are inaccurate, having regard to the purposes \"�accuracy.purpose.base_NamedElement.name�\" for which they are processed, it shall erased or rectified without delay."); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.e |
| */ |
| public CharSequence getDescriptionForStorageLimitation(final StorageLimitation storageLimitation) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Personal Data \"�storageLimitation.personalData.base_NamedElement.name�\" shall be kept in a form which permits identification of data subject \"�storageLimitation.personalData.relatedTo.get(0).base_NamedElement.name�\" for no longer than is necessary for the purpose \"�storageLimitation.purpose.base_NamedElement.name�\" for which the personal data are processed"); |
| return _builder; |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.e |
| */ |
| public CharSequence getDescriptionForSecuritySafety(final SecuritySafety securitySafety) { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Personal Data �getPersonalDataFromProcess(securitySafety)� shall be processed in a manner that ensures appropriate security. "); |
| return _builder; |
| } |
| |
| public String getPersonalDataFromProcess(final ProcessPrinciple ProcessPrinciple) { |
| String result = ""; |
| EList<PersonalDataRequirement> _personalData = ProcessPrinciple.getPersonalData(); |
| for (final PersonalDataRequirement element : _personalData) { |
| String _name = element.getBase_NamedElement().getName(); |
| String _plus = (result + _name); |
| String _plus_1 = (_plus + " "); |
| result = _plus_1; |
| } |
| return result; |
| } |
| } |