use of org.zkoss.bind.annotation.NotifyChange in project compss by bsc-wdc.
the class ViewModel method updateRuntimeLog.
@Command
@NotifyChange("runtimeLogViewModel")
public void updateRuntimeLog() {
logger.debug("Loading Monitored Application...");
Application monitoredApp = new Application();
Session session = Sessions.getCurrent();
if (session != null) {
UserCredential userCred = ((UserCredential) session.getAttribute("userCredential"));
if (userCred != null) {
monitoredApp = userCred.getMonitoredApp();
}
}
logger.debug("Loaded Monitored Application: " + monitoredApp.getName());
logger.debug("Updating RuntimeLog...");
if (monitoredApp.getName() != "") {
if (selectedTab.equals(Constants.runtimeLogTabName)) {
runtimeLogViewModel.update();
} else {
runtimeLogViewModel.clear();
}
} else {
runtimeLogViewModel.clear();
}
logger.info("Runtime.log updated");
}
use of org.zkoss.bind.annotation.NotifyChange in project compss by bsc-wdc.
the class ViewModel method update.
@Command
@NotifyChange({ "resourcesViewModel", "coresViewModel", "currentGraphViewModel", "completeGraphViewModel", "loadChartViewModel", "statisticsViewModel", "runtimeLogViewModel" })
public void update() {
logger.debug("Loading Monitored Application...");
Application monitoredApp = new Application();
Session session = Sessions.getCurrent();
if (session != null) {
UserCredential userCred = ((UserCredential) session.getAttribute("userCredential"));
if (userCred != null) {
monitoredApp = userCred.getMonitoredApp();
}
}
logger.info("Loaded Monitored Application: " + monitoredApp.getName());
if (monitoredApp.getName() != "") {
if (selectedTab.equals(Constants.resourcesInformationTabName)) {
logger.debug("Updating Resources Information...");
// Monitor XML parse
logger.debug("Parsing Monitor XML File...");
MonitorXmlParser.parseResources();
logger.debug("Monitor XML File parsed");
// Update
resourcesViewModel.update(MonitorXmlParser.getWorkersDataArray());
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.tasksInformationTabName)) {
logger.debug("Updating Jobs Information...");
// Monitoring parse
logger.debug("Parsing Monitor XML File...");
MonitorXmlParser.parseCores();
logger.debug("Monitor XML File parsed");
// Update
coresViewModel.update(MonitorXmlParser.getCoresDataArray());
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.currentTasksGraphTabName)) {
logger.debug("Updating Current Tasks Graph...");
// Monitor XML parse
logger.debug("Parsing Monitor XML File...");
MonitorXmlParser.parseCores();
logger.debug("Monitor XML File parsed");
// Update
coresViewModel.update(MonitorXmlParser.getCoresDataArray());
currentGraphViewModel.update(monitoredApp);
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.completeTasksGraphTabName)) {
logger.debug("Updating Complete Tasks Graph...");
// Monitor XML parse
logger.debug("Parsing Monitor XML File...");
MonitorXmlParser.parseCores();
logger.debug("Monitor XML File parsed");
// Update
coresViewModel.update(MonitorXmlParser.getCoresDataArray());
completeGraphViewModel.update(monitoredApp);
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.loadChartTabName)) {
logger.debug("Updating Resouces Load Chart...");
// Update
loadChartViewModel.update();
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.statisticsTabName)) {
logger.debug("Updating statistics...");
// Monitor XML parse
logger.debug("Parsing Monitor XML File...");
MonitorXmlParser.parseStatistics();
logger.debug("Monitor XML File parsed");
// Update
statisticsViewModel.update(MonitorXmlParser.getStatisticsParameters());
logger.info("Structures updated");
} else if (selectedTab.equals(Constants.runtimeLogTabName)) {
// Check messagebox result
if (runtimeLogConfirmation == 0) {
logger.debug("Messagebox confirmation received. Loading runtime.log");
this.updateRuntimeLog();
// Reset messagebox handler to avoid automatic refresh
runtimeLogConfirmation = -1;
} else if (runtimeLogConfirmation == 1) {
logger.debug("Messagebox denied");
// Reset messagebox handler to avoid automatic refresh
runtimeLogConfirmation = -1;
}
} else if (selectedTab.equals(Constants.executionInformationTabName)) {
// Nothing to do. This tab doesn't have automatic update
} else {
logger.info("No Information Tab selected");
}
} else {
resourcesViewModel.clear();
coresViewModel.clear();
currentGraphViewModel.clear();
completeGraphViewModel.clear();
loadChartViewModel.clear();
statisticsViewModel.clear();
runtimeLogViewModel.clear();
logger.info("No Application Selected");
}
}
use of org.zkoss.bind.annotation.NotifyChange in project compss by bsc-wdc.
the class ViewModel method updateExecutionInformation.
@Command
@NotifyChange("executionInformationViewModel")
public void updateExecutionInformation() {
logger.debug("Loading Monitored Application...");
Application monitoredApp = new Application();
Session session = Sessions.getCurrent();
if (session != null) {
UserCredential userCred = ((UserCredential) session.getAttribute("userCredential"));
if (userCred != null) {
monitoredApp = userCred.getMonitoredApp();
}
}
logger.debug("Loaded Monitored Application: " + monitoredApp.getName());
logger.debug("Updating Execution Information...");
if (monitoredApp.getName() != "") {
if (selectedTab.equals(Constants.executionInformationTabName)) {
executionInformationViewModel.update();
}
} else {
executionInformationViewModel.clear();
}
logger.info("Execution Information updated");
}
use of org.zkoss.bind.annotation.NotifyChange in project collect by openforis.
the class AttributeVM method addAttributeDefault.
@Command
@NotifyChange("attributeDefaults")
public void addAttributeDefault() {
if (checkCanInsertAttributeDefault()) {
editingNewAttributeDefault = true;
editedAttributeDefault = new AttributeDefault();
openAttributeDefaultEditPopUp();
}
}
use of org.zkoss.bind.annotation.NotifyChange in project collect by openforis.
the class AttributeVM method deleteAttributeDefault.
@Command
@NotifyChange({ "selectedAttributeDefault", "attributeDefaults" })
public void deleteAttributeDefault() {
ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
editedItem.removeAttributeDefault(selectedAttributeDefault);
selectedAttributeDefault = null;
initAttributeDefaults();
notifyChange("selectedAttributeDefault", "attributeDefaults");
}
}, "survey.schema.attribute.attribute_default.confirm_delete");
params.setOkLabelKey("global.delete_item");
MessageUtil.showConfirm(params);
}
Aggregations