From 742faa3f9f71de4509f08c33b2cac16ba4a59f62 Mon Sep 17 00:00:00 2001 From: Tamas Cserhati Date: Mon, 3 Jun 2024 22:52:00 +0200 Subject: [PATCH 1/4] #74 dookug 2.7.0 update --- docs/install.adoc | 8 + docs/release-notes/v1.0.0.adoc | 12 + .../IOExceptionBaseExceptionWrapper.java | 2 +- .../IDocumentContentInternalRest.java | 2 +- .../IDocumentGenerateInlineInternalRest.java | 2 +- ...entGenerateStoredTemplateInternalRest.java | 2 +- .../IDocumentStoredTemplateInternalRest.java | 2 +- dookug-bom/dookug-bom-all-coffee20/pom.xml | 164 ---------- dookug-bom/dookug-bom-all-jee10/pom.xml | 10 +- dookug-bom/dookug-bom-all/pom.xml | 6 +- dookug-bom/dookug-bom-test/pom.xml | 6 +- .../dookug-bom-wf/dookug-bom-wf-27/pom.xml | 2 +- dookug-client/dookug-client-jee10/pom.xml | 2 +- .../rest/IDocumentContentInternalRest.java | 30 +- .../IDocumentGenerateInlineInternalRest.java | 95 +++++- ...entGenerateStoredTemplateInternalRest.java | 56 +++- .../IDocumentStoredTemplateInternalRest.java | 29 +- .../rest/IDocumentContentInternalRest.java | 30 +- .../IDocumentGenerateInlineInternalRest.java | 95 +++++- ...entGenerateStoredTemplateInternalRest.java | 56 +++- .../IDocumentStoredTemplateInternalRest.java | 29 +- .../jsonb/CustomJsonbContextResolver.java | 2 +- .../common/cdi/document/IDocumentStore.java | 2 +- .../cdi/template/IDocumentGenerator.java | 2 +- .../cdi/template/ITemplateCompiler.java | 2 +- .../common/cdi/template/ITemplateStore.java | 2 +- .../dookug/common/jpa/util/JpaUtil.java | 136 +++++++++ .../common/jpa/util/ReflectionUtils.java | 279 ++++++++++++++++++ .../pdfbox/signing/CMSPrivateKeyLoader.java | 2 +- .../pdfbox/signing/SignatureGenerator.java | 2 +- .../signing/SignatureProfileLoader.java | 2 +- .../rest/jsonb/CustomJsonbProvider.java | 43 --- .../dookug/common/rest/jsonb/JsonbUtil.java | 52 ---- .../rest/locale/ProjectMessageResolver.java | 2 +- .../provider/CustomJsonbContextResolver.java | 46 --- .../ProjectRestClientBuilderListener.java | 1 - .../system/rest/cache/AbstractCache.java | 2 +- .../rest/cache/CacheMetricsCollector.java | 2 +- .../common/system/rest/rest/ISystemRest.java | 2 +- .../common/system/rest/rest/SystemRest.java | 2 +- .../dookug/common/util/filename/FileUtil.java | 2 +- .../dookug-document-service/pom.xml | 3 +- .../action/BaseDocumentGenerateAction.java | 2 +- .../service/action/DocumentContentAction.java | 2 +- .../action/DocumentGenerateAction.java | 2 +- .../action/DocumentMetadataQueryAction.java | 2 +- .../StoredTemplateDocumentGenerateAction.java | 2 +- .../service/converter/DocumentConverter.java | 2 +- .../helper/DocumentPersisterHelper.java | 2 +- .../rest/DocumentContentInternalRest.java | 2 +- .../DocumentGenerateInlineInternalRest.java | 2 +- ...entGenerateStoredTemplateInternalRest.java | 2 +- .../DocumentStoredTemplateInternalRest.java | 2 +- .../service/DocumentContentService.java | 2 +- .../service/service/DocumentQueryService.java | 2 +- .../service/TemplatePartContentService.java | 2 +- .../service/service/TemplatePartService.java | 2 +- .../service/service/TemplateService.java | 2 +- .../service/TemplateTemplatePartService.java | 2 +- .../storage/DatabaseDocumentStore.java | 2 +- .../storage/DatabaseTemplateStore.java | 2 +- .../dookug-engine-handlebars/pom.xml | 5 - .../handlebars/EscapingStrategyFactory.java | 2 +- .../HandlebarsTemplateCompiler.java | 2 +- .../engine/handlebars/HelperRegister.java | 2 +- .../pdfbox/PdfBoxDocumentGenerator.java | 2 +- dookug-engine/dookug-engine-saxon/pom.xml | 4 +- .../engine/saxon/SaxonDocumentGenerator.java | 2 +- dookug-model/pom.xml | 2 +- dookug-testsuite/dookug-ts-bom/pom.xml | 13 +- dookug-testsuite/dookug-ts-client/pom.xml | 14 + .../dookug-ts-common-base/pom.xml | 25 ++ .../icellmobilsoft/dookug/ts/base/BaseIT.java | 29 +- .../src/main/resources/META-INF/beans.xml | 8 + .../dookug-ts-common-rest/pom.xml | 12 +- .../rest/AbstractGenerateDocumentIT.java | 7 +- dookug-testsuite/dookug-ts-common/pom.xml | 1 + .../document/rest/GetDocumentContentIT.java | 2 +- .../rest/PostInlineInvalidInputIT.java | 6 +- ...PostDocumentGenerateInlineMultipartIT.java | 2 +- .../PostStoredTemplateDocumentGenerateIT.java | 5 +- ...erateInlineHandlebarsOnlyEntityBodyIT.java | 6 +- ...nerateInlineHandlebarsOnlyMultipartIT.java | 6 +- ...mentGenerateInlineMultipartMetadataIT.java | 2 +- .../metadata/PostDocumentMetadataQueryIT.java | 6 +- ...redTemplateDocumentGenerateMetadataIT.java | 12 +- ...tInlinePdfboxHtmlTemplateCustomFontIT.java | 3 +- .../PostInlinePdfboxHtmlTemplateIT.java | 2 +- .../PostInlineSaxonXsltPdfTemplateIT.java | 62 ++-- pom.xml | 4 +- 90 files changed, 1055 insertions(+), 459 deletions(-) delete mode 100644 dookug-bom/dookug-bom-all-coffee20/pom.xml create mode 100644 dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/JpaUtil.java create mode 100644 dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/ReflectionUtils.java delete mode 100644 dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/CustomJsonbProvider.java delete mode 100644 dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/JsonbUtil.java delete mode 100644 dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/CustomJsonbContextResolver.java create mode 100644 dookug-testsuite/dookug-ts-common/dookug-ts-common-base/pom.xml rename dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/FieldOnlyVisibilityStrategy.java => dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/java/hu/icellmobilsoft/dookug/ts/base/BaseIT.java (51%) create mode 100644 dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/resources/META-INF/beans.xml diff --git a/docs/install.adoc b/docs/install.adoc index d84c0b61..7e653be1 100644 --- a/docs/install.adoc +++ b/docs/install.adoc @@ -203,3 +203,11 @@ ifdef::generatedDoc[] include::../generated/dookug-api-dto-config.adoc[leveloffset=+1] endif::[] + + +=== Létrehozás és módosítás dátuma + +A coffee 2.7.0 verziója óta az adatábizba mentendő OffsetDateTime típusoknál a zóna most már beállítható a létrehozás és módosítás dátumánál. +Ezt a `COFFEE_MODEL_BASE_JAVA_TIME_TIMEZONE_ID` környezeti változóval lehet megtenni, melynek alapértelmezett értéke `UTC`, de beállítható bármi amit a java.time.ZoneId osztály `public static ZoneId of(String zoneId)` metódusa befogad paraméterben. + +Rossz érték esetén warn szintű hibaüzenet keletkezik, és a default értéket veszi alapu, ami `TimeZone.getDefault().toZoneId()` lesz. diff --git a/docs/release-notes/v1.0.0.adoc b/docs/release-notes/v1.0.0.adoc index e42d02b7..219f5439 100644 --- a/docs/release-notes/v1.0.0.adoc +++ b/docs/release-notes/v1.0.0.adoc @@ -7,3 +7,15 @@ * gitHub Workflows - java 17 upgrade * Bugfix: The `not` helper function has been fixed, it evaluated the `false` parameter incorrectly. * Handlebars version bump: 4.3.1 -> 4.4.0 +* coff:ee upgrade migráció: https://i-cell-mobilsoft-open-source.github.io/coffee/#_v2_5_0_v2_6_0[2.6.0 -> 2.7.0] + +NOTE: A coffee upgrade nem érinti a klienst, abban marad a 2.6.0 coffee . Ennek oka, hogy a 2.7.0-ra kellene felhúzni a projekten is a coffee-t, ami használja. + +IMPORTANT: A coffee upgrade miatt az interface-ek használatát ki kellett venni a klienseknél, mert az már a coffee 2.7.0 BaseException-t használja, és összeakadás lenne a kliensben emiatt. + +* Coffee 2.7.0 miatt bevezetésre került a COFFEE_MODEL_BASE_JAVA_TIME_TIMEZONE_ID környezeti változó, aminek az értéke alapként UTC. +* `dookug-model` esetén a `org.hibernate` groupId helyett `org.hibernate.orm` lett helyesebben. + +* Roaster upgrade migráció: https://i-cell-mobilsoft-open-source.github.io/roaster/#_2_1_0_2_2_0[2.1.0 -> 2.2.0] + +* tesztekben a BaseIT osztályban a coffee.model.base.java.time.timezone.id property beállításra kerül UTC-re. diff --git a/dookug-api/dookug-api-common/src/main/java/hu/icellmobilsoft/dookug/api/dto/exception/IOExceptionBaseExceptionWrapper.java b/dookug-api/dookug-api-common/src/main/java/hu/icellmobilsoft/dookug/api/dto/exception/IOExceptionBaseExceptionWrapper.java index dd8d5a67..2ff8bb45 100644 --- a/dookug-api/dookug-api-common/src/main/java/hu/icellmobilsoft/dookug/api/dto/exception/IOExceptionBaseExceptionWrapper.java +++ b/dookug-api/dookug-api-common/src/main/java/hu/icellmobilsoft/dookug/api/dto/exception/IOExceptionBaseExceptionWrapper.java @@ -21,8 +21,8 @@ import java.io.IOException; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BaseExceptionWrapper; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; /** * {@code IOException} csomagolása {@code BaseException} formára hogy a hibakezelés automatama lehessen diff --git a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentContentInternalRest.java b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentContentInternalRest.java index d12d167e..fe82f3cf 100644 --- a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentContentInternalRest.java +++ b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentContentInternalRest.java @@ -30,7 +30,7 @@ import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; import org.eclipse.microprofile.openapi.annotations.tags.Tag; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; diff --git a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateInlineInternalRest.java b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateInlineInternalRest.java index 6bae4e1a..5fa50eef 100644 --- a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateInlineInternalRest.java +++ b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateInlineInternalRest.java @@ -31,7 +31,7 @@ import org.jboss.resteasy.annotations.providers.multipart.MultipartForm; import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; diff --git a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateStoredTemplateInternalRest.java b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateStoredTemplateInternalRest.java index 9b00cd8e..97c1dd69 100644 --- a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateStoredTemplateInternalRest.java +++ b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentGenerateStoredTemplateInternalRest.java @@ -30,7 +30,7 @@ import org.eclipse.microprofile.openapi.annotations.tags.Tag; import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; diff --git a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentStoredTemplateInternalRest.java b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentStoredTemplateInternalRest.java index 9dd8c8d7..f45f8462 100644 --- a/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentStoredTemplateInternalRest.java +++ b/dookug-api/dookug-api-jee10/dookug-api-rest-jee10/src/main/java/hu/icellmobilsoft/dookug/api/rest/document/IDocumentStoredTemplateInternalRest.java @@ -29,7 +29,7 @@ import org.eclipse.microprofile.openapi.annotations.tags.Tag; import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.dto.constants.IOpenapiConstants; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; diff --git a/dookug-bom/dookug-bom-all-coffee20/pom.xml b/dookug-bom/dookug-bom-all-coffee20/pom.xml deleted file mode 100644 index 65467907..00000000 --- a/dookug-bom/dookug-bom-all-coffee20/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - 4.0.0 - - hu.icellmobilsoft.dookug - dookug-bom - 1.0.0-SNAPSHOT - - dookug-bom-all-coffee20 - pom - - - 2.0.0 - 4.1 - 0.8.0 - 2.10.0 - 1.10.0 - 4.3.0 - 1.0.10 - - 5.8.2 - - - - - - - hu.icellmobilsoft.dookug - dookug-bom-jee10 - ${project.version} - pom - import - - - hu.icellmobilsoft.dookug - dookug-bom-wf - ${project.version} - pom - import - - - hu.icellmobilsoft.dookug - dookug-bom-project - ${project.version} - pom - import - - - hu.icellmobilsoft.coffee - coffee-bom - ${version.hu.icellmobilsoft.coffee} - pom - import - - - hu.icellmobilsoft.dookug - dookug-bom-test - ${project.version} - pom - import - - - org.eclipse.microprofile - microprofile - ${version.org.eclipse.microprofile} - pom - import - - - - hu.icellmobilsoft.coffee - coffee-rest - ${version.hu.icellmobilsoft.coffee} - - - org.jboss.resteasy - resteasy-jaxrs - - - org.apache.httpcomponents - httpclient - - - org.apache.httpcomponents - httpcore - - - org.apache.httpcomponents - httpmime - - - - - hu.icellmobilsoft.coffee - coffee-jpa - ${version.hu.icellmobilsoft.coffee} - - - org.glassfish.jaxb - jaxb-runtime - - - - - hu.icellmobilsoft.coffee - coffee-tool - ${version.hu.icellmobilsoft.coffee} - - - org.glassfish.jaxb - jaxb-runtime - - - - - hu.icellmobilsoft.coffee - coffee-dto-base - ${version.hu.icellmobilsoft.coffee} - - - org.glassfish.jaxb - jaxb-runtime - - - - - - io.smallrye.config - smallrye-config-source-yaml - ${version.io.smallrye.config} - - - - - org.apache.commons - commons-text - ${version.org.apache.commons.commons-text} - - - - - com.github.jknack - handlebars - ${version.com.github.jknack.handlebars} - - - - com.openhtmltopdf - openhtmltopdf-pdfbox - ${version.com.openhtmltopdf.openhtmltopdf-pdfbox} - - - commons-logging - commons-logging - - - - - com.openhtmltopdf - openhtmltopdf-slf4j - ${version.com.openhtmltopdf.openhtmltopdf-pdfbox} - - - - diff --git a/dookug-bom/dookug-bom-all-jee10/pom.xml b/dookug-bom/dookug-bom-all-jee10/pom.xml index 4968206f..e0ce158d 100644 --- a/dookug-bom/dookug-bom-all-jee10/pom.xml +++ b/dookug-bom/dookug-bom-all-jee10/pom.xml @@ -24,7 +24,6 @@ 9.1.0.8 12.4 1.10.0 - @@ -51,6 +50,13 @@ pom import + + hu.icellmobilsoft.dookug + dookug-bom-test + ${project.version} + pom + import + org.eclipse.microprofile microprofile @@ -60,7 +66,7 @@ hu.icellmobilsoft.coffee - coffee-bom + coffee-bom-project ${version.hu.icellmobilsoft.coffee} pom import diff --git a/dookug-bom/dookug-bom-all/pom.xml b/dookug-bom/dookug-bom-all/pom.xml index 2ca60f8a..f4d7c046 100644 --- a/dookug-bom/dookug-bom-all/pom.xml +++ b/dookug-bom/dookug-bom-all/pom.xml @@ -13,9 +13,8 @@ 1.9.6 4.1 - 2.10.0 + 3.0.0 - 0.8.0 1.10.0 4.4.0 @@ -23,7 +22,7 @@ 2.5 9.1.0.8 - 5.8.1 + 5.9.1 @@ -183,7 +182,6 @@ saxon ${version.net.sourceforge.saxon.saxon} - diff --git a/dookug-bom/dookug-bom-test/pom.xml b/dookug-bom/dookug-bom-test/pom.xml index af870bb1..42f273b7 100644 --- a/dookug-bom/dookug-bom-test/pom.xml +++ b/dookug-bom/dookug-bom-test/pom.xml @@ -10,7 +10,7 @@ pom - 5.4.0 + 5.9.1 2.0.2.Final 2.24.0 @@ -44,13 +44,13 @@ org.jboss.weld weld-junit5 - ${version.weld-junit5} + ${version.org.jboss.weld.weld-junit5} test org.mockito mockito-core - ${version.mockito} + ${version.org.mockito} test diff --git a/dookug-bom/dookug-bom-wf/dookug-bom-wf-27/pom.xml b/dookug-bom/dookug-bom-wf/dookug-bom-wf-27/pom.xml index f68a1065..27b7d037 100644 --- a/dookug-bom/dookug-bom-wf/dookug-bom-wf-27/pom.xml +++ b/dookug-bom/dookug-bom-wf/dookug-bom-wf-27/pom.xml @@ -24,7 +24,7 @@ 2.13.4 - 3.0.1 + 3.0.3 4.0 4.0 3.0 diff --git a/dookug-client/dookug-client-jee10/pom.xml b/dookug-client/dookug-client-jee10/pom.xml index b50fd5e6..db709507 100644 --- a/dookug-client/dookug-client-jee10/pom.xml +++ b/dookug-client/dookug-client-jee10/pom.xml @@ -11,7 +11,7 @@ dookug-client-jee10 - ${version.hu.icellmobilsoft.coffee.ee10} + 2.6.0 6.2.1.Final diff --git a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java index 9da9f1dd..bdbb76b1 100644 --- a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java +++ b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java @@ -19,11 +19,21 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; @@ -37,5 +47,23 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_CONTENT) -public interface IDocumentContentInternalRest extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentContentInternalRest, AutoCloseable { +public interface IDocumentContentInternalRest extends AutoCloseable { + + /** + * REST interface definition for getting document content + * + * @param documentId + * document entity unique identifier + * @return Document content output stream + * @throws BaseException + * on error + */ + @GET + @Path(DocumentGeneratePath.ID) + @Produces(value = { MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response getDocumentContent(@PathParam(DocumentGeneratePath.PARAM_ID) @Parameter(name = DocumentGeneratePath.PARAM_ID, + description = "Generált dokumentum azonosító") String documentId) throws BaseException; + } diff --git a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java index d4218eba..ef184919 100644 --- a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java +++ b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java @@ -19,14 +19,29 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import org.jboss.resteasy.annotations.providers.multipart.MultipartForm; +import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; +import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataResponse; /** * REST client interface for template based document generation @@ -37,6 +52,84 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_GENERATE_INLINE) -public interface IDocumentGenerateInlineInternalRest extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest, AutoCloseable { +public interface IDocumentGenerateInlineInternalRest extends AutoCloseable { + + /** + * Default entity log size + */ + int LOG_ENTITY_SIZE = 1000; + + /** + * REST interface definition for document generation by multipart form input + * + * @param form + * multipart form input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @Path(DocumentGeneratePath.MULTIPART) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postDocumentGenerateMultipart(@MultipartForm DocumentGenerateMultipartForm form) throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postDocumentGenerateEntityBody(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentGenerateWithTemplatesRequest request) + throws BaseException; + + /** + * REST interface definition for document generation by multipart form input + * + * @param form + * multipart form input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @Path(DocumentGeneratePath.MULTIPART_METADATA) + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postDocumentGenerateMultipartMetadata(@MultipartForm DocumentGenerateMultipartForm form) throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA) + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postDocumentGenerateEntityBodyMetadata( + @ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentGenerateWithTemplatesRequest request) throws BaseException; } diff --git a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java index 219f9212..340e8e26 100644 --- a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java +++ b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java @@ -19,14 +19,27 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataResponse; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.StoredTemplateDocumentGenerateRequest; /** * REST client interface for template based document generation @@ -37,7 +50,46 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_GENERATE_STOREDTEMPLATE) -public interface IDocumentGenerateStoredTemplateInternalRest - extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest, AutoCloseable { +public interface IDocumentGenerateStoredTemplateInternalRest extends AutoCloseable { + + /** + * Default entity log size + */ + int LOG_ENTITY_SIZE = 1000; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(value = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postStoredTemplateDocumentGenerate(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) StoredTemplateDocumentGenerateRequest request) + throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA) + @Consumes(MediaType.APPLICATION_JSON) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postStoredTemplateDocumentGenerateMetadata( + @ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) StoredTemplateDocumentGenerateRequest request) throws BaseException; } diff --git a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java index 7b8b0945..cd1b81cb 100644 --- a/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java +++ b/dookug-client/dookug-client-jee10/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java @@ -19,14 +19,23 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.cdi.annotation.xml.ValidateXML; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryRequest; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryResponse; /** * REST client interface for stored template operations @@ -37,6 +46,22 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_STOREDTEMPLATE) -public interface IDocumentStoredTemplateInternalRest - extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentStoredTemplateInternalRest, AutoCloseable { +public interface IDocumentStoredTemplateInternalRest extends AutoCloseable { + + /** + * REST interface definition for generated document paginated listing + * + * @param request + * structured input + * @return paginated list + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA_QUERY) + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + DocumentMetadataQueryResponse postDocumentMetadataQuery(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentMetadataQueryRequest request) + throws BaseException; + } diff --git a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java index a2465a79..6111106f 100644 --- a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java +++ b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentContentInternalRest.java @@ -19,11 +19,21 @@ */ package hu.icellmobilsoft.dookug.client.rest; +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 javax.ws.rs.core.Response; +import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; @@ -37,5 +47,23 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_CONTENT) -public interface IDocumentContentInternalRest extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentContentInternalRest, AutoCloseable { +public interface IDocumentContentInternalRest extends AutoCloseable { + + /** + * REST interface definition for getting document content + * + * @param documentId + * document entity unique identifier + * @return Document content output stream + * @throws BaseException + * on error + */ + @GET + @Path(DocumentGeneratePath.ID) + @Produces(value = { MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response getDocumentContent(@PathParam(DocumentGeneratePath.PARAM_ID) @Parameter(name = DocumentGeneratePath.PARAM_ID, + description = "Generált dokumentum azonosító") String documentId) throws BaseException; + } diff --git a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java index 4c4e8ae3..3856f284 100644 --- a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java +++ b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateInlineInternalRest.java @@ -19,14 +19,29 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import org.jboss.resteasy.annotations.providers.multipart.MultipartForm; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; +import hu.icellmobilsoft.coffee.rest.validation.xml.annotation.ValidateXML; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; +import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataResponse; /** * REST client interface for template based document generation @@ -37,6 +52,84 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_GENERATE_INLINE) -public interface IDocumentGenerateInlineInternalRest extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest, AutoCloseable { +public interface IDocumentGenerateInlineInternalRest extends AutoCloseable { + + /** + * Default entity log size + */ + int LOG_ENTITY_SIZE = 1000; + + /** + * REST interface definition for document generation by multipart form input + * + * @param form + * multipart form input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @Path(DocumentGeneratePath.MULTIPART) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postDocumentGenerateMultipart(@MultipartForm DocumentGenerateMultipartForm form) throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postDocumentGenerateEntityBody(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentGenerateWithTemplatesRequest request) + throws BaseException; + + /** + * REST interface definition for document generation by multipart form input + * + * @param form + * multipart form input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @Path(DocumentGeneratePath.MULTIPART_METADATA) + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postDocumentGenerateMultipartMetadata(@MultipartForm DocumentGenerateMultipartForm form) throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA) + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postDocumentGenerateEntityBodyMetadata( + @ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentGenerateWithTemplatesRequest request) throws BaseException; } diff --git a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java index 3fe070aa..1dc6b53c 100644 --- a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java +++ b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentGenerateStoredTemplateInternalRest.java @@ -19,14 +19,27 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifier; +import hu.icellmobilsoft.coffee.rest.log.annotation.LogSpecifiers; +import hu.icellmobilsoft.coffee.rest.log.annotation.enumeration.LogSpecifierTarget; +import hu.icellmobilsoft.coffee.rest.validation.xml.annotation.ValidateXML; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataResponse; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.StoredTemplateDocumentGenerateRequest; /** * REST client interface for template based document generation @@ -37,7 +50,46 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_GENERATE_STOREDTEMPLATE) -public interface IDocumentGenerateStoredTemplateInternalRest - extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest, AutoCloseable { +public interface IDocumentGenerateStoredTemplateInternalRest extends AutoCloseable { + + /** + * Default entity log size + */ + int LOG_ENTITY_SIZE = 1000; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document content output stream + * @throws BaseException + * on error + */ + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(value = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_RESPONSE, maxEntityLogSize = LogSpecifier.NO_LOG) }) + Response postStoredTemplateDocumentGenerate(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) StoredTemplateDocumentGenerateRequest request) + throws BaseException; + + /** + * REST interface definition for document generation by structured input + * + * @param request + * structured input + * @return Generated document metadata + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA) + @Consumes(MediaType.APPLICATION_JSON) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @LogSpecifiers({ @LogSpecifier(target = LogSpecifierTarget.REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE), + @LogSpecifier(target = LogSpecifierTarget.CLIENT_REQUEST, maxEntityLogSize = LOG_ENTITY_SIZE) }) + DocumentMetadataResponse postStoredTemplateDocumentGenerateMetadata( + @ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) StoredTemplateDocumentGenerateRequest request) throws BaseException; } diff --git a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java index 30e26548..0a3a24ed 100644 --- a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java +++ b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/IDocumentStoredTemplateInternalRest.java @@ -19,14 +19,23 @@ */ package hu.icellmobilsoft.dookug.client.rest; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.rest.validation.xml.annotation.ValidateXML; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.client.rest.jsonb.CustomJsonbContextResolver; +import hu.icellmobilsoft.dookug.common.dto.constant.XsdConstants; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryRequest; +import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryResponse; /** * REST client interface for stored template operations @@ -37,6 +46,22 @@ @RegisterRestClient(configKey = ConfigKeys.Client.DOOKUG_CLIENT_DOCUMENT) @RegisterProvider(CustomJsonbContextResolver.class) @Path(DocumentGeneratePath.INTERNAL_DOCUMENT_STOREDTEMPLATE) -public interface IDocumentStoredTemplateInternalRest - extends hu.icellmobilsoft.dookug.api.rest.document.IDocumentStoredTemplateInternalRest, AutoCloseable { +public interface IDocumentStoredTemplateInternalRest extends AutoCloseable { + + /** + * REST interface definition for generated document paginated listing + * + * @param request + * structured input + * @return paginated list + * @throws BaseException + * on error + */ + @POST + @Path(DocumentGeneratePath.METADATA_QUERY) + @Consumes(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + @Produces(value = { MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON }) + DocumentMetadataQueryResponse postDocumentMetadataQuery(@ValidateXML(xsdPath = XsdConstants.SUPER_XSD_PATH) DocumentMetadataQueryRequest request) + throws BaseException; + } diff --git a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/jsonb/CustomJsonbContextResolver.java b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/jsonb/CustomJsonbContextResolver.java index 1e9cfb9e..3de35584 100644 --- a/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/jsonb/CustomJsonbContextResolver.java +++ b/dookug-client/dookug-client-jee8/src/main/java/hu/icellmobilsoft/dookug/client/rest/jsonb/CustomJsonbContextResolver.java @@ -36,7 +36,7 @@ * @author mate.biro * @since 0.2.0 */ -@Dependent +//@Dependent public class CustomJsonbContextResolver implements ContextResolver { @Override diff --git a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/document/IDocumentStore.java b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/document/IDocumentStore.java index 7895c1ba..d1cc924b 100644 --- a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/document/IDocumentStore.java +++ b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/document/IDocumentStore.java @@ -25,7 +25,7 @@ import jakarta.xml.bind.JAXBElement; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.tool.utils.marshalling.MarshallingUtil; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.ParametersDataType; diff --git a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/IDocumentGenerator.java b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/IDocumentGenerator.java index 86a3e863..91ac76d4 100644 --- a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/IDocumentGenerator.java +++ b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/IDocumentGenerator.java @@ -22,7 +22,7 @@ import java.io.OutputStream; import java.util.Map; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.common.cdi.sign.DigitalSigningDto; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.ParametersDataType; diff --git a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateCompiler.java b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateCompiler.java index 1cc08ab2..e449188b 100644 --- a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateCompiler.java +++ b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateCompiler.java @@ -21,7 +21,7 @@ import java.util.Map; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; /** * Interface for compiling templates. Performs the variable -> value replacement and recursive template composition. Uses a specified template diff --git a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateStore.java b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateStore.java index 7b6621ff..86d2ec06 100644 --- a/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateStore.java +++ b/dookug-common/dookug-common-core/src/main/java/hu/icellmobilsoft/dookug/common/cdi/template/ITemplateStore.java @@ -21,7 +21,7 @@ import java.time.OffsetDateTime; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; /** * Interface for template storage diff --git a/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/JpaUtil.java b/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/JpaUtil.java new file mode 100644 index 00000000..5d278123 --- /dev/null +++ b/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/JpaUtil.java @@ -0,0 +1,136 @@ +/*- + * #%L + * DookuG + * %% + * Copyright (C) 2023 - 2024 i-Cell Mobilsoft Zrt. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package hu.icellmobilsoft.dookug.common.jpa.util; + +import java.util.function.Supplier; + +import jakarta.persistence.Query; + +import org.hibernate.query.spi.DomainQueryExecutionContext; +import org.hibernate.query.spi.QueryImplementor; +import org.hibernate.query.spi.QueryInterpretationCache; +import org.hibernate.query.spi.SelectQueryPlan; +import org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan; +import org.hibernate.query.sqm.internal.DomainParameterXref; +import org.hibernate.query.sqm.internal.QuerySqmImpl; +import org.hibernate.query.sqm.internal.SqmInterpretationsKey; +import org.hibernate.query.sqm.tree.select.SqmSelectStatement; +import org.hibernate.sql.exec.spi.JdbcSelect; + +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; +import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; +import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; +import hu.icellmobilsoft.coffee.se.logging.Logger; + +/** + * JPA common functions. + * + * @author tamas.cserhati + * @since 1.0.0 + */ +public class JpaUtil { + + /** + * Default constructor, constructs a new object. + */ + public JpaUtil() { + super(); + } + + /** + * Get native SQL from created Query, exception is logged only + * + * @param query + * created query + * @return native SQL of query or null + */ + public static String toNativeSQLNoEx(Query query) { + try { + return toNativeSQL(query); + } catch (BaseException e) { + Logger.getLogger(JpaUtil.class).warn("Exception on converting Query to native SQL!", e); + } + return null; + } + + /** + * Get native SQL from created Query + * + * @param criteriaQuery + * created query + * @return native SQL of query or {@code null} if criteriaQuery parameter is null + * @throws BaseException + * on error + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static String toNativeSQL(Query criteriaQuery) throws BaseException { + if (criteriaQuery == null) { + return null; + } + QueryImplementor query = criteriaQuery.unwrap(QueryImplementor.class); + if (query instanceof SqmInterpretationsKey.InterpretationsKeySource && query instanceof QuerySqmImpl) { + QueryInterpretationCache.Key cacheKey = SqmInterpretationsKey + .createInterpretationsKey((SqmInterpretationsKey.InterpretationsKeySource) query); + QuerySqmImpl querySqm = (QuerySqmImpl) query; + Supplier buildSelectQueryPlan = () -> { + try { + return ReflectionUtils.invokeMethod(querySqm, "buildSelectQueryPlan", ConcreteSqmSelectQueryPlan.class); + } catch (BaseException e) { + Logger.getLogger(JpaUtil.class).warn("Exception on calling buildSelectQueryPlan()!", e); + return null; + } + }; + SelectQueryPlan plan = cacheKey != null + ? ((QueryImplementor) query).getSession() + .getFactory() + .getQueryEngine() + .getInterpretationCache() + .resolveSelectQueryPlan(cacheKey, buildSelectQueryPlan) + : (SelectQueryPlan) buildSelectQueryPlan.get(); + if (plan instanceof ConcreteSqmSelectQueryPlan) { + ConcreteSqmSelectQueryPlan selectQueryPlan = (ConcreteSqmSelectQueryPlan) plan; + Object cacheableSqmInterpretation = ReflectionUtils.getFieldValueOrNull(selectQueryPlan, "cacheableSqmInterpretation", Object.class); + if (cacheableSqmInterpretation == null) { + DomainQueryExecutionContext domainQueryExecutionContext = DomainQueryExecutionContext.class.cast(querySqm); + cacheableSqmInterpretation = ReflectionUtils.invokeStaticMethod( + ReflectionUtils.getMethod( + ConcreteSqmSelectQueryPlan.class, + "buildCacheableSqmInterpretation", + SqmSelectStatement.class, + DomainParameterXref.class, + DomainQueryExecutionContext.class), + Object.class, + ReflectionUtils.getFieldValueOrNull(selectQueryPlan, "sqm", SqmSelectStatement.class), + ReflectionUtils.getFieldValueOrNull(selectQueryPlan, "domainParameterXref", DomainParameterXref.class), + domainQueryExecutionContext); + } + if (cacheableSqmInterpretation != null) { + JdbcSelect jdbcSelect = ReflectionUtils.getFieldValueOrNull(cacheableSqmInterpretation, "jdbcSelect", JdbcSelect.class); + if (jdbcSelect != null) { + return jdbcSelect.getSql(); + } + } + } else { + throw new TechnicalException(CoffeeFaultType.OPERATION_FAILED, "Cannot invoke buildSelectQueryPlan()"); + } + } + return ReflectionUtils.invokeMethod(query, "getQueryString", String.class); + } +} diff --git a/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/ReflectionUtils.java b/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/ReflectionUtils.java new file mode 100644 index 00000000..3eee1f3f --- /dev/null +++ b/dookug-common/dookug-common-jpa/src/main/java/hu/icellmobilsoft/dookug/common/jpa/util/ReflectionUtils.java @@ -0,0 +1,279 @@ +/*- + * #%L + * DookuG + * %% + * Copyright (C) 2023 - 2024 i-Cell Mobilsoft Zrt. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package hu.icellmobilsoft.dookug.common.jpa.util; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.apache.commons.lang3.StringUtils; + +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; +import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; +import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; + +/** + * ReflectionUtils - Reflection utilities holder from hypersistence-utils-60 + * + * @author tamas.cserhati + * @since 1.0.0 + */ +public final class ReflectionUtils { + + private ReflectionUtils() { + } + + /** + * Get the {@link Field} with the given name belonging to the provided Java {@link Class}. + * + * @param targetClass + * the provided Java {@link Class} the field belongs to + * @param fieldName + * the {@link Field} name + * @return the {@link Field} matching the given name or {@code null} if one parameter is null or empty + * @throws BaseException + * on error + */ + private static Field getField(Class targetClass, String fieldName) throws BaseException { + if (targetClass == null || StringUtils.isBlank(fieldName)) { + return null; + } + + Field field = null; + + try { + field = targetClass.getDeclaredField(fieldName); + } catch (NoSuchFieldException e) { + try { + field = targetClass.getField(fieldName); + } catch (NoSuchFieldException ignore) { + // ignore + } + + if (!targetClass.getSuperclass().equals(Object.class)) { + return getField(targetClass.getSuperclass(), fieldName); + } else { + throw handleException(e); + } + } finally { + if (field != null) { + field.setAccessible(true); + } + } + + return field; + } + + /** + * Get the value of the field matching the given name and belonging to target {@link Object} + * + * @param target + * target {@link Object} whose field we are retrieving the value from + * @param fieldName + * field name + * @param clazz + * class of returning object + * @param + * field type + * @return field value matching the given name or {@code null} + */ + static T getFieldValueOrNull(Object target, String fieldName, Class clazz) { + if (target == null || clazz == null || StringUtils.isBlank(fieldName)) { + return null; + } + try { + Field field = getField(target.getClass(), fieldName); + if (field == null) { + return null; + } + return clazz.cast(field.get(target)); + } catch (Exception e) { + return null; + } + } + + /** + * Get the {@link Method} with the given signature (name and parameter types) belonging to the provided Java {@link Object}. + * + * @param target + * target {@link Object} + * @param methodName + * method name + * @param parameterTypes + * method parameter types + * @return return {@link Method} matching the provided signature or {@code null} + * @throws BaseException + * on error + */ + private static Method getMethod(Object target, String methodName, Class... parameterTypes) throws BaseException { + if (target == null || StringUtils.isBlank(methodName)) { + return null; + } + return getMethod(target.getClass(), methodName, parameterTypes); + } + + /** + * Get the {@link Method} with the given signature (name and parameter types) belonging to the provided Java {@link Class}. + * + * @param targetClass + * target {@link Class} + * @param methodName + * method name + * @param parameterTypes + * method parameter types + * @return the {@link Method} matching the provided signature or {@code null} + * @throws BaseException + * on error + */ + static Method getMethod(Class targetClass, String methodName, Class... parameterTypes) throws BaseException { + if (targetClass == null || StringUtils.isBlank(methodName)) { + return null; + } + try { + return targetClass.getDeclaredMethod(methodName, parameterTypes); + } catch (NoSuchMethodException e) { + try { + return targetClass.getMethod(methodName, parameterTypes); + } catch (NoSuchMethodException ignore) { + // ignore + } + + if (!targetClass.getSuperclass().equals(Object.class)) { + return getMethod(targetClass.getSuperclass(), methodName, parameterTypes); + } else { + throw handleException(e); + } + } + } + + /** + * Invoke the method with the provided signature (name and parameter types) on the given Java {@link Object}. + * + * @param target + * target {@link Object} whose method we are invoking + * @param methodName + * method name to invoke + * @param clazz + * class of returning object + * @param parameters + * parameters passed to the method call + * @param + * return value object type + * @return the value return by the method invocation or {@code null} + * @throws BaseException + * on error + */ + static T invokeMethod(Object target, String methodName, Class clazz, Object... parameters) throws BaseException { + if (target == null || clazz == null || StringUtils.isBlank(methodName)) { + return null; + } + try { + Class[] parameterClasses = new Class[parameters.length]; + + for (int i = 0; i < parameters.length; i++) { + parameterClasses[i] = parameters[i].getClass(); + } + + Method method = getMethod(target, methodName, parameterClasses); + if (method == null) { + return null; + } + method.setAccessible(true); + return clazz.cast(method.invoke(target, parameters)); + } catch (InvocationTargetException e) { + throw handleException(e); + } catch (IllegalAccessException e) { + throw handleException(e); + } + } + + /** + * Invoke the {@code static} {@link Method} with the provided parameters. + * + * @param method + * target {@code static} {@link Method} to invoke + * @param clazz + * class of returning object + * @param parameters + * parameters passed to the method call + * @param + * return value object type + * @return the value return by the method invocation or {@code null} + * @throws BaseException + * on error + */ + static T invokeStaticMethod(Method method, Class clazz, Object... parameters) throws BaseException { + if (method == null || clazz == null) { + return null; + } + try { + method.setAccessible(true); + return clazz.cast(method.invoke(null, parameters)); + } catch (InvocationTargetException e) { + throw handleException(e); + } catch (IllegalAccessException e) { + throw handleException(e); + } + } + + /** + * Handle the {@link NoSuchFieldException} by rethrowing it as an {@link BaseException}. + * + * @param e + * the original {@link NoSuchFieldException} + * @return the {@link BaseException} wrapping exception + */ + private static BaseException handleException(NoSuchFieldException e) { + return new TechnicalException(CoffeeFaultType.OPERATION_FAILED, e.getLocalizedMessage(), e); + } + + /** + * Handle the {@link NoSuchMethodException} by rethrowing it as an {@link BaseException}. + * + * @param e + * the original {@link NoSuchMethodException} + * @return the {@link BaseException} wrapping exception + */ + private static BaseException handleException(NoSuchMethodException e) { + return new TechnicalException(CoffeeFaultType.OPERATION_FAILED, e.getLocalizedMessage(), e); + } + + /** + * Handle the {@link IllegalAccessException} by rethrowing it as an {@link BaseException}. + * + * @param e + * the original {@link IllegalAccessException} + * @return the {@link BaseException} wrapping exception + */ + private static BaseException handleException(IllegalAccessException e) { + return new TechnicalException(CoffeeFaultType.OPERATION_FAILED, e.getLocalizedMessage(), e); + } + + /** + * Handle the {@link InvocationTargetException} by rethrowing it as an {@link BaseException}. + * + * @param e + * the original {@link InvocationTargetException} + * @return the {@link BaseException} wrapping exception + */ + private static BaseException handleException(InvocationTargetException e) { + return new TechnicalException(CoffeeFaultType.OPERATION_FAILED, e.getLocalizedMessage(), e); + } +} diff --git a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/CMSPrivateKeyLoader.java b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/CMSPrivateKeyLoader.java index 25a750c9..dbbf7b65 100644 --- a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/CMSPrivateKeyLoader.java +++ b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/CMSPrivateKeyLoader.java @@ -37,7 +37,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.engine.pdfbox.signing.types.CMSPrivateKey; diff --git a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureGenerator.java b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureGenerator.java index ddbd5a06..725745eb 100644 --- a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureGenerator.java +++ b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureGenerator.java @@ -53,7 +53,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.common.cdi.sign.DigitalSigningDto; diff --git a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureProfileLoader.java b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureProfileLoader.java index cd9b1405..d2ea4652 100644 --- a/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureProfileLoader.java +++ b/dookug-common/dookug-common-pdfsignature/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/signing/SignatureProfileLoader.java @@ -28,7 +28,7 @@ import org.apache.commons.lang3.StringUtils; import hu.icellmobilsoft.coffee.configuration.ApplicationConfiguration; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.engine.pdfbox.config.ConfigKeys; diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/CustomJsonbProvider.java b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/CustomJsonbProvider.java deleted file mode 100644 index c16d2521..00000000 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/CustomJsonbProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * #%L - * DookuG - * %% - * Copyright (C) 2023 - 2024 i-Cell Mobilsoft Zrt. - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package hu.icellmobilsoft.dookug.common.rest.jsonb; - -import jakarta.json.bind.Jsonb; -import jakarta.ws.rs.ext.ContextResolver; -import jakarta.ws.rs.ext.Provider; - - -/** - * Custom default JSON-B JAXRS provider. Used in {@code org.jboss.resteasy.plugins.providers.jsonb.AbstractJsonBindingProvider} - * - * @author tamas.cserhati - * @since 1.0.0 - * @see JSON-B spec - * @see Setter/Getter hide - * @see Future configuration option - */ -@Provider -public class CustomJsonbProvider implements ContextResolver { - - @Override - public Jsonb getContext(Class type) { - return JsonbUtil.getContext(); - } -} diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/JsonbUtil.java b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/JsonbUtil.java deleted file mode 100644 index b93e3045..00000000 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/JsonbUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * #%L - * DookuG - * %% - * Copyright (C) 2023 - 2024 i-Cell Mobilsoft Zrt. - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package hu.icellmobilsoft.dookug.common.rest.jsonb; - -import jakarta.json.bind.Jsonb; -import jakarta.json.bind.JsonbBuilder; -import jakarta.json.bind.JsonbConfig; -import jakarta.json.bind.config.BinaryDataStrategy; - -/** - * {@link Jsonb} object creator util class. - * - * @author tamas.cserhati - * @since 1.0.0 - */ -public class JsonbUtil { - - private static final JsonbConfig CONFIG = new JsonbConfig() - // property visibility strategy setting - .withPropertyVisibilityStrategy(new FieldOnlyVisibilityStrategy()) - // binary data strategy setting - .withBinaryDataStrategy(BinaryDataStrategy.BASE_64); - - private JsonbUtil() { - } - - /** - * Create {@link Jsonb} instance with {@link FieldOnlyVisibilityStrategy} property visibility strategy. - * - * @return configured {@link Jsonb} instance - */ - public static Jsonb getContext() { - return JsonbBuilder.newBuilder().withConfig(CONFIG).build(); - } -} diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/locale/ProjectMessageResolver.java b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/locale/ProjectMessageResolver.java index b55884ed..b9150853 100644 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/locale/ProjectMessageResolver.java +++ b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/locale/ProjectMessageResolver.java @@ -51,7 +51,7 @@ import org.apache.deltaspike.core.api.message.MessageContext; import org.apache.deltaspike.core.impl.message.DefaultMessageResolver; -import org.apache.deltaspike.core.util.ClassUtils; +import org.apache.deltaspike.core.util.message.ClassUtils; /** * {@code MessageResolver} for resolving localized messages with custom fallback locale logic diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/CustomJsonbContextResolver.java b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/CustomJsonbContextResolver.java deleted file mode 100644 index c0dacf11..00000000 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/CustomJsonbContextResolver.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * #%L - * DookuG - * %% - * Copyright (C) 2023 - 2024 i-Cell Mobilsoft Zrt. - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package hu.icellmobilsoft.dookug.common.rest.restclient.provider; - -import jakarta.enterprise.context.Dependent; -import jakarta.json.bind.Jsonb; -import jakarta.ws.rs.ext.ContextResolver; - -import hu.icellmobilsoft.coffee.cdi.logger.LogProducer; -import hu.icellmobilsoft.dookug.common.rest.jsonb.JsonbUtil; - -/** - * Custom default JSON-B JAXRS provider. For MP-rest client - * - * @author tamas.cserhati - * @since 1.0.0 - * @see MP - * Rest client 2.0 spec JSON-B provider - */ -@Dependent -public class CustomJsonbContextResolver implements ContextResolver { - - @Override - public Jsonb getContext(Class type) { - LogProducer.logToAppLogger(log -> log.info("CustomJsonBContextResolver"), getClass()); - return JsonbUtil.getContext(); - } -} diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/ProjectRestClientBuilderListener.java b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/ProjectRestClientBuilderListener.java index 10faab15..fba1527e 100644 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/ProjectRestClientBuilderListener.java +++ b/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/restclient/provider/ProjectRestClientBuilderListener.java @@ -40,6 +40,5 @@ public void onNewBuilder(RestClientBuilder builder) { super.onNewBuilder(builder); CDI cdi = CDI.current(); builder.register(cdi.select(ProjectSettingClientRequestFilter.class).get()); - builder.register(cdi.select(CustomJsonbContextResolver.class).get()); } } diff --git a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/AbstractCache.java b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/AbstractCache.java index 426c6796..c4e89d60 100644 --- a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/AbstractCache.java +++ b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/AbstractCache.java @@ -31,7 +31,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.common.core.evictable.Evictable; import hu.icellmobilsoft.dookug.common.system.rest.action.BaseAction; diff --git a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/CacheMetricsCollector.java b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/CacheMetricsCollector.java index a7df6952..90c0709d 100644 --- a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/CacheMetricsCollector.java +++ b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/cache/CacheMetricsCollector.java @@ -34,7 +34,7 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheStats; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.common.system.rest.action.BaseAction; /** diff --git a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/ISystemRest.java b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/ISystemRest.java index 9356e20a..b16bbfbf 100644 --- a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/ISystemRest.java +++ b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/ISystemRest.java @@ -28,7 +28,7 @@ import org.eclipse.microprofile.openapi.annotations.Operation; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.url.DocumentGeneratePath; import hu.icellmobilsoft.dookug.schemas.common._1_0.config.evict.EvictResponse; diff --git a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/SystemRest.java b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/SystemRest.java index 7c7e372e..84540bdf 100644 --- a/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/SystemRest.java +++ b/dookug-common/dookug-common-system-rest/src/main/java/hu/icellmobilsoft/dookug/common/system/rest/rest/SystemRest.java @@ -29,7 +29,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.common.system.rest.cache.EvictAction; import hu.icellmobilsoft.dookug.schemas.common._1_0.config.evict.EvictResponse; diff --git a/dookug-common/dookug-common-util/src/main/java/hu/icellmobilsoft/dookug/common/util/filename/FileUtil.java b/dookug-common/dookug-common-util/src/main/java/hu/icellmobilsoft/dookug/common/util/filename/FileUtil.java index 7e89ce46..65d6cc00 100644 --- a/dookug-common/dookug-common-util/src/main/java/hu/icellmobilsoft/dookug/common/util/filename/FileUtil.java +++ b/dookug-common/dookug-common-util/src/main/java/hu/icellmobilsoft/dookug/common/util/filename/FileUtil.java @@ -23,7 +23,7 @@ import org.apache.commons.lang3.StringUtils; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.ResponseFormatType; diff --git a/dookug-document/dookug-document-service/pom.xml b/dookug-document/dookug-document-service/pom.xml index c0337374..15e99ca0 100644 --- a/dookug-document/dookug-document-service/pom.xml +++ b/dookug-document/dookug-document-service/pom.xml @@ -55,11 +55,12 @@ compile - + diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/BaseDocumentGenerateAction.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/BaseDocumentGenerateAction.java index 37747678..85364d2c 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/BaseDocumentGenerateAction.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/BaseDocumentGenerateAction.java @@ -39,7 +39,7 @@ import org.apache.commons.lang3.StringUtils; import org.eclipse.microprofile.config.inject.ConfigProperty; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BusinessException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentContentAction.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentContentAction.java index 4550aea1..1b1f6f34 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentContentAction.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentContentAction.java @@ -27,7 +27,7 @@ import org.apache.commons.lang3.StringUtils; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.rest.utils.ResponseUtil; import hu.icellmobilsoft.dookug.common.cdi.StorageMethodQualifier; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentGenerateAction.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentGenerateAction.java index 66f86155..497da2aa 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentGenerateAction.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentGenerateAction.java @@ -28,7 +28,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentMetadataQueryAction.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentMetadataQueryAction.java index 0c21776f..01910a15 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentMetadataQueryAction.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/DocumentMetadataQueryAction.java @@ -23,7 +23,7 @@ import jakarta.inject.Inject; import hu.icellmobilsoft.coffee.dto.common.common.QueryRequestDetails; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.jpa.sql.paging.PagingResult; import hu.icellmobilsoft.coffee.tool.utils.enums.EnumUtil; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/StoredTemplateDocumentGenerateAction.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/StoredTemplateDocumentGenerateAction.java index 372c888f..68ea60c4 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/StoredTemplateDocumentGenerateAction.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/action/StoredTemplateDocumentGenerateAction.java @@ -24,7 +24,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.rest.utils.ResponseUtil; import hu.icellmobilsoft.dookug.common.cdi.StorageMethodQualifier; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/converter/DocumentConverter.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/converter/DocumentConverter.java index c9dca45c..c406af1f 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/converter/DocumentConverter.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/converter/DocumentConverter.java @@ -23,7 +23,7 @@ import jakarta.enterprise.context.Dependent; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BusinessException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.common.cdi.document.Document; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/helper/DocumentPersisterHelper.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/helper/DocumentPersisterHelper.java index e549322d..6648aee7 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/helper/DocumentPersisterHelper.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/helper/DocumentPersisterHelper.java @@ -22,7 +22,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.jpa.annotation.Transactional; import hu.icellmobilsoft.dookug.common.model.template.Document; import hu.icellmobilsoft.dookug.common.model.template.DocumentContent; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentContentInternalRest.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentContentInternalRest.java index 2b0daabf..0dec74e0 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentContentInternalRest.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentContentInternalRest.java @@ -23,7 +23,7 @@ import jakarta.inject.Inject; import jakarta.ws.rs.core.Response; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentContentInternalRest; import hu.icellmobilsoft.dookug.common.system.rest.rest.BaseRestService; import hu.icellmobilsoft.dookug.document.service.action.DocumentContentAction; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateInlineInternalRest.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateInlineInternalRest.java index faa476c4..e060e881 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateInlineInternalRest.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateInlineInternalRest.java @@ -23,7 +23,7 @@ import jakarta.inject.Inject; import jakarta.ws.rs.core.Response; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.common.system.rest.rest.BaseRestService; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateStoredTemplateInternalRest.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateStoredTemplateInternalRest.java index 404bbc40..f0f66a2d 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateStoredTemplateInternalRest.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentGenerateStoredTemplateInternalRest.java @@ -23,7 +23,7 @@ import jakarta.inject.Inject; import jakarta.ws.rs.core.Response; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest; import hu.icellmobilsoft.dookug.common.system.rest.rest.BaseRestService; import hu.icellmobilsoft.dookug.document.service.action.StoredTemplateDocumentGenerateAction; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentStoredTemplateInternalRest.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentStoredTemplateInternalRest.java index 2e21c3d3..d1abd6e9 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentStoredTemplateInternalRest.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/rest/DocumentStoredTemplateInternalRest.java @@ -22,7 +22,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentStoredTemplateInternalRest; import hu.icellmobilsoft.dookug.common.system.rest.rest.BaseRestService; import hu.icellmobilsoft.dookug.document.service.action.DocumentMetadataQueryAction; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentContentService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentContentService.java index f1d584c9..f3adf901 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentContentService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentContentService.java @@ -22,7 +22,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.common.model.template.Document; import hu.icellmobilsoft.dookug.common.model.template.DocumentContent; import hu.icellmobilsoft.dookug.common.system.jpa.service.BaseService; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentQueryService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentQueryService.java index 11fcf31e..1a806b89 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentQueryService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/DocumentQueryService.java @@ -37,7 +37,7 @@ import hu.icellmobilsoft.coffee.dto.common.common.OrderByTypeType; import hu.icellmobilsoft.coffee.dto.common.common.QueryRequestDetails; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.InvalidParameterException; import hu.icellmobilsoft.coffee.jpa.sql.paging.PagingResult; import hu.icellmobilsoft.coffee.jpa.sql.paging.PagingUtil; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartContentService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartContentService.java index 5991749f..c7c12b01 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartContentService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartContentService.java @@ -24,7 +24,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.jpa.service.BaseService; import hu.icellmobilsoft.dookug.common.model.template.TemplatePart; import hu.icellmobilsoft.dookug.common.model.template.TemplatePartContent; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartService.java index 7cbd68f2..7d111c88 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplatePartService.java @@ -24,7 +24,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.jpa.service.BaseService; import hu.icellmobilsoft.dookug.common.model.template.TemplatePart; import hu.icellmobilsoft.dookug.document.service.repository.TemplatePartRepository; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateService.java index 81d90fe6..0c28147c 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateService.java @@ -24,7 +24,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.jpa.service.BaseService; import hu.icellmobilsoft.dookug.common.model.template.Template; import hu.icellmobilsoft.dookug.document.service.repository.TemplateRepository; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateTemplatePartService.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateTemplatePartService.java index c1cef864..5e2fb5ff 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateTemplatePartService.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/service/service/TemplateTemplatePartService.java @@ -24,7 +24,7 @@ import jakarta.enterprise.inject.Model; import jakarta.inject.Inject; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.jpa.service.BaseService; import hu.icellmobilsoft.dookug.common.model.template.Template; import hu.icellmobilsoft.dookug.common.model.template.TemplateTemplatePart; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseDocumentStore.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseDocumentStore.java index 1ab0ff16..b837a077 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseDocumentStore.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseDocumentStore.java @@ -28,7 +28,7 @@ import org.apache.commons.lang3.EnumUtils; import org.apache.commons.lang3.StringUtils; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BusinessException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.coffee.tool.utils.string.RandomUtil; diff --git a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseTemplateStore.java b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseTemplateStore.java index 5d2e3026..f6c4198e 100644 --- a/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseTemplateStore.java +++ b/dookug-document/dookug-document-service/src/main/java/hu/icellmobilsoft/dookug/document/template/storage/DatabaseTemplateStore.java @@ -32,7 +32,7 @@ import org.apache.commons.lang3.StringUtils; import hu.icellmobilsoft.coffee.dto.exception.BONotFoundException; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BusinessException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.coffee.tool.utils.compress.GZIPUtil; diff --git a/dookug-engine/dookug-engine-handlebars/pom.xml b/dookug-engine/dookug-engine-handlebars/pom.xml index 4ae91519..e87c1524 100644 --- a/dookug-engine/dookug-engine-handlebars/pom.xml +++ b/dookug-engine/dookug-engine-handlebars/pom.xml @@ -21,10 +21,5 @@ com.github.jknack handlebars - - - org.osgi - osgi.annotation - diff --git a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/EscapingStrategyFactory.java b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/EscapingStrategyFactory.java index cb4a6429..628f1e9a 100644 --- a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/EscapingStrategyFactory.java +++ b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/EscapingStrategyFactory.java @@ -30,7 +30,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; diff --git a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HandlebarsTemplateCompiler.java b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HandlebarsTemplateCompiler.java index 2bbe6663..8cba5ed4 100644 --- a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HandlebarsTemplateCompiler.java +++ b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HandlebarsTemplateCompiler.java @@ -42,7 +42,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.BusinessException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; diff --git a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HelperRegister.java b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HelperRegister.java index 712299d8..33adbf8e 100644 --- a/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HelperRegister.java +++ b/dookug-engine/dookug-engine-handlebars/src/main/java/hu/icellmobilsoft/dookug/engine/handlebars/HelperRegister.java @@ -34,7 +34,7 @@ import hu.icellmobilsoft.coffee.cdi.logger.AppLogger; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; diff --git a/dookug-engine/dookug-engine-pdfbox/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/PdfBoxDocumentGenerator.java b/dookug-engine/dookug-engine-pdfbox/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/PdfBoxDocumentGenerator.java index 5af209bd..26805f0b 100644 --- a/dookug-engine/dookug-engine-pdfbox/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/PdfBoxDocumentGenerator.java +++ b/dookug-engine/dookug-engine-pdfbox/src/main/java/hu/icellmobilsoft/dookug/engine/pdfbox/PdfBoxDocumentGenerator.java @@ -33,7 +33,7 @@ import com.openhtmltopdf.util.XRLog; import hu.icellmobilsoft.coffee.cdi.logger.ThisLogger; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.coffee.se.logging.Logger; diff --git a/dookug-engine/dookug-engine-saxon/pom.xml b/dookug-engine/dookug-engine-saxon/pom.xml index 7bf76fea..a3e5dc6d 100644 --- a/dookug-engine/dookug-engine-saxon/pom.xml +++ b/dookug-engine/dookug-engine-saxon/pom.xml @@ -39,11 +39,13 @@ Saxon-HE - + + diff --git a/dookug-engine/dookug-engine-saxon/src/main/java/hu/icellmobilsoft/dookug/engine/saxon/SaxonDocumentGenerator.java b/dookug-engine/dookug-engine-saxon/src/main/java/hu/icellmobilsoft/dookug/engine/saxon/SaxonDocumentGenerator.java index ea47f8af..4b097cc0 100644 --- a/dookug-engine/dookug-engine-saxon/src/main/java/hu/icellmobilsoft/dookug/engine/saxon/SaxonDocumentGenerator.java +++ b/dookug-engine/dookug-engine-saxon/src/main/java/hu/icellmobilsoft/dookug/engine/saxon/SaxonDocumentGenerator.java @@ -47,10 +47,10 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; import hu.icellmobilsoft.coffee.cdi.trace.annotation.Traced; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; import hu.icellmobilsoft.coffee.rest.validation.xml.JaxbTool; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.tool.utils.compress.GZIPUtil; import hu.icellmobilsoft.dookug.api.dto.constants.ConfigKeys; import hu.icellmobilsoft.dookug.common.cdi.DocumentGeneratorQualifier; diff --git a/dookug-model/pom.xml b/dookug-model/pom.xml index 981cb876..6a571a78 100644 --- a/dookug-model/pom.xml +++ b/dookug-model/pom.xml @@ -46,7 +46,7 @@ - org.hibernate + org.hibernate.orm hibernate-jpamodelgen ${hibernate.jpamodelgen.version} provided diff --git a/dookug-testsuite/dookug-ts-bom/pom.xml b/dookug-testsuite/dookug-ts-bom/pom.xml index c6f4fa85..3975eedc 100644 --- a/dookug-testsuite/dookug-ts-bom/pom.xml +++ b/dookug-testsuite/dookug-ts-bom/pom.xml @@ -10,7 +10,7 @@ pom - 2.1.0 + 2.2.0-SNAPSHOT ${version.hu.icellmobilsoft.coffee.ee10} 1.2 @@ -18,10 +18,16 @@ 2.13.4.2 5.0.Final 4.0.3 + 3.24.2 + + hu.icellmobilsoft.dookug.testsuite + dookug-ts-common-base + ${project.version} + hu.icellmobilsoft.dookug.testsuite dookug-ts-common-rest @@ -81,6 +87,11 @@ awaitility ${version.awaitility} + + org.assertj + assertj-core + ${version.org.assertj.assertj-core} + diff --git a/dookug-testsuite/dookug-ts-client/pom.xml b/dookug-testsuite/dookug-ts-client/pom.xml index 36246ae4..20036238 100644 --- a/dookug-testsuite/dookug-ts-client/pom.xml +++ b/dookug-testsuite/dookug-ts-client/pom.xml @@ -14,6 +14,20 @@ + + hu.icellmobilsoft.coffee + coffee-bom + 2.6.0 + pom + import + + + hu.icellmobilsoft.roaster + roaster-bom + 2.2.0-SNAPSHOT + pom + import + hu.icellmobilsoft.dookug.testsuite dookug-ts-bom diff --git a/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/pom.xml b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/pom.xml new file mode 100644 index 00000000..73727366 --- /dev/null +++ b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + hu.icellmobilsoft.dookug.testsuite + dookug-ts-common + 1.0.0-SNAPSHOT + + + dookug-ts-common-base + + + + hu.icellmobilsoft.roaster + roaster-weldunit + + + org.awaitility + awaitility + + + org.assertj + assertj-core + + + \ No newline at end of file diff --git a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/FieldOnlyVisibilityStrategy.java b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/java/hu/icellmobilsoft/dookug/ts/base/BaseIT.java similarity index 51% rename from dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/FieldOnlyVisibilityStrategy.java rename to dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/java/hu/icellmobilsoft/dookug/ts/base/BaseIT.java index cbbc0277..a3550f4e 100644 --- a/dookug-common/dookug-common-rest-jee/src/main/java/hu/icellmobilsoft/dookug/common/rest/jsonb/FieldOnlyVisibilityStrategy.java +++ b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/java/hu/icellmobilsoft/dookug/ts/base/BaseIT.java @@ -17,30 +17,31 @@ * limitations under the License. * #L% */ -package hu.icellmobilsoft.dookug.common.rest.jsonb; +package hu.icellmobilsoft.dookug.ts.base; -import java.lang.reflect.Field; -import java.lang.reflect.Method; +import java.time.Duration; -import jakarta.json.bind.config.PropertyVisibilityStrategy; +import org.awaitility.Awaitility; +import org.junit.jupiter.api.BeforeAll; + +import hu.icellmobilsoft.roaster.weldunit.BaseWeldUnitType; /** - * The default JSON-B output mapping has all public methods, include setter and getter. This configuration avoids this. Based on - * private_fields_serialization_with_json + * Minden teszt alap osztalya * * @author tamas.cserhati * @since 1.0.0 * */ -public class FieldOnlyVisibilityStrategy implements PropertyVisibilityStrategy { +public class BaseIT extends BaseWeldUnitType { - @Override - public boolean isVisible(Field field) { - return true; + /** + * Minden teszt osztaly elejen lefut + */ + @BeforeAll + public static void beforeAll() { + Awaitility.setDefaultTimeout(Duration.ofSeconds(10)); + Awaitility.setDefaultPollInterval(Duration.ofSeconds(1)); } - @Override - public boolean isVisible(Method method) { - return false; - } } diff --git a/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/resources/META-INF/beans.xml b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000..331296c8 --- /dev/null +++ b/dookug-testsuite/dookug-ts-common/dookug-ts-common-base/src/main/resources/META-INF/beans.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/pom.xml b/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/pom.xml index 034f47be..4ea33dae 100644 --- a/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/pom.xml +++ b/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/pom.xml @@ -17,6 +17,10 @@ hu.icellmobilsoft.dookug dookug-api-rest-jee10 + + hu.icellmobilsoft.dookug.testsuite + dookug-ts-common-base + commons-logging @@ -27,10 +31,10 @@ weld-junit5 compile - - org.osgi - osgi.annotation - + org.eclipse.microprofile.config + microprofile-config-api + 3.0.3 + diff --git a/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/src/main/java/hu/icellmobilsoft/dookug/ts/common/rest/AbstractGenerateDocumentIT.java b/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/src/main/java/hu/icellmobilsoft/dookug/ts/common/rest/AbstractGenerateDocumentIT.java index be621e3c..34214408 100644 --- a/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/src/main/java/hu/icellmobilsoft/dookug/ts/common/rest/AbstractGenerateDocumentIT.java +++ b/dookug-testsuite/dookug-ts-common/dookug-ts-common-rest/src/main/java/hu/icellmobilsoft/dookug/ts/common/rest/AbstractGenerateDocumentIT.java @@ -40,11 +40,12 @@ import org.junit.jupiter.api.Assertions; import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.dto.exception.TechnicalException; import hu.icellmobilsoft.dookug.api.rest.builder.ParametersDataBuilder; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.ParametersDataType; +import hu.icellmobilsoft.dookug.ts.base.BaseIT; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; import hu.icellmobilsoft.roaster.common.util.FileUtil; -import hu.icellmobilsoft.roaster.restassured.BaseConfigurableWeldIT; /** * Abstract class for document generation IT tests @@ -52,7 +53,7 @@ * @author szabolcs.gemesi * @since 0.0.1 */ -public abstract class AbstractGenerateDocumentIT extends BaseConfigurableWeldIT { +public abstract class AbstractGenerateDocumentIT extends BaseIT { /** * empty json @@ -109,7 +110,7 @@ protected void writeFileIfEnabled(InputStream inputStream, String filename) thro FileUtils.copyInputStreamToFile(new ByteArrayInputStream(resultContent.toByteArray()), generatedFile); } } catch (IOException e) { - throw new BaseException(e.getLocalizedMessage()); + throw new TechnicalException(e.getLocalizedMessage()); } } diff --git a/dookug-testsuite/dookug-ts-common/pom.xml b/dookug-testsuite/dookug-ts-common/pom.xml index 9f1df10d..33df6d61 100644 --- a/dookug-testsuite/dookug-ts-common/pom.xml +++ b/dookug-testsuite/dookug-ts-common/pom.xml @@ -10,6 +10,7 @@ pom + dookug-ts-common-base dookug-ts-common-rest dookug-ts-common-resources diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/GetDocumentContentIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/GetDocumentContentIT.java index 7b216693..03d99dcb 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/GetDocumentContentIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/GetDocumentContentIT.java @@ -34,9 +34,9 @@ import hu.icellmobilsoft.coffee.dto.common.commonservice.FunctionCodeType; import hu.icellmobilsoft.coffee.dto.exception.BONotFoundException; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.RestClientResponseException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.tool.utils.string.RandomUtil; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentContentInternalRest; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentStoredTemplateInternalRest; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/PostInlineInvalidInputIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/PostInlineInvalidInputIT.java index 10ab504e..56405901 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/PostInlineInvalidInputIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/PostInlineInvalidInputIT.java @@ -33,8 +33,8 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.RestClientResponseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.GeneratorEngineType; @@ -43,10 +43,10 @@ import hu.icellmobilsoft.dookug.ts.common.builder.DocumentGenerateWithTemplatesRequestBuilder; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; import hu.icellmobilsoft.dookug.ts.common.constants.DocumentServiceTestConstant; +import hu.icellmobilsoft.dookug.ts.common.rest.AbstractGenerateDocumentIT; import hu.icellmobilsoft.dookug.ts.common.rest.mprestclient.IDocumentGenerateInlineInternalRestClient; import hu.icellmobilsoft.roaster.api.TestSuiteGroup; import hu.icellmobilsoft.roaster.common.util.FileUtil; -import hu.icellmobilsoft.roaster.restassured.BaseConfigurableWeldIT; /** * Sample service {@link IDocumentGenerateInlineInternalRest} test @@ -56,7 +56,7 @@ */ @DisplayName("Generate document inline with Pdfbox only - entity body request - simple template") @Tag(TestSuiteGroup.JAXRS) -class PostInlineInvalidInputIT extends BaseConfigurableWeldIT { +class PostInlineInvalidInputIT extends AbstractGenerateDocumentIT { @Inject @ConfigProperty(name = TsConfigKey.DOOKUG_SERVICE_DOCUMENT_BASE_URI) diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostDocumentGenerateInlineMultipartIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostDocumentGenerateInlineMultipartIT.java index 7b57f908..9bdab049 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostDocumentGenerateInlineMultipartIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostDocumentGenerateInlineMultipartIT.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateRequest; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostStoredTemplateDocumentGenerateIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostStoredTemplateDocumentGenerateIT.java index 54e8e7a3..2838a571 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostStoredTemplateDocumentGenerateIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/generate/PostStoredTemplateDocumentGenerateIT.java @@ -34,9 +34,9 @@ import org.junit.jupiter.api.Test; import hu.icellmobilsoft.coffee.dto.exception.BONotFoundException; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.RestClientResponseException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.tool.utils.string.RandomUtil; import hu.icellmobilsoft.dookug.api.rest.builder.ParametersDataBuilder; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest; @@ -89,7 +89,8 @@ void storedTemplateDocumenSaxontGenerate() throws BaseException { IDocumentGenerateStoredTemplateInternalRestClient client = RestClientBuilder.newBuilder() .baseUri(URI.create(documentBaseUri)) .build(IDocumentGenerateStoredTemplateInternalRestClient.class); - StoredTemplateDocumentGenerateRequest request = requestBuilder.fullFillDatabaseStorage(DocumentServiceTestConstant.PROJECT_STORED_TEMPLATE_NAME); + StoredTemplateDocumentGenerateRequest request = requestBuilder + .fullFillDatabaseStorage(DocumentServiceTestConstant.PROJECT_STORED_TEMPLATE_NAME); request.getGeneratorSetup().setGeneratorEngine(GeneratorEngineType.SAXON); request.getGeneratorSetup().setTemplateEngine(TemplateEngineType.NONE); request.getGeneratorSetup() diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT.java index 4a6ec0f3..23b00d48 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT.java @@ -35,14 +35,14 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; import hu.icellmobilsoft.dookug.ts.common.builder.DocumentGenerateWithTemplatesRequestBuilder; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; +import hu.icellmobilsoft.dookug.ts.common.rest.AbstractGenerateDocumentIT; import hu.icellmobilsoft.dookug.ts.common.rest.mprestclient.IDocumentGenerateInlineInternalRestClient; import hu.icellmobilsoft.roaster.api.TestSuiteGroup; -import hu.icellmobilsoft.roaster.restassured.BaseConfigurableWeldIT; /** * Sample service {@link IDocumentGenerateInlineInternalRest} test @@ -52,7 +52,7 @@ */ @DisplayName("Generate document inline with Handlebars only - entity body request") @Tag(TestSuiteGroup.JAXRS) -class PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT extends BaseConfigurableWeldIT { +class PostDocumentGenerateInlineHandlebarsOnlyEntityBodyIT extends AbstractGenerateDocumentIT { public static final String RESPONSE_STRING = "DookuG simple test with prameters first: [első], second: [í123456789öüóőúűáé-.,<>#&@{};*¤ß$]"; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyMultipartIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyMultipartIT.java index 1f15a812..b20de9c6 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyMultipartIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/handlebars/PostDocumentGenerateInlineHandlebarsOnlyMultipartIT.java @@ -36,14 +36,14 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.ts.common.builder.DocumentGenerateRequestBuilder; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; +import hu.icellmobilsoft.dookug.ts.common.rest.AbstractGenerateDocumentIT; import hu.icellmobilsoft.dookug.ts.common.rest.mprestclient.IDocumentGenerateInlineInternalRestClient; import hu.icellmobilsoft.roaster.api.TestSuiteGroup; -import hu.icellmobilsoft.roaster.restassured.BaseConfigurableWeldIT; /** * Sample service {@link IDocumentGenerateInlineInternalRest} test @@ -53,7 +53,7 @@ */ @DisplayName("Generate document inline with Handlebars only - multipart request") @Tag(TestSuiteGroup.JAXRS) -class PostDocumentGenerateInlineHandlebarsOnlyMultipartIT extends BaseConfigurableWeldIT { +class PostDocumentGenerateInlineHandlebarsOnlyMultipartIT extends AbstractGenerateDocumentIT { public static final String TEMPLATE = "DookuG simple test with prameters first: [{{first}}], second: [{{second}}]"; public static final String RESPONSE_STRING = "DookuG simple test with prameters first: [első], second: [í123456789öüóőúűáé-.,<>#&@{};*¤ß$]"; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentGenerateInlineMultipartMetadataIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentGenerateInlineMultipartMetadataIT.java index 8fbf47ac..4e67ee94 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentGenerateInlineMultipartMetadataIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentGenerateInlineMultipartMetadataIT.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import hu.icellmobilsoft.coffee.dto.common.commonservice.FunctionCodeType; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.DocumentGenerateMultipartForm; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateRequest; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentMetadataQueryIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentMetadataQueryIT.java index 7eb809ee..5da867e0 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentMetadataQueryIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostDocumentMetadataQueryIT.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; import hu.icellmobilsoft.coffee.dto.common.commonservice.FunctionCodeType; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryRequest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataQueryResponse; @@ -80,7 +80,9 @@ void testDocumentMetadataQuery() throws BaseException { DocumentMetadataQueryResponse queryResponse = queryRestClient.postDocumentMetadataQuery(queryRequest); Assertions.assertEquals(FunctionCodeType.OK, queryResponse.getFuncCode()); Assertions.assertTrue(CollectionUtils.isNotEmpty(queryResponse.getRowList())); - Set responseFormatTypes = queryResponse.getRowList().stream().map(DocumentMetadataType::getFormat) + Set responseFormatTypes = queryResponse.getRowList() + .stream() + .map(DocumentMetadataType::getFormat) .collect(Collectors.toSet()); Assertions.assertEquals(1, responseFormatTypes.size()); Assertions.assertEquals(ResponseFormatType.PDF, responseFormatTypes.toArray()[0]); diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostStoredTemplateDocumentGenerateMetadataIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostStoredTemplateDocumentGenerateMetadataIT.java index f7cbfbd6..8b697616 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostStoredTemplateDocumentGenerateMetadataIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/metadata/PostStoredTemplateDocumentGenerateMetadataIT.java @@ -32,9 +32,9 @@ import hu.icellmobilsoft.coffee.dto.common.commonservice.FunctionCodeType; import hu.icellmobilsoft.coffee.dto.exception.BONotFoundException; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.RestClientResponseException; import hu.icellmobilsoft.coffee.dto.exception.enums.CoffeeFaultType; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.coffee.tool.utils.string.RandomUtil; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateStoredTemplateInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentMetadataResponse; @@ -42,9 +42,9 @@ import hu.icellmobilsoft.dookug.ts.common.builder.StoredTemplateDocumentGenerateRequestBuilder; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; import hu.icellmobilsoft.dookug.ts.common.constants.DocumentServiceTestConstant; +import hu.icellmobilsoft.dookug.ts.common.rest.AbstractGenerateDocumentIT; import hu.icellmobilsoft.dookug.ts.common.rest.mprestclient.IDocumentGenerateStoredTemplateInternalRestClient; import hu.icellmobilsoft.roaster.api.TestSuiteGroup; -import hu.icellmobilsoft.roaster.restassured.BaseConfigurableWeldIT; /** * {@link IDocumentGenerateStoredTemplateInternalRest#postStoredTemplateDocumentGenerateMetadata(StoredTemplateDocumentGenerateRequest)} test @@ -54,7 +54,7 @@ */ @Tag(TestSuiteGroup.JAXRS) @DisplayName("Generate document with stored template") -class PostStoredTemplateDocumentGenerateMetadataIT extends BaseConfigurableWeldIT { +class PostStoredTemplateDocumentGenerateMetadataIT extends AbstractGenerateDocumentIT { @Inject @ConfigProperty(name = TsConfigKey.DOOKUG_SERVICE_DOCUMENT_BASE_URI) @@ -66,7 +66,8 @@ class PostStoredTemplateDocumentGenerateMetadataIT extends BaseConfigurableWeldI @Test @DisplayName("Generate PDF document with stored template and get the document's metadata") void testStoredTemplateDocumentGenerateMetadata() throws BaseException { - IDocumentGenerateStoredTemplateInternalRestClient client = RestClientBuilder.newBuilder().baseUri(URI.create(documentBaseUri)) + IDocumentGenerateStoredTemplateInternalRestClient client = RestClientBuilder.newBuilder() + .baseUri(URI.create(documentBaseUri)) .build(IDocumentGenerateStoredTemplateInternalRestClient.class); StoredTemplateDocumentGenerateRequest request = requestBuilder.fullFillDatabaseStorage(DocumentServiceTestConstant.DEV_TEMPLATE_NAME); DocumentMetadataResponse response = client.postStoredTemplateDocumentGenerateMetadata(request); @@ -77,7 +78,8 @@ void testStoredTemplateDocumentGenerateMetadata() throws BaseException { @Test @DisplayName("Generate PDF document with non-stored template - BONotFound") void testStoredTemplateBONotFound() throws BaseException { - IDocumentGenerateStoredTemplateInternalRestClient client = RestClientBuilder.newBuilder().baseUri(URI.create(documentBaseUri)) + IDocumentGenerateStoredTemplateInternalRestClient client = RestClientBuilder.newBuilder() + .baseUri(URI.create(documentBaseUri)) .build(IDocumentGenerateStoredTemplateInternalRestClient.class); StoredTemplateDocumentGenerateRequest request = requestBuilder.fullFillDatabaseStorage(RandomUtil.generateId()); try { diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateCustomFontIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateCustomFontIT.java index a5dc2525..26ab721b 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateCustomFontIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateCustomFontIT.java @@ -28,7 +28,6 @@ import jakarta.inject.Inject; import jakarta.ws.rs.core.Response; -import org.apache.commons.lang3.StringUtils; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.rest.client.RestClientBuilder; import org.junit.jupiter.api.Assertions; @@ -36,7 +35,7 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentStorageMethodType; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateIT.java index 46905756..cf297cd4 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/pdfbox/PostInlinePdfboxHtmlTemplateIT.java @@ -35,8 +35,8 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; import hu.icellmobilsoft.coffee.dto.exception.RestClientResponseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.api.rest.document.IDocumentGenerateInlineInternalRest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.TemplateType; diff --git a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/saxon/PostInlineSaxonXsltPdfTemplateIT.java b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/saxon/PostInlineSaxonXsltPdfTemplateIT.java index 59c63c8a..6a784686 100644 --- a/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/saxon/PostInlineSaxonXsltPdfTemplateIT.java +++ b/dookug-testsuite/dookug-ts-document/dookug-ts-document-service/src/test/java/hu/icellmobilsoft/dookug/ts/document/rest/saxon/PostInlineSaxonXsltPdfTemplateIT.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import hu.icellmobilsoft.coffee.dto.exception.BaseException; +import hu.icellmobilsoft.coffee.se.api.exception.BaseException; import hu.icellmobilsoft.dookug.schemas.document._1_0.rest.documentgenerate.DocumentGenerateWithTemplatesRequest; import hu.icellmobilsoft.dookug.ts.common.builder.DocumentGenerateWithTemplatesRequestBuilder; import hu.icellmobilsoft.dookug.ts.common.config.TsConfigKey; @@ -60,22 +60,22 @@ class PostInlineSaxonXsltPdfTemplateIT extends AbstractGenerateDocumentIT { @Inject private DocumentGenerateWithTemplatesRequestBuilder documentGenerateWithTemplatesRequestBuilder; -// @Test -// @DisplayName("Generate inline PDF document with xslt") -// void testInlineDocumentXSLTGenerate() throws BaseException { -// IDocumentGenerateInlineInternalRestClient client = RestClientBuilder.newBuilder() -// .baseUri(URI.create(documentBaseUri)) -// .build(IDocumentGenerateInlineInternalRestClient.class); -// DocumentGenerateWithTemplatesRequest request = templatesRequestBuilder.fullFillSaxonXsltDatabase(); -// request.getGeneratorSetup().setAddDigitalSignature(documentGenerateWithTemplatesRequestBuilder.digitalSigningType()); -// Response response = client.postDocumentGenerateEntityBody(request); -// Assertions.assertEquals(200, response.getStatus()); -// String filename = getFilename(response); -// Assertions.assertNotNull(filename); -// Assertions.assertTrue(filename.contains("pdf")); -// writeFileIfEnabled((InputStream) response.getEntity(), filename); -// response.close(); -// } + // @Test + // @DisplayName("Generate inline PDF document with xslt") + // void testInlineDocumentXSLTGenerate() throws BaseException { + // IDocumentGenerateInlineInternalRestClient client = RestClientBuilder.newBuilder() + // .baseUri(URI.create(documentBaseUri)) + // .build(IDocumentGenerateInlineInternalRestClient.class); + // DocumentGenerateWithTemplatesRequest request = templatesRequestBuilder.fullFillSaxonXsltDatabase(); + // request.getGeneratorSetup().setAddDigitalSignature(documentGenerateWithTemplatesRequestBuilder.digitalSigningType()); + // Response response = client.postDocumentGenerateEntityBody(request); + // Assertions.assertEquals(200, response.getStatus()); + // String filename = getFilename(response); + // Assertions.assertNotNull(filename); + // Assertions.assertTrue(filename.contains("pdf")); + // writeFileIfEnabled((InputStream) response.getEntity(), filename); + // response.close(); + // } @Test @DisplayName("Generate inline PDF document with xslt and handlebars") @@ -93,19 +93,19 @@ void testInlineDocumentXSLTGenerateHandlebars() throws BaseException { response.close(); } -// @Test -// @DisplayName("XSLT - invalid input") -// void testInlineDocumentXSLTGenerateBadParams() throws BaseException { -// IDocumentGenerateInlineInternalRestClient client = RestClientBuilder.newBuilder() -// .baseUri(URI.create(documentBaseUri)) -// .build(IDocumentGenerateInlineInternalRestClient.class); -// DocumentGenerateWithTemplatesRequest request = templatesRequestBuilder.fullFillSaxonXsltDatabase(); -// request.getGeneratorSetup().setResponseFormat(ResponseFormatType.STRING); -// BaseException fault = Assertions.assertThrows(BaseException.class, () -> { -// Response response = client.postDocumentGenerateEntityBody(request); -// response.close(); -// }); -// Assertions.assertEquals(CoffeeFaultType.INVALID_INPUT, ((BaseException) fault.getCause()).getFaultTypeEnum()); -// } + // @Test + // @DisplayName("XSLT - invalid input") + // void testInlineDocumentXSLTGenerateBadParams() throws BaseException { + // IDocumentGenerateInlineInternalRestClient client = RestClientBuilder.newBuilder() + // .baseUri(URI.create(documentBaseUri)) + // .build(IDocumentGenerateInlineInternalRestClient.class); + // DocumentGenerateWithTemplatesRequest request = templatesRequestBuilder.fullFillSaxonXsltDatabase(); + // request.getGeneratorSetup().setResponseFormat(ResponseFormatType.STRING); + // BaseException fault = Assertions.assertThrows(BaseException.class, () -> { + // Response response = client.postDocumentGenerateEntityBody(request); + // response.close(); + // }); + // Assertions.assertEquals(CoffeeFaultType.INVALID_INPUT, ((BaseException) fault.getCause()).getFaultTypeEnum()); + // } } diff --git a/pom.xml b/pom.xml index 4bc25211..47ef48f7 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ ${surefire.reportsDir}, ${failsafe.reportsDir} ${jacoco.ut.execution.data.file}, ${jacoco.it.execution.data.file} 1.16.0 - 2.5.0 + 2.7.0 @@ -182,7 +182,7 @@ - true + false true From 298d12cd4f1ea0726be6e13609ee95a6792a136a Mon Sep 17 00:00:00 2001 From: Tamas Cserhati Date: Mon, 3 Jun 2024 22:54:40 +0200 Subject: [PATCH 2/4] #74 docker env removed --- etc/docker-compose/.env | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 etc/docker-compose/.env diff --git a/etc/docker-compose/.env b/etc/docker-compose/.env deleted file mode 100644 index f8359580..00000000 --- a/etc/docker-compose/.env +++ /dev/null @@ -1,12 +0,0 @@ -OSS_DOCKER_REPOSITORY=dockerhub-dockerio.icellmobilsoft.hu -INTERNAL_DOCKER_REPOSITORY=dockerhub.icellmobilsoft.hu - -OSS_BASEIMAGE_VERSION=1.3.0 -OSS_WILDFLY_VERSION=2.0.0-SNAPSHOT - -#upgrade liqui to 1.0.0 -LIQUIBASE_VERSION=0.2.0 - -#internal -DWH_IMAGE_VERSION=0.9.0 -COMPOSE_PROFILE= From aa804d2c8c6c0de199c455af3df2ac1c04ad77c4 Mon Sep 17 00:00:00 2001 From: Tamas Cserhati Date: Mon, 3 Jun 2024 22:57:12 +0200 Subject: [PATCH 3/4] #74 install.adoc link fix --- docs/install.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.adoc b/docs/install.adoc index 7e653be1..1bef6251 100644 --- a/docs/install.adoc +++ b/docs/install.adoc @@ -93,7 +93,7 @@ DOOKUG_SERVICE_CACHE_TEMPLATE_ENABLESTATISTIC=false <3> * Ajánlott konfiguráció // TODO visszatenni, ha a docker-es dolgok is átherültek a gitHub-ra -// További kulcsok itt találhatók: https://common.pages-dev.icellmobilsoft.hu/baseimages/docker-wildfly/master/#_wildflyoracle_jdbc[wildfly/oracle-jdbc konfiguráció] +// További kulcsok itt találhatók: https://i-cell-mobilsoft-open-source.github.io/docker-wildfly/#wildfly-oracle-jdbc[wildfly/oracle-jdbc konfiguráció] [options="header",cols="1,1,1"] |=== From b38d3e26554da255a7cd737ed726b73e90a4adf4 Mon Sep 17 00:00:00 2001 From: Tamas Cserhati Date: Tue, 4 Jun 2024 09:12:17 +0200 Subject: [PATCH 4/4] #74 pr fix --- docs/release-notes/v1.0.0.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/v1.0.0.adoc b/docs/release-notes/v1.0.0.adoc index 219f5439..ef9f650b 100644 --- a/docs/release-notes/v1.0.0.adoc +++ b/docs/release-notes/v1.0.0.adoc @@ -7,7 +7,8 @@ * gitHub Workflows - java 17 upgrade * Bugfix: The `not` helper function has been fixed, it evaluated the `false` parameter incorrectly. * Handlebars version bump: 4.3.1 -> 4.4.0 -* coff:ee upgrade migráció: https://i-cell-mobilsoft-open-source.github.io/coffee/#_v2_5_0_v2_6_0[2.6.0 -> 2.7.0] +* coff:ee upgrade migráció: https://i-cell-mobilsoft-open-source.github.io/coffee/#_v2_5_0_v2_6_0[2.5.0 -> 2.6.0] +* coff:ee upgrade migráció: https://i-cell-mobilsoft-open-source.github.io/coffee/#_v2_6_0_v2_7_0[2.6.0 -> 2.7.0] NOTE: A coffee upgrade nem érinti a klienst, abban marad a 2.6.0 coffee . Ennek oka, hogy a 2.7.0-ra kellene felhúzni a projekten is a coffee-t, ami használja.