-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added the ability to select a BaselineCollection for bulk export
Refs: #285
- Loading branch information
1 parent
9519d7b
commit 9feeed2
Showing
16 changed files
with
299 additions
and
86 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
19 changes: 19 additions & 0 deletions
19
.../java/ch/sbb/polarion/extension/pdf_exporter/rest/controller/CollectionApiController.java
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ch.sbb.polarion.extension.pdf_exporter.rest.controller; | ||
|
||
import ch.sbb.polarion.extension.generic.rest.filter.Secured; | ||
import ch.sbb.polarion.extension.generic.service.PolarionService; | ||
import ch.sbb.polarion.extension.pdf_exporter.rest.model.collections.CollectionItem; | ||
|
||
import javax.ws.rs.Path; | ||
import java.util.List; | ||
|
||
@Secured | ||
@Path("/api") | ||
public class CollectionApiController extends CollectionInternalController { | ||
private static final PolarionService polarionService = new PolarionService(); | ||
|
||
@Override | ||
public List<CollectionItem> getCollectionItems(String projectId, String collectionId) { | ||
return polarionService.callPrivileged(() -> super.getCollectionItems(projectId, collectionId)); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../ch/sbb/polarion/extension/pdf_exporter/rest/controller/CollectionInternalController.java
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package ch.sbb.polarion.extension.pdf_exporter.rest.controller; | ||
|
||
|
||
import ch.sbb.polarion.extension.pdf_exporter.rest.model.collections.CollectionItem; | ||
import ch.sbb.polarion.extension.pdf_exporter.service.PdfExporterPolarionService; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import java.util.List; | ||
|
||
@Hidden | ||
@Path("/internal") | ||
@Tag(name = "Collections") | ||
public class CollectionInternalController { | ||
private final PdfExporterPolarionService pdfExporterPolarionService; | ||
|
||
public CollectionInternalController() { | ||
pdfExporterPolarionService = new PdfExporterPolarionService(); | ||
} | ||
|
||
@GET | ||
@Path("/projects/{projectId}/collections/{collectionId}") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Operation(summary = "Get items from collection", | ||
responses = { | ||
@ApiResponse(responseCode = "200", | ||
description = "List of collection item", | ||
content = @Content(schema = @Schema(implementation = CollectionItem.class)) | ||
) | ||
} | ||
) | ||
public List<CollectionItem> getCollectionItems(@Parameter(description = "Project ID", required = true) @PathParam("projectId") String projectId, | ||
@Parameter(description = "Collection ID", required = true) @PathParam("collectionId") String collectionId) { | ||
return pdfExporterPolarionService.getCollectionItems(projectId, collectionId); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...in/java/ch/sbb/polarion/extension/pdf_exporter/rest/model/collections/CollectionItem.java
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ch.sbb.polarion.extension.pdf_exporter.rest.model.collections; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Schema(description = "Details about the collection item") | ||
public class CollectionItem { | ||
@Schema(description = "The name of the module with spaces") | ||
private String moduleNameWithSpace; | ||
|
||
@Schema(description = "The revision of the module") | ||
private String revision; | ||
} |
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
Oops, something went wrong.