diff --git a/README.md b/README.md index f881fb55..9d88f3ec 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved # News and noteworthy * v3.1.10 - work in progress + * Added support for EN 16931 rules v1.3.12 format and deprecated v1.3.10 * All OIOUBL 1.x validations are now correctly based on UBL 2.1 instead of UBL 2.0 * Extracted the rules for the legacy OIOUBL rules into a separate registerable entity (`OIOUBLLegacyValidation`). * v3.1.9 - 2024-03-22 diff --git a/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java b/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java index fe7b4600..fbbcafc5 100644 --- a/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java +++ b/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java @@ -25,6 +25,8 @@ import com.helger.diver.api.version.VESID; import com.helger.phive.api.executorset.IValidationExecutorSetRegistry; import com.helger.phive.api.executorset.ValidationExecutorSet; +import com.helger.phive.api.executorset.status.IValidationExecutorSetStatus; +import com.helger.phive.api.executorset.status.ValidationExecutorSetStatus; import com.helger.phive.xml.schematron.SchematronNamespaceBeautifier; import com.helger.phive.xml.source.IValidationSourceXML; import com.helger.phive.xml.xsd.ValidationExecutorXSD; @@ -47,6 +49,12 @@ public final class CIIValidation private CIIValidation () {} + @Nonnull + private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated) + { + return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated); + } + /** * Register all standard CII D16B validation execution sets to the provided * registry. @@ -66,7 +74,7 @@ public static void initCIID16B (@Nonnull final IValidationExecutorSetRegistry XSD_UTITLITY_STATEMENT = new CommonsArrayList <> (CUBL20.XSD_CODELIST_UNIT_CODE, CUBL20.XSD_CODELIST_MIME_MEDIA_TYPE_CODE, CUBL20.XSD_CODELIST_CURRENCY_CODE, @@ -232,7 +242,7 @@ public static void initOIOUBL (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -85,7 +93,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -90,13 +99,13 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -97,7 +105,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -91,7 +99,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aVESInvoiceAT = ValidationExecutorSet.createDerived (aVESInvoice, VID_OPENPEPPOL_T10_AT_NAT, "OpenPeppol Invoice (Austria)", - bDeprecated, + _createStatus (bDeprecated), ValidationExecutorSchematron.createXSLT (INVOICE_AT_NAT, sPreReqInvoice, aNSCtxInvoice)); @@ -99,7 +107,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aVESCreditNoteAT = ValidationExecutorSet.createDerived (aVESCreditNote, VID_OPENPEPPOL_T14_AT_NAT, "OpenPeppol Credit Note (Austria)", - bDeprecated, + _createStatus (bDeprecated), ValidationExecutorSchematron.createXSLT (CREDIT_NOTE_AT_NAT, sPreReqCreditNote, aNSCtxCreditNote)); @@ -116,7 +124,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -323,7 +275,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -89,7 +87,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -96,7 +101,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); final String sVersion = " (" + VERSION_STR + ")"; - final boolean bIsDeprecated = true; + final boolean bDeprecated = true; aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T01_V2, "OpenPeppol Order" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderXSDs ()), _createPure (ORDER_RULES), _createPure (ORDER_OPENPEPPOL), _createPure (ORDER_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T10_V2, "OpenPeppol Invoice" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()), _createPure (INVOICE_RULES), _createPure (INVOICE_OPENPEPPOL), _createPure (INVOICE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T14_V2, "OpenPeppol Credit Note" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()), _createPure (CREDIT_NOTE_RULES), _createPure (CREDIT_NOTE_OPENPEPPOL), _createPure (CREDIT_NOTE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T16_V2, "OpenPeppol Despatch Advice" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllDespatchAdviceXSDs ()), _createPure (DESPATCH_ADVICE_RULES), _createPure (DESPATCH_ADVICE_OPENPEPPOL), _createPure (DESPATCH_ADVICE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T19_V2, "OpenPeppol Catalogue" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCatalogueXSDs ()), _createPure (CATALOGUE_RULES), _createSCH (CATALOGUE_OPENPEPPOL), _createPure (CATALOGUE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T58_V2, "OpenPeppol Catalogue Response" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllApplicationResponseXSDs ()), _createPure (CATALOGUE_RESPONSE_RULES), _createPure (CATALOGUE_RESPONSE_OPENPEPPOL), _createPure (CATALOGUE_RESPONSE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T71_V2, "OpenPeppol MLR" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllApplicationResponseXSDs ()), _createPure (MLR_RULES), _createPure (MLR_OPENPEPPOL), _createPure (MLR_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T76_V2, "OpenPeppol Order Response" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderResponseXSDs ()), _createPure (ORDER_RESPONSE_RULES), _createPure (ORDER_RESPONSE_OPENPEPPOL), _createPure (ORDER_RESPONSE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T77_V1, "OpenPeppol Punch Out" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCatalogueXSDs ()), _createPure (PUNCH_OUT_RULES), _createPure (PUNCH_OUT_OPENPEPPOL))); // Must use XSLT based conversion because of custom XSLT function! aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T110_V1, "OpenPeppol Order Agreement" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderResponseXSDs ()), _createSCH (ORDER_AGREEMENT_RULES), _createSCH (ORDER_AGREEMENT_OPENPEPPOL))); diff --git a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java index 1b33131e..aaac2a29 100644 --- a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java +++ b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java @@ -30,6 +30,8 @@ import com.helger.diver.api.version.VESID; import com.helger.phive.api.executorset.IValidationExecutorSetRegistry; import com.helger.phive.api.executorset.ValidationExecutorSet; +import com.helger.phive.api.executorset.status.IValidationExecutorSetStatus; +import com.helger.phive.api.executorset.status.ValidationExecutorSetStatus; import com.helger.phive.xml.schematron.ValidationExecutorSchematron; import com.helger.phive.xml.source.IValidationSourceXML; import com.helger.phive.xml.xsd.ValidationExecutorXSD; @@ -224,6 +226,12 @@ private static ValidationExecutorSchematron _createXSLT (@Nonnull final IReadabl return ValidationExecutorSchematron.createXSLT (aRes, UBL21NamespaceContext.getInstance ()); } + @Nonnull + private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated) + { + return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated); + } + public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -232,70 +240,70 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -196,14 +204,14 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -185,7 +193,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -133,7 +141,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -135,7 +143,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -150,7 +158,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -128,7 +136,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -137,7 +145,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -136,7 +144,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -110,7 +118,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -74,7 +82,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -80,7 +88,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -85,7 +93,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -90,13 +98,13 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -78,7 +86,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -94,7 +102,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry