-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CSV exports IsIndexed implementations
- Loading branch information
1 parent
e2e5845
commit 43603eb
Showing
17 changed files
with
184 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,25 @@ | |
import org.roda.core.data.v2.jobs.IndexedReport; | ||
import org.roda.core.model.utils.UserUtility; | ||
import org.roda.wui.api.v2.services.IndexService; | ||
import org.roda.wui.api.v2.utils.ApiUtils; | ||
import org.roda.wui.client.services.JobReportRestService; | ||
import org.roda.wui.common.model.RequestContext; | ||
import org.roda.wui.common.utils.RequestUtils; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
|
||
/** | ||
* @author António Lindo <[email protected]> | ||
*/ | ||
@RestController | ||
@RequestMapping(path = "/api/v2/job-reports") | ||
public class JobReportController implements JobReportRestService { | ||
public class JobReportController implements JobReportRestService, Exportable { | ||
@Autowired | ||
private HttpServletRequest request; | ||
|
||
|
@@ -62,4 +64,12 @@ public List<String> suggest(SuggestRequest suggestRequest) { | |
RequestContext requestContext = RequestUtils.parseHTTPRequest(request); | ||
return indexService.suggest(suggestRequest, IndexedReport.class, requestContext); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<StreamingResponseBody> exportToCSV(String findRequestString) { | ||
RequestContext requestContext = RequestUtils.parseHTTPRequest(request); | ||
// delegate | ||
return ApiUtils.okResponse( | ||
indexService.exportToCSV(requestContext.getUser(), findRequestString, IndexedReport.class, requestContext)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.