}
@Override
- public void validate() throws StepValidationException {
- TPESFactureOld factureObj = null;
- if(!getWizardProcess().getPjStep().getFactures().isEmpty()){
- try {
- 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){
- logger.error("Probleme de unmarshaller",e);
- throw new StepValidationException("Probleme de generation de PES Facture.");
- }
- }
-
+ public void validate() throws StepValidationException {
String directoryPath = PropertiesUtils.getDiretoryByProperty(getWizardProcess().getProperties(), Constants.PROPERTIES_LAST_DIRECTORY_SAVE, System.getProperty("user.home"));
JFileChooser chooseFileDialog = new JFileChooser(new File(directoryPath));
FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter("xml files (*.xml)", "xml");
PESAller pesAller = getWizardProcess().getPesAller();
// Ajout du nom de fichier et de la date de création
GeneratePesUtils.setNomFicAndDatStr(pesAller, pesPjFile.getName());
-
- if(factureObj != null){
- pesAller.setPESFacture(factureObj);
- }
+
pesAller.setPESPJ(GeneratePesUtils.generatePesPj(pesAller, getWizardProcess().getPjStep().getPjs()));
FileOutputStream fos = new FileOutputStream(pesPjFile);