21
21
import java .util .Date ;
22
22
import java .util .HashMap ;
23
23
import java .util .Hashtable ;
24
+ import java .util .Iterator ;
24
25
import java .util .List ;
25
26
import java .util .Map ;
27
+ import java .util .Map .Entry ;
26
28
import java .util .StringTokenizer ;
27
29
28
- import javax .print .attribute .standard .Finishings ;
29
30
import javax .servlet .ServletException ;
30
31
import javax .servlet .http .HttpServletRequest ;
31
32
import javax .servlet .http .HttpServletResponse ;
46
47
import org .eclipse .jetty .server .handler .AbstractHandler ;
47
48
import org .eclipse .jetty .server .handler .ContextHandler ;
48
49
import org .eclipse .jetty .server .handler .ContextHandlerCollection ;
49
- import org .eclipse .jetty .server .handler .DebugHandler ;
50
50
import org .jdom .Namespace ;
51
51
import org .vcell .imagej .ImageJHelper .ApiSolverHandler .IJGeom ;
52
52
import org .vcell .util .BeanUtils ;
140
140
import cbit .vcell .solver .SimulationOwner ;
141
141
import cbit .vcell .solver .SolverDescription ;
142
142
import cbit .vcell .solver .SolverUtilities ;
143
+ import cbit .vcell .solver .TempSimulation ;
143
144
import cbit .vcell .solver .VCSimulationDataIdentifier ;
144
145
import cbit .vcell .solver .VCSimulationIdentifier ;
145
146
import cbit .vcell .solver .ode .ODESimData ;
@@ -1400,6 +1401,14 @@ private static void addSimToIJContextInfo(ArrayList<IJContextInfo>ijContextInfos
1400
1401
ArrayList <IJSimInfo > ijSimInfos = new ArrayList <>();
1401
1402
for (Simulation sim :sims ) {
1402
1403
ijSimInfos .add (new IJSimInfo (true , false , sim .getSimulationID (), sim .getName ()));
1404
+ final Iterator <Entry <String , String >> iterator = TempSimulation .mapTempSimIDToModelAppSim .entrySet ().iterator ();
1405
+ String modelAppSim = TempSimulation .createModelAppSimName (sim );
1406
+ while (iterator .hasNext ()) {
1407
+ final Entry <String , String > next = iterator .next ();
1408
+ if (next .getValue ().equals (modelAppSim )) {
1409
+ ijSimInfos .add (new IJSimInfo (true , false , next .getKey ().toString (), sim .getName ()+" (quickrun_" +next .getKey ().toString ()+")" ));
1410
+ }
1411
+ }
1403
1412
}
1404
1413
ijContextInfos .add (new IJContextInfo (contextName ,mathType ,geomDim ,geomName , ijSimInfos ));
1405
1414
}
@@ -1421,11 +1430,11 @@ private static void populateDesktopIJModelInfos(IJDocType docType,ArrayList<KeyV
1421
1430
for (SimulationContext simulationContext :((BioModelWindowManager )documentWindowManager ).getBioModel ().getSimulationContexts ()) {
1422
1431
addSimToIJContextInfo (ijContextInfos , simulationContext .getName (), simulationContext .getMathType (),simulationContext .getGeometryContext ().getGeometry ().getDimension (),simulationContext .getGeometry ().getName (),simulationContext .getSimulations ());
1423
1432
}
1424
- modelInfos .add (new IJModelInfo (documentWindowManager .getVCDocument ().getName (), null , IJDocType .bm , true ,documentWindowManager .getUser (). getName (),null , ijContextInfos ));
1433
+ modelInfos .add (new IJModelInfo (documentWindowManager .getVCDocument ().getName (), null , IJDocType .bm , true ,( documentWindowManager .getUser ()== null ? null : documentWindowManager . getUser (). getName () ),null , ijContextInfos ));
1425
1434
}else if (documentWindowManager instanceof MathModelWindowManager ) {
1426
1435
MathModel mathModel = ((MathModelWindowManager )documentWindowManager ).getMathModel ();
1427
1436
addSimToIJContextInfo (ijContextInfos , null ,mathModel .getMathDescription ().getMathType (),mathModel .getGeometry ().getDimension (),mathModel .getGeometry ().getName (),((MathModelWindowManager )documentWindowManager ).getSimulationWorkspace ().getSimulations ());
1428
- modelInfos .add (new IJModelInfo (documentWindowManager .getVCDocument ().getName (), null , IJDocType .mm , true ,documentWindowManager .getUser (). getName (),null , ijContextInfos ));
1437
+ modelInfos .add (new IJModelInfo (documentWindowManager .getVCDocument ().getName (), null , IJDocType .mm , true ,( documentWindowManager .getUser ()== null ? null : documentWindowManager . getUser (). getName () ),null , ijContextInfos ));
1429
1438
}
1430
1439
}
1431
1440
}
@@ -1629,7 +1638,7 @@ public static ArrayList<IJModelInfo> refreshIJModelInfoCache(IJDocType ijDocType
1629
1638
if (bOpenOnly == null || bOpenOnly .booleanValue () == false || (bOpenOnly .booleanValue () == true && bOpenOnDesktop == true )){
1630
1639
ArrayList <IJContextInfo > contInfos = new ArrayList <>();
1631
1640
ArrayList <IJSimInfo > ijsimfos = new ArrayList <>();
1632
- ijsimfos .add (new IJSimInfo (bOpenOnDesktop , false ,Simulation .createSimulationID (new KeyValue (quickrunKey )), parentSimName ));
1641
+ ijsimfos .add (new IJSimInfo (bOpenOnDesktop , false ,quickrunKey /* Simulation.createSimulationID(new KeyValue(quickrunKey))*/ , parentSimName ));
1633
1642
// ijsimfos.add(new IJSimInfo(quickrunKey, parentSimName));
1634
1643
contInfos .add (new IJContextInfo (parentContextName , parentMathType , parentGeomDim , parentGeomName , ijsimfos ));
1635
1644
modelInfos .add (new IJModelInfo (parentModelName , parentDate , docType , (docType != IJDocType .quick ?true :false ), parentUser ,parentModelKey ,contInfos ));
@@ -2430,7 +2439,9 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
2430
2439
StringTokenizer st = new StringTokenizer (file .getName (), "_" );
2431
2440
st .nextToken ();
2432
2441
String quickrunKey = st .nextToken ();
2433
- if (Simulation .createSimulationID (new KeyValue (quickrunKey )).equals (ijSimInfo .simId )) {
2442
+ // if(TempSimulation.mapTempSimIDToOriginalSimID.get(quickrunKey) != null && TempSimulation.mapTempSimIDToOriginalSimID.get(quickrunKey).equals(ijSimInfo.simId)) {
2443
+ // if(Simulation.createSimulationID(new KeyValue(quickrunKey)).equals(ijSimInfo.simId)) {
2444
+ if (quickrunKey .equals (ijSimInfo .simId )) {
2434
2445
ijDataResponder = IJDataResponder .create (new KeyValue (quickrunKey ),file .getParentFile ().getParentFile (), jobIndex );
2435
2446
break fileloop ;
2436
2447
}
@@ -2494,6 +2505,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
2494
2505
response .setContentType ("text/plain; charset=utf-8" );
2495
2506
response .setStatus (HttpServletResponse .SC_OK );
2496
2507
response .getWriter ().write ("VCellApi" );
2508
+ //response.getWriter().write("VCellApi:"+VCellClientTest.getVCellClient().getRequestManager().getDocumentManager().getUser().getName());
2497
2509
baseRequest .setHandled (true );
2498
2510
2499
2511
}
0 commit comments