-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial code cleanup, Quarkus 3.15 LTS, fixed versions, Dev UI (#57)
* Initial code cleanup, Quarkus 3.15 LTS, fixed versions, Dev UI * Update deployment/src/main/java/io/quarkiverse/jasperreports/deployment/devui/JasperReportsDevUIProcessor.java Co-authored-by: George Gastaldi <[email protected]> --------- Co-authored-by: George Gastaldi <[email protected]>
- Loading branch information
Showing
18 changed files
with
691 additions
and
323 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,79 @@ | ||
# Quarkus Jasperreports | ||
<div align="center"> | ||
<img src="https://github.com/quarkiverse/quarkus-jasperreports/blob/main/docs/modules/ROOT/assets/images/quarkus.svg" width="67" height="70" ><img src="https://github.com/quarkiverse/quarkus-jasperreports/blob/main/docs/modules/ROOT/assets/images/plus-sign.svg" height="70" ><img src="https://github.com/quarkiverse/quarkus-jasperreports/blob/main/docs/modules/ROOT/assets/images/jasperreports.svg" height="70" > | ||
|
||
# Quarkus JasperReports | ||
</div> | ||
<br> | ||
|
||
[![Version](https://img.shields.io/maven-central/v/io.quarkiverse.jasperreports/quarkus-jasperreports?logo=apache-maven&style=flat-square)](https://search.maven.org/artifact/io.quarkiverse.jasperreports/quarkus-jasperreports) | ||
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) | ||
[![Build](https://github.com/quarkiverse/quarkus-jasperreports/actions/workflows/build.yml/badge.svg)](https://github.com/quarkiverse/quarkus-jasperreports/actions/workflows/build.yml) | ||
|
||
A Quarkus extension that lets you utilize [JasperReports](https://community.jaspersoft.com/download-jaspersoft/community-edition/). JasperReports is an open source Java reporting tool that can write to a variety of targets, such as: screen, a printer, into PDF, HTML, Microsoft Excel, RTF, ODT, comma-separated values (CSV), XSL, or XML files. | ||
|
||
## Getting started | ||
|
||
Read the full [JasperReports documentation](https://docs.quarkiverse.io/quarkus-jasperreports/dev/index.html). | ||
|
||
### Installation | ||
|
||
Create a new JasperReports project (with a base jasperreports starter code): | ||
|
||
- With [code.quarkus.io](https://code.quarkus.io/?a=jasperreports-bowl&j=17&e=io.quarkiverse.jasperreports%3Aquarkus-jasperreports) | ||
- With the [Quarkus CLI](https://quarkus.io/guides/cli-tooling): | ||
|
||
```bash | ||
quarkus create app jasperreports-app -x=io.quarkiverse.jasperreports:quarkus-jasperreports | ||
``` | ||
Or add to you pom.xml directly: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>io.quarkiverse.jasperreports</groupId> | ||
<artifactId>quarkus-jasperreports</artifactId> | ||
<version>{project-version}</version> | ||
</dependency> | ||
``` | ||
|
||
## Welcome to Quarkiverse! | ||
## Docker | ||
|
||
Congratulations and thank you for creating a new Quarkus extension project in Quarkiverse! | ||
When building native images in Docker using the standard Quarkus Docker configuration files some additional features need to be installed to support fonts. Specifically font information is not included in [Red Hat's ubi-minimal images](https://developers.redhat.com/products/rhel/ubi). To install it | ||
simply add these lines to your `DockerFile.native` file: | ||
|
||
Feel free to replace this content with the proper description of your new project and necessary instructions how to use and contribute to it. | ||
```shell | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 | ||
|
||
You can find the basic info, Quarkiverse policies and conventions in [the Quarkiverse wiki](https://github.com/quarkiverse/quarkiverse/wiki). | ||
######################### Set up environment for POI ############################# | ||
RUN microdnf update && microdnf install freetype fontconfig && microdnf clean all | ||
######################### Set up environment for POI ############################# | ||
|
||
In case you are creating a Quarkus extension project for the first time, please follow [Building My First Extension](https://quarkus.io/guides/building-my-first-extension) guide. | ||
WORKDIR /work/ | ||
RUN chown 1001 /work \ | ||
&& chmod "g+rwX" /work \ | ||
&& chown 1001:root /work | ||
# Shared objects to be dynamically loaded at runtime as needed, | ||
COPY --chown=1001:root target/*.properties target/*.so /work/ | ||
COPY --chown=1001:root target/*-runner /work/application | ||
# Permissions fix for Windows | ||
RUN chmod "ugo+x" /work/application | ||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
Other useful articles related to Quarkus extension development can be found under the [Writing Extensions](https://quarkus.io/guides/#writing-extensions) guide category on the [Quarkus.io](https://quarkus.io) website. | ||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] | ||
``` | ||
|
||
Thanks again, good luck and have fun! | ||
> [!CAUTION] | ||
> Make sure `.dockerignore` does not exclude `.so` files! | ||
## Documentation | ||
## 🧑💻 Contributing | ||
|
||
The documentation for this extension should be maintained as part of this repository and it is stored in the `docs/` directory. | ||
- Contribution is the best way to support and get involved in community! | ||
- Please, consult our [Code of Conduct](./CODE_OF_CONDUCT.md) policies for interacting in our community. | ||
- Contributions to `quarkus-jasperreports` Please check our [CONTRIBUTING.md](./CONTRIBUTING.md) | ||
|
||
The layout should follow the [Antora's Standard File and Directory Set](https://docs.antora.org/antora/2.3/standard-directories/). | ||
### If you have any idea or question 🤷 | ||
|
||
Once the docs are ready to be published, please open a PR including this repository in the [Quarkiverse Docs Antora playbook](https://github.com/quarkiverse/quarkiverse-docs/blob/main/antora-playbook.yml#L7). See an example [here](https://github.com/quarkiverse/quarkiverse-docs/pull/1). | ||
- [Ask a question](https://github.com/quarkiverse/quarkus-jasperreports/discussions) | ||
- [Raise an issue](https://github.com/quarkiverse/quarkus-jasperreports/issues) | ||
- [Feature request](https://github.com/quarkiverse/quarkus-jasperreports/issues) | ||
- [Code submission](https://github.com/quarkiverse/quarkus-jasperreports/pulls) |
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 |
---|---|---|
@@ -1,48 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.jasperreports</groupId> | ||
<artifactId>quarkus-jasperreports-parent</artifactId> | ||
<version>lütter-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>quarkus-jasperreports-deployment</artifactId> | ||
<name>Quarkus Jasperreports - Deployment</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${version.quarkus}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.jasperreports</groupId> | ||
<artifactId>quarkus-jasperreports-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>quarkus-jasperreports-deployment</artifactId> | ||
<name>Quarkus JasperReports - Deployment</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jackson-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-vertx-http-dev-ui-spi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.jasperreports</groupId> | ||
<artifactId>quarkus-jasperreports</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jackson-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.jasperreports</groupId> | ||
<artifactId>quarkus-jasperreports</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${version.quarkus}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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
29 changes: 29 additions & 0 deletions
29
.../main/java/io/quarkiverse/jasperreports/deployment/devui/JasperReportsDevUIProcessor.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,29 @@ | ||
package io.quarkiverse.jasperreports.deployment.devui; | ||
|
||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.ExternalPageBuilder; | ||
import io.quarkus.devui.spi.page.Page; | ||
import net.sf.jasperreports.engine.JasperReport; | ||
|
||
public class JasperReportsDevUIProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
void createVersion(BuildProducer<CardPageBuildItem> cardPageBuildItemBuildProducer) { | ||
final CardPageBuildItem card = new CardPageBuildItem(); | ||
|
||
final ExternalPageBuilder versionPage = Page.externalPageBuilder("JasperReports Version") | ||
.icon("font-awesome-regular:tag") | ||
.url("https://community.jaspersoft.com/download-jaspersoft/community-edition/") | ||
.doNotEmbed() | ||
.staticLabel(JasperReport.class.getPackage().getSpecificationVersion()); | ||
|
||
card.addPage(versionPage); | ||
|
||
card.setCustomCard("qwc-jasperreports-card.js"); | ||
|
||
cardPageBuildItemBuildProducer.produce(card); | ||
} | ||
} |
Oops, something went wrong.