TPESFactureOld factureObj = null;
if(!getWizardProcess().getPjStep().getFactures().isEmpty()){
try {
- JAXBContext jc = JAXBContext.newInstance(TPESFacture.class);
- // TODO : VIRER le chemin en dur
- // unmarshal from foo.xml
+ JAXBContext jc = JAXBContext.newInstance(TPESFactureOld.class);
Unmarshaller u = jc.createUnmarshaller();
factureObj = (TPESFactureOld)u.unmarshal(new File(getWizardProcess().getPjStep().getFactures().get(0).getUrlFile()) );
} catch (Exception e){
int response = chooseFileDialog.showDialog(getWizardProcess().getWizardDialog(), "Enregistrer");
if (response == JFileChooser.APPROVE_OPTION) {
+ pesPjFile = chooseFileDialog.getSelectedFile();
PESAller pesAller = getWizardProcess().getPesAller();
if(factureObj != null){
pesAller.setPESFacture(factureObj);
fos.close();
}
} catch (Exception e) {
- throw new StepValidationException("Probleme de génération du flux xml.\n"+e.getMessage());
+ throw new StepValidationException("Probleme de génération du flux xml."+e.getLocalizedMessage());
}
- /*
- // Ajout des PES FACTURES
- Document doc = null;
- try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(pesPjFile);
- XPath xp = XPathFactory.newInstance().newXPath();
- Element el = (Element) xp.evaluate("//PES_Aller",doc, XPathConstants.NODE);
- doc.i
- } catch (java.io.IOException e) {
- System.out.println("Can't find the file");
- } catch (Exception e) {
- System.out.print("Problem parsing the file.");
- }*/
} else {
throw new StepValidationException("");
}