Changeset 369 for gssim_ui/branches
- Timestamp:
- 08/10/12 14:18:18 (13 years ago)
- Location:
- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/DatabaseHelper.java
r365 r369 31 31 */ 32 32 protected String apJobDescription = "job_description"; 33 /** 34 * Application property for input location 35 */ 36 protected String apInputLocation = "input_location"; 37 /** 38 * Application property for output location 39 */ 40 protected String apOutputLocation = "output_location"; 41 /** 42 * Application property for GSSim input files location 43 */ 44 protected String apGSSimInput = "gssim_input"; 33 45 34 46 /** … … 36 48 */ 37 49 protected String jdPropertyFile = "$PROPERTY_FILE"; 50 /** 51 * Job description token for input location 52 */ 53 protected String jdInputLocation = "$INPUT_LOCATION"; 54 /** 55 * Job description token for output location 56 */ 57 protected String jdOutputLocation = $OUTPUT_LOCATION"; 38 58 } -
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java
r368 r369 147 147 uploadPropertyFile(destFileName, fileContent); 148 148 149 UUID uuid = UUID.randomUUID(); 150 String uniqueFolderName = uuid.toString(); 151 149 152 String grmsURL = null; 150 153 String grmsDN = null; 151 154 String jobDescription = null; 155 String inputLocation = null; 156 String outputLocatin = null; 157 String gssimInput = null; 152 158 153 159 Connection connection = null; … … 173 179 else { 174 180 jobDescription = list.get(0).getValue(); 175 //replace tokens 176 jobDescription = jobDescription.replace(jdPropertyFile, "input/" + destFileName); 181 jobDescription = jobDescription.replace(jdPropertyFile, uniqueFolderName + "/" + destFileName); 177 182 } 183 184 finder = Finder.getApplicationPropertyFinder(apInputLocation); 185 list = applicationPropertyDAO.find(finder); 186 if (list.isEmpty()) ; 187 else { 188 inputLocation = list.get(0).getValue(); 189 if (inputLocation.endsWith("/")) 190 inputLocation = inputLocation.substring(0,inputLocation.length() - 1); 191 if (jobDescription != null) 192 jobDescription = jobDescription.replace(jdInputLocation, inputLocation); 193 } 194 195 finder = Finder.getApplicationPropertyFinder(apOutputLocation); 196 list = applicationPropertyDAO.find(finder); 197 if (list.isEmpty()) ; 198 else { 199 outputLocation = list.get(0).getValue(); 200 if (jobDescription != null) 201 jobDescription = jobDescription.replace(jdOutputLocation, outputLocation); 202 } 203 204 finder = Finder.getApplicationPropertyFinder(apGSSimInput); 205 list = applicationPropertyDAO.find(finder); 206 if (list.isEmpty()) ; 207 else 208 gssimInput = list.get(0).getValue(); 209 178 210 } catch (SQLException e) { 179 211 ; … … 188 220 } finally { 189 221 closeConnection(connection, null); 190 } 222 } 223 224 //move the files to unique subfolder 225 String cmd = new String[2]; 226 cmd[0] = "mkdir"; 227 cmd[1] = inputLocation + "/" + uniqueFolderName; 228 Runtime.getRuntime().exec(cmd).waitFor(); 229 cmd = new String[3]; 230 cmd[0] = "cp"; 231 cmd[2] = inputLocation + "/" + uniqueFolderName 232 cmd[1] = gssimInput + "/" + destFileName; 233 Runtime.getRuntime().exec(cmd).waitFor(); 191 234 192 235 return doSubmitApplication(grmsURL, grmsDN, jobDescription);
Note: See TracChangeset
for help on using the changeset viewer.