import com.axyus.generator.pespj.steps.PjStep;
import com.axyus.generator.pespj.steps.ReferenceComptableStep;
import com.axyus.generator.pespj.utils.ConfigHandler;
+import com.axyus.generator.pespj.utils.Constants;
import com.axyus.swing.components.wizard.WizardProcess;
import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
import fr.gouv.minefi.cp.helios.pes_v2.rev0.aller.PESAller;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
+import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
/**
int stepIndex = 0;
+ private static Properties properties;
+ private static File propertiesFile = new File(System.getProperty("user.home"), Constants.PROPERTIES_FILE_NAME);
+
private PESAller pesAller;
private ConfigHandler configHandler;
public GeneratorPesPjWizardProcess(WizardLauncher.RunContextAdapter runContextAdapter) throws UnExpectedException {
this.runContextAdapter = runContextAdapter;
this.pesAller = new PESAller();
-
- try {
+
+ try {
+ if(!propertiesFile.exists()){
+ propertiesFile.createNewFile();
+ }
InputStream input = this.getClass().getResourceAsStream("/com/axyus/generator/pespj/datas.xml");
try{
DocumentBuilder documentBuilder = new DocumentBuilderFactoryImpl().newDocumentBuilder();
configHandler = new ConfigHandler(documentBuilder.parse(input));
+ properties = new Properties();
+ properties.load(new FileInputStream(propertiesFile));
}finally{
input.close();
}
this.pjStep = new PjStep();
this.referenceComptableStep = new ReferenceComptableStep();
this.generationResultStep = new GenerationResultStep(runContextAdapter.isPesFileImportSupported());
+ this.generationResultStep.setPreviousEnable(false);
if (runContextAdapter.isPesFileImportSupported()) {
this.importXemeliosConfirmationStep = new ImportXemeliosResultStep();
public boolean isInXemelios() {
return inXemelios;
- }
+ }
+
+ public void storeInPropertiesFile() throws Exception {
+ properties.store(new FileOutputStream(propertiesFile), null);
+ }
+
+ public Properties getProperties(){
+ return properties;
+ }
}