Im/Exporter for ContentSections

Jens Pelzetter 2020-12-03 20:26:50 +01:00
parent 6313ef9ab2
commit f9e8311694
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.librecms.contentsection;
import org.libreccm.imexport.AbstractEntityImExporter;
import org.libreccm.imexport.Exportable;
import org.libreccm.imexport.Processes;
import java.util.Collections;
import java.util.Set;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.transaction.Transactional;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
@Processes(ContentSection.class)
public class ContentSectionImExporter
extends AbstractEntityImExporter<ContentSection> {
@Inject
private ContentSectionRepository sectionRepository;
@Override
protected Class<ContentSection> getEntityClass() {
return ContentSection.class;
}
@Override
protected Set<Class<? extends Exportable>> getRequiredEntities() {
return Collections.emptySet();
}
@Override
@Transactional(Transactional.TxType.REQUIRED)
protected void saveImportedEntity(final ContentSection entity) {
sectionRepository.save(entity);
}
}