use of org.eclipse.sw360.datahandler.thrift.licenses.LicenseType in project sw360portal by sw360.
the class LicenseDatabaseHandler method fillLicenseForOrganisation.
private void fillLicenseForOrganisation(String organisation, License license) {
if (license.isSetTodoDatabaseIds()) {
license.setTodos(getTodosByIds(license.todoDatabaseIds));
}
if (license.isSetTodos()) {
for (Todo todo : license.getTodos()) {
// remove other organisations from whitelist of todo
todo.setWhitelist(SW360Utils.filterBUSet(organisation, todo.whitelist));
if (todo.isSetObligationDatabaseIds()) {
todo.setObligations(getObligationsByIds(todo.obligationDatabaseIds));
}
}
}
if (license.isSetLicenseTypeDatabaseId()) {
final LicenseType licenseType = licenseTypeRepository.get(license.getLicenseTypeDatabaseId());
license.setLicenseType(licenseType);
}
if (license.isSetRiskDatabaseIds()) {
license.setRisks(getRisksByIds(license.riskDatabaseIds));
license.unsetRiskDatabaseIds();
}
license.setShortname(license.getId());
}
Aggregations