This commit is contained in:
CITE\spapacharalampous 2024-08-23 13:26:41 +03:00
parent fb38aa379e
commit 3621853807
1 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import gr.cite.tools.logging.DataLogEntry;
import gr.cite.tools.logging.LoggerService;
import org.opencdmp.authorization.AuthorizationFlags;
import org.opencdmp.commons.XmlHandlingService;
import org.opencdmp.commons.scope.tenant.TenantScope;
import org.opencdmp.commons.types.planstatus.PlanStatusDefinitionEntity;
import org.opencdmp.convention.ConventionService;
import org.opencdmp.data.PlanStatusEntity;
@ -24,14 +25,16 @@ import java.util.*;
public class PlanStatusBuilder extends BaseBuilder<PlanStatus, PlanStatusEntity> {
private final XmlHandlingService xmlHandlingService;
private final TenantScope tenantScope;
private final BuilderFactory builderFactory;
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
public PlanStatusBuilder(ConventionService conventionService, XmlHandlingService xmlHandlingService, BuilderFactory builderFactory) {
public PlanStatusBuilder(ConventionService conventionService, XmlHandlingService xmlHandlingService, TenantScope tenantScope, BuilderFactory builderFactory) {
super(conventionService, new LoggerService(LoggerFactory.getLogger(PlanStatusDefinitionAuthorizationItemBuilder.class)));
this.xmlHandlingService = xmlHandlingService;
this.tenantScope = tenantScope;
this.builderFactory = builderFactory;
}
@ -69,6 +72,8 @@ public class PlanStatusBuilder extends BaseBuilder<PlanStatus, PlanStatusEntity>
m.setInternalStatus(d.getInternalStatus());
if (fields.hasField(this.asIndexer(PlanStatus._hash)))
m.setHash(this.hashValue(d.getUpdatedAt()));
if (fields.hasField(this.asIndexer(PlanStatus._belongsToCurrentTenant)))
m.setBelongsToCurrentTenant(this.getBelongsToCurrentTenant(d, this.tenantScope));
if (!definitionFields.isEmpty() && d.getDefinition() != null) {
PlanStatusDefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(PlanStatusDefinitionEntity.class, d.getDefinition());