use of org.eclipse.sw360.datahandler.db.ReleaseRepository in project sw360portal by sw360.
the class ComponentSummary method makeExportSummary.
private Component makeExportSummary(Component document, List<Release> releases) {
if (releaseRepository == null) {
throw new IllegalStateException("Cannot make export summary without database connection!");
}
Component copy = new Component();
copyField(document, copy, Component._Fields.ID);
copyField(document, copy, Component._Fields.NAME);
copyField(document, copy, Component._Fields.LANGUAGES);
copyField(document, copy, Component._Fields.OPERATING_SYSTEMS);
copyField(document, copy, Component._Fields.SOFTWARE_PLATFORMS);
copyField(document, copy, Component._Fields.CREATED_BY);
copyField(document, copy, Component._Fields.CREATED_ON);
copyField(document, copy, Component._Fields.VENDOR_NAMES);
for (Release release : releases) {
Release exportRelease = new Release();
copyField(release, exportRelease, Release._Fields.NAME);
copyField(release, exportRelease, Release._Fields.VERSION);
exportRelease.setComponentId("");
copy.addToReleases(exportRelease);
}
return copy;
}
use of org.eclipse.sw360.datahandler.db.ReleaseRepository in project sw360portal by sw360.
the class LicenseDatabaseHandler method checkIfInUse.
public boolean checkIfInUse(String licenseId) {
ReleaseRepository releaseRepository = new ReleaseRepository(db, new VendorRepository(db));
final List<Release> usingReleases = releaseRepository.searchReleasesByUsingLicenseId(licenseId);
return !usingReleases.isEmpty();
}
Aggregations