|
12 | 12 | import cbit.vcell.modeldb.DatabaseServerImpl;
|
13 | 13 | import cbit.vcell.resource.PropertyLoader;
|
14 | 14 | import cbit.vcell.simdata.DataSetControllerImpl;
|
| 15 | +import cbit.vcell.solver.SimulationInfo; |
15 | 16 | import cbit.vcell.solvers.CartesianMesh;
|
16 | 17 | import jakarta.enterprise.context.ApplicationScoped;
|
17 | 18 | import jakarta.inject.Inject;
|
18 |
| -import org.apache.commons.io.IOUtils; |
19 | 19 | import org.vcell.restq.db.AgroalConnectionFactory;
|
20 | 20 | import org.vcell.util.DataAccessException;
|
21 | 21 | import org.vcell.util.ObjectNotFoundException;
|
|
26 | 26 | import java.io.*;
|
27 | 27 | import java.sql.SQLException;
|
28 | 28 | import java.util.ArrayList;
|
29 |
| -import java.util.HashMap; |
30 |
| -import java.util.Map; |
31 | 29 | import java.util.Vector;
|
32 | 30 | import java.util.zip.DataFormatException;
|
33 | 31 |
|
@@ -119,8 +117,14 @@ public FieldDataFileOperationResults saveNewFieldDataFromFile(FieldDataResource.
|
119 | 117 | }
|
120 | 118 | }
|
121 | 119 |
|
122 |
| - public FieldDataDBOperationResults saveNewFieldDataIntoDB(User user, FieldDataDBOperationSpec spec) throws DataAccessException { |
123 |
| - return databaseServer.fieldDataDBOperation(user, spec); |
| 120 | + public void saveFieldDataFromSimulation(User user, KeyValue simKeyValue, int jobIndex, String newFieldDataName) throws DataAccessException { |
| 121 | + // Create DB entry |
| 122 | + SimulationInfo simInfo = databaseServer.getSimulationInfo(user, simKeyValue); |
| 123 | + FieldDataDBOperationSpec fieldDataDBOperationSpec = FieldDataDBOperationSpec.createSaveNewExtDataIDSpec(user, newFieldDataName, ""); |
| 124 | + FieldDataDBOperationResults results = databaseServer.fieldDataDBOperation(user, fieldDataDBOperationSpec); |
| 125 | + |
| 126 | + // Save new file with reference to DB entry |
| 127 | + dataSetController.fieldDataCopySim(simKeyValue, simInfo.getOwner(), results.extDataID, jobIndex, user); |
124 | 128 | }
|
125 | 129 |
|
126 | 130 | public void deleteFieldData(User user, String fieldDataID) throws DataAccessException {
|
|
0 commit comments