-
Notifications
You must be signed in to change notification settings - Fork 1
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
provide a default repository implementation #114
provide a default repository implementation #114
Conversation
import net.sf.jasperreports.repo.SimpleRepositoryContext; | ||
import net.sf.jasperreports.repo.StreamRepositoryService; | ||
|
||
@Dependent |
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.
Should this be ApplicationScoped?
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.
I was thinking that we might leak things from one report invocation to the next, so explicitly making it @Dependent
would help isolate it. I could be totally misunderstanding things too, and if we find that nothing is shared between invocations then @ApplicationScoped
seems correct in that case.
@@ -0,0 +1,17 @@ | |||
package io.quarkiverse.jasperreports; | |||
|
|||
public interface Constants { |
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.
Hmm don't love generic Constants class let me see what other extensions do
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.
Yeah, me either. I would love to have a better pattern here.
deployment/src/main/java/io/quarkiverse/jasperreports/deployment/RepositoryProcessor.java
Outdated
Show resolved
Hide resolved
deployment/src/main/java/io/quarkiverse/jasperreports/deployment/RepositoryProcessor.java
Outdated
Show resolved
Hide resolved
runtime/src/main/java/io/quarkiverse/jasperreports/repository/DefaultReadOnlyRepository.java
Outdated
Show resolved
Hide resolved
|
||
// TODO - why is it not picking up the default value from ReportConfig??? | ||
@ConfigProperty(name = "quarkus.jasperreports.build.destination", defaultValue = Constants.DEFAULT_DEST_PATH) | ||
Optional<Path> reportPathConfig; |
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.
You had this as Optional String not path above. It might be that it's a Path?
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.
I went several rounds with this, using String
, using Path
, changing the config to use a converter, changing the config to use an Optional
with a converter, using a default
method that set the value... No matter what, I still ended up with null
for the value at this point, so I logged #115 and kind of punted by adding the defaultValue
here. 😞
deployment/src/main/java/io/quarkiverse/jasperreports/deployment/RepositoryProcessor.java
Outdated
Show resolved
Hide resolved
* centralized some constants into a runtime class that can be used in multiple places * added a default read-only repository that can load a report file and any of it's subreports * added a build step to produce the default repository bean * updated the tests (except the JSON data source tests) to use the repository instead of doing the loading themselves * added a blurb in the docs about using the repository Signed-off-by:Nathan Erwin <[email protected]>
c78c086
to
9c9128c
Compare
Signed-off-by:Nathan Erwin [email protected]