use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class RoleExportBulkAction method exportRoleCatalogs.
/**
* Export role-catalogs for given role.
*
* @param role
*/
private void exportRoleCatalogs(IdmRoleDto role) {
IdmRoleCatalogueRoleFilter filter = new IdmRoleCatalogueRoleFilter();
filter.setRoleId(role.getId());
List<IdmRoleCatalogueRoleDto> dtos = roleCatalogueRoleService.find(filter, null).getContent();
if (dtos.isEmpty()) {
roleCatalogueRoleService.export(ExportManager.BLANK_UUID, this.getBatch());
}
dtos.forEach(dto -> {
roleCatalogueRoleService.export(dto.getId(), this.getBatch());
});
// Set parent field -> set authoritative mode.
this.getExportManager().setAuthoritativeMode(IdmRoleCatalogueRole_.role.getName(), "roleId", IdmRoleCatalogueRoleDto.class, this.getBatch());
List<ExportDescriptorDto> exportOrder = getBatch().getExportOrder();
// Order can be wrong now! Catalog descriptor must be first (then role-catalogue-role)!
ExportDescriptorDto roleCatalogDescriptor = this.getExportManager().getDescriptor(getBatch(), IdmRoleCatalogueRoleDto.class);
ExportDescriptorDto catalogDescriptor = this.getExportManager().getDescriptor(getBatch(), IdmRoleCatalogueDto.class);
if (roleCatalogDescriptor != null && catalogDescriptor != null) {
int roleCatalogueIndex = exportOrder.indexOf(roleCatalogDescriptor);
int catalogueIndex = exportOrder.indexOf(catalogDescriptor);
if (roleCatalogueIndex < catalogueIndex) {
exportOrder.set(catalogueIndex, roleCatalogDescriptor);
exportOrder.set(roleCatalogueIndex, catalogDescriptor);
}
}
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmRoleGuaranteeService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
super.export(id, batch);
// Advanced pairing
ExportDescriptorDto descriptorDto = getExportManager().getDescriptor(batch, this.getDtoClass());
descriptorDto.getAdvancedParingFields().add(IdmRoleGuarantee_.guarantee.getName());
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmRoleCatalogueService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Batch cannot be null!");
// We need to export all catalog items (direct to the root)
IdmRoleCatalogueDto catalog = this.get(id);
if (catalog != null) {
UUID parent = catalog.getParent();
if (parent != null) {
this.export(parent, batch);
}
}
super.export(id, batch);
// Authoritative mode is not set here only parent field could be sets.
ExportDescriptorDto descriptor = getExportManager().getDescriptor(batch, IdmRoleCatalogueDto.class);
if (descriptor != null) {
descriptor.getParentFields().add(IdmRoleCatalogue_.parent.getName());
}
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmIncompatibleRoleService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
// Export break-recipient
super.export(id, batch);
// Advanced pairing
ExportDescriptorDto descriptorDto = getExportManager().getDescriptor(batch, this.getDtoClass());
descriptorDto.getAdvancedParingFields().add(IdmIncompatibleRole_.sub.getName());
descriptorDto.getAdvancedParingFields().add(IdmIncompatibleRole_.superior.getName());
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmRoleCompositionService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
// Export break-recipient
super.export(id, batch);
// Advanced pairing
ExportDescriptorDto descriptorDto = getExportManager().getDescriptor(batch, this.getDtoClass());
descriptorDto.getAdvancedParingFields().add(IdmRoleComposition_.sub.getName());
descriptorDto.getAdvancedParingFields().add(IdmRoleComposition_.superior.getName());
}
Aggregations