Changeset 389 for gssim_ui/branches
- Timestamp:
- 08/13/12 11:36:01 (13 years ago)
- Location:
- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/GSSimStudio.mxml
r377 r389 30 30 import gssim.gssimstudio.editor.gssim.skins.IconButtonSkin; 31 31 32 import mx.controls.Alert; 33 import mx.rpc.events.ResultEvent; 34 32 35 public var isFileTransfering : Boolean = false; 33 36 … … 48 51 49 52 addModelUpdatedResultCallback(archiveViewer.convertToXml); 53 addModelUpdatedResultCallback(printMessage); 50 54 } 51 55 … … 64 68 //refresh editors 65 69 if (workloadEditor != null && workloadEditor.ErrorList != null) workloadEditor.ErrorList.invalidateList(); 66 } 70 } 71 72 private function printMessage(event:ResultEvent):void{ 73 if (model.messageCode == null || model.messageCode == "") return; 74 Alert.show(resourceManager.getString('Messages', model.messageCode)); 75 } 67 76 ]]> 68 77 </fx:Script> -
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/GSSimStudioModel.as
r81 r389 24 24 25 25 public var openUrl : String; 26 public var messageCode : String; 26 27 27 28 /* Hashmap used to load multiple experiments configurations from Archive into Experiment Editor. */ -
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/views/ArchiveViewer.mxml
r63 r389 144 144 if (parentApplication.gsSimStudioModel.experimentListChanged == true) 145 145 { 146 parentApplication.gsSimStudioModel.experimentListChanged = false;147 146 var temp : XML = <experiments />; 148 147 for each (var exp2 : Object in parentApplication.gsSimStudioModel.experimentList) -
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java
r375 r389 121 121 private ServiceLog log = ServiceLog.getInstance(GSSimStudio.class); 122 122 123 private GSSimStudioModel getModel() { 124 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 125 model.setMessageCode(null); 126 model.setExperimentListChanged(false); 127 return model; 128 } 129 123 130 @BlazeDsMethod() 124 131 public GSSimStudioModel getOpenURL(String fileUrl) throws MalformedURLException { 125 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();132 GSSimStudioModel model = getModel(); 126 133 FileLocation fileLocation = new FileLocation(fileUrl); 127 134 ServletContext servletContext = FlexContext.getServletContext(); … … 209 216 210 217 } catch (SQLException e) { 211 log.error(e.toString());212 } catch (InstantiationException e) { 213 log.error(e.toString());214 } catch (IllegalAccessException e) { 215 log.error(e.toString());216 } catch (ClassNotFoundException e) { 217 log.error(e.toString());218 } catch (Exception e) { 219 log.error(e.toString());220 } finally { 221 closeConnection(connection, null);218 setSqlError("Submit experiment", model, e); 219 } catch (InstantiationException e) { 220 setDbConnectionError(model, e); 221 } catch (IllegalAccessException e) { 222 setDbConnectionError(model, e); 223 } catch (ClassNotFoundException e) { 224 setDbConnectionError(model, e); 225 } catch (Exception e) { 226 setError("Unexpected error occured", model, e); 227 } finally { 228 closeConnection(connection, model); 222 229 } 223 230 … … 234 241 Runtime.getRuntime().exec(cmd).waitFor(); 235 242 } catch (Exception e) { 236 log.error(e.toString()); 237 } 243 setError("Unexpected error", model, e); 244 } 245 246 model.setMessageCode("ExperimentSubmitted"); 238 247 239 248 return (GSSimStudioModel) VineFlexUtilClass.getUIModel(); … … 320 329 public GSSimStudioModel getAllocationsFromDb(Integer taskId, Integer unitId) { 321 330 322 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 323 //avoid updating experiment list in archive when nothing changed 324 model.setExperimentListChanged(false); 331 GSSimStudioModel model = getModel(); 325 332 Connection connection = null; 326 333 … … 356 363 public GSSimStudioModel getAllocationDetailsFromDb(Integer allocationId) { 357 364 358 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 359 //avoid updating experiment list in archive when nothing changed 360 model.setExperimentListChanged(false); 365 GSSimStudioModel model = getModel(); 361 366 Connection connection = null; 362 367 try { … … 392 397 public GSSimStudioModel getBlobPropertiesFromDb(Integer configId) { 393 398 394 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 395 //avoid updating experiment list in archive when nothing changed 396 model.setExperimentListChanged(false); 399 GSSimStudioModel model = getModel(); 397 400 Connection connection = null; 398 401 try { … … 435 438 public GSSimStudioModel getResourceTimelineFromDb(String resourceName, Integer expId, String type) { 436 439 437 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();440 GSSimStudioModel model = getModel(); 438 441 439 442 Connection connection = null; … … 492 495 public GSSimStudioModel getExperimentConfiguration(List experiments) { 493 496 494 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 495 //avoid updating experiment list in archive when nothing changed 496 model.setExperimentListChanged(false); 497 GSSimStudioModel model = getModel(); 497 498 498 499 Connection connection = null; … … 547 548 protected int addExperimentToDb(String expName, String metaexperiment) { 548 549 Connection connection = null; 549 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();550 GSSimStudioModel model = getModel(); 550 551 try { 551 552 connection = factory().createDBConnection(dbAddress, dbUser, … … 672 673 @BlazeDsMethod() 673 674 public GSSimStudioModel deleteExperiment(Integer PK) { 674 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 675 //avoid updating experiment list in archive when nothing changed 676 model.setExperimentListChanged(false); 675 GSSimStudioModel model = getModel(); 677 676 Connection connection = null; 678 677 try { … … 704 703 @BlazeDsMethod() 705 704 public GSSimStudioModel updateExperiment(Integer PK, Integer userID, Integer configID, String name, Timestamp commissionDate, String description, String status, Integer metaexpID) { 706 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 707 //avoid updating experiment list in archive when nothing changed 708 model.setExperimentListChanged(false); 705 GSSimStudioModel model = getModel(); 709 706 Connection connection = null; 710 707 try { … … 737 734 @BlazeDsMethod() 738 735 public GSSimStudioModel changeExperimentsMetaexperiment(List experiments, String metaexperiment) { 739 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 740 //avoid updating experiment list in archive when nothing changed 741 model.setExperimentListChanged(false); 736 GSSimStudioModel model = getModel(); 742 737 Connection connection = null; 743 738 try { … … 777 772 @BlazeDsMethod() 778 773 public GSSimStudioModel getExperimentNetworkTopology(Integer PK) { 779 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 780 //avoid updating experiment list in archive when nothing changed 781 model.setExperimentListChanged(false); 774 GSSimStudioModel model = getModel(); 782 775 Connection connection = null; 783 776 try { … … 829 822 Boolean publish, String status) { 830 823 831 if (model == null) model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();824 if (model == null) model = getModel(); 832 825 Connection connection = null; 833 826 try { … … 866 859 public GSSimStudioModel getExperimentStatsFromDb(Integer experimentId) { 867 860 868 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 869 //avoid updating experiment list in archive when nothing changed 870 model.setExperimentListChanged(false); 861 GSSimStudioModel model = getModel(); 871 862 Connection connection = null; 872 863 try { … … 899 890 @BlazeDsMethod() 900 891 public GSSimStudioModel getExtendedConfigurationFromDb(int id) { 901 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 902 //avoid updating experiment list in archive when nothing changed 903 model.setExperimentListChanged(false); 892 GSSimStudioModel model = getModel(); 904 893 Connection connection = null; 905 894 try { … … 965 954 public GSSimStudioModel getQueuesFromDb(Integer resourceId) { 966 955 967 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 968 //avoid updating experiment list in archive when nothing changed 969 model.setExperimentListChanged(false); 956 GSSimStudioModel model = getModel(); 970 957 Connection connection = null; 971 958 try { … … 1000 987 public GSSimStudioModel getReservationsFromDb(Integer taskId, Integer unitId) { 1001 988 1002 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1003 //avoid updating experiment list in archive when nothing changed 1004 model.setExperimentListChanged(false); 989 GSSimStudioModel model = getModel(); 1005 990 Connection connection = null; 1006 991 try { … … 1035 1020 public GSSimStudioModel getReservationDetailsFromDb(Integer reservationId) { 1036 1021 1037 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1038 //avoid updating experiment list in archive when nothing changed 1039 model.setExperimentListChanged(false); 1022 GSSimStudioModel model = getModel(); 1040 1023 Connection connection = null; 1041 1024 try { … … 1097 1080 1098 1081 protected GSSimStudioModel delegateResource(Object[] parameters, Integer index) { 1099 GSSimStudioModel gssimStudioModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1100 gssimStudioModel.setExperimentListChanged(false); 1082 GSSimStudioModel gssimStudioModel = getModel(); 1101 1083 ResourceChartModel resourceChartModel = (ResourceChartModel) gssimStudioModel.getResourceChartComponents().get(index.toString()); 1102 1084 if (resourceChartModel == null) … … 1120 1102 1121 1103 protected GSSimStudioModel delegateComparison(Object[] parameters, Integer index) { 1122 GSSimStudioModel gssimStudioModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1123 gssimStudioModel.setExperimentListChanged(false); 1104 GSSimStudioModel gssimStudioModel = getModel(); 1124 1105 ExperimentComparisonChartModel experimentComparisonChartModel = (ExperimentComparisonChartModel) gssimStudioModel.getComparisonComponents().get(index.toString()); 1125 1106 if (experimentComparisonChartModel == null) … … 1138 1119 1139 1120 protected GSSimStudioModel delegateGannt(Object[] parameters, Integer index) { 1140 GSSimStudioModel gssimStudioModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1141 gssimStudioModel.setExperimentListChanged(false); 1121 GSSimStudioModel gssimStudioModel = getModel(); 1142 1122 GanntChartModel ganntChartModel = (GanntChartModel) gssimStudioModel.getGanntChartComponents().get(index.toString()); 1143 1123 if (ganntChartModel == null) … … 1154 1134 Integer jobId, Integer taskId, Integer procSetId) { 1155 1135 1156 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1157 //avoid updating experiment list in archive when nothing changed 1158 model.setExperimentListChanged(false); 1136 GSSimStudioModel model = getModel(); 1159 1137 Connection connection = null; 1160 1138 try { … … 1219 1197 Long maxExecutionFinishDateMilis) { 1220 1198 1221 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1222 //avoid updating experiment list in archive when nothing changed 1223 model.setExperimentListChanged(false); 1199 GSSimStudioModel model = getModel(); 1224 1200 Connection connection = null; 1225 1201 try { … … 1289 1265 public GSSimStudioModel getTextPropertiesFromDb(Integer configId) { 1290 1266 1291 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1292 //avoid updating experiment list in archive when nothing changed 1293 model.setExperimentListChanged(false); 1267 GSSimStudioModel model = getModel(); 1294 1268 Connection connection = null; 1295 1269 try { … … 1325 1299 String type) { 1326 1300 1327 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1328 //avoid updating experiment list in archive when nothing changed 1329 model.setExperimentListChanged(false); 1301 GSSimStudioModel model = getModel(); 1330 1302 Connection connection = null; 1331 1303 try { … … 1361 1333 Long minTimestampMilis, Long maxTimestampMilis) { 1362 1334 1363 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1364 //avoid updating experiment list in archive when nothing changed 1365 model.setExperimentListChanged(false); 1335 GSSimStudioModel model = getModel(); 1366 1336 Connection connection = null; 1367 1337 try { … … 1403 1373 public GSSimStudioModel getUnitDetailsFromDb(Integer unitId) { 1404 1374 1405 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1406 //avoid updating experiment list in archive when nothing changed 1407 model.setExperimentListChanged(false); 1375 GSSimStudioModel model = getModel(); 1408 1376 Connection connection = null; 1409 1377 try { … … 1440 1408 Long minTimestampMilis, Long maxTimestampMilis) { 1441 1409 1442 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1443 //avoid updating experiment list in archive when nothing changed 1444 model.setExperimentListChanged(false); 1410 GSSimStudioModel model = getModel(); 1445 1411 Connection connection = null; 1446 1412 try { … … 1480 1446 1481 1447 public GSSimStudioModel getUser(int id) { 1482 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();1448 GSSimStudioModel model = getModel(); 1483 1449 Connection connection = null; 1484 1450 try { … … 1586 1552 log.debug(jobDescription); 1587 1553 1588 GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();1554 GSSimStudioModel model = getModel(); 1589 1555 model.setGrmsDN(grmsDN); 1590 1556 model.setGrmsURL(grmsURL); 1591 //avoid updating experiment list in archive when nothing changed1592 1557 model.setExperimentListChanged(true); 1593 1558 … … 1624 1589 int jobCount) { 1625 1590 if (model == null) { 1626 model = (GSSimStudioModel) VineFlexUtilClass.getUIModel();1591 model = (GSSimStudioModel) getModel(); 1627 1592 } 1628 1593 GRMS3ReturnType grms3ReturnType = null; … … 1723 1688 log.debug("FILELISTCOM all files uploaded"); 1724 1689 1725 GSSimStudioModel fileListComModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel();1690 GSSimStudioModel fileListComModel = getModel(); 1726 1691 Vector<FileItem> uploadedFiles = VineFlexUtilClass.getUploadedFiles(); 1727 //avoid updating experiment list in archive when nothing changed 1728 fileListComModel.setExperimentListChanged(false); 1729 1692 1730 1693 int numOfFiles = uploadedFiles.size(); 1731 1694 System.out.println("FILELISTCOM all files uploaded"); … … 1851 1814 log.debug("FILELISTCOM all files uploaded"); 1852 1815 1853 GSSimStudioModel fileListComModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 1854 //avoid updating experiment list in archive when nothing changed 1855 fileListComModel.setExperimentListChanged(false); 1816 GSSimStudioModel fileListComModel = getModel(); 1856 1817 Vector<FileItem> uploadedFiles = new Vector<FileItem>(); 1857 1818 File rootDir = new File(System.getProperty("java.io.tmpdir")); … … 2148 2109 log.debug("deleteFileItem"); 2149 2110 2150 GSSimStudioModel fileListComModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 2151 //avoid updating experiment list in archive when nothing changed 2152 fileListComModel.setExperimentListChanged(false); 2111 GSSimStudioModel fileListComModel = getModel(); 2153 2112 2154 2113 try { … … 2206 2165 public Object init(Object model) { 2207 2166 log.debug("init() called"); 2208 GSSimStudioModel gssimStudioModel = (GSSimStudioModel) model; 2209 //avoid updating experiment list in archive when nothing changed 2210 gssimStudioModel.setExperimentListChanged(false); 2167 GSSimStudioModel gssimStudioModel = getModel(); 2211 2168 if (gssimStudioModel == null) 2212 2169 gssimStudioModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); … … 2332 2289 ServiceContext serviceContext = VineFlexUtilClass.getServiceContext(); 2333 2290 2334 GSSimStudioModel fileListComModel = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 2335 2336 //avoid updating experiment list in archive when nothing changed 2337 fileListComModel.setExperimentListChanged(false); 2291 GSSimStudioModel fileListComModel = getModel(); 2338 2292 2339 2293 FileResourceManager fileResourceManager = getFileResourceManager(serviceContext); -
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudioModel.java
r81 r389 132 132 /* END OF DB DATA */ 133 133 134 private String messageCode; 135 136 public String getMessageCode() { 137 return messageCode; 138 } 139 140 public void setMessageCode(String messageCode) { 141 this.messageCode = messageCode; 142 } 143 134 144 private String openUrl; 135 145 136 /**137 * @return the grmsDN138 */139 146 public String getOpenUrl() { 140 147 return openUrl; 141 148 } 142 149 143 /**144 * @param grmsDN the grmsDN to set145 */146 150 public void setOpenUrl(String openUrl) { 147 151 this.openUrl = openUrl;
Note: See TracChangeset
for help on using the changeset viewer.