Skip to content

Commit

Permalink
Ctd
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Sep 16, 2024
1 parent 9c95f5e commit ecccf2b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Publish to the Maven Central Repository
run: mvn --batch-mode --update-snapshots deploy
if: matrix.Java == 11
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

- name: Maven Build
run: mvn --batch-mode --update-snapshots install
if: matrix.Java != 11
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ public static boolean isContentCorrect (final IValidationExecutor <IValidationSo
final IValidationArtefact aVA = aVE.getValidationArtefact ();
final IReadableResource aRes = aVA.getRuleResource ();

if (aVA.getValidationType () == EValidationType.XSD)
return XMLSchemaCache.getInstance ().getSchema (aRes) != null;
// Don't check XSD, because the dependency list will is not correctly
// available
if (false)
{
if (aVA.getValidationType () == EValidationType.XSD)
return XMLSchemaCache.getInstance ().getSchema (aRes) != null;
}

// Check that the passed Schematron is valid
if (aVA.getValidationType () == EValidationType.SCHEMATRON_PURE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public final class CIUS_PTValidation
"ubl-invoice",
"2.1.1");

private static final ClassPathResource RES_200 = new ClassPathResource ("/external/schematron/2.0.0/urn_feap.gov.pt_CIUS-PT_2.0.0.xslt",
_getCL ());
private static final ClassPathResource RES_211 = new ClassPathResource ("/external/schematron/2.1.1/urn_feap.gov.pt_CIUS-PT_2.1.1.xslt",
_getCL ());

private CIUS_PTValidation ()
{}

Expand All @@ -97,31 +92,39 @@ public static void initCIUS_PT (@Nonnull final IValidationExecutorSetRegistry <I
final boolean bNotDeprecated = false;

// V2.0.0 containing the underlying EN rules
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_200,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_200.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_200)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_200,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_200.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_200)));
{
final ClassPathResource RES_200 = new ClassPathResource ("/external/schematron/2.0.0/urn_feap.gov.pt_CIUS-PT_2.0.0.xslt",
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_200,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_200.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_200)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_200,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_200.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_200)));
}

// V2.1.1 containing the underlying EN rules
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_211,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_211.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_211)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_211,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_211.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_211)));
{
final ClassPathResource RES_211 = new ClassPathResource ("/external/schematron/2.1.1/urn_feap.gov.pt_CIUS-PT_2.1.1.xslt",
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_211,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_211.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_211)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_211,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_211.getVersionString (),
PhiveRulesHelper.createSimpleStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
PhiveRulesUBLHelper.createXSLT_UBL21 (RES_211)));
}
}
}

0 comments on commit ecccf2b

Please sign in to comment.