import-class="fr.gouv.finances.dgfip.xemelios.etatFrais.EtatFraisImporter"
persistence-config="etat-frais/etat-frais-persist.xml"
referentiel="no-balise" titre="Etat de frais FEN0058"
- natIdColl="SIRET"
- isControlable="true"
- control-config-file="etat-frais/etat-frais-controls.xml"
+ natIdColl="SIRET"
browsable="false"
ordre-presentation="500"
displayInMenuIf="xemelios.do.not.set">
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<controls>
- <document id="DocEtatsFrais">
- <collectivite-path sort="2">
- <code-path>/ef:EtatsFrais/ef:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID</code-path>
- <libelle-path>/ef:EtatsFrais/ef:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID</libelle-path>
- </collectivite-path>
- <param id="secteur" name="Secteur" datatype="string" use="required" value="Etat">
- <select id="nomencl">
- <option value="Public Local">Public Local</option>
- <option value="Etat">Etat</option>
- </select>
- </param>
- <param id="Type d'état" name="Type d'état" datatype="string" use="required" value="K2, K3">
- <input id="Type d'état" datatype="String"/></param>
- <param id="Moyens de paiement" name="Moyens de paiement" datatype="string" use="required" value="V, O, C">
- <input id="Moyens de paiement" datatype="String"/></param>
- <param id="Types de frais" name="Types de frais" datatype="string" use="required" value="AUTRE, HOTEL, PARKING, VOITURE, 2_ROUES, TAXI, PEAGE, TRAIN, AVION, CAR, BATEAU, AUTRE_TRANSPORT_COMMUN, REPAS, NUITEE, LOCATION, ABONNEMENT, AVANCE_FRAIS">
- <input id="Types de frais" datatype="String"/></param>
- <controlTech id="TECH01" libelle="Contrôle de la structure xml du fichier." severity="BLOQUANT"/>
- <controlTech id="TECH02" libelle="Contrôle de l'encoding du fichier." severity="BLOQUANT">
- <paramTech id="encoding" name="encoding" value="ISO-8859-15"/></controlTech>
- <controlTech id="TECH03" libelle="Contrôle de la conformance au schéma." severity="BLOQUANT">
- <paramTech id="schemaLocation" name="schemaLocation" value="etat-frais/schema/EtatsFrais.xsd"/></controlTech>
- <control id="SOM01" libelle="Contrôle de cohérence des montants des ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.som.SOM01">
- <regle-fonctionnelle>Le montant total des frais de chaque ordre de mission doit être égal à la somme des montants des lignes de frais.</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# MtN= #CAC_LEGAL_MONETARY_TOTAL# - Somme des lignes= #SOMME_CBC_LINEEXTENSIONAMOUNT# </message-echec>
- </control>
- <control id="PRES01" libelle="Contrôle de présence des valideurs d'ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres.PRES01">
- <regle-fonctionnelle>Chaque ordre de mission doit avoir un valideur</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Il n'y a pas de valideur</message-echec>
- </control>
- <control id="PRES02" libelle="Contrôle de présence des initiateurs d'ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres.PRES02">
- <regle-fonctionnelle>Chaque ordre de mission doit avoir un initiateur</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Il n'y a pas d'initiateur</message-echec>
- </control>
- <control id="CHORUS01" libelle="Contrôle de présence des centres de couts" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.CHORUS01">
- <regle-fonctionnelle>Chaque ligne de frais doit avoir un centre de couts</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# - Ligne de frais #CBC_IDINVOICELINE#: Il n'y a pas de centre de couts</message-echec>
- </control>
- <control id="CHORUS02" libelle="Contrôle de présence des centres financiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.CHORUS02">
- <regle-fonctionnelle>Chaque ligne de frais doit avoir un centre de couts</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# - Ligne de frais #CBC_IDINVOICELINE#: Il n'y a pas de centre de financier</message-echec>
- </control>
- <control id="CHORUS03" libelle="Contrôle de présence des domaines fonctionnels" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.CHORUS03">
- <regle-fonctionnelle>Chaque ligne de frais doit avoir un centre de couts</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# - Ligne de frais #CBC_IDINVOICELINE#: Il n'y a pas de domaine fonctionnel</message-echec>
- </control>
- <control id="CHORUS04" libelle="Contrôle de présence des activités" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.CHORUS04">
- <regle-fonctionnelle>Chaque ligne de frais doit avoir une activité</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# - Ligne de frais #CBC_IDINVOICELINE#: Il n'y a pas d'activité</message-echec>
- </control>
- <control id="CHORUS05" libelle="Contrôle de présence des localisations interministerielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.CHORUS05">
- <regle-fonctionnelle>Chaque ligne de frais doit avoir un centre de couts</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# - Ligne de frais #CBC_IDINVOICELINE#: Il n'y a pas de localisation interministérielle</message-echec>
- </control>
- <control id="VALUES01" libelle="Contrôle des modalités de réglement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values.VALUES01">
- <regle-fonctionnelle>Les seuls moyens de paiement reconnus sont V: virement bancaire O: paiement en devise étrangère et C: chèque</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# Valeur incorrecte #CBC_VALUE# pour l'élément #CBC_ELEMENT#
-Les valeurs possibles sont #CBC_LISTVALUES#
- </message-echec>
- </control>
- <control id="VALUES02" libelle="Contrôle des types de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values.VALUES02">
- <regle-fonctionnelle>Les seuls types de frais reconnus sont ceux de la liste passée en paramètre</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Valeur incorrecte #CBC_VALUE# pour l'élément #CBC_ELEMENT# ;
-Les valeurs possibles sont #CBC_LISTVALUES#
- </message-echec>
- </control>
- <control id="VALUES03" libelle="Contrôle du type d'état de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values.VALUES03">
- <regle-fonctionnelle>Les seuls types d'état reconnus sont Etat de frais, demande d'avance ou Régularisation d'avance</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Valeur incorrecte #CBC_VALUE# pour l'élément #CBC_ELEMENT# ;
-Les valeurs possibles sont #CBC_LISTVALUES#
- </message-echec>
- </control>
- </document>
-</controls>
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<controls>
- <document id="etat-frais">
- <collectivite-path sort="2">
- <code-path>/EtatsFrais/@added:collectivite</code-path>
- <libelle-path>/EtatsFrais/@added:collectivite</libelle-path>
- </collectivite-path>
- <param id="secteur" name="Secteur" datatype="string" use="required" value="Etat">
- <select id="nomencl">
- <option value="Public Local">Public Local</option>
- <option value="Etat">Etat</option>
- </select>
- </param>
- <param id="Moyens de paiement" name="Moyens de paiement" datatype="string" use="required" value="V, O, C">
- <input id="Moyens de paiement" datatype="String"/></param>
- <param id="Types de frais" name="Types de frais" datatype="string" use="required" value="AUTRE, HOTEL, PARKING, VOITURE, 2_ROUES, TAXI, PEAGE, TRAIN, AVION, CAR, BATEAU, AUTRE_TRANSPORT_COMMUN, REPAS, NUITEE, LOCATION, ABONNEMENT, AVANCE_FRAIS">
- <input id="Types de frais" datatype="String"/></param>
- <engine xmlns="">
- <add-on name="unique.id.generator">
- <param id="element.name" name="element.name" datatype="string" value="Invoice"/>
- <param id="generated.attribute" name="generated.attribute" datatype="string" value="ano:unique-id"/>
- <param id="processor" name="processor" datatype="string" value="fr.gouv.finances.cp.xemelios.controls.processors.IdGeneratorProcessor"/>
- <param id="event" name="event" datatype="string" value="start.element"/>
- <param id="generator" name="generator" datatype="string" value="fr.gouv.finances.cp.xemelios.controls.processors.impl.TstampIPUniqueId"/></add-on>
- <add-on name="collectivite.generator">
- <param id="element.name" name="element.name" datatype="string" value="EtatsFrais"/>
- <param id="processor" name="processor" datatype="string" value="fr.gouv.finances.dgfip.xemelios.etatFrais.CollectiviteGenerator"/>
- <param id="event" name="event" datatype="string" value="start.element"/></add-on>
- </engine>
- <controlTech id="TECH01" libelle="Contrôle de la structure xml du fichier." severity="BLOQUANT"/>
- <controlTech id="TECH02" libelle="Contrôle de l'encoding du fichier." severity="BLOQUANT">
- <paramTech id="encoding1" name="encoding" value="ISO-8859-15"/>
- <paramTech id="failOnError" name="failOnError" value="false"/></controlTech>
- <controlTech id="TECH03" libelle="Contrôle de la conformance au schéma." severity="BLOQUANT">
- <paramTech id="schemaLocation" name="schemaLocation" value="etat-frais/schema/EtatsFrais.xsd"/>
- <paramTech id="failOnError" name="failOnError" value="false"/></controlTech>
- <control id="SOM01" libelle="Contrôle de cohérence des montants des ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.som.SOM01">
- <regle-fonctionnelle>Le montant total des frais de chaque ordre de mission doit être égal à la somme des montants des lignes de frais.</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# MtN= #CAC_LEGAL_MONETARY_TOTAL# - Somme des lignes= #SOMME_CBC_LINEEXTENSIONAMOUNT# </message-echec>
- </control>
- <control id="PRES01" libelle="Contrôle de présence des valideurs d'ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres.PRES01">
- <regle-fonctionnelle>Chaque ordre de mission doit avoir un valideur</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Il n'y a pas d'identifiant de valideur</message-echec>
- </control>
- <control id="PRES02" libelle="Contrôle de présence des initiateurs d'ordres de mission" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres.PRES02">
- <regle-fonctionnelle>Chaque ordre de mission doit avoir un initiateur</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Il n'y a pas d'initiateur</message-echec>
- </control>
- <control id="VALUES02" libelle="Contrôle des types de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values.VALUES02">
- <regle-fonctionnelle>Les seuls types de frais reconnus sont ceux de la liste passée en paramètre</regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# : Valeur incorrecte #CBC_VALUE# pour l'élément #CBC_ELEMENT# ; Les valeurs possibles sont #CBC_LISTVALUES# </message-echec>
- </control>
- <control id="CTL-M029" libelle="Identifiant de l'EF dans l'application émettrice" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M029">
- <regle-fonctionnelle> Vérifier que le texte de l'élément EtatsFrais/Invoice/ID a une longueur de 12 caractères maximum.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M030" libelle="Type de demande de paiement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M030">
- <regle-fonctionnelle>L'élément EtatsFrais/Invoice/ID doit être unique dans un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M031" libelle="Type de demande de paiement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M031">
- <regle-fonctionnelle>L'élément EtatsFrais/Invoice/InvoiceTypeCode est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M032" libelle="Type de demande de paiement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M032">
- <regle-fonctionnelle><![CDATA[Le texte de l'élément EtatsFrais/Invoice/InvoiceTypeCode ne peut prendre que l'une des valeurs suivantes :<br/>
- <ul><li> K1 : DP du solde d'un état de frais </li> <li> K2 : DP de l'avance sur un état de frais </li>
- <li> K3 : DP de récupération d'avance sur état de frais </li></ul>]]></regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice#_InvoiceTypeCode: #TYPECODE# : Valeur du texte de l'element EtatsFrais/Invoice/InvoiceTypeCode non autorisee. </message-echec>
- </control>
- <control id="CTL-M033" libelle="IInitiateur de la demande de paiement dans Chorus" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M033">
- <regle-fonctionnelle> Vérifier que le texte l'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/Valideur/PartyIdentification/ID a une longueur de 12 caractères maximum.</regle-fonctionnelle>
- <message-echec>ID_PartyIdentification = #ID_PartyIdentification# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M034" libelle="Informations décrivant le paiement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M034">
- <regle-fonctionnelle> Vérifier la présence obligatoire et unique pour un EF (cardinalité 1:1) de l'élément EtatsFrais/Invoice/PaymentMeans.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M035" libelle="Mode de paiement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values.CTL_M035">
- <regle-fonctionnelle><![CDATA[Le texte de l'élément EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode ne peut prendre que l'une des valeurs suivantes : <br/> <ul><li> V : virements bancaires</li>
- <li> O : paiements en devise étrangère </li>
- <li> C : chèques.</li> </ul>]]></regle-fonctionnelle>
- <message-echec>Ordre de mission n° #CBC_ID# - Date= #CBC_ISSUEDATE# - Type Etat de Frais= #CBC_INVOICETYPECODE# Valeur incorrecte #CBC_VALUE# pour l'élément #CBC_ELEMENT# : Valeur du texte de l element EtatsFrais/Invoice/InvoiceTypeCode non autorisee. </message-echec>
- </control>
- <control id="CTL-M036" libelle="Domaine d'activité" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M036">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/EtatFraisChorus est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M037" libelle="Centre de coûts" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M037">
- <regle-fonctionnelle>Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_CENTRE_COUTS. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M038" libelle="Centre de coûts" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M038">
- <regle-fonctionnelle>Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_CENTRE_COUTS a une longueur de 10 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M039" libelle="Centre financier (Programme-BOP-UO)" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M039">
- <regle-fonctionnelle>Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_CENTRE_FINANCIER.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M040" libelle="Centre financier(Programme-BOP-UO)" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M040">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_CENTRE_FINANCIER a une longueur de 16 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M041" libelle="Domaine fonctionnel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M041">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_DOMAINE_FONCTIONNEL.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M042" libelle="Domaine fonctionnel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M042">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_DOMAINE_FONCTIONNEL a une longueur de 16 caractères maximum.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M043" libelle="Activité" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M043">
- <regle-fonctionnelle>Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_ACTIVITE. Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_ACTIVITE. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M044" libelle="Activité" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M044">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_ACTIVITE a une longueur de 24 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M045" libelle="Projet analytique ministériel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M045">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_PROJET_ANALYTIQUE_MINISTERIEL.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M046" libelle="Projet analytique ministériel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M046">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_PROJET_ANALYTIQUE_MINISTERIEL a une longueur de 22 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M047" libelle="Localisation ministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M047">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_LOCALISATION_MINISTERIELLE. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M048" libelle="Localisation ministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M048">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_LOCALISATION_MINISTERIELLE a une longueur de 22 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M049" libelle="Localisation interministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M049">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_LOCALISATION_INTERMINISTERIELLE. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M050" libelle="Localisation interministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M050">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_LOCALISATION_INTERMINISTERIELLE a une longueur de 8 caractères maximum. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M051" libelle="Nature détaillée ministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M051">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_NATURE_MINISTERIELLE. </regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M052" libelle="Nature détaillée ministérielle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M052">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_NATURE_MINISTERIELLE a une longueur de 11 caractères maximum.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M053" libelle="Axe ministériel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M053">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_AXE_MINISTERIEL_1.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M054" libelle="Axe ministériel 1" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M054">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_AXE_MINISTERIEL_1 a une longueur de 22 caractères maximum.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M055" libelle="Axe ministériel" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M055">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_AXE_MINISTERIEL_2.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M056" libelle="Axe ministériel 2" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M056">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_AXE_MINISTERIEL_2 a une longueur de 22 caractères maximum.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M057" libelle="Compte PCE" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M057">
- <regle-fonctionnelle> Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à CH_COMPTE_PCE.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M058" libelle="Compte PCE " severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M058">
- <regle-fonctionnelle> Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à CH_COMPTE_PCE a une longueur de 10 caractères exactement.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# _ InvoiceLine n° #IDLINE# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M059" libelle="Informations complémentaires liées à l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M059">
- <regle-fonctionnelle>L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M060" libelle="Contrôle de la présence de l'identifiant Chorus du tiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M060">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdChorusTiers est obligatoire pour un EF si le texte de l'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers est égal à 'ZCPD'.</regle-fonctionnelle>
- <message-echec>L'invoice #INVOICE_ID# ne comporte pas d'identifiant Chorus du tiers.</message-echec>
- </control>
- <control id="CTL-M061" libelle="Contrôle de la présence de l'identifiant Chorus du tiers et de l'identifiant fonctionnel du tiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M061">
- <regle-fonctionnelle> Si le texte de l'élément /dgfip:AgentChorus/dgfip:TypeTiers est différent de 'ZCPD' alors l'un des deux éléments /dgfip:AgentChorus/dgfip:IdChorusTiers et /dgfip:AgentChorus/dgfip:IdFoncTiers doit être présent pour un EF.</regle-fonctionnelle>
- <message-echec>L'invoice #INVOICE_ID# ne comporte ni identifiant Chorus du tiers ni identifiant fonctionnel du tiers.</message-echec>
- </control>
- <control id="CTL-M062" libelle="Contrôle de l'identifiant fonctionnel du tiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M062">
- <regle-fonctionnelle><![CDATA[Le texte de l'élément /dgfip:AgentChorus/dgfip:IdFoncTiers doit vérifier les caractéristiques suivantes selon le texte de l'élément /dgfip:AgentChorus/dgfip:TypeTiers :<br/>
- <ul><li>Si TypeTiers='ZCOM' alors donnée numérique sur 6 chiffres</li>
- <li>Si TypeTiers='ZCPD' alors donnée numérique sur 10 ou 14 chiffres</li>
- <li>Si TypeTiers='ZETR' alors donnée sur 2 caractères min et 37 max</li>
- <li>Si TypeTiers='ZEUR' alors pas de contrainte de longueur et de format</li>
- <li>Si TypeTiers='ZFRA' alors donnée numérique sur 14 chiffres</li>
- <li>Si TypeTiers='ZPHY' alors donnée sur 10 caractères min et 80 max</li>
- <li>Si TypeTiers='ZREG' alors donnée sur 12 caractères composée de 4 lettres + 7 chiffres + 1 lettre</li>
- <li>Si TypeTiers='ZSRV' alors donnée sur 10 caractères composée de 1 lettre + 6 chiffres + 3 alphanumériques</li> <li>Si TypeTiers='ZTAE' alors donnée sur 10 caractères min et 80 max</li></ul>]]></regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# _ Type tiers = #TYPETIERS# _ Identifiant fonctionnel du tiers = #IDFONCTIERS# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M063" libelle="Informations décrivant l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M063">
- <regle-fonctionnelle>L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M064" libelle="Informations décrivant l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M064">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M065" libelle="Contrôle de la présence de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M065">
- <regle-fonctionnelle>L'élément AcountingSupplierParty/Party/AgentParty/PhysicalLocation/Address est obligatoire pour un EF</regle-fonctionnelle>
- <message-echec>L'invoice #INVOICE_ID# : La résidence administrative de l'agent est obligatoire.</message-echec>
- </control>
- <control id="CTL-M066" libelle="Résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M066">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/Address est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M067" libelle="Contrôle de la présence de la localité de la résidence de l'agent (familiale ou administrative)" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M067">
- <regle-fonctionnelle>L'élément CityName est obligatoire dans une adresse : AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/CityName ou AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : CityName de PhysicalLocation/Address ou de PostalAddress est obligatoire avec une adresse.</message-echec>
- </control>
- <control id="CTL-M068" libelle="Contrôle des informations sur la ligne d'adresse de la résidence de l'agent (familiale ou administrative)" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M068">
- <regle-fonctionnelle>L'élément AddressLine est obligatoire dans une adresse : AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine ou AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : AddressLine de PhysicalLocation/Address ou de PostalAddress est obligatoire avec une adresse.</message-echec>
- </control>
- <control id="CTL-M069" libelle="Ligne d'adresse de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M069">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/Address est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M070" libelle="Informations sur le pays de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M070">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/Address/Country est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Id Invoice = #ID_Invoice# : #ERREUR#.</message-echec>
- </control>
- <control id="CTL-M071" libelle="Contrôle de la clé de pays de la résidence de l'agent (familiale ou administrative)" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M071">
- <regle-fonctionnelle>L'élément Country/IdentificationCode est obligatoire dans une adresse : AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country/IdentificationCode ou AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/IdentificationCode.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Country/IdentificationCode de PhysicalLocation/Address ou de PostalAddress est obligatoire avec une adresse.</message-echec>
- </control>
- <control id="CTL-M072" libelle="Informations décrivant l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M072">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/Person est obligatoire si tiers ZCPD.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Tiers ZCPD alors l'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/Person est obligatoire.</message-echec>
- </control>
- <control id="CTL-M073" libelle="Contrôle du prénom de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M073">
- <regle-fonctionnelle>L'élément AccountingSupplierParty/Party/Person/FirstName est obligatoire pour un EF si le type de tiers vaut 'ZCPD'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : l'élément AccountingSupplierParty/Party/Person/FirstName est obligatoire si tiers ZCPD.</message-echec>
- </control>
- <control id="CTL-M074" libelle="Contrôle du nom de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M074">
- <regle-fonctionnelle>L'élément AccountingSupplierParty/Party/Person/FamilyName est obligatoire pour un EF si le type de tiers vaut 'ZCPD'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : l'élément AccountingSupplierParty/Party/Person/FamilyName est obligatoire si tiers ZCPD.</message-echec>
- </control>
- <control id="CTL-M075" libelle="Localité de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M075">
- <regle-fonctionnelle>L'élément PostalAddress/CityName est obligatoire si PostalAddress est présent.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PostalAddress est présent alors l'élément PostalAddress/CityName est obligatoire.</message-echec>
- </control>
- <control id="CTL-M076" libelle="Informations sur la ligne d'adresse de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M076">
- <regle-fonctionnelle>L'élément PostalAddress/AddressLine est obligatoire si PostalAddress est présent. </regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PostalAddress est présent alors l'élément PostalAddress/AddressLine est obligatoire.</message-echec>
- </control>
- <control id="CTL-M077" libelle="Informations sur la ligne d'adresse de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M077">
- <regle-fonctionnelle>L'élément PostalAddress/AddressLine/Line est obligatoire si PostalAddress est présent.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PostalAddress est présent alors l'élément PostalAddress/AddressLine/Line est obligatoire.</message-echec>
- </control>
- <control id="CTL-M078" libelle="Informations sur le pays de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M078">
- <regle-fonctionnelle>L'élément PostalAddress/Country est obligatoire si PostalAddress est présent.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PostalAddress est présent alors l'élément PostalAddress/Country est obligatoire.</message-echec>
- </control>
- <control id="CTL-M079" libelle="Clé de pays de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M079">
- <regle-fonctionnelle>L'élément PostalAddress/Country/IdentificationCode est obligatoire si PostalAddress est présent. </regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PostalAddress est présent alors l'élément PostalAddress/Country/IdentificationCode est obligatoire.</message-echec>
- </control>
- <control id="CTL-M080" libelle="Contrôle du prénom de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M080">
- <regle-fonctionnelle>Le texte de l'élément AccountingSupplierParty/Party/Person/FirstName doit avoir une longueur de 35 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de AccountingSupplierParty/Party/Person/FirstName est incorrecte.</message-echec>
- </control>
- <control id="CTL-M081" libelle="Contrôle du nom de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M081">
- <regle-fonctionnelle>Le texte de l'élément AccountingSupplierParty/Party/Person/FamilyName doit avoir une longueur de 35 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de AccountingSupplierParty/Party/Person/FamilyName est incorrecte.</message-echec>
- </control>
- <control id="CTL-M082" libelle="Contrôle du code postal de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M082">
- <regle-fonctionnelle>Le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/PostalZone doit avoir une longueur de 10 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PhysicalLocation/Address/PostalZone est incorrecte.</message-echec>
- </control>
- <control id="CTL-M083" libelle="Code postal de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M083">
- <regle-fonctionnelle>Le texte de l'élément ..PostalAddress/PostalZone doit avoir une longueur de 16 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID#_PostalZone=#PostalZone# : Longueur de ..PostalAddress/PostalZone est incorrecte.</message-echec>
- </control>
- <control id="CTL-M084" libelle="Contrôle de la localité de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M084">
- <regle-fonctionnelle>Le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/CityName doit avoir une longueur de 35 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PhysicalLocation/Address/CityName est incorrecte.</message-echec>
- </control>
- <control id="CTL-M085" libelle="Localité de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M085">
- <regle-fonctionnelle>Le texte de l'élément .../PostalAddress/CityName doit avoir une longueur de 16 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID#_CityName=#CityName# : Longueur de .../PostalAddress/CityName est incorrecte.</message-echec>
- </control>
- <control id="CTL-M086" libelle="Contrôle de la clé de pays de la résidence administrative de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M086">
- <regle-fonctionnelle>Le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country/IdentificationCode doit avoir une longueur de 2 caractères.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PhysicalLocation/Address/Country/IdentificationCode est incorrecte.</message-echec>
- </control>
- <control id="CTL-M087" libelle="Clé de pays de la résidence familiale de l'agent" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M087">
- <regle-fonctionnelle>Le texte de l'élément .../PostalAddress/Country/IdentificationCode doit avoir une longueur de 2 caractères exactement. </regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID#_IdentificationCode=#IdentificationCode# : .../PostalAddress/Country/IdentificationCode est incorrecte.</message-echec>
- </control>
- <control id="CTL-M088" libelle="Contrôle du type d'identification bancaire pour virement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M088">
- <regle-fonctionnelle>L'élément PaymentMeans/PaymentChannelCode est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : L'élément PaymentMeans/PaymentChannelCode est obligatoire.</message-echec>
- </control>
- <control id="CTL-M089" libelle="Contrôle du type d'identification bancaire pour virement" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M089">
- <regle-fonctionnelle>Le texte de l'élément PaymentMeans/PaymentChannelCode ne peut prendre comme valeur que 'IBAN' ou 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Valeur du texte de l'élément PaymentMeans/PaymentChannelCode non autorisée.</message-echec>
- </control>
- <control id="CTL-M090" libelle="Contrôle de l'IBAN" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M090">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/ID est obligatoire si et seulement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'IBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/ID est obligatoire si virement et IBAN fourni.</message-echec>
- </control>
- <control id="CTL-M091" libelle="Contrôle du numéro de compte bancaire du tiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M091">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/ID est obligatoire si et seulement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/ID est obligatoire si virement et BBAN fourni.</message-echec>
- </control>
- <control id="CTL-M092" libelle="Contrôle de l'identifiant de la banque" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M092">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID est obligatoire si et seulement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID est obligatoire si virement et BBAN fourni.</message-echec>
- </control>
- <control id="CTL-M093" libelle="Contrôle de la clé du pays de la banque" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M093">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode est obligatoire si et seulement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode est obligatoire si virement et BBAN fourni.</message-echec>
- </control>
- <control id="CTL-M094" libelle="Contrôle de l'IBAN" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M094">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/ID doit avoir une longueur de 34 caractères maximum si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'IBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PaymentMeans/PayeeFinancialAccount/ID doit être de 34 car. maxi.</message-echec>
- </control>
- <control id="CTL-M095" libelle="Contrôle du numéro de compte bancaire du tiers" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M095">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/ID doit avoir une longueur de 18 caractères maximum si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PaymentMeans/PayeeFinancialAccount/ID doit être de 18 car. maxi.</message-echec>
- </control>
- <control id="CTL-M096" libelle="Contrôle de l'identifiant de la banque" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M096">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID doit avoir une longueur de 15 caractères maximum si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : Longueur de PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID doit être de 15 car. maxi.</message-echec>
- </control>
- <control id="CTL-M097" libelle="Contrôle de la clé du pays de la banque" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M097">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode doit avoir une longueur de 2 caractères exactement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode doit être sur 2 car.</message-echec>
- </control>
- <control id="CTL-M098" libelle="Contrôle de la clé de contrôle" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M098">
- <regle-fonctionnelle>L'élément PaymentMeans/PayeeFinancialAccount/PaymentNote doit avoir une longueur de 2 caractères exactement si PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : PaymentMeans/PayeeFinancialAccount/PaymentNote doit être sur 2 car.</message-echec>
- </control>
- <control id="CTL-M099" libelle="Contrôle du Montant TTC en devise de l'EF" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M099">
- <regle-fonctionnelle> L'élément EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount est obligatoire pour un EF.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : L'élément EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount est obligatoire. </message-echec>
- </control>
- <control id="CTL-M100" libelle="Contrôle du montant TTC en devise de l'EF" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M100">
- <regle-fonctionnelle> Vérifier que l'élément EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount vérifie le format 9(19).9(4).</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# : EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount doit verifier le format 9(19).9(4).</message-echec>
- </control>
- <control id="CTL-M101" libelle="Contrôle des montants TTC en devise de l'EF et de la ligne de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M101">
- <regle-fonctionnelle> Vérifier que la valeur de l'attribut CurrencyID est identique pour l'élément EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount de l'EF et les éléments EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount au niveau de chaque ligne d'EF. </regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# _ Ligne de frais n° #INVOICE_LINE_ID# : L'attribut CurrencyID doit etre identique dans tous les elements LineExtensionAmount. </message-echec>
- </control>
- <control id="CTL-M102" libelle="Contrôle du montant TTC en devise de la ligne de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M102">
- <regle-fonctionnelle> Vérifier que l'élément EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount au niveau de chaque ligne d'EF vérifie le format 9(19).9(4).</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# _ Ligne de frais n° #INVOICE_LINE_ID# : EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount doit verifier le format 9(19).9(4).</message-echec>
- </control>
- <control id="CTL-M103" libelle="Contrôle de la description de la ligne d'état de frais" severity="BLOQUANT" class="fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus.M103">
- <regle-fonctionnelle> Vérifier que le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/Description a une longueur de 50 caractères maximum.</regle-fonctionnelle>
- <message-echec>Invoice #INVOICE_ID# _ Ligne de frais n° #INVOICE_LINE_ID# : EtatsFrais/Invoice/InvoiceLine/Item/Description doit avoir une longueur de 50 caracteres maximum.</message-echec>
- </control>
- </document>
-</controls>
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * - présence de divers items CHORUS
- * @author laurent.meckert
- */
-public abstract class CHORUS00 extends AbstractUnitControl {
-
- protected StringBuilder charsBuffer = new StringBuilder();
- private Vector<Anomalie> anos = new Vector<Anomalie>();
- private Hashtable<String, Object> hParams;
- private boolean isExecutable = false;
- /**
- * La balise du document général
- */
- private String docId = null;
- private ArrayList<Node> nodesId = new ArrayList<Node>();
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String om_IssueDate = "";
- private String om_IdOm = "";
- private String om_TypEtatFrais = "";
- private String om_IdLine = "";
- private String om_AipName = "";
- /**
- * Chemins vers les divers éléments que l'on veut lire.
- */
- private static final String CHEMIN_INVOICEDATE = "EtatsFrais/Invoice/IssueDate/";
- private static final String CHEMIN_INVOICE_IDINVOICE = "EtatsFrais/Invoice/ID/";
- private static final String CHEMIN_INVOICE_TYPINVOICE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- private static final String CHEMIN_INVOICE_LINE = "EtatsFrais/Invoice/InvoiceLine/";
- private static final String CHEMIN_INVOICE_IDLINE = "EtatsFrais/Invoice/InvoiceLine/ID/";
- private static final String CHEMIN_INVOICE_AIP_NAME = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- private static final String CHEMIN_INVOICE_AIP_VALUE = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- private static final String CHAMP_CHORUS = "CHAMP_CHORUS";
- /**
- * La chaine cible
- */
- private static final String FIN_INVOICE_LINE = "EtatsFrais/Invoice/InvoiceLine/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE_LINE;
- private Hashtable<String, String> hashPresents = new Hashtable<String, String>();
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_CBC_ID = "#CBC_ID#";
- private static final String MSG_CBC_ISSUEDATE = "#CBC_ISSUEDATE#";
- private static final String MSG_CBC_INVOICETYPECODE = "#CBC_INVOICETYPECODE#";
- private static final String MSG_CBC_IDINVOICELINE = "#CBC_IDINVOICELINE#";
-
- // Le champ chorus a rechercher
- abstract protected String nomAChercher();
-
- abstract protected Logger getLogger();
-
- abstract protected String getCtrlId();
-
- public void startDocument() throws SAXException {
- if (isExecutable) {
- getLogger().info("In " + getCtrlId());
- } else {
- getLogger().info(getCtrlId() + " not executed");
- }
-
- }
-
- public void setDocId(String docID) {
- this.docId = docID;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) {
- if (!isExecutable) {
- return;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_LINE)) {
- anos = new Vector<Anomalie>();
- }
- if (xpath.endsWith(CHEMIN_INVOICE_AIP_VALUE)) {
- if (om_AipName.equals(nomAChercher())) {
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- }
- }
-
-
- this.charsBuffer.delete(0, this.charsBuffer.length());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- if (!isExecutable) {
- return null;
- }
- String value = this.charsBuffer.toString();
- if (xpath.endsWith(CHEMIN_INVOICEDATE)) {
- om_IssueDate = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDINVOICE)) {
- om_IdOm = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_TYPINVOICE)) {
- om_TypEtatFrais = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDLINE)) {
- om_IdLine = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_AIP_NAME)) {
- om_AipName = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_AIP_VALUE)) {
- if (om_AipName.equals(nomAChercher())) {
- hashPresents.put(CHAMP_CHORUS, value);
- }
- }
- if (xpath.endsWith(ON_RETURN_ANOMALIES)) {
- if (hashPresents.get(CHAMP_CHORUS) == null || hashPresents.get(CHAMP_CHORUS).equals("")) {
-
- String msg = getDocumentModel().getControlById(getCtrlId()).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_CBC_ID, om_IdOm);
- msg = msg.replaceAll(MSG_CBC_ISSUEDATE, om_IssueDate);
- msg = msg.replaceAll(MSG_CBC_INVOICETYPECODE, om_TypEtatFrais);
- msg = msg.replaceAll(MSG_CBC_IDINVOICELINE, om_IdLine);
- //String path = "@added:primary-key='" + om_IdOm + "-" + om_IdLine + "'";
- String path = "cbc:ID/text()='" + om_IdOm + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice " + om_IdOm;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("elementId", "");
- xslParams.put("browser-destination", "internal");
- xslParams.put("anoId", anoId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(getCtrlId()).getId(),
- getDocumentModel().getControlById(getCtrlId()).getLibelle(),
- getDocumentModel().getDocumentId(),
- "EtatFrais", // xpath.split("/")[0],
- "invoice", // élément importable
- om_IdOm, // id élément importable
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(getCtrlId()).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(getCtrlId()).getSeverity(),
- path, // xpath vers l'invoice line sous lequel se trouve l'anomalie
- xslParams); // paramètres supplémentaires pour accéder à l'élément en anomalie
- ano.addAll(nodesId);
- anos.add(ano);
- }
-
- hashPresents.clear();
- nodesId.clear();
- return anos;
- } else {
- return null;
- }
-
- }
-
- public void endDocument() throws SAXException {
- }
-
- public void characters(char[] ch, int start, int length, String xpath) {
- if (!isExecutable) {
- return;
- }
- this.charsBuffer.append(ch, start, length);
-
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) {
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) {
- }
-
- public void endPrefixMapping(String prefix, String xpath) {
- }
-
- public void processingInstruction(String target, String data, String xpath) {
- }
-
- public void skippedEntity(String name, String xpath) {
- }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams = params;
- Object secteur = hParams.get("secteur");
- if (secteur == null
- || !(secteur.toString().equals("Etat"))) {
- // les controles Chorus pas executes si secteur local
- isExecutable = false;
- } else {
- isExecutable = true;
- }
- }
-
- public void setDocumentLocator(Locator locator) {
- }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import org.apache.log4j.Logger;
-
-public class CHORUS01 extends CHORUS00 {
-
- private final static Logger logger = Logger.getLogger(CHORUS01.class);
- public static final transient String CTRL_ID = "CHORUS01";
-
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- public String nomAChercher(){
- return "CH_CENTRE_COUTS";
- }
-
-
-
-
- }
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-
-
-/**
- * - présence de CH_CENTRE_COUTS
- * @author laurent.meckert
- */
-
-import org.apache.log4j.Logger;
-
-public class CHORUS02 extends CHORUS00 {
-
- private final static Logger logger = Logger.getLogger(CHORUS02.class);
- public static final transient String CTRL_ID = "CHORUS02";
-
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- public String nomAChercher(){
- return "CH_CENTRE_FINANCIER";
- }
-
-
-
-
- }
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import org.apache.log4j.Logger;
-
-public class CHORUS03 extends CHORUS00 {
-
- private final static Logger logger = Logger.getLogger(CHORUS03.class);
- public static final transient String CTRL_ID = "CHORUS03";
-
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- public String nomAChercher(){
- return "CH_DOMAINE_FONCTIONNEL";
- }
-
-
-
-
- }
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import org.apache.log4j.Logger;
-
-public class CHORUS04 extends CHORUS00 {
-
- private final static Logger logger = Logger.getLogger(CHORUS04.class);
- public static final transient String CTRL_ID = "CHORUS04";
-
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- public String nomAChercher(){
- return "CH_ACTIVITE";
- }
-
-
-
-
- }
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import org.apache.log4j.Logger;
-
-public class CHORUS05 extends CHORUS00 {
-
- private final static Logger logger = Logger.getLogger(CHORUS05.class);
- public static final transient String CTRL_ID = "CHORUS05";
-
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- public String nomAChercher(){
- return "CH_LOCALISATION_INTERMINISTERIELLE";
- }
-
-
-
-
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M029
- *
- * Vérifier que le texte de l'élément EtatsFrais/Invoice/ID a une longueur de 12 caractères maximum
-
-
- */
-public class M029 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M029.class);
- public static final String CTRL_ID = "CTL-M029" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String ID_Invoice_Unique = "";
- private String ID_Invoice = "";
- private String ID_Invoice_NodeId="";
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- else if( xpath.equals(REQUIRED_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());}
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if(xpath.equals(REQUIRED_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if ((ID_Invoice.length()>12)||(ID_Invoice.length()==0)){
-
- erreur = "Le texte de l element EtatsFrais/Invoice/ID doit avoir une longueur de 12 caracteres maximum";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- else{
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M030
- *
- * L'élément EtatsFrais/Invoice/ID doit être unique (à vérifier par rapport à l'ensemble des EF du flux reçu)
-
-
- */
-public class M030 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M030.class);
- public static final String CTRL_ID = "CTL-M030" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = new Vector<Anomalie>();
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String ID_Invoice = "";
- private String Invoice_Unique = "";
- private String ID_Invoice_Unique = "";
- private String ID_Invoice_NodeId="";
- private Vector<String> ID_Invoice_values = new Vector<String>();
- private Vector<String> ID_Invoice_values_erreur = new Vector<String>();
- private Hashtable<String,Vector<String>> all_NodeId = new Hashtable<String, Vector<String>>();
- private Hashtable<String,Vector<String>> all_ID_Invoice_Unique = new Hashtable<String, Vector<String>>();
- private TreeSet<String> treeIdinvoice = new TreeSet<String>();
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String Invoice_PATH = "EtatsFrais/Invoice/";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- //public static final transient String RETURN_ANOMALIES_PATH = "EtatsFrais/";
- private static final String RETURN_ANOMALIES_PATH = Invoice_PATH;
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(Invoice_PATH)){
- ID_Invoice = "";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- anomalies.clear();
- }
- if (xpath.equals(ID_Invoice_PATH)){
- ID_Invoice_NodeId = atts.getValue("ano:node-id");
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
-
- if (all_NodeId.containsKey(ID_Invoice))
- all_NodeId.get(ID_Invoice).add(ID_Invoice_NodeId);
- else {
- Vector<String> temp = new Vector<String>();
- temp.add(ID_Invoice_NodeId);
- all_NodeId.put(ID_Invoice, temp);
- }
-
-
- if (all_ID_Invoice_Unique.containsKey(ID_Invoice))
- all_ID_Invoice_Unique.get(ID_Invoice).add(ID_Invoice_Unique);
- else {
- Vector<String> temp = new Vector<String>();
- temp.add(ID_Invoice_Unique);
- all_ID_Invoice_Unique.put(ID_Invoice, temp);
- }
-
-
- if (ID_Invoice_values!=null && ID_Invoice_values.contains(ID_Invoice)){ //erreur
- if (!ID_Invoice_values_erreur.contains(ID_Invoice))
- ID_Invoice_values_erreur.add(ID_Invoice);
- }
- else
- ID_Invoice_values.add(ID_Invoice);
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)){
-
- if (treeIdinvoice.contains(ID_Invoice)){
- String erreur="L'element EtatsFrais/Invoice/ID/ doit être unique ";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- }
-
- treeIdinvoice.add(ID_Invoice);
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
- public void endDocument() throws SAXException {}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M031
- *
- * L'élément EtatsFrais/Invoice/InvoiceTypeCode est obligatoire pour un EF
-
- */
-public class M031 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M031.class);
- public static final String CTRL_ID = "CTL-M031" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean InvoiceTypeCode_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceTypeCode/";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- InvoiceTypeCode_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(REQUIRED_PATH)) {
- InvoiceTypeCode_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!InvoiceTypeCode_exist){
-
- erreur = "L'element EtatsFrais/Invoice/InvoiceTypeCode est obligatoire pour un EF";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M032
- *
- * "RG02-02-FEN0058A : Le texte de l'élément EtatsFrais/Invoice/InvoiceTypeCode ne peut prendre que l'une des valeurs suivantes :
-- K1 : DP du solde d'un état de frais
-- K2 : DP de l'avance sur un état de frais
-- K3 : DP de récupération d\92avance sur état de f"
-
-
-
- */
-public class M032 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M032.class);
- public static final String CTRL_ID = "CTL-M032" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String ID_Invoice_Unique = "";
- private String ID_Invoice = "";
- private String TYPECODE_NodeId="";
- private String InvoiceTypeCode="";
- private Boolean InvoiceTypeCode_exist = false;
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
- private static final String MSG_TYPECODE= "#TYPECODE#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String CHEMIN_TYPECODE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- public static final transient String CHEMIN_INVOICE = "EtatsFrais/Invoice/";
- public static final transient String CHEMIN_IDINVOICE = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = CHEMIN_INVOICE;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(CHEMIN_INVOICE)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- TYPECODE_NodeId=InvoiceTypeCode="";
- InvoiceTypeCode_exist=false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
-
- else if( xpath.equals(CHEMIN_TYPECODE)) {
- TYPECODE_NodeId=atts.getValue("ano:node-id");
- }
-
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());}
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if(xpath.equals(CHEMIN_IDINVOICE)) {
- ID_Invoice = chars.peek().toString();
- }
-
- else if( xpath.equals(CHEMIN_TYPECODE)) {
- InvoiceTypeCode=chars.peek().toString();
- InvoiceTypeCode_exist=true;
- }
-
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!InvoiceTypeCode.equals("K1") && !InvoiceTypeCode.equals("K2") && !InvoiceTypeCode.equals("K3") && InvoiceTypeCode_exist){
-
- erreur = "Le texte de l element EtatsFrais/Invoice/ID doit avoir une longueur de 12 caracteres maximum";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- msg = msg.replaceAll(MSG_TYPECODE, InvoiceTypeCode);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(TYPECODE_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- else{
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M033
- *
- * Vérifier que le texte l'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/Valideur/PartyIdentification/ID a une longueur de 12 caractères maximum
-
-
- */
-public class M033 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M033.class);
- public static final String CTRL_ID = "CTL-M033" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private String ID_PartyIdentification_NodeId="";
- private Vector<String> vecteur_nodeId = new Vector<String>();
- boolean anomalie = false;
- private String ID_Invoice_Unique = "";
- private String ID_PartyIdentification = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_ID_PartyIdentification ="#ID_PartyIdentification#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/Valideur/PartyIdentification/ID/";
- public static final transient String UBLExtension_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/";
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(UBLExtension_PATH )){
- ID_PartyIdentification_NodeId="";
- }
- if(xpath.equals(REQUIRED_PATH )) {
- ID_PartyIdentification_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- anomalie=false;
- vecteur_nodeId.clear();
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(REQUIRED_PATH)) {
- if ((chars.peek().toString().length()>12)||(chars.peek().toString().length()==0)){
- anomalie=true;
- vecteur_nodeId.add(ID_PartyIdentification_NodeId);
- ID_PartyIdentification = chars.peek().toString();
- }
- }
-
- if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (anomalie && (xpath.equals(RETURN_ANOMALIES_PATH))){
-
- erreur = "Longueur du texte de l'élément .../EtatFrais/Valideur/PartyIdentification/ID doit etre de 12 car. maxi.";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_ID_PartyIdentification, ID_PartyIdentification);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- for (int i=0; i<vecteur_nodeId.size(); i++)
- ano.addNode(new Node(vecteur_nodeId.get(i)));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
-
- chars.pop();
- return null;
- }
-
-
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M034
- *
- * Vérifier la présence obligatoire et unique pour un EF (cardinalité 1:1) de l'élément EtatsFrais/Invoice/PaymentMeans
-
- */
-public class M034 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M034.class);
- public static final String CTRL_ID = "CTL-M034" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private int compteur_PaymentMeans = 0;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- compteur_PaymentMeans=0 ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(REQUIRED_PATH)) {
- compteur_PaymentMeans++;
- } else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (compteur_PaymentMeans!=1){
-
- erreur = "Presence obligatoire et unique pour un EF de l'élément EtatsFrais/Invoice/PaymentMeans";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- else{
- chars.pop();
- return null;}
- }
-
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M036
- *
- * L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/EtatFraisChorus est obligatoire pour un EF
-
-
- */
-public class M036 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M036.class);
- public static final String CTRL_ID = "CTL-M036" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean EtatFraisChorus_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
-
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/EtatFrais/EtatFraisChorus/";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- EtatFraisChorus_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- else if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
-
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(REQUIRED_PATH))
- {
- EtatFraisChorus_exist=true;
- }
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!EtatFraisChorus_exist){
-
- erreur = ".../UBLExtension/ExtentionContent/EtatFraisExtension/EtatFrais/EtatFraisChorus obligatoire";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
-
- }
- chars.pop();
- return anomalies;
- }
- else{
- chars.pop();
- return null;}
- }
-
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M037
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_CENTRE_COUTS\92
-
-
-
- */
-public class M037 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M037.class);
- public static final String CTRL_ID = "CTL-M037" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_CENTRE_COUTS";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_CENTRE_COUTS' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_CENTRE_COUTS pour chaque ligne d'EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- } else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M038
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_CENTRE_COUTS\92 a une longueur de 10 caractères maximum
-
- */
-public class M038 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M038.class);
- public static final String CTRL_ID = "CTL-M038" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_CENTRE_COUTS";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>10){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_CENTRE_COUTS incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M039
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_FINANCIER\92
-
- */
-public class M039 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M039.class);
- public static final String CTRL_ID = "CTL-M039" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_CENTRE_FINANCIER";
- private String ID_Invoice="";
- private String ID_Invoice_Unique = "";
- private String ID_InvoiceLine="";
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_FINANCIER' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_CENTRE_FINANCIER pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- } else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M040
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_FINANCIER\92 a une longueur de 16 caractères maximum
-
- */
-public class M040 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M040.class);
- public static final String CTRL_ID = "CTL-M040" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_CENTRE_FINANCIER";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>16){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_CENTRE_FINANCIER incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M041
- *
- * RG04-06-02-FEN0058A : Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_DOMAINE_FONCTIONNEL\92
-
- */
-public class M041 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M041.class);
- public static final String CTRL_ID = "CTL-M041" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_DOMAINE_FONCTIONNEL";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_DOMAINE_FONCTIONNEL' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_DOMAINE_FONCTIONNEL pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M042
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_DOMAINE_FONCTIONNEL\92 a une longueur de 16 caractères maximum
-
- */
-public class M042 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M042.class);
- public static final String CTRL_ID = "CTL-M042" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_DOMAINE_FONCTIONNEL";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>16){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
-
-
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_DOMAINE_FONCTIONNEL incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M043
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_ACTIVITE\92
-
- */
-public class M043 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M043.class);
- public static final String CTRL_ID = "CTL-M043" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_ACTIVITE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_ACTIVITE' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_ACTIVITE pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M044
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_ACTIVITE\92 a une longueur de 24 caractères maximum
-
-
- */
-public class M044 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M044.class);
- public static final String CTRL_ID = "CTL-M044" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_ACTIVITE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>16){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_ACTIVITE incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M045
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_PROJET_ANALYTIQUE_MINISTERIEL\92
-
- */
-public class M045 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M045.class);
- public static final String CTRL_ID = "CTL-M045" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_PROJET_ANALYTIQUE_MINISTERIEL";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_PROJET_ANALYTIQUE_MINISTERIEL' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name>1)) {
-
- erreur = "AdditionalItemProperty/Name CH_PROJET_ANALYTIQUE_MINISTERIEL doit etre unique pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M046
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_PROJET_ANALYTIQUE_MINISTERIEL\92 a une longueur de 22 caractères maximum
-
- */
-public class M046 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M046.class);
- public static final String CTRL_ID = "CTL-M046" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_PROJET_ANALYTIQUE_MINISTERIEL";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>22){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_PROJET_ANALYTIQUE_MINISTERIEL incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M047
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_LOCALISATION_MINISTERIELLE\92
-
- */
-public class M047 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M047.class);
- public static final String CTRL_ID = "CTL-M047" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_LOCALISATION_MINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_LOCALISATION_MINISTERIELLE' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name>1)) {
-
- erreur = "AdditionalItemProperty/Name CH_LOCALISATION_MINISTERIELLE doit etre unique pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M048
- *
- *Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_LOCALISATION_MINISTERIELLE\92 a une longueur de 22 caractères maximum
-
- */
-public class M048 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M048.class);
- public static final String CTRL_ID = "CTL-M048" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_LOCALISATION_MINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>22){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_LOCALISATION_MINISTERIELLE incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M049
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_LOCALISATION_INTERMINISTERIELLE\92
-
- */
-public class M049 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M049.class);
- public static final String CTRL_ID = "CTL-M049" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_LOCALISATION_INTERMINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_LOCALISATION_INTERMINISTERIELLE' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_LOCALISATION_INTERMINISTERIELLE pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M050
- *
- *Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_LOCALISATION_INTERMINISTERIELLE\92 a une longueur de 8 caractères maximum
- */
-public class M050 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M050.class);
- public static final String CTRL_ID = "CTL-M050" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_LOCALISATION_INTERMINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if ((chars.peek().toString().length()>8)||(chars.peek().toString().length()==0)){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_LOCALISATION_INTERMINISTERIELLE incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M051
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_NATURE_MINISTERIELLE\92
-
- */
-public class M051 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M051.class);
- public static final String CTRL_ID = "CTL-M051" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_NATURE_MINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_NATURE_MINISTERIELLE' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name>1)) {
-
- erreur = "AdditionalItemProperty/Name CH_NATURE_MINISTERIELLE doit etre unique pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M052
- *
-* Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_NATURE_MINISTERIELLE\92 a une longueur de 11 caractères maximum
-
- */
-public class M052 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M052.class);
- public static final String CTRL_ID = "CTL-M052" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_NATURE_MINISTERIELLE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>11){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_NATURE_MINISTERIELLE incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M053
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_AXE_MINISTERIEL_1\92
-
- */
-public class M053 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M053.class);
- public static final String CTRL_ID = "CTL-M053" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_AXE_MINISTERIEL_1";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_AXE_MINISTERIEL_1' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name>1)) {
-
- erreur = "AdditionalItemProperty/Name CH_AXE_MINISTERIEL_1 doit etre unique pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M054
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_AXE_MINISTERIEL_1\92 a une longueur de 22 caractères maximum
-
- */
-public class M054 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M054.class);
- public static final String CTRL_ID = "CTL-M054" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_AXE_MINISTERIEL_1";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>22){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_AXE_MINISTERIEL_1 incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M055
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un seul (unique mais facultatif) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_AXE_MINISTERIEL_2\92
-
- */
-public class M055 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M055.class);
- public static final String CTRL_ID = "CTL-M055" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_AXE_MINISTERIEL_2";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_AXE_MINISTERIEL_2' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name>1)) {
-
- erreur = "AdditionalItemProperty/Name CH_AXE_MINISTERIEL_2 doit etre unique pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M056
- *
- * Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_AXE_MINISTERIEL_2\92 a une longueur de 22 caractères maximum
-
- */
-public class M056 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M056.class);
- public static final String CTRL_ID = "CTL-M056" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_AXE_MINISTERIEL_2";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>22){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_AXE_MINISTERIEL_2 incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M057
- *
- * Chaque ligne d'EF (éléments EtatsFrais/Invoice/InvoiceLine) doit avoir un (obligatoire) et un seul (unique) élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name avec un texte est égal à \91CH_COMPTE_PCE\92
-
- */
-public class M057 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M057.class);
- public static final String CTRL_ID = "CTL-M057" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String Item_NodeId= "";
- private int compteur_Name=0;
- private String STRING_TO_COMPARE="CH_COMPTE_PCE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String InvoiceLine_PATH ="EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String InvoiceLine_Item ="EtatsFrais/Invoice/InvoiceLine/Item/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(InvoiceLine_Item )) {
- Item_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(InvoiceLine_PATH)){
- //nombre de ..AdditionalItemProperty/Name='CH_COMPTE_PCE' dans un même InvoiceLine
- compteur_Name=0;
- Item_NodeId="";
- ID_InvoiceLine = "";
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- compteur_Name++;
- }
- }
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
-
- }
-
- if (xpath.equals(InvoiceLine_PATH) && (compteur_Name!=1)) {
-
- erreur = "1 et 1 seul AdditionalItemProperty/Name CH_COMPTE_PCE pour chaque ligne d EF";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(Item_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
-}
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M058
- *
- *Le texte de l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value associée à l'élément EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name dont le texte est égal à \91CH_COMPTE_PCE\92 a une longueur de 10 caractères exactement
-
- */
-public class M058 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M058.class);
- public static final String CTRL_ID = "CTL-M058" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String value_NodeId= "";
- private int compteur_erreur=0;
- private String STRING_TO_COMPARE="CH_COMPTE_PCE";
- private String ID_Invoice="";
- private String ID_InvoiceLine="";
- private boolean is_contralable=false;
- private String ID_Invoice_Unique = "";
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDLINE = "#IDLINE#";
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH ="EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Name/";
- public static final transient String VALUE_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/Value/";
- public static final transient String InvoiceLine_ID ="EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
- public static final transient String ID_Invoice_PATH ="EtatsFrais/Invoice/ID/";
- public static final transient String AdditionalItemProperty_PATH ="EtatsFrais/Invoice/InvoiceLine/Item/AdditionalItemProperty/";
-
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if (xpath.equals(VALUE_PATH)){
- value_NodeId=atts.getValue("ano:node-id");
- }
- if (xpath.equals(AdditionalItemProperty_PATH)){
- is_contralable=false;
- value_NodeId="";
- compteur_erreur=0;
- }
-
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
-
- if (xpath.equals(REQUIRED_PATH)){
- if(chars.peek().toString().equals(STRING_TO_COMPARE)) {
- is_contralable=true;
- }
- }
- if((xpath.equals(VALUE_PATH ))&& is_contralable){
- if (chars.peek().toString().length()>10){
- compteur_erreur++;
- }
- }
-
- if(xpath.equals(InvoiceLine_ID )) {
- ID_InvoiceLine = chars.peek().toString();
- }
-
- if (xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice=chars.peek().toString();
- }
-
- if (xpath.equals(AdditionalItemProperty_PATH) && (compteur_erreur!=0)) {
-
- erreur = "Longueur de AdditionalItemProperty/Value associee a CH_COMPTE_PCE incorrecte";
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDLINE, String.valueOf(ID_InvoiceLine));
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(value_NodeId));
- anomalies.add(ano);
- chars.pop();
- return null;
-
- }
- else if (xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- } else {
- chars.pop();
- return null;
- }
- }
-
- private void Println(String partyIdentification) {
- // TODO Auto-generated method stub
-
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
-
-
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M059
- *
- * L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus est obligatoire pour un EF
-
- */
-public class M059 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M059.class);
- public static final String CTRL_ID = "CTL-M059" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean InvoiceTypeCode_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
- String contenu_AgentChorus= "";
- private boolean INAgentChorus = false;
-
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
- private StringBuffer charsAddress = new StringBuffer();
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
-
- if (xpath.equals(REQUIRED_PATH)){
- charsAddress=new StringBuffer();
- INAgentChorus=true;
-
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- InvoiceTypeCode_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- contenu_AgentChorus="";
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if((xpath.equals(REQUIRED_PATH))) {
- contenu_AgentChorus = charsAddress.toString().replace("\n", "").replace("\t", "").replace(" ", "");
- INAgentChorus=false;
- InvoiceTypeCode_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (contenu_AgentChorus.equals("")|| !InvoiceTypeCode_exist){
-
- erreur = "ne contient pas l'élément.../UBLExtension/ExtentionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;
- }
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- if (INAgentChorus) {
- charsAddress.append(new String(ch, start, length));}
- }
-
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C.Marchand - christophe.marchand@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence du IdChorusTiers sur chaque Invoice
- * L'élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdChorusTiers est obligatoire pour un EF si le texte de l\91élément EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers est égal à \92ZCPD\92
-
- * @author christophe Marchand
- */
-public class M060 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M060" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String REQUIRED_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdChorusTiers/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ANO_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M060.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // on va compter le nombre de IdChorusTiers que l'on va rencontrer par Invoice
- private int idChorusTiersCounter = 0;
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private String typeTiers = null;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- boolean isSecteurEtat = true; // par défaut, on est dans le secteur etat
-
- private String anoNodeId = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(!isSecteurEtat) return;
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence une nouvelle invoice :
- // on remet le compteur à 0,
- // on remet la liste des anomalies à vide
- // on remet l'invoice id à null
- idChorusTiersCounter = 0;
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- typeTiers = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ANO_PATH)) {
- anoNodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- // notre controle ne concerne que le secteur etat
- if(!isSecteurEtat) return null;
- // pour le moment
- if (xpath.equals(REQUIRED_PATH) && !chars.peek().toString().equals("")) {
- // sur la fermeture di IdChorusTiers, on incrémente le compteur
- idChorusTiersCounter++;
- // pour information, si nécessaireadmin
-
- String idChorusTiersText = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && typeTiers.equals("ZCPD")) {
- // on est à la fin de l'invoice, on compte le nombre de IdChorusTiers qu'on a rencontré
- switch(idChorusTiersCounter) {
- case 0: {
- // il y a un manque
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(anoNodeId));
- anomalies.add(ano);
- }
- default: break; // c'est ce qu'on voulait, parfait, on ne renvoie rien
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- if(!isSecteurEtat) return;
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- isSecteurEtat = hParams.get("secteur").equals("Etat");
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence du IdChorusTiers ou IdFoncTiers sur chaque Invoice
- * Si le texte de l'élèment /dgfip:AgentChorus/dgfip:TypeTiers est différent de 'ZCPD' alors l'un des deux éléments /dgfip:AgentChorus/dgfip:IdChorusTiers
- * et /dgfip:AgentChorus/dgfip:IdFoncTiers doit être présent pour un EF
- * @author Christel ESCOBAR
- */
-public class M061 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M061" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String CHEMIN_IDCHORUSTIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdChorusTiers/";
- public static final transient String CHEMIN_IDFONCTIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdFoncTiers/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ANO_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M061.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String typeTiers = "";
- private boolean idChorus = false;
- private boolean idFonc = false;
- private String idChorusTiers = "";
- private String idFoncTiers = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- private String anoNodeId = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- anoNodeId = "";
- invoiceId = "";
- typeTiers = idChorusTiers = idFoncTiers = "";
- idChorus = idFonc = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICEID_PATH)) {
- anoNodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- if(xpath.equals(CHEMIN_IDCHORUSTIERS)) {
- idChorus = true;
- idChorusTiers = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_IDFONCTIERS)) {
- idFonc = true;
- idFoncTiers = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && !typeTiers.equals("ZCPD")) {
- if ((idChorus == false || idChorusTiers.equals("") || idChorusTiers.equals(" ")) && (idFonc == false || idFoncTiers.equals("") || idFoncTiers.equals(" "))) {
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(anoNodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de IdFoncTiers sur chaque Invoice
- * Le texte de l'élément /dgfip:AgentChorus/dgfip:IdFoncTiers doit vérifier les caractéristiques suivantes selon le texte de l'élément /dgfip:AgentChorus/dgfip:TypeTiers :<br/>
- * Si TypeTiers='ZCOM' alors donnée numérique sur 6 chiffres
- * -Si TypeTiers='ZCPD' alors donnée numérique sur 10 ou 14 chiffres
- * -Si TypeTiers='ZETR' alors donnée sur 2 caractères min et 37 max
- * -Si TypeTiers='ZEUR' alors pas de contrainte de longueur et de format
- * -Si TypeTiers='ZFRA' alors donnée numérique sur 14 chiffres
- * -Si TypeTiers='ZPHY' alors donnée sur 10 caractères min et 80 max
- * -Si TypeTiers='ZREG' alors donnée sur 12 caractères composée de 4 lettres + 7 chiffres + 1 lettre
- * -Si TypeTiers='ZSRV' alors donnée sur 10 caractères composée de 1 lettre + 6 chiffres + 3 alphanumériques
- * -Si TypeTiers='ZTAE' alors donnée sur 10 caractères min et 80 max
- *
- * @author Christel ESCOBAR
- */
-public class M062 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M062" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String CHEMIN_IDFONCTIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/IdFoncTiers/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ANO_PATH = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M062.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private String typeTiers = "";
- private String idFoncTiers = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- private String anoNodeId = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- anoNodeId = "";
- invoiceId = "";
- typeTiers = idFoncTiers = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ANO_PATH)) {
- anoNodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- if(xpath.equals(CHEMIN_IDFONCTIERS)) {
- idFoncTiers = chars.peek().toString();
-
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
- boolean err = false;
-
- if (typeTiers.equals("ZCOM") && !idFoncTiers.matches("^[0-9]{9}$")&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZCPD") && !idFoncTiers.matches("^[0-9]{10}$") && !idFoncTiers.matches("^[0-9]{14}$")&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZETR") && (idFoncTiers.length()<2 || idFoncTiers.length()>37)&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZFRA") && !idFoncTiers.matches("^[0-9]{14}$")&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZPHY") && (idFoncTiers.length()<10 || idFoncTiers.length()>80)&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZREG") && !idFoncTiers.matches("^[a-zA-Z]{4}[0-9]{7}[a-zA-Z]{1}$") && !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZSRV") && !idFoncTiers.matches("^[a-zA-Z]{1}[0-9]{6}[a-zA-Z0-9]{3}$")&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
- if (typeTiers.equals("ZTAE") && (idFoncTiers.length()<10 || idFoncTiers.length()>80)&& !idFoncTiers.equals("")&& !idFoncTiers.equals(" "))
- err = true;
-
- if (err) {
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- String erreur = "Le texte de l'élément IdFoncTiers n'est pas au format attendu selon le type de tiers";
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#TYPETIERS#", typeTiers);
- message = message.replace("#IDFONCTIERS#", idFoncTiers);
- message = message.replace("#ERREUR#", erreur);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(anoNodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M063
- *
- * Les éléments EtatsFrais/Invoice/AccountingSupplierParty/Party doivent être systématiquement présents au niveau de chaque EF
-
- */
-public class M063 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M063.class);
- public static final String CTRL_ID = "CTL-M063" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean Party_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String Party_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- Party_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(Party_PATH)) {
- Party_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!Party_exist){
-
- erreur = "ne contient pas l'élément .../AccountingSupplierParty/Partyest";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M064
- *
- * L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty doivent être systématiquement présents au niveau de chaque EF
-
- */
-public class M064 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M063.class);
- public static final String CTRL_ID = "CTL-M064" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean AgentParty= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String AgentParty_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- AgentParty=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(AgentParty_PATH)) {
- AgentParty=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!AgentParty){
-
- erreur = "ne contient pas l'élément .../AccountingSupplierParty/Party/AgentParty";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AgentParty/PhysicalLocation/Address sur chaque Invoice
- * @author Christel ESCOBAR
- */
-public class M065 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M065" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/";
- public static final transient String ANO_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M065.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- String contenu_address= "";
-
- private boolean address = false;
- private boolean INaddress = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
- private StringBuffer charsAddress = new StringBuffer();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- private String anoNodeId = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- anoNodeId = "";
- invoiceId = contenu_address = "";
- address = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ADDRESS)) {
- address = true;
- INaddress = true;
- charsAddress=new StringBuffer();
- } else if(xpath.equals(ANO_PATH)) {
- anoNodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(ADDRESS)) {
- INaddress = false;
- contenu_address = charsAddress.toString().replace("\n", "").replace("\t", "").replace(" ", "");
- }
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
-
- if (!address || contenu_address.equals("")||contenu_address.equals(" ")){
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(anoNodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- if (INaddress)
- charsAddress.append(new String(ch, start, length));
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M066
- *
- * L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/ est obligatoire pour un EF
-
- */
-public class M066 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M066.class);
- public static final String CTRL_ID = "CTL-M066" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean Address_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String Address_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- Address_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(Address_PATH)) {
- Address_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!Address_exist){
-
- erreur = "ne contient pas l'élément ...AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AgentParty/PhysicalLocation/Address/CityName ou AgentParty/PostalAddress/CityName sur chaque Invoice
- * @author Christel ESCOBAR
- */
-public class M067 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M067" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/";
- public static final transient String POSTALE_ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String ADDRESS_CITYNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/CityName/";
- public static final transient String POSTALE_ADDRESS_CITYNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M067.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String cityName1 = "";
- private String cityName2 = "";
- private boolean address = false;
-
- private String cityName1_nodeId = "";
- private String cityName2_nodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- cityName1_nodeId = cityName2_nodeId = "";
- invoiceId = cityName1 = cityName2 = "";
- address = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ADDRESS)) {
- address = true;
- cityName1_nodeId = atts.getValue("ano:node-id");
- } else if(xpath.equals(POSTALE_ADDRESS)) {
- address = true;
- cityName2_nodeId = atts.getValue("ano:node-id");
- }
-
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(ADDRESS_CITYNAME)) {
- cityName1 = chars.peek().toString();
- } else if(xpath.equals(POSTALE_ADDRESS_CITYNAME)) {
- cityName2 = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && address==true && cityName1.equals("") && cityName2.equals("")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(cityName1_nodeId));
- ano.addNode(new Node(cityName2_nodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AgentParty/PhysicalLocation/Address/AddressLine ou AgentParty/PostalAddress/AddressLine sur chaque Invoice
- * @author Christel ESCOBAR
- */
-public class M068 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M068" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/";
- public static final transient String POSTALE_ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String ADDRESS_LINE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine/";
- public static final transient String POSTALE_ADDRESS_LINE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M068.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private boolean addressLine1 = false;
- private boolean addressLine2 = false;
- private boolean address = false;
-
- private String addressLine1_nodeId = "";
- private String addressLine2_nodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- addressLine1_nodeId = addressLine2_nodeId = "";
- invoiceId = "";
- address = addressLine1 = addressLine2 = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ADDRESS)) {
- address = true;
- addressLine1_nodeId = atts.getValue("ano:node-id");
- } else if(xpath.equals(POSTALE_ADDRESS)) {
- address = true;
- addressLine2_nodeId = atts.getValue("ano:node-id");
- } else if(xpath.equals(ADDRESS_LINE)) {
- addressLine1 = true;
- } else if(xpath.equals(POSTALE_ADDRESS_LINE)) {
- addressLine2 = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && address==true && addressLine1 == false && addressLine2 == false) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(addressLine1_nodeId));
- ano.addNode(new Node(addressLine2_nodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M069
- *
- * L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine/Line est obligatoire pour un EF
-
- */
-public class M069 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M069.class);
- public static final String CTRL_ID = "CTL-M069" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean Line_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String AddressLine_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine";
- public static final transient String Line_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine/Line";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
-
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
-
- if(xpath.equals(AddressLine_PATH)) {
- Line_exist=false ;
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(Line_PATH)) {
- Line_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!Line_exist){
-
- erreur = "ne contient pas l'élément.../AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/AddressLine/Line";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-/**
- * Implémente le contrôle N° M070
- *
- * L'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country est obligatoire pour un EF
-
- */
-public class M070 extends AbstractUnitControl {
- private static final Logger logger = Logger.getLogger(M066.class);
- public static final String CTRL_ID = "CTL-M070" ;
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
-
- private String ID_Invoice = "";
- private boolean Country_exist= false ;
- private String ID_Invoice_NodeId="";
- private String ID_Invoice_Unique = "";
-
-
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_IDInvoice ="#ID_Invoice#";
- private static final String MSG_ERREUR = "#ERREUR#";
-
-
- /**
- * Chemins vers les divers éléments que l'on veux lire
- */
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String Country_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country";
- public static final transient String ID_Invoice_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
-
- if(xpath.equals(ID_Invoice_PATH )) {
- ID_Invoice_NodeId=atts.getValue("ano:node-id");
- }
- if(xpath.equals(RESET_COUNTER_PATH)) {
- // on commence un nouveau Invoice :
- Country_exist=false ;
- //vider le vecteur d'anomalie
- anomalies = new Vector<Anomalie>();
- ID_Invoice="";
- ID_Invoice_NodeId="";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- // A chaque nouvel élément, on vide la Stack
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String erreur = "";
- if(xpath.equals(Country_PATH)) {
- Country_exist=true;
- }
-
- else if(xpath.equals(ID_Invoice_PATH)) {
- ID_Invoice = chars.peek().toString();
- }
-
- if (xpath.equals(RETURN_ANOMALIES_PATH)) {
- if (!Country_exist){
-
- erreur = "ne contient pas l'élément .../AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country";
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_IDInvoice, ID_Invoice);
- msg = msg.replaceAll(MSG_ERREUR, erreur);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice "+ID_Invoice;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- ID_Invoice,
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(ID_Invoice_NodeId));
- anomalies.add(ano);
- chars.pop();
-
- }
-
- return anomalies;
- }
- else {
- chars.pop();
- return null;}
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- //on stocke les caractères lus
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException {
- logger.info("In "+CTRL_ID);
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
- }
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AgentParty/PhysicalLocation/Address/Country/IdentificationCode ou AgentParty/PostalAddress/Country/IdentificationCode sur chaque Invoice
- * @author Christel ESCOBAR
- */
-public class M071 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M071" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/";
- public static final transient String POSTALE_ADDRESS = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String ADDRESS_CODE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country/IdentificationCode/";
- public static final transient String POSTALE_ADDRESS_CODE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/IdentificationCode/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M071.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String identificationCode1 = "";
- private String identificationCode2 = "";
- private boolean address = false;
-
- private String identificationCode1_nodeId = "";
- private String identificationCode2_nodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- identificationCode1_nodeId = identificationCode2_nodeId = "";
- invoiceId = "";
- address = false;
- identificationCode1 = identificationCode2 = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ADDRESS)) {
- address = true;
- identificationCode1_nodeId = atts.getValue("ano:node-id");
- } else if(xpath.equals(POSTALE_ADDRESS)) {
- address = true;
- identificationCode2_nodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(ADDRESS_CODE)) {
- identificationCode1 = chars.peek().toString();
- } else if(xpath.equals(POSTALE_ADDRESS_CODE)) {
- identificationCode2 = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && address==true && identificationCode1.equals("") && identificationCode2.equals("")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(identificationCode1_nodeId));
- ano.addNode(new Node(identificationCode2_nodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence l'element EtatsFrais/Invoice/AccountingSupplierParty/Party/Person obligatoire si tiers ZCPD'
- * @author Assia ARIOUAT
- */
-public class M072 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M072" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PERSON_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M072.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private Boolean PERSON_exist = false;
- private String PERSON_NodeId = "";
- private String typeTiers = "";
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- PERSON_exist =false;
- PERSON_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICEID_PATH)) {
- PERSON_NodeId = atts.getValue("ano:node-id");
- }
- else if(xpath.equals(PERSON_PATH)) {
- PERSON_exist= true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && typeTiers.equals("ZCPD") && !PERSON_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PERSON_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AccountingSupplierParty/Party/Person/FirstName sur chaque Invoice si TypeTiers='ZCPD'
- * @author Christel ESCOBAR
- */
-public class M073 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M073" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String FIRSTNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/FirstName/";
- public static final transient String PERSON = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M073.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String firstName = "";
- private String INVOICEID_NodeId = "";
- private String typeTiers = "";
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- firstName = INVOICEID_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICEID_PATH)) {
- INVOICEID_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- } else if(xpath.equals(FIRSTNAME)) {
- firstName = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && typeTiers.equals("ZCPD") && firstName.equals("")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(INVOICEID_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Contrôle de la présence de AccountingSupplierParty/Party/Person/Name sur chaque Invoice si TypeTiers='ZCPD'
- * @author Christel ESCOBAR
- */
-public class M074 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M074" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String FAMILYNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/FamilyName/";
- public static final transient String PERSON = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/";
- public static final transient String CHEMIN_TYPETIERS = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Agent/AgentChorus/TypeTiers/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M074.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String name = "";
- private String name_NodeId = "";
- private String typeTiers = "";
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- name = name_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PERSON)) {
- name_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_TYPETIERS)) {
- typeTiers = chars.peek().toString();
- } else if(xpath.equals(FAMILYNAME)) {
- name = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && typeTiers.equals("ZCPD") && name.equals("")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(name_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName est obligatoire si PostalAddress est présent
- * @author Assia ARIOUAT
- */
-public class M075 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M075" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CityName_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName/";
- public static final transient String CHEMIN_PostalAddress = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M075.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private Boolean CityName_exist = false;
- private Boolean PostalAddress_exist = false;
- private String PostalAddress_NodeId = "";
- private String PostalAddress = "";
-
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- CityName_exist =false;
- PostalAddress_exist=false;
- PostalAddress_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
-
- }
- if(xpath.equals(CityName_PATH)) {
- CityName_exist= true;
- }
- if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress_NodeId = atts.getValue("ano:node-id");
- PostalAddress_exist=true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && PostalAddress_exist && !CityName_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PostalAddress_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine est obligatoire si PostalAddress est présent
- * @author Assia ARIOUAT
- */
-public class M076 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M076" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String AddressLine_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine/";
- public static final transient String CHEMIN_PostalAddress = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M076.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private Boolean AddressLine_exist = false;
- private Boolean PostalAddress_exist = false;
- private String PostalAddress_NodeId = "";
- private String PostalAddress = "";
-
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- AddressLine_exist =false;
- PostalAddress_exist=false;
- PostalAddress_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if(xpath.equals(AddressLine_PATH)) {
- AddressLine_exist= true;
- }
- if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress_exist=true;
- PostalAddress_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && PostalAddress_exist && !AddressLine_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PostalAddress_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine/Line est obligatoire si PostalAddress est présent
- * @author Assia ARIOUAT
- */
-public class M077 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M077" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String Line_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/AddressLine/Line/";
- public static final transient String CHEMIN_PostalAddress = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M077.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private Boolean Line_exist = false;
- private Boolean PostalAddress_exist = false;
- private String PostalAddress_NodeId = "";
- private String PostalAddress = "";
-
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- Line_exist =false;
- PostalAddress_exist=false;
- PostalAddress_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if(xpath.equals(Line_PATH)) {
- Line_exist= true;
- }
- if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress_exist=true;
- PostalAddress_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && PostalAddress_exist && !Line_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PostalAddress_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country est obligatoire si PostalAddress est présent
- * @author Assia ARIOUAT
- */
-public class M078 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M078" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String Country_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/";
- public static final transient String CHEMIN_PostalAddress = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M078.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private Boolean Country_exist = false;
- private Boolean PostalAddress_exist = false;
- private String PostalAddress_NodeId = "";
- private String PostalAddress = "";
-
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- Country_exist =false;
- PostalAddress_exist=false;
- PostalAddress_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if(xpath.equals(Country_PATH)) {
- Country_exist= true;
- }
- if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress_exist=true;
- PostalAddress_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && PostalAddress_exist && !Country_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PostalAddress_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. - assia.ariouatr@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/IdentificationCode est obligatoire si PostalAddress est présent
- * @author Assia ARIOUAT
- */
-public class M079 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M079" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String IdentificationCode_PATH= "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/IdentificationCode/";
- public static final transient String CHEMIN_PostalAddress = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M079.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private Boolean IdentificationCode_exist = false;
- private Boolean PostalAddress_exist = false;
- private String PostalAddress_NodeId = "";
- private String PostalAddress = "";
-
-
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- IdentificationCode_exist =false;
- PostalAddress_exist=false;
- PostalAddress_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if(xpath.equals(IdentificationCode_PATH)) {
- IdentificationCode_exist= true;
- }
- if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress_exist=true;
- PostalAddress_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHEMIN_PostalAddress)) {
- PostalAddress = chars.peek().toString();
- }
- else if(xpath.equals(RETURN_ANOMALIES_PATH) && PostalAddress_exist && !IdentificationCode_exist) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(PostalAddress_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément AccountingSupplierParty/Party/Person/FirstName a une longueur de 35 caractères maximum
- * @author Christel ESCOBAR
- */
-public class M080 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M080" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String FIRSTNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/FirstName/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M080.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String firstName = "";
- private String firstName_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- firstName = firstName_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(FIRSTNAME)) {
- firstName_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(FIRSTNAME)) {
- firstName = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && firstName.length()>35) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(firstName_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément AccountingSupplierParty/Party/Person/FamilyName a une longueur de 35 caractères maximum
- * @author Christel ESCOBAR
- */
-public class M081 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M081" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String FAMILYNAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/Person/FamilyName/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M081.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String name = "";
- private String name_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- name = name_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(FAMILYNAME)) {
- name_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(FAMILYNAME)) {
- name = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && name.length()>35) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(name_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/PostalZone a une longueur de 10 caractères maximum
- * @author Christel ESCOBAR
- */
-public class M082 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M082" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String POSTALE_ZONE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/PostalZone/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M082.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String postalZone = "";
- private String postalZone_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- postalZone = postalZone_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(POSTALE_ZONE)) {
- postalZone_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(POSTALE_ZONE)) {
- postalZone = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && postalZone.length()>10) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(postalZone_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C.ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/PostalZone a une longueur de 16 caractères maximum
- * @author Assia ARIOUAT
- */
-public class M083 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M083" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String POSTALE_ZONE = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/PostalZone/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M083.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String postalZone = "";
- private String postalZone_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- postalZone = postalZone_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(POSTALE_ZONE)) {
- postalZone_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(POSTALE_ZONE)) {
- postalZone = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && postalZone.length()>16) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#PostalZone#", postalZone);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(postalZone_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/CityName a une longueur de 35 caractères maximum
- * @author Christel ESCOBAR
- */
-public class M084 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M084" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CITY_NAME = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/CityName/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M084.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String cityName = "";
- private String cityName_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- cityName = cityName_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(CITY_NAME)) {
- cityName_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CITY_NAME)) {
- cityName = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && cityName.length()>35) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(cityName_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C.ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName a une longueur de 35 caractères maximum
- * @author Assia ARIOUAT
- */
-public class M085 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M085" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CityName_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/CityName/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M085.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private String CityName = "";
- private String CityName_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- CityName = CityName_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(CityName_PATH)) {
- CityName_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CityName_PATH)) {
- CityName = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && CityName.length()>35) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#CityName#", CityName);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(CityName_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country/IdentificationCode a une longueur de 2 caractères
- * @author Christel ESCOBAR
- */
-public class M086 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M086" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CODE_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PhysicalLocation/Address/Country/IdentificationCode/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M086.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String identificationCode = "";
- private String identificationCode_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- identificationCode = identificationCode_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(CODE_PATH)) {
- identificationCode_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CODE_PATH)) {
- identificationCode = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && identificationCode.length()!=2) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(identificationCode_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C.ARIOUAT - assia.ariouat@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément .../PostalAddress/Country/IdentificationCode doit avoir exactement une longueur de 2 caractères
- * @author Assia ARIOUAT
- */
-public class M087 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M087" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String IdentificationCode_PATH = "EtatsFrais/Invoice/AccountingSupplierParty/Party/AgentParty/PostalAddress/Country/IdentificationCode/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M087.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
-
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
- private String IdentificationCode = "";
- private String IdentificationCode_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- IdentificationCode = IdentificationCode_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(IdentificationCode_PATH)) {
- IdentificationCode_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(IdentificationCode_PATH)) {
- IdentificationCode = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && IdentificationCode.length()!=2) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#IdentificationCode#", IdentificationCode);
-
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(IdentificationCode_NodeId));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que l'élément PaymentMeans/PaymentChannelCode est obligatoire pour un EF
- * @author Christel ESCOBAR
- */
-public class M088 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M088" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CHANNEL_CODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String ANO_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M088.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private boolean paymentChannelCode_present = false;
- // si 1 /PaymentMeans/PaymentChannelCode est OK, on ne retourne pas l'erreur
- private boolean paymentChannelCode_OK = false;
- // il peut y avoir plusieurs PaymentMeans, on les surligne tous en jaune en cas d'erreur
- private Vector<String> paymentChannelCode_NodeId = new Vector<String>();
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- paymentChannelCode_NodeId.clear();
- paymentChannelCode_OK = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(ANO_PATH)) {
- paymentChannelCode = "";
- paymentChannelCode_present = false;
- paymentChannelCode_NodeId.add(atts.getValue("ano:node-id"));
- } else if(xpath.equals(CHANNEL_CODE)) {
- paymentChannelCode_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHANNEL_CODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(ANO_PATH) && !(paymentChannelCode_present==false || paymentChannelCode.equals(""))) {
- paymentChannelCode_OK = true;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH) && !paymentChannelCode_OK) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- for (int i=0; i<paymentChannelCode_NodeId.size(); i++)
- ano.addNode(new Node(paymentChannelCode_NodeId.get(i)));
- anomalies.add(ano);
-
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Vérifier que le texte de l'élément PaymentMeans/PaymentChannelCode vaut 'IBAN' ou 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M089 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M089" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String CHANNEL_CODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANS = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M089.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentChannelCode_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_MEANS)) {
- paymentChannelCode = "";
- paymentChannelCode_NodeId = "";
- } else if(xpath.equals(CHANNEL_CODE)) {
- paymentChannelCode_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(CHANNEL_CODE)) {
- paymentChannelCode = chars.peek().toString();
-
- if(!paymentChannelCode.equals("IBAN") && !paymentChannelCode.equals("BBAN")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(paymentChannelCode_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/ID est obligatoire si et seulement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'IBAN'
- * @author Christel ESCOBAR
- */
-public class M090 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M090" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M090.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private boolean paymentId_present = false;
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = atts.getValue("ano:node-id");
- paymentId_present = false;
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("IBAN") && paymentMeansCode.equals("V") && (paymentId_present == false || paymentId.equals(""))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/ID est obligatoire si et seulement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M091 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M091" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M091.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private boolean paymentId_present = false;
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = atts.getValue("ano:node-id");
- paymentId_present = false;
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && (paymentId_present == false || paymentId.equals(""))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID est obligatoire si et seulement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M092 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M092" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M092.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private boolean paymentId_present = false;
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = atts.getValue("ano:node-id");
- paymentId_present = false;
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && (paymentId_present == false || paymentId.equals(""))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode est obligatoire si et seulement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M093 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M093" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M093.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private boolean paymentId_present = false;
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = atts.getValue("ano:node-id");
- paymentId_present = false;
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && (paymentId_present == false || paymentId.equals(""))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/ID doit avoir une longueur de 34 maximum si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'IBAN'
- * @author Christel ESCOBAR
- */
-public class M094 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M094" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M094.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = "";
- } else if(xpath.equals(PAYMENT_ID)) {
- payment_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("IBAN") && paymentMeansCode.equals("V") && paymentId.length()>34) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/ID doit avoir une longueur de 18 maximum si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M095 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M095" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M095.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = "";
- } else if(xpath.equals(PAYMENT_ID)) {
- payment_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && paymentId.length()>18) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID doit avoir une longueur de 15 caractères maximum si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M096 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M096" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M096.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private String payment_NodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = "";
- } else if(xpath.equals(PAYMENT_ID)) {
- payment_NodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && paymentId.length()>15) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode doit avoir une longueur de 2 caractères exactement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M097 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M097" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_ID = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/Country/IdentificationCode/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M097.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentId = "";
- private String payment_NodeId = "";
- private boolean id_present = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentId = "";
- payment_NodeId = "";
- id_present = false;
- } else if(xpath.equals(PAYMENT_ID)) {
- payment_NodeId = atts.getValue("ano:node-id");
- id_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_ID)) {
- paymentId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(id_present == true && paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && paymentId.length()!=2) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément PaymentMeans/PayeeFinancialAccount/PaymentNote doit avoir une longueur de 2 caractères exactement si
- * PaymentMeans/PaymentMeansCode vaut 'V' et PaymentMeans/PaymentChannelCode vaut 'BBAN'
- * @author Christel ESCOBAR
- */
-public class M098 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M098" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String PAYMENT_NOTE = "EtatsFrais/Invoice/PaymentMeans/PayeeFinancialAccount/PaymentNote/";
- public static final transient String PAYMENT_CHANNELCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentChannelCode/";
- public static final transient String PAYMENT_MEANSCODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- public static final transient String PAYMENT_PATH = "EtatsFrais/Invoice/PaymentMeans/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M098.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String paymentChannelCode = "";
- private String paymentMeansCode = "";
- private String paymentNote = "";
- private String payment_NodeId = "";
- private boolean note_present = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(PAYMENT_PATH)) {
- paymentChannelCode = paymentMeansCode = paymentNote = "";
- payment_NodeId = "";
- note_present = false;
- } else if(xpath.equals(PAYMENT_NOTE)) {
- payment_NodeId = atts.getValue("ano:node-id");
- note_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_NOTE)) {
- paymentNote = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_CHANNELCODE)) {
- paymentChannelCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_MEANSCODE)) {
- paymentMeansCode = chars.peek().toString();
- } else if(xpath.equals(PAYMENT_PATH)) {
-
- if(paymentChannelCode.equals("BBAN") && paymentMeansCode.equals("V") && paymentNote.length()!=2) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(payment_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)){
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément LegalMonetaryTotal/LineExtensionAmount est obligatoire pour un EF
- * @author Christel ESCOBAR
- */
-public class M099 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M099" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String MONETARY_PATH = "EtatsFrais/Invoice/LegalMonetaryTotal/";
- public static final transient String MONETARY_LINE = "EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M099.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String monetaryLine = "";
- private String monetary_NodeId = "";
- private boolean monetaryLine_present = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- monetary_NodeId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(MONETARY_PATH)) {
- monetaryLine = "";
- monetary_NodeId = atts.getValue("ano:node-id");
- monetaryLine_present = false;
- } else if(xpath.equals(MONETARY_LINE)) {
- monetaryLine_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(MONETARY_LINE)) {
- monetaryLine = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
-
- if(monetaryLine_present == false || monetaryLine.equals("")) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(monetary_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément LegalMonetaryTotal/LineExtensionAmount doit vérifier le format 9(19).9(4)
- *
- * @author Christel ESCOBAR
- */
-
-public class M100 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M100" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String MONETARY_PATH = "EtatsFrais/Invoice/LegalMonetaryTotal/";
- public static final transient String MONETARY_LINE = "EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M100.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = null;
- private String ID_Invoice_Unique = "";
-
- private String monetaryLine = "";
- private String monetary_NodeId = "";
- private boolean monetaryLine_present = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- monetary_NodeId = "";
- monetaryLine = "";
- monetaryLine_present = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(MONETARY_LINE)) {
- monetary_NodeId = atts.getValue("ano:node-id");
- monetaryLine_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(MONETARY_LINE)) {
- monetaryLine = chars.peek().toString();
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
-
- if (monetaryLine_present && (!monetaryLine.matches("^[+-]{0,1}[0-9]{1,19}[.][0-9]{1,4}$") && (!monetaryLine.matches("^[+-]{0,1}[0-9]{1,19}$")))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(monetary_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * La valeur de l'attribut currencyID doit etre identique pour les éléments
- * LegalMonetaryTotal/LineExtensionAmount et InvoiceLine/LineExtensionAmount au niveau de chaque ligne d'EF
- * @author Christel ESCOBAR
- */
-public class M101 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M101" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String INVOICEID_LINE = "EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String INVOICEID_LINE_ID = "EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String INVOICE_AMOUNT = "EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount/";
- public static final transient String MONETARY_AMOUNT = "EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M101.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = "";
- private String ID_Invoice_Unique = "";
- private String invoiceLineId = "";
-
- private String monetaryAmountID = "";
- private String invoiceAmountID = "";
-
- private String monetaryAmountID_nodeId = "";
- private String invoiceAmountID_nodeId = "";
-
- private boolean monetaryAmount_present = false; //car cet élément n'est pas obligatoire, le controle n'a pas de sens si cette balise n'est pas présente (présence vérifiée par le CTL-M099)
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- monetaryAmountID = "";
- monetaryAmountID_nodeId = "";
- monetaryAmount_present = false;
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICEID_LINE)) {
- invoiceAmountID = invoiceLineId = "";
- invoiceAmountID_nodeId = "";
- } else if(xpath.equals(INVOICE_AMOUNT)) {
- invoiceAmountID = atts.getValue("currencyID");;
- invoiceAmountID_nodeId = atts.getValue("ano:node-id");
- } else if(xpath.equals(MONETARY_AMOUNT)) {
- monetaryAmountID = atts.getValue("currencyID");
- monetaryAmountID_nodeId = atts.getValue("ano:node-id");
- monetaryAmount_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_LINE_ID)) {
- invoiceLineId = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_LINE)) {
-
- if(monetaryAmount_present && !invoiceAmountID.equals(monetaryAmountID)) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#INVOICE_LINE_ID#", invoiceLineId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(monetaryAmountID_nodeId));
- ano.addNode(new Node(invoiceAmountID_nodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * L'élément InvoiceLine/LineExtensionAmount doit vérifier le format 9(19).9(4)
- *
- * @author Christel ESCOBAR
- */
-
-public class M102 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M102" ;
- public static final transient String RESET_COUNTER_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String INVOICELINE_ID = "EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String INVOICELINE_PATH = "EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String INVOICELINE_AMOUNT = "EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_COUNTER_PATH;
-
- private static final Logger logger = Logger.getLogger(M102.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = "";
- private String ID_Invoice_Unique = "";
- private String invoiceLine_Id = "";
-
- private String amount = "";
- private String amount_NodeId = "";
- private boolean amount_present = false;
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_COUNTER_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICELINE_PATH)) {
- invoiceLine_Id = "";
- amount_NodeId = "";
- amount_present = false;
- } else if(xpath.equals(INVOICELINE_AMOUNT)) {
- amount_NodeId = atts.getValue("ano:node-id");
- amount_present = true;
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(INVOICELINE_ID)) {
- invoiceLine_Id = chars.peek().toString();
- } else if(xpath.equals(INVOICELINE_AMOUNT)) {
- amount = chars.peek().toString();
- } else if(xpath.equals(INVOICELINE_PATH)) {
-
- if (amount_present && !amount.matches("^[+-]{0,1}[0-9]{1,19}[.][0-9]{1,4}$") && (!amount.matches("^[+-]{0,1}[0-9]{1,19}$"))) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'"; // le XPath qui permettra de retrouver le
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#INVOICE_LINE_ID#", invoiceLine_Id);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(amount_NodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2010 axYus - www.axyus.com
- * 2010 C. ESCOBAR - christel.escobar@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.chorus;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * Le texte de l'élément InvoiceLine/Item/Description doit avoir une longueur de 50 caractères maximum
- * @author Christel ESCOBAR
- */
-public class M103 extends AbstractUnitControl {
- public static final String CTRL_ID = "CTL-M103" ;
- public static final transient String RESET_PATH = "EtatsFrais/Invoice/";
- public static final transient String INVOICEID_PATH = "EtatsFrais/Invoice/ID/";
- public static final transient String INVOICEID_LINE = "EtatsFrais/Invoice/InvoiceLine/";
- public static final transient String INVOICEID_LINE_ID = "EtatsFrais/Invoice/InvoiceLine/ID/";
- public static final transient String DESCRIPTION_PATH = "EtatsFrais/Invoice/InvoiceLine/Item/Description/";
- public static final transient String RETURN_ANOMALIES_PATH = RESET_PATH;
-
- private static final Logger logger = Logger.getLogger(M103.class);
-
- // pour stocker tous les paramètres d'execution des controles
- private Hashtable<String,Object> hParams;
-
- // pour stocker l'identifiant de l'invoice, on en a besoin pour générer l'anomalie
- private String invoiceId = "";
- private String ID_Invoice_Unique = "";
- private String invoiceLineId = "";
-
- private String description = "";
- private String description_nodeId = "";
-
- // pour récupérer le texte des balises
- private Stack<StringBuffer> chars = new Stack<StringBuffer>();
-
- // pour stocker les anomalies que l'on génère
- Vector<Anomalie> anomalies = null;
-
- public void endDocument() throws SAXException { }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) throws SAXException {
- if(xpath.equals(RESET_PATH)) {
- anomalies = new Vector<Anomalie>();
- invoiceId = "";
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- } else if(xpath.equals(INVOICEID_LINE)) {
- invoiceLineId = "";
- } else if(xpath.equals(DESCRIPTION_PATH)) {
- description = "";
- description_nodeId = atts.getValue("ano:node-id");
- }
- chars.push(new StringBuffer());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- if(xpath.equals(INVOICEID_PATH)) {
- invoiceId = chars.peek().toString();
- } else if(xpath.equals(INVOICEID_LINE_ID)) {
- invoiceLineId = chars.peek().toString();
- } else if(xpath.equals(DESCRIPTION_PATH)) {
- description = chars.peek().toString();
- if(description.length()>50) {
-
- String anoId = IdGenerator.nextId();
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- String libelleLien = "Invoice "+invoiceId;
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- // on reconstitue le message
- String message = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- message = message.replace("#INVOICE_ID#", invoiceId);
- message = message.replace("#INVOICE_LINE_ID#", invoiceLineId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(CTRL_ID),
- getDocumentModel().getDocumentId(),
- "EtatFrais",
- "invoice",
- invoiceId,
- localName, // l'élément en anomalie est bien Invoice
- libelleLien,
- message,
- getDocumentModel().getControlById(CTRL_ID).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(CTRL_ID).getSeverity(),
- path,
- xslParams);
- ano.addNode(new Node(description_nodeId));
- anomalies.add(ano);
- }
- chars.pop();
- return null;
- } else if(xpath.equals(RETURN_ANOMALIES_PATH)) {
- chars.pop();
- return anomalies;
- }
- chars.pop();
- return null;
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- // on met les caractères lus dans la pile
- chars.peek().append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) throws SAXException { }
-
- public void processingInstruction(String target, String data, String xpath) throws SAXException { }
-
- public void skippedEntity(String name, String xpath) throws SAXException { }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams=params;
- }
-
- public void setDocumentLocator(Locator locator) { }
-
- public void startDocument() throws SAXException { }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) throws SAXException { }
-
- public void endPrefixMapping(String prefix, String xpath) throws SAXException { }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- *
- * - présence de valideur d'ordre de mission
- * @author laurent.meckert
- */
-public class PRES01 extends AbstractUnitControl { //implements ConstantsControlsPESv2 {
-
- protected StringBuilder charsBuffer = new StringBuilder();
- private final static Logger logger = Logger.getLogger(PRES01.class);
- public static final transient String CTRL_ID = "PRES01";
- private Vector<Anomalie> anos = new Vector<Anomalie>();
- private Hashtable<String, Object> hParams;
- protected Logger getLogger() {
- return logger;
- }
- protected String getCtrlId() {
- return CTRL_ID;
- }
- /**
- * La balise du document général
- */
- private String docId = null;
- private ArrayList<Node> nodesId = new ArrayList<Node>();
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String om_IssueDate;
- private String om_IdOm;
- private String om_TypEtatFrais;
- private String ID_Invoice_Unique = "";
- /**
- * Chemins vers les divers éléments que l'on veut lire.
- */
-
- // la balise valideur de l'ordre de mission
- //private static final String CHEMIN_VALIDEUR_OM = "EtatsFrais/Invoice/UBLExtensions/UBLExtension/ExtensionContent/EtatFraisExtension/OrdreMission/Valideur/PartyIdentification";
- private static final String CHEMIN_VALIDEUR_OM = "OrdreMission/Valideur/PartyIdentification/ID/";
- private static final String CHEMIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String CHEMIN_INVOICEDATE = "EtatsFrais/Invoice/IssueDate/";
- private static final String CHEMIN_INVOICE_IDINVOICE = "EtatsFrais/Invoice/ID/";
- private static final String CHEMIN_INVOICE_TYPINVOICE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- /**
- * La chaine cible
- */
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE;
- private Hashtable<String, String> hashPresents = new Hashtable<String, String>();
- private static final String VALIDEUR = "Valideur";
-
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_CBC_ID = "#CBC_ID#";
- private static final String MSG_CBC_ISSUEDATE = "#CBC_ISSUEDATE#";
- private static final String MSG_CBC_INVOICETYPECODE = "#CBC_INVOICETYPECODE#";
-
- public void startDocument() throws SAXException {
- logger.info("In " + CTRL_ID);
- }
-
- public void setDocId(String docID) {
- this.docId = docID;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) {
- // 1
- if (xpath.endsWith(CHEMIN_INVOICE)) {
- anos = new Vector<Anomalie>();
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if (xpath.endsWith(CHEMIN_VALIDEUR_OM)) {
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- }
-
-
- this.charsBuffer.delete(0, this.charsBuffer.length());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- String value = this.charsBuffer.toString();
- if (xpath.endsWith(CHEMIN_INVOICEDATE)) {
- om_IssueDate = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDINVOICE)) {
- om_IdOm = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_TYPINVOICE)) {
- om_TypEtatFrais = value;
- }
- if (xpath.endsWith(CHEMIN_VALIDEUR_OM)) {
- hashPresents.put(VALIDEUR, value);
- }
- if (xpath.endsWith(ON_RETURN_ANOMALIES)) {
- if (hashPresents.get(VALIDEUR) == null || hashPresents.get(VALIDEUR).equals("")) {
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_CBC_ID, om_IdOm);
- msg = msg.replaceAll(MSG_CBC_ISSUEDATE, om_IssueDate);
- msg = msg.replaceAll(MSG_CBC_INVOICETYPECODE, om_TypEtatFrais);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice " + om_IdOm;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("elementId", "");
- xslParams.put("browser-destination", "internal");
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(getCtrlId()).getId(),
- getDocumentModel().getControlById(getCtrlId()).getLibelle(),
- getDocumentModel().getDocumentId(),
- "EtatFrais", // xpath.split("/")[0],
- "invoice", // élément importable
- om_IdOm, // id élément importable
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(getCtrlId()).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(getCtrlId()).getSeverity(),
- path, // xpath vers l'invoice line sous lequel se trouve l'anomalie
- xslParams); // paramètres supplémentaires pour accéder à l'élément en anomalie
- ano.addAll(nodesId);
- anos.add(ano);
- }
-
- hashPresents.clear();
- nodesId.clear();
- return anos;
- } else {
- return null;
- }
-
- }
-
- public void endDocument() throws SAXException {
- }
-
- public void characters(char[] ch, int start, int length, String xpath) {
- this.charsBuffer.append(ch, start, length);
-
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) {
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) {
- }
-
- public void endPrefixMapping(String prefix, String xpath) {
- }
-
- public void processingInstruction(String target, String data, String xpath) {
- }
-
- public void skippedEntity(String name, String xpath) {
- }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams = params;
- }
-
- public void setDocumentLocator(Locator locator) {
- }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.pres;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * - présence d'initiateur
- * @author laurent.meckert
- */
-public class PRES02 extends AbstractUnitControl { //implements ConstantsControlsPESv2 {
-
- protected StringBuilder charsBuffer = new StringBuilder();
- private final static Logger logger = Logger.getLogger(PRES02.class);
- public static final transient String CTRL_ID = "PRES02";
- private Vector<Anomalie> anos = new Vector<Anomalie>();
- private Hashtable<String, Object> hParams;
- /**
- * La balise du document général
- */
- private String docId = null;
- private ArrayList<Node> nodesId = new ArrayList<Node>();
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String om_IssueDate;
- private String om_IdOm;
- private String om_TypEtatFrais;
- private String ID_Invoice_Unique = "";
- /**
- * Chemins vers les divers éléments que l'on veut lire.
- */
- // la balise initiateur
- // peut etre est ce l'emetteur AccountingCustomerParty
- // peut etre est ce l'agent AccountingSupplierParty
- // ici je prends l'emetteur bien qu'il fasse double emploi c'est la collectivite
- //
- //private static final String CHEMIN_INITIATEUR_OM = "AccountingSupplierParty/Party/PartyIdentification/ID/";
- private static final String CHEMIN_INITIATEUR_OM = "AccountingCustomerParty/Party/PartyIdentification/ID/";
- private static final String CHEMIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String CHEMIN_INVOICEDATE = "EtatsFrais/Invoice/IssueDate/";
- private static final String CHEMIN_INVOICE_IDINVOICE = "EtatsFrais/Invoice/ID/";
- private static final String CHEMIN_INVOICE_TYPINVOICE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- /**
- * La chaine cible
- */
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE;
- private Hashtable<String, String> hashPresents = new Hashtable<String, String>();
- private static final String INITIATEUR = "Initiateur";
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_CBC_ID = "#CBC_ID#";
- private static final String MSG_CBC_ISSUEDATE = "#CBC_ISSUEDATE#";
- private static final String MSG_CBC_INVOICETYPECODE = "#CBC_INVOICETYPECODE#";
-
- protected Logger getLogger() {
- return logger;
- }
-
- protected String getCtrlId() {
- return CTRL_ID;
- }
-
- public void startDocument() throws SAXException {
- logger.info("In " + CTRL_ID);
- }
-
- public void setDocId(String docID) {
- this.docId = docID;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) {
- if (xpath.endsWith(CHEMIN_INVOICE)) {
- anos = new Vector<Anomalie>();
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if (xpath.endsWith(CHEMIN_INITIATEUR_OM)) {
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- }
- this.charsBuffer.delete(0, this.charsBuffer.length());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
-
- String value = this.charsBuffer.toString();
- if (xpath.endsWith(CHEMIN_INVOICEDATE)) {
- om_IssueDate = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDINVOICE)) {
- om_IdOm = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_TYPINVOICE)) {
- om_TypEtatFrais = value;
- }
- if (xpath.endsWith(CHEMIN_INITIATEUR_OM)) {
- hashPresents.put(INITIATEUR, value);
- }
- if (xpath.endsWith(ON_RETURN_ANOMALIES)) {
- if (hashPresents.get(INITIATEUR) == null || hashPresents.get(INITIATEUR).equals("")) {
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_CBC_ID, om_IdOm);
- msg = msg.replaceAll(MSG_CBC_ISSUEDATE, om_IssueDate);
- msg = msg.replaceAll(MSG_CBC_INVOICETYPECODE, om_TypEtatFrais);
-
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice " + om_IdOm;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("elementId", "");
- xslParams.put("browser-destination", "internal");
- xslParams.put("anoId", anoId);
- xslParams.put("presentation", "src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(getCtrlId()).getId(),
- getDocumentModel().getControlById(getCtrlId()).getLibelle(),
- getDocumentModel().getDocumentId(),
- "EtatFrais", // xpath.split("/")[0],
- "invoice", // élément importable
- om_IdOm, // id élément importable
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(getCtrlId()).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(getCtrlId()).getSeverity(),
- path, // xpath vers l'invoice line sous lequel se trouve l'anomalie
- xslParams); // paramètres supplémentaires pour accéder à l'élément en anomalie
- ano.addAll(nodesId);
- anos.add(ano);
- }
-
- hashPresents.clear();
- nodesId.clear();
- return anos;
- } else {
- return null;
- }
-
- }
-
- public void endDocument() throws SAXException {
- }
-
- public void characters(char[] ch, int start, int length, String xpath) {
- this.charsBuffer.append(ch, start, length);
-
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) {
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) {
- }
-
- public void endPrefixMapping(String prefix, String xpath) {
- }
-
- public void processingInstruction(String target, String data, String xpath) {
- }
-
- public void skippedEntity(String name, String xpath) {
- }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams = params;
- }
-
- public void setDocumentLocator(Locator locator) {
- }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert - laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-/*
- *
- * - controle : montant total = somme des montants des lignes
- *
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.som;
-
-/**
- *
- * @author laurent.meckert
- */
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-public class SOM01 extends AbstractUnitControl {
-
- protected StringBuilder charsBuffer = new StringBuilder();
- private final static Logger logger = Logger.getLogger(SOM01.class);
- public static final transient String CTRL_ID = "SOM01";
- private Vector<Anomalie> anos = new Vector<Anomalie>();
- private Hashtable<String, Object> hParams;
- /**
- * La balise du document général
- */
- private String docId = null;
- private ArrayList<Node> nodesId = new ArrayList<Node>();
- private String ID_Invoice_Unique = "";
- /**
- * La chaine cible
- */
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE;
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String om_IssueDate;
- private String om_IdOm;
- private String om_TypEtatFrais;
- private BigDecimal om_LegalMonetaryTotal;
- private static final String BALISE_MONTANT_LIGNE = "LineExtensionAmount";
- private static DecimalFormat df;
- private Hashtable<String, BigDecimal> hashMtsINVOICE = new Hashtable<String, BigDecimal>();
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_CBC_ID = "#CBC_ID#";
- private static final String MSG_CBC_ISSUEDATE = "#CBC_ISSUEDATE#";
- private static final String MSG_CBC_INVOICETYPECODE = "#CBC_INVOICETYPECODE#";
- private static final String MSG_CAC_LEGAL_MONETARY_TOTAL = "#CAC_LEGAL_MONETARY_TOTAL#";
- private static final String MSG_SOMME_CBC_LINEEXTENSIONAMOUNT = "#SOMME_CBC_LINEEXTENSIONAMOUNT#";
- /**
- * Chemins vers les divers éléments que l'on veut lire.
- */
- private static final String CHEMIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String CHEMIN_INVOICEDATE = "EtatsFrais/Invoice/IssueDate/";
- private static final String CHEMIN_INVOICE_IDINVOICE = "EtatsFrais/Invoice/ID/";
- private static final String CHEMIN_INVOICE_TYPINVOICE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- private static final String CHEMIN_INVOICE_MONTANTINVOICE = "EtatsFrais/Invoice/LegalMonetaryTotal/LineExtensionAmount/";
- private static final String CHEMIN_INVOICE_MONTANTLIGNE = "EtatsFrais/Invoice/InvoiceLine/LineExtensionAmount/";
-
- protected Logger getLogger() {
- return logger;
- }
-
- protected String getCtrlId() {
- return CTRL_ID;
- }
-
- public void startDocument() throws SAXException {
- logger.info("In " + CTRL_ID);
- df = new DecimalFormat("############0.00");
- }
-
- public void setDocId(String docID) {
- this.docId = docID;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) {
- // 1
- if (xpath.endsWith(CHEMIN_INVOICE)) {
- anos = new Vector<Anomalie>();
- om_LegalMonetaryTotal = new BigDecimal(0);
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if (xpath.endsWith(CHEMIN_INVOICE_MONTANTINVOICE) || xpath.endsWith(CHEMIN_INVOICE_MONTANTLIGNE)) {
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- }
-
-
- this.charsBuffer.delete(0, this.charsBuffer.length());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String value = this.charsBuffer.toString();
- if (xpath.endsWith(CHEMIN_INVOICEDATE)) {
- om_IssueDate = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDINVOICE)) {
- om_IdOm = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_TYPINVOICE)) {
- om_TypEtatFrais = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_MONTANTINVOICE)) {
- try {
- om_LegalMonetaryTotal = new BigDecimal(value);
- } catch (Exception ex) {
- }
- }
- if (xpath.endsWith(CHEMIN_INVOICE_MONTANTLIGNE)) {
- if (hashMtsINVOICE.get(BALISE_MONTANT_LIGNE) != null) {
- try {
- BigDecimal oldValue = hashMtsINVOICE.get(BALISE_MONTANT_LIGNE);
- BigDecimal newValue = new BigDecimal(value).add(oldValue);
- hashMtsINVOICE.put(BALISE_MONTANT_LIGNE, newValue);
- } catch (NumberFormatException nfe) {
- nfe.printStackTrace();
- logger.debug("Pb de parsing de float dans SOM01.");
- }
- } else {
- BigDecimal dvalue = new BigDecimal(value);
- hashMtsINVOICE.put(BALISE_MONTANT_LIGNE, dvalue);
- }
- }
- if (xpath.endsWith(ON_RETURN_ANOMALIES)) {
- if (om_LegalMonetaryTotal.compareTo(hashMtsINVOICE.get(BALISE_MONTANT_LIGNE)) != 0) {
-
- String msg = getDocumentModel().getControlById(CTRL_ID).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_CBC_ID, om_IdOm);
- msg = msg.replaceAll(MSG_CBC_ISSUEDATE, om_IssueDate);
- msg = msg.replaceAll(MSG_CBC_INVOICETYPECODE, om_TypEtatFrais);
- msg = msg.replaceAll(MSG_CAC_LEGAL_MONETARY_TOTAL, (om_LegalMonetaryTotal != null ? om_LegalMonetaryTotal.toString() : ""));
- msg = msg.replaceAll(MSG_SOMME_CBC_LINEEXTENSIONAMOUNT, new BigDecimal(hashMtsINVOICE.get(BALISE_MONTANT_LIGNE).toString()).toString());
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice " + om_IdOm;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- xslParams.put("elementId", "");
- xslParams.put("browser-destination", "internal");
- xslParams.put("anoId", anoId);
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(getCtrlId()).getId(),
- getDocumentModel().getControlById(getCtrlId()).getLibelle(),
- getDocumentModel().getDocumentId(),
- "EtatFrais", // xpath.split("/")[0],
- "invoice", // élément importable
- om_IdOm, // id élément importable
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(getCtrlId()).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(getCtrlId()).getSeverity(),
- path, // xpath vers l'invoice line sous lequel se trouve l'anomalie
- xslParams); // paramètres supplémentaires pour accéder à l'élément en anomalie
- ano.addAll(nodesId);
- anos.add(ano);
- }
-
- hashMtsINVOICE.clear();
- nodesId.clear();
- return anos;
- } else {
- return null;
- }
- }
-
- public void endDocument() throws SAXException {
- }
-
- public void characters(char[] ch, int start, int length, String xpath) throws SAXException {
- this.charsBuffer.append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) {
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) {
- }
-
- public void endPrefixMapping(String prefix, String xpath) {
- }
-
- public void processingInstruction(String target, String data, String xpath) {
- }
-
- public void skippedEntity(String name, String xpath) {
- }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams = params;
- }
-
- public void setDocumentLocator(Locator locator) {
- }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values;
-
-import org.apache.log4j.Logger;
-
-/**
- * Implémente le contrôle VALUES03
- *
- * Contrôle sur la valeur des champs Modalités de règlement
- * (PaymentMeansCode)
- *
- * Pour toutes les lignes, vérifier que le PaymentMeansCode appartient à la liste
- * passee en parametre.
- * + @TODO si code V indiquer reference bancaire PaymentChannelCode et PayeeFinancialAccount
- *
- */
-/**
- *
- * @author laurent.meckert
- */
-public class CTL_M032 extends VALUES00 {
-
- private final static Logger logger = Logger.getLogger(CTL_M032.class);
- public static final transient String CTRL_ID = "CTL-M032";
- /**
- * La chaine cible
- */
- private static final String CHEMIN_TYPECODE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE;
- private String valuesString;
- private String[] valuesList;
- private String badValue;
-
- /**
- * @return the valuesList
- */
- public String[] getValuesList() {
- return valuesList;
- }
-
- /**
- * @param aValuesList the valuesList to set
- */
- public void setValuesList(String[] aValuesList) {
- valuesList = aValuesList;
- }
-
- protected Logger getLogger() {
- return logger;
- }
-
- protected String getCtrlId() {
- return CTRL_ID;
- }
-
- protected String getReturnAnomalies() {
- return ON_RETURN_ANOMALIES;
- }
-
- protected String getXpath() {
- return CHEMIN_TYPECODE;
- }
-
- protected String getValuesParameterName() {
- return "Type d'état";
- }
-
- /**
- * @return the valuesString
- */
- public String getValuesString() {
- return valuesString;
- }
-
- /**
- * @param valuesString the valuesString to set
- */
- public void setValuesString(String valuesString) {
- this.valuesString = valuesString;
- }
-
- /**
- * @return the badValue
- */
- public String getBadValue() {
- return badValue;
- }
-
- /**
- * @param badValue the badValue to set
- */
- public void setBadValue(String badValue) {
- this.badValue = badValue;
- }
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values;
-
-import org.apache.log4j.Logger;
-
-/**
- * Implémente le contrôle VALUES01
- *
- * Contrôle sur la valeur des champs Modalités de règlement
- * (PaymentMeansCode)
- *
- * Pour toutes les lignes, vérifier que le PaymentMeansCode appartient à la liste
- * passee en parametre.
- * + @TODO si code V indiquer reference bancaire PaymentChannelCode et PayeeFinancialAccount
- *
- */
-/**
- *
- * @author laurent.meckert
- */
-public class CTL_M035 extends VALUES00 {
-
- private final static Logger logger = Logger.getLogger(CTL_M035.class);
- public static final transient String CTRL_ID = "CTL-M035";
- /**
- * La chaine cible
- */
- private static final String CHEMIN_PM_CODE = "EtatsFrais/Invoice/PaymentMeans/PaymentMeansCode/";
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = FIN_INVOICE;
- private String valuesString;
- private String[] valuesList;
- private String badValue;
-
- /**
- * @return the valuesList
- */
- public String[] getValuesList() {
- return valuesList;
- }
-
- /**
- * @param aValuesList the valuesList to set
- */
- public void setValuesList(String[] aValuesList) {
- valuesList = aValuesList;
- }
-
- protected Logger getLogger() {
- return logger;
- }
-
- protected String getCtrlId() {
- return CTRL_ID;
- }
-
- protected String getReturnAnomalies() {
- return ON_RETURN_ANOMALIES;
- }
-
- protected String getXpath() {
- return CHEMIN_PM_CODE;
- }
-
- protected String getValuesParameterName() {
- return "Moyens de paiement";
- }
-
- /**
- * @return the valuesString
- */
- public String getValuesString() {
- return valuesString;
- }
-
- /**
- * @param valuesString the valuesString to set
- */
- public void setValuesString(String valuesString) {
- this.valuesString = valuesString;
- }
-
- /**
- * @return the badValue
- */
- public String getBadValue() {
- return badValue;
- }
-
- /**
- * @param badValue the badValue to set
- */
- public void setBadValue(String badValue) {
- this.badValue = badValue;
- }
-}
+++ /dev/null
-
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import fr.gouv.finances.dgfip.xemelios.controls.core.AbstractUnitControl;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Anomalie;
-import fr.gouv.finances.dgfip.xemelios.controls.core.IdGenerator;
-import fr.gouv.finances.dgfip.xemelios.controls.core.Node;
-
-/**
- * code générique pour les champs n'acceptant qu'une liste
- * de valeurs possibles
- * @author laurent.meckert
- */
-public abstract class VALUES00 extends AbstractUnitControl {
-
- private final static Logger logger = Logger.getLogger(VALUES00.class);
-
- /**
- * @return the valuesString
- */
- abstract public String getValuesString();
-
- /**
- * @param aValuesString the valuesString to set
- */
- abstract public void setValuesString(String aValuesString);
-
- /**
- * @return the valuesList
- */
- abstract public String[] getValuesList();
-
- /**
- * @param aValuesList the valuesList to set
- */
- abstract public void setValuesList(String[] aValuesList);
- private Vector<Anomalie> anos = new Vector<Anomalie>();
- private Hashtable<String, Object> hParams;
- protected StringBuilder charsBuffer = new StringBuilder();
- /**
- * La balise du document général
- */
- private String docId = null;
- private String nodeId = null;
- private static final String CHEMIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String CHEMIN_INVOICEDATE = "EtatsFrais/Invoice/IssueDate/";
- private static final String CHEMIN_INVOICE_IDINVOICE = "EtatsFrais/Invoice/ID/";
- private static final String CHEMIN_INVOICE_TYPINVOICE = "EtatsFrais/Invoice/InvoiceTypeCode/";
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private ArrayList<Node> nodesId = new ArrayList<Node>();
- /**
- * Variables contenant les valeurs nécessaires à ce contrôle
- */
- private String om_IssueDate;
- private String om_IdOm;
- private String om_TypEtatFrais;
- private String ID_Invoice_Unique = "";
- /**
- * Variables devant être remplacées dans le message
- */
- private static final String MSG_CBC_ID = "#CBC_ID#";
- private static final String MSG_CBC_ISSUEDATE = "#CBC_ISSUEDATE#";
- private static final String MSG_CBC_INVOICETYPECODE = "#CBC_INVOICETYPECODE#";
- private static final String MSG_CBC_ELEMENT = "#CBC_ELEMENT#";
- private static final String MSG_CBC_VALUE = "#CBC_VALUE#";
- private static final String MSG_CBC_LISTVALUES = "#CBC_LISTVALUES#";
-
- abstract protected String getXpath();
-
- abstract protected String getReturnAnomalies();
-
- abstract protected Logger getLogger();
-
- abstract protected String getCtrlId();
-
- abstract protected String getValuesParameterName();
- private boolean found = false;
-
- public void startDocument() throws SAXException {
- getLogger().info("In " + getCtrlId());
- }
-
- public void setDocId(String docID) {
- this.docId = docID;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes atts, String xpath) {
- if (xpath.endsWith(CHEMIN_INVOICE)) {
- ID_Invoice_Unique = atts.getValue("ano:unique-id");
- }
- if (xpath.endsWith(getXpath())) {
- nodesId.clear();
- anos = new Vector<Anomalie>();
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- found = false;
- }
- /*if (xpath.endsWith(getReturnAnomalies())) {
- nodesId.add(new Node(atts.getValue("ano:node-id")));
- }*/
- this.charsBuffer.delete(0, this.charsBuffer.length());
- }
-
- public Vector<Anomalie> endElement(String uri, String localName, String qName, String xpath) throws SAXException {
- String value = this.charsBuffer.toString();
- if (xpath.endsWith(CHEMIN_INVOICEDATE)) {
- om_IssueDate = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_IDINVOICE)) {
- om_IdOm = value;
- }
- if (xpath.endsWith(CHEMIN_INVOICE_TYPINVOICE)) {
- om_TypEtatFrais = value;
- }
-
- if (xpath.endsWith(getXpath())) {
- // comparer avec les valeurs possible dans valuesList
- for (String s : getValuesList()) {
- if (s.equals(value)) {
- found = true;
- break;
- }
- }
- if (!found) {
- setBadValue(value);
- }
- }
- if (xpath.endsWith(getReturnAnomalies())) {
- if (getBadValue() != null) {
- String msg = getDocumentModel().getControlById(this.getCtrlId()).getMessage().getHtmlContent();
- msg = msg.replaceAll(MSG_CBC_ID, om_IdOm);
- msg = msg.replaceAll(MSG_CBC_ISSUEDATE, om_IssueDate);
- msg = msg.replaceAll(MSG_CBC_INVOICETYPECODE, om_TypEtatFrais);
- msg = msg.replaceAll(MSG_CBC_ELEMENT, getXpath());
- msg = msg.replaceAll(MSG_CBC_VALUE,getBadValue());
- msg = msg.replaceAll(MSG_CBC_LISTVALUES, getValuesString());
- setBadValue(null);
- String path = "@ano:unique-id='" + ID_Invoice_Unique + "'";
- String anoId = IdGenerator.nextId();
- String libelleLien = "Invoice " + om_IdOm;
- Hashtable<String, Object> xslParams = new Hashtable<String, Object>();
- //xslParams.put("elementId", "");
- //xslParams.put("browser-destination", "internal");
- xslParams.put("anoId", anoId);
- xslParams.put("presentation","src");
- Anomalie ano = new Anomalie(anoId,
- getDocumentModel().getControlById(getCtrlId()).getId(),
- getDocumentModel().getControlById(getCtrlId()).getLibelle(),
- getDocumentModel().getDocumentId(),
- "EtatFrais", // xpath.split("/")[0],
- "invoice", // élément importable
- om_IdOm, // id élément importable
- localName,
- libelleLien,
- msg,
- getDocumentModel().getControlById(getCtrlId()).getRegle().getHtmlContent(),
- getDocumentModel().getControlById(getCtrlId()).getSeverity(),
- path, // xpath vers l'invoice line sous lequel se trouve l'anomalie
- xslParams); // paramètres supplémentaires pour accéder à l'élément en anomalie
- ano.addAll(nodesId);
- anos.add(ano);
- return anos;
- } else {
-
- return null;
- }
- }
-
- return null;
-
- }
-
- public void endDocument() throws SAXException {
- }
-
- public void characters(char[] ch, int start, int length, String xpath) {
- this.charsBuffer.append(ch, start, length);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length, String xpath) {
- }
-
- public void startPrefixMapping(String prefix, String uri, String xpath) {
- }
-
- public void endPrefixMapping(String prefix, String xpath) {
- }
-
- public void processingInstruction(String target, String data, String xpath) {
- }
-
- public void skippedEntity(String name, String xpath) {
- }
-
- public void setParameters(Hashtable<String, Object> params) {
- this.hParams = params;
- if (hParams.get(getValuesParameterName()) != null) {
- setValuesString(hParams.get(getValuesParameterName()).toString());
- setValuesList(getValuesString().split("[ ,]+"));
- }
- }
-
- public void setDocumentLocator(Locator locator) {
- }
-
- /**
- * @return the badValue
- */
- abstract public String getBadValue();
-
- /**
- * @param badValue the badValue to set
- */
- abstract public void setBadValue(String badValue);
-}
+++ /dev/null
-/*
- * Copyright
- * 2009 axYus - www.axyus.com
- * 2009 L.Meckert laurent.meckert@axyus.com
- *
- * This file is part of XEMELIOS.
- *
- * XEMELIOS is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XEMELIOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with XEMELIOS; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package fr.gouv.finances.dgfip.xemelios.controls.etatFrais.values;
-
-import org.apache.log4j.Logger;
-
-/**
- * Implémente le contrôle VALUES01
- *
- * Contrôle sur la valeur des champs Modalités de règlement
- * (PaymentMeansCode)
- *
- * Pour toutes les lignes, vérifier que le PaymentMeansCode appartient à la liste
- * passee en parametre.
- * + @TODO si code V indiquer reference bancaire PaymentChannelCode et PayeeFinancialAccount
- *
- */
-/**
- *
- * @author laurent.meckert
- */
-public class VALUES02 extends VALUES00 {
-
- private final static Logger logger = Logger.getLogger(VALUES02.class);
- public static final transient String CTRL_ID = "VALUES02";
- /**
- * La chaine cible
- */
- private static final String CHEMIN_TYPE_FRAIS = "EtatsFrais/Invoice/InvoiceLine/Item/BuyersItemIdentification/ID/";
- private static final String CHEMIN_INVOICE_LINE = "EtatsFrais/Invoice/InvoiceLine/";
- private static final String FIN_INVOICE = "EtatsFrais/Invoice/";
- private static final String ON_RETURN_ANOMALIES = CHEMIN_INVOICE_LINE;
- private String valuesString;
- private String[] valuesList;
- private String badValue;
-
- /**
- * @return the valuesList
- */
- public String[] getValuesList() {
- return valuesList;
- }
-
- /**
- * @param aValuesList the valuesList to set
- */
- public void setValuesList(String[] aValuesList) {
- valuesList = aValuesList;
- }
-
- protected Logger getLogger() {
- return logger;
- }
-
- protected String getCtrlId() {
- return CTRL_ID;
- }
-
- protected String getReturnAnomalies() {
- return ON_RETURN_ANOMALIES;
- }
-
- protected String getXpath() {
- return CHEMIN_TYPE_FRAIS;
- }
-
- protected String getValuesParameterName() {
- return "Types de frais";
- }
-
- /**
- * @return the valuesString
- */
- public String getValuesString() {
- return valuesString;
- }
-
- /**
- * @param valuesString the valuesString to set
- */
- public void setValuesString(String valuesString) {
- this.valuesString = valuesString;
- }
-
- /**
- * @return the badValue
- */
- public String getBadValue() {
- return badValue;
- }
-
- /**
- * @param badValue the badValue to set
- */
- public void setBadValue(String badValue) {
- this.badValue = badValue;
- }
-}