xsi:noNamespaceSchemaLocation="../../defs/technical-component-definition.xsd">
<name>control-core</name>
<description>Brique de base pour les contrôles</description>
- <release>5.0.0.3</release>
+ <release>5.0.0.5</release>
<url>http://xemelios.org/updatesV5/control-core</url>
<type>COMPOSANT</type>
<destination>
<component-ref url="http://xemelios.org/updatesV5/starter" release="5.0.0.0"/>
</requires>
<release-notes>
+ <release v="5.0.0.5">
+ <note visibility="dev">Ameliorations/Corrections des nouveaux contrôles</note>
+ </release>
+ <release v="5.0.0.4">
+ <note visibility="public">Corrections relatives aux nouveaux contrôles</note>
+ </release>
<release v="5.0.0.3">
<note visibility="public">Mise en place des nouveaux controles</note>
<note visibility="public">Optimisation de la construction du XPath dans les endElement</note>
*/
package fr.gouv.finances.dgfip.xemelios.controls.core;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
// protected MainWindow owner;
private ArrayList<ControlReturn> anos = new ArrayList<ControlReturn>();
private ArrayList<ControlReturn> vTotalAnomalies;
+ private ArrayList<Pair> vControlStatus;
private ArrayList<ControlModel> controlsModel;
private SaxXmlWriter saxXmlWriter;
private NamespaceContext nsCtx;
this.fileName = file;
this.nsCtx = nsCtx;
vTotalAnomalies = new ArrayList<ControlReturn>();
+ vControlStatus = new ArrayList<Pair>();
stack = new Stack<String>();
controlsToCall = new ArrayList<AbstractUnitControl>();
controlsToCallById = new HashMap<String, AbstractUnitControl>();
for (AbstractUnitControl auc : controlsToCall) {
try {
anos = auc.endElement(uri, localName, qName, xPath);
+ if(auc.getControlId()!=null) vControlStatus.add(new Pair(auc.getControlId(), String.valueOf(auc.getStatusControle())));
if (anos != null && !anos.isEmpty()) {
if (!(vTotalAnomalies.size() > MAX_ANOS)) {
vTotalAnomalies.addAll(anos);
vAno.addAll(anos);
}
}
- } catch (SAXException saxEx) {
- logger.debug("in endElement!!!", saxEx);
+ } catch (Exception ex) {
+ if(ex instanceof SAXException){
+ logger.debug("in endElement!!!", ex);
+ } else {
+ // an exception during schema loading
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw, true);
+ ex.printStackTrace(pw);
+ Anomalie ano = new Anomalie(IdGenerator.nextId(),
+ auc.getControlId(),
+ "Erreur d'execution du " + auc.getControlId(),
+ auc.getControlId(),
+ "",
+ "",
+ "",
+ "",
+ "",
+ new StringBuilder("<![CDATA[<b>Erreur critique lors de l'analyse du flux</b> : Veuillez contacter votre support technique.<p style='font-size: 10px; padding-left: 75px;'>").append(sw.toString()).append("</p>]]>").toString(),
+ "Erreur d'execution du contrôle " + auc.getControlId(),
+ "BLOQUANT",
+ "xpath namespacise",
+ new Hashtable<String, Object>());
+ //ano.addNode(new Node(null));
+ if(anos!=null){
+ anos.add(ano);
+ if (!(vTotalAnomalies.size() > MAX_ANOS)) {
+ vTotalAnomalies.addAll(anos);
+ vAno.addAll(anos);
+ }
+ }
+ }
}
}
if (!vAno.isEmpty()) {
@Override
public void endDocument() throws SAXException {
+ for (AbstractUnitControl auc : controlsToCall) {
+ try {
+ if(auc.getControlId()!=null) vControlStatus.add(new Pair(auc.getControlId(), String.valueOf(auc.getStatusControle())));
+ } catch (Exception ex) {
+ logger.debug("in endDocument!!!", ex);
+ }
+ }
if (collectivite == null || collectivite.key == null || collectivite.libelle == null) {
try {
collectivite = getCollectivite(documentId, fileName);