Search in sources :

Example 1 with Template

use of edu.harvard.iq.dataverse.Template in project dataverse by IQSS.

the class DeleteTemplateCommand method execute.

@Override
public Dataverse execute(CommandContext ctxt) throws CommandException {
    Dataverse merged = ctxt.em().merge(editedDv);
    if (!dvWDefaultTemplate.isEmpty()) {
        for (Dataverse remove : dvWDefaultTemplate) {
            remove.setDefaultTemplate(null);
            ctxt.em().merge(remove);
        }
    }
    Template doomedAndMerged = ctxt.em().merge(doomed);
    ctxt.em().remove(doomedAndMerged);
    return merged;
}
Also used : Dataverse(edu.harvard.iq.dataverse.Dataverse) Template(edu.harvard.iq.dataverse.Template)

Aggregations

Dataverse (edu.harvard.iq.dataverse.Dataverse)1 Template (edu.harvard.iq.dataverse.Template)1