stable

Clone or download

Read-only

Have an endpoint for CSV export

Part of story #12345 export results to csv In contradiction to the acceptance criteria of this story, we must provide a second route. Since the returned Artifact representations are fixed in the regular cross-tracker REST route and since they do not use duck-typing at all, it is necessary to offer another endpoint. We made the choice not to use Restler because that would mean enabling CSV representations for ALL REST routes, which is not desirable (and apparently also broken). Thus, this introduces a FrontRouter-enabled endpoint to retrieve paginated CSV. The route is still paginated to avoid performance problems and DOS. How to test: - Browse to /plugins/crosstracker/csv_export/<report_id>?limit=50&offset=0 - The browser should offer to download a CSV file with "id" as header and the list of artifact id of the given Cross-tracker report. - When you omit limit / offset, you should get a 400 error. - When you set limit > 50, you should get a 400 error (Same limit as the REST route). - When you don't have permission to view the project of the associated widget or when you don't have permission to view a project used in the query, then you should get a 403 error. - When the project can't be found, you should get a 404 error. Will be done later: - CSV Export button that takes pagination into account - CSV Export of other "Always-there" fields Change-Id: I9d33010cb1f5683dff2d649bc45f21af67cd3f08

Modified Files

Name
R plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerArtifactRepresentationFactory.php Go to diff View file
M plugins/crosstracker/include/CrossTracker/CrossTrackerReportFactory.php +6 −1 Go to diff View file
M plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerReportsResource.php +1 −0 Go to diff View file
A plugins/crosstracker/include/CrossTracker/Report/CSV/BadRequestException.php +25 −0 Go to diff View file
A plugins/crosstracker/include/CrossTracker/Report/CSV/CSVExportController.php +238 −0 Go to diff View file
A plugins/crosstracker/include/CrossTracker/Report/CSV/CSVRepresentation.php +52 −0 Go to diff View file
A plugins/crosstracker/include/CrossTracker/Report/CSV/PaginatedCollectionOfCSVRepresentations.php +71 −0 Go to diff View file
M plugins/crosstracker/include/autoload.php +7 −3 Go to diff View file
M plugins/crosstracker/include/crosstrackerPlugin.class.php +290 −0 Go to diff View file
M plugins/crosstracker/site-content/fr_FR/LC_MESSAGES/tuleap-crosstracker.po +27 −1 Go to diff View file
M plugins/crosstracker/site-content/tuleap-crosstracker.pot +24 −0 Go to diff View file