-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(obligation): endpoint to list license obligations from license db. #2276
Conversation
1b49027
to
699a910
Compare
Testing this PR |
Test Successful. |
f34f4f8
to
b858ae3
Compare
@@ -19,6 +19,7 @@ | |||
import com.google.common.collect.ImmutableMap; | |||
import com.google.common.collect.ImmutableSet; | |||
import com.google.common.collect.Lists; | |||
import com.google.common.collect.Maps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
@@ -49,6 +50,7 @@ | |||
import org.eclipse.sw360.datahandler.resourcelists.PaginationResult; | |||
import org.eclipse.sw360.datahandler.resourcelists.ResourceClassNotFoundException; | |||
import org.eclipse.sw360.datahandler.thrift.MainlineState; | |||
import org.eclipse.sw360.datahandler.thrift.ObligationStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
@@ -72,6 +74,8 @@ | |||
import org.eclipse.sw360.datahandler.thrift.licenseinfo.OutputFormatInfo; | |||
import org.eclipse.sw360.datahandler.thrift.licenseinfo.OutputFormatVariant; | |||
import org.eclipse.sw360.datahandler.thrift.licenses.License; | |||
import org.eclipse.sw360.datahandler.thrift.projects.ObligationList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
tags = {"Project"} | ||
) | ||
@RequestMapping(value = PROJECTS_URL + "/{id}/licenseDbObligations", method = RequestMethod.GET) | ||
public ResponseEntity<?> getLicObligations(@RequestParam(defaultValue = "0") int page, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Pageable instead of page and size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried with Pageable but finding some challenges, therefore switched to page and size for time being.
import org.eclipse.sw360.datahandler.thrift.components.Release; | ||
import org.eclipse.sw360.datahandler.thrift.components.ReleaseClearingStatusData; | ||
import org.eclipse.sw360.datahandler.thrift.components.ReleaseLink; | ||
import org.eclipse.sw360.datahandler.thrift.licenseinfo.LicenseInfoParsingResult; | ||
import org.eclipse.sw360.datahandler.thrift.licenseinfo.LicenseInfoService; | ||
import org.eclipse.sw360.datahandler.thrift.licenseinfo.LicenseObligationsStatusInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
import org.eclipse.sw360.datahandler.thrift.projects.Project; | ||
import org.eclipse.sw360.datahandler.thrift.projects.ProjectClearingState; | ||
import org.eclipse.sw360.datahandler.thrift.projects.ProjectData; | ||
import org.eclipse.sw360.datahandler.thrift.projects.ProjectLink; | ||
import org.eclipse.sw360.datahandler.common.ThriftEnumUtils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
import javax.annotation.PreDestroy; | ||
|
||
import java.io.IOException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
@@ -57,14 +70,22 @@ | |||
import org.springframework.security.access.AccessDeniedException; | |||
import org.springframework.stereotype.Service; | |||
|
|||
import com.google.common.collect.Lists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
@@ -57,14 +70,22 @@ | |||
import org.springframework.security.access.AccessDeniedException; | |||
import org.springframework.stereotype.Service; | |||
|
|||
import com.google.common.collect.Lists; | |||
import com.google.common.collect.Maps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
@@ -134,6 +157,183 @@ public String getCyclicLinkedProjectPath(Project project, User user) throws TExc | |||
return cyclicLinkedProjectPath; | |||
} | |||
|
|||
public Map<String, Set<Release>> getLicensesFromAttachmentUsage( | |||
Map<String, AttachmentUsage> licenseInfoAttachmentUsage, | |||
Map<String, ProjectReleaseRelationship> releaseIdToUsage, User user) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused param releaseIdToUsage
b858ae3
to
68426de
Compare
Signed-off-by: Rudra Chopra <prabhuchopra@gmail.com>
68426de
to
5fcb353
Compare
Review comments addressed. |
Code look good to me |
Issue: Closes #2275
Description: get license obligations for the project from license database.
Steps to test: