IDEMPIERE-2871 Import CSV process not returning log file when run via web services
This commit is contained in:
parent
9a464977a4
commit
16791faf20
|
@ -46,6 +46,7 @@ import org.compiere.model.GridTab;
|
|||
import org.compiere.model.GridWindow;
|
||||
import org.compiere.model.MImportTemplate;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.process.ProcessInfo;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -144,6 +145,11 @@ public class ImportCSVProcess extends SvrProcess implements DataStatusListener {
|
|||
|
||||
if (processUI != null)
|
||||
processUI.download(outFile);
|
||||
else if( getProcessInfo() != null ){
|
||||
ProcessInfo m_pi = getProcessInfo();
|
||||
m_pi.setExportFile(outFile);
|
||||
m_pi.setExportFileExtension("csv");
|
||||
}
|
||||
|
||||
m_file_istream.close();
|
||||
}
|
||||
|
|
|
@ -364,11 +364,24 @@ public class Process {
|
|||
}
|
||||
else
|
||||
{
|
||||
try{
|
||||
if( pi.getExportFile() != null ){
|
||||
r.setData(java.nio.file.Files.readAllBytes(pi.getExportFile().toPath()));
|
||||
r.setReportFormat(pi.getExportFileExtension());
|
||||
}
|
||||
r.setSummary(pi.getSummary());
|
||||
r.setError(pi.getSummary());
|
||||
r.setLogInfo(pi.getLogInfo(true));
|
||||
r.setIsError( false );
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
r.setError("Cannot get the export file:" + e.getMessage());
|
||||
r.setLogInfo(pi.getLogInfo(true) );
|
||||
r.setIsError( true );
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Report
|
||||
|
|
Loading…
Reference in New Issue