Search in sources :

Example 1 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class RolesEditorAction method do_CheckPolicy_Clicked.

/**
 * This will re-render the screen with the original values.
 * @return the FormKey for this screen.
 */
public FormKey do_CheckPolicy_Clicked() {
    FormKey fk = null;
    RolesEditorForm myForm = (RolesEditorForm) form;
    RolesEditorComponent myComp = (RolesEditorComponent) component;
    try {
        fk = myComp.runCheckPolicy();
    } 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.getRolesEditorFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 2 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class RolesEditorAction method do_Save_Clicked.

/**
 * Event Handler for the 'Save' clicked event.
 * This will copy the values from the Form to the Component and then invoke the performSave() method on the component.
 * Finally it'll get the latest file contents of the roles.xml file.
 * @return the FormKey for this screen.
 */
public FormKey do_Save_Clicked() {
    FormKey fk = null;
    RolesEditorForm myForm = (RolesEditorForm) form;
    RolesEditorComponent myComp = (RolesEditorComponent) component;
    try {
        // Copy the values from Form to Component
        myForm.doValidate();
        // save the file contents
        myComp.performSave(request);
        // Get the latest values
        fk = do_Refresh_Clicked();
    } 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.getRolesEditorFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 3 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class DefaultValueEditorAction method do_Save_Clicked.

/**
 * Clicked event handler for the field Save.
 * @return The FormKey.
 */
public FormKey do_Save_Clicked() {
    FormKey fk = null;
    DefaultValueEditorForm myForm = (DefaultValueEditorForm) form;
    DefaultValueEditorComponent myComp = (DefaultValueEditorComponent) myForm.getComponent();
    try {
        if (invokeDoValidateForScreen(myComp.getCurrentScreenCounter())) {
            myComp.saveDefaultValues();
        }
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    fk = myComp.determineFormKey();
    return fk;
}
Also used : FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 4 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class DefaultValueEditorAction method do_Refresh_Clicked.

/**
 * Clicked event handler for the field Refresh.
 * @return The FormKey.
 */
public FormKey do_Refresh_Clicked() {
    FormKey fk = null;
    DefaultValueEditorForm myForm = (DefaultValueEditorForm) form;
    DefaultValueEditorComponent myComp = (DefaultValueEditorComponent) myForm.getComponent();
    myComp.setDefaultValues(null);
    try {
        myComp.obtainDefaultValues();
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    fk = myComp.determineFormKey();
    return fk;
}
Also used : FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 5 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class FileExplorerAction method do_FileTree_Download_Clicked.

public FormKey do_FileTree_Download_Clicked(String rowId) {
    FileExplorerForm myForm = (FileExplorerForm) form;
    FileExplorerComponent myComp = (FileExplorerComponent) component;
    GridModel m = (GridModel) myForm.getWidgetCache().getModel("fileTree");
    GridModelRow row = m.getRowById(new Integer(rowId).intValue());
    File f = (File) row.get("file");
    if (f == null || !f.exists()) {
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "message.Jaffa.Admin.FileExplorer.fileNotFound");
        return myComp.getCurrentFormKey();
    } else {
        request.setAttribute("org.jaffa.applications.jaffa.modules.admin.components.fileexplorer", f);
        return new FormKey("jaffa_admin_fileExplorer_download", null);
    }
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) FormKey(org.jaffa.presentation.portlet.FormKey) File(java.io.File)

Aggregations

FormKey (org.jaffa.presentation.portlet.FormKey)231 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)205 FrameworkException (org.jaffa.exceptions.FrameworkException)205 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)106 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)104 ApplicationException (org.jaffa.exceptions.ApplicationException)4 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)4 File (java.io.File)3 IOException (java.io.IOException)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 Method (java.lang.reflect.Method)2 Iterator (java.util.Iterator)2 FormSelectionException (org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException)2 FormSelectionMaintenanceOutRowDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutRowDto)2 Component (org.jaffa.presentation.portlet.component.Component)2 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 AccessControlException (java.security.AccessControlException)1