package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel;

import eu.eudat.data.entities.DMPProfile;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
import java.util.UUID;

@XmlRootElement(name = "root")
public class DmpProfile {

    private DmpProfileDefinition dmpProfileDefinition;

    @XmlElement(name = "definition")
    public DmpProfileDefinition getDmpProfileDefinition() {
        return dmpProfileDefinition;
    }

    public void setDmpProfileDefinition(DmpProfileDefinition dmpProfileDefinition) {
        this.dmpProfileDefinition = dmpProfileDefinition;
    }

    public eu.eudat.models.data.listingmodels.DataManagementPlanProfileListingModel toDmpProfileCompositeModel(String label) {
        eu.eudat.models.data.listingmodels.DataManagementPlanProfileListingModel dmpProfileModel = new eu.eudat.models.data.listingmodels.DataManagementPlanProfileListingModel();
        dmpProfileModel.setLabel(label);
        dmpProfileModel.setStatus(DMPProfile.Status.SAVED.getValue());
        dmpProfileModel.setCreated(new Date());
        dmpProfileModel.setModified(new Date());
        dmpProfileModel.setDefinition(this.dmpProfileDefinition.toDmpProfileCompositeModel());
        return dmpProfileModel;
    }
}
