use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_Save_Clicked.
/**
* Clicked event handler for the field Save.
* @return The FormKey.
*/
public FormKey do_Save_Clicked() {
FormKey fk = null;
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
try {
// Copy the values from Form to Component
myForm.doValidate(request);
// save the file contents
myComp.performSave();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_CoreRulesUrl_Clicked.
/**
* Invoked if the core-rules URL is clicked
* @return The FormKey for the Update screen.
*/
public FormKey do_CoreRulesUrl_Clicked() {
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
FormKey fk = null;
try {
String fileName = (String) Config.getProperty(Config.PROP_RULES_ENGINE_CORE_RULES_URL, null);
if (!fileName.equals(myComp.getValidationRulesFile())) {
myComp.setFileContents(null);
myComp.setValidationRulesFile(fileName);
myComp.loadFileContents();
}
myComp.determineAndSetNextScreen();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
// Direct User back to current form
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_ValidatorsUrls_Update_Clicked.
/**
* Invoked if a update button on a row is selected.
* @param rowId The selected row on the screen.
* @return The FormKey for the Update screen.
*/
public FormKey do_ValidatorsUrls_Update_Clicked(String rowId) {
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
FormKey fk = null;
GridModel model = (GridModel) myForm.getValidatorsUrlsWM();
GridModelRow selectedRow = model.getRowById(Integer.parseInt(rowId));
if (selectedRow != null) {
try {
String fileName = (String) selectedRow.get("validatorsUrl");
if (!fileName.equals(myComp.getValidationRulesFile())) {
myComp.setFileContents(null);
myComp.setValidationRulesFile(fileName);
myComp.loadFileContents();
}
myComp.determineAndSetNextScreen();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
}
// Direct User back to current form
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_Rules_Update_Clicked.
/**
* Invoked if a update button on a row is selected.
* @param rowId The selected row on the screen.
* @return The FormKey for the Update screen.
*/
public FormKey do_Rules_Update_Clicked(String rowId) {
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
FormKey fk = null;
GridModel model = (GridModel) myForm.getRulesWM();
GridModelRow selectedRow = model.getRowById(Integer.parseInt(rowId));
if (selectedRow != null) {
try {
String fileName = (String) selectedRow.get("name");
if (!fileName.equals(myComp.getValidationRulesFile())) {
myComp.setFileContents(null);
myComp.setValidationRulesFile(fileName);
myComp.loadFileContents();
}
myComp.determineAndSetNextScreen();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
}
// Direct User back to current form
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_Refresh_Clicked.
/**
* Clicked event handler for the field Refresh.
* @return The FormKey.
*/
public FormKey do_Refresh_Clicked() {
FormKey fk = null;
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
myComp.setFileContents(null);
try {
myComp.loadFileContents();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
Aggregations