Search in sources :

Example 1 with LinkedReleaseRenderer

use of org.eclipse.sw360.portal.tags.urlutils.LinkedReleaseRenderer in project sw360portal by sw360.

the class DisplayProjectChanges method renderReleaseIdToUsage.

private void renderReleaseIdToUsage(StringBuilder display, User user) {
    if (ensureSomethingTodoAndNoNullReleaseIdUsage()) {
        Set<String> changedReleaseIds = Sets.intersection(additions.getReleaseIdToUsage().keySet(), deletions.getReleaseIdToUsage().keySet());
        changedReleaseIds = Sets.intersection(changedReleaseIds, // remove projects already deleted in database
        actual.getReleaseIdToUsage().keySet());
        Set<String> removedReleaseIds = Sets.difference(deletions.getReleaseIdToUsage().keySet(), changedReleaseIds);
        removedReleaseIds = Sets.intersection(removedReleaseIds, actual.getReleaseIdToUsage().keySet());
        Set<String> addedReleaseIds = Sets.difference(additions.getReleaseIdToUsage().keySet(), changedReleaseIds);
        LinkedReleaseRenderer renderer = new LinkedReleaseRenderer(display, tableClasses, idPrefix, user);
        renderer.renderReleaseLinkList(display, deletions.getReleaseIdToUsage(), removedReleaseIds, "Removed Release Links");
        renderer.renderReleaseLinkList(display, additions.getReleaseIdToUsage(), addedReleaseIds, "Added Release Links");
        renderer.renderReleaseLinkListCompare(display, actual.getReleaseIdToUsage(), deletions.getReleaseIdToUsage(), additions.getReleaseIdToUsage(), changedReleaseIds);
    }
}
Also used : LinkedReleaseRenderer(org.eclipse.sw360.portal.tags.urlutils.LinkedReleaseRenderer)

Example 2 with LinkedReleaseRenderer

use of org.eclipse.sw360.portal.tags.urlutils.LinkedReleaseRenderer in project sw360portal by sw360.

the class DisplayReleaseChanges method renderReleaseIdToRelationship.

private void renderReleaseIdToRelationship(StringBuilder display, User user) {
    if (ensureSomethingTodoAndNoNull(Release._Fields.RELEASE_ID_TO_RELATIONSHIP)) {
        Set<String> changedReleaseIds = Sets.intersection(additions.getReleaseIdToRelationship().keySet(), deletions.getReleaseIdToRelationship().keySet());
        Set<String> releaseIdsInDb = nullToEmptyMap(actual.getReleaseIdToRelationship()).keySet();
        // keep only releases that are still in the database
        changedReleaseIds = Sets.intersection(changedReleaseIds, releaseIdsInDb);
        Set<String> removedReleaseIds = Sets.difference(deletions.getReleaseIdToRelationship().keySet(), changedReleaseIds);
        removedReleaseIds = Sets.intersection(removedReleaseIds, releaseIdsInDb);
        Set<String> addedReleaseIds = Sets.difference(additions.getReleaseIdToRelationship().keySet(), changedReleaseIds);
        display.append("<h3> Changes in linked releases </h3>");
        LinkedReleaseRenderer renderer = new LinkedReleaseRenderer(display, tableClasses, idPrefix, user);
        renderer.renderReleaseLinkList(display, deletions.getReleaseIdToRelationship(), removedReleaseIds, "Removed Release Links");
        renderer.renderReleaseLinkList(display, additions.getReleaseIdToRelationship(), addedReleaseIds, "Added Release Links");
        renderer.renderReleaseLinkListCompare(display, actual.getReleaseIdToRelationship(), deletions.getReleaseIdToRelationship(), additions.getReleaseIdToRelationship(), changedReleaseIds);
    }
}
Also used : LinkedReleaseRenderer(org.eclipse.sw360.portal.tags.urlutils.LinkedReleaseRenderer)

Aggregations

LinkedReleaseRenderer (org.eclipse.sw360.portal.tags.urlutils.LinkedReleaseRenderer)2