<%@ page info="Make the script for the visualization." %> <%@ page import="WebFlow.*" %> <%@ page import="WebFlow.ContextManager.*" %> <%@ page import="WebFlow.RemoteFile.*" %> <%@ page import="WebFlow.RemoteFile.RemoteFilePackage.*" %> <%@ page import="java.util.Date" %> <%@ page errorPage="/Generic/Error.jsp" %> <% String userName=storeInfo.getTableVal("userName"); String collcheck = request.getParameter("collchoice"); String vizcomm = request.getParameter("vizsubmitcomm"); System.out.println("VizScript: Vizcomm: "+vizcomm); String propspath = application.getRealPath("/WEB-INF/"); propspath += "../Properties/Collab.properties"; String problemName=storeInfo.getTableVal("problemName"); String sessionName=storeInfo.getTableVal("sessionName"); ContextManager cm = null; RemoteFile rf = null; boolean flag = false; String archiveType = storeInfo.getTableVal("archiveType"); if(archiveType.equals("masterProblemname")) { cm=modserver.getContextManager(); flag = true; } else { cm=modserver.getContextManagerForSlave(); rf=modserver.getRemoteFileForSlave(); } //ContextManager cm=modserver.getContextManager(); //cm.selectSession(problemName,sessionName); setprops.setCM(cm); setprops.setRequests(request); //Setup the createScript bean and create the script. //Use a factory pattern here so that the queuing system //is determined by the user's selection. //System.out.println("Queue Type: "+cm.getCurrentSessionProperty("QueueType")); extensions.generic.createScript cjs = null; String scriptString=""; String probDir = cm.getCurrentSessionProperty("Directory"); String scripttype = cm.getCurrentSessionProperty("VtkCode"); if(flag) { cjs=extensions.generic.scriptFactory.makeChild(cm.getCurrentSessionProperty("VtkType"),cm,userName); cjs.setScriptProperties(propspath); cjs.createFlagTable(); cjs.createHeader(); cjs.createGnuplotCommands(); cjs.writeScript(); //Now grab the script and give the user a chance to edit it. //String scriptString=""; //String probDir="Descriptors/users/JSPClient/"+userName+"/"+problemName+"/"+sessionName; //String scripttype = cm.getCurrentSessionProperty("VtkCode"); if(scripttype.equalsIgnoreCase("gnuplot")) { scriptString=getfile.fileToString(probDir+"/script.gnu"); } else { scriptString=getfile.fileToString(probDir+"/scriptmatlab.m"); } } else { cjs=extensions.generic.scriptFactory.makeChild(cm.getCurrentSessionProperty("VtkType"),rf,cm,userName); cjs.setScriptProperties(propspath); cjs.createFlagTable(); cjs.createHeader(); cjs.createMatlabCommands(); cjs.writeScriptRf(); //Now grab the script and give the user a chance to edit it. //String probDir="Descriptors/users/JSPClient/"+userName+"/"+probName+"/"+sessionName; if(scripttype.equalsIgnoreCase("gnuplot")) { probDir = probDir+"/script.gnu"; } else { probDir = probDir+"/scriptmatlab.m"; } byte buffer[] = null; try { rf.open(probDir, "r"); //open remote file for reading buffer = rf.getBlock(); scriptString = new String(buffer); while(true) { if(buffer.length > 0) { buffer = rf.getBlock(); scriptString += new String(buffer); } else throw new EOFFileException(); } }catch(EOFFileException ex) { rf.close(); } } %> Edit Generated Script

Review Viz Script for <%= cm.getCurrentSessionProperty("VtkCode") %>

The following Viz script has been created for you. You can modify it if you wish. When you are finished, click the "Update Viz Script" button to commit your changes.