Search in sources :

Example 21 with FormKey

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

the class FormDefinitionFinderAction method do_Rows_View_Clicked.

// .//GEN-END:_do_CreateFromResults_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_View_Clicked_1_be
/**
 * Invokes the viewObject() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the View screen.
 */
public FormKey do_Rows_View_Clicked(String rowNum) {
    FormKey fk = null;
    // .//GEN-END:_do_Rows_View_Clicked_1_be
    // Add custom code before processing the action //GEN-FIRST:_do_Rows_View_Clicked_1
    // .//GEN-LAST:_do_Rows_View_Clicked_1
    // .//GEN-BEGIN:_do_Rows_View_Clicked_2_be
    FormDefinitionFinderForm myForm = (FormDefinitionFinderForm) form;
    FormDefinitionFinderComponent myComp = (FormDefinitionFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            // .//GEN-END:_do_Rows_View_Clicked_2_be
            // Add custom code before invoking the component //GEN-FIRST:_do_Rows_View_Clicked_2
            // .//GEN-LAST:_do_Rows_View_Clicked_2
            // .//GEN-BEGIN:_do_Rows_View_Clicked_3_be
            fk = myComp.viewObject((java.lang.Long) selectedRow.get("formId"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Viewer Failed");
            myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
        } catch (FrameworkException e) {
            log.error(null, e);
            myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
        }
    }
    // .//GEN-END:_do_Rows_View_Clicked_3_be
    // Add custom code after returning from the component //GEN-FIRST:_do_Rows_View_Clicked_3
    // .//GEN-LAST:_do_Rows_View_Clicked_3
    // .//GEN-BEGIN:_do_Rows_View_Clicked_4_be
    // The Viewer will be rendered in a new window
    // We don't want to see the existing HistoryNav in that window
    // Hence, initialize the HistoryNav
    HistoryNav.initializeHistoryNav(request);
    // Direct User back to current form
    if (fk == null)
        fk = myComp.getResultsFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 22 with FormKey

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

the class FormDefinitionFinderAction method do_Rows_Update_Clicked.

// .//GEN-END:_do_Rows_View_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_Update_Clicked_1_be
/**
 * Invokes the updateObject() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the Update screen.
 */
public FormKey do_Rows_Update_Clicked(String rowNum) {
    FormKey fk = null;
    // .//GEN-END:_do_Rows_Update_Clicked_1_be
    // Add custom code before processing the action //GEN-FIRST:_do_Rows_Update_Clicked_1
    // .//GEN-LAST:_do_Rows_Update_Clicked_1
    // .//GEN-BEGIN:_do_Rows_Update_Clicked_2_be
    FormDefinitionFinderForm myForm = (FormDefinitionFinderForm) form;
    FormDefinitionFinderComponent myComp = (FormDefinitionFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            // .//GEN-END:_do_Rows_Update_Clicked_2_be
            // Add custom code before invoking the component //GEN-FIRST:_do_Rows_Update_Clicked_2
            // .//GEN-LAST:_do_Rows_Update_Clicked_2
            // .//GEN-BEGIN:_do_Rows_Update_Clicked_3_be
            fk = myComp.updateObject((java.lang.Long) selectedRow.get("formId"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Update Failed");
            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.getResultsFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 23 with FormKey

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

the class FormDefinitionFinderAction method do_CreateFromCriteria_Clicked.

// .//GEN-END:_2_be
// .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_1_be
/**
 * Invokes the createFromCriteria() method on the component.
 * @return The FormKey for the Create screen.
 */
public FormKey do_CreateFromCriteria_Clicked() {
    FormKey fk = null;
    // .//GEN-END:_do_CreateFromCriteria_Clicked_1_be
    // Add custom code before processing the action //GEN-FIRST:_do_CreateFromCriteria_Clicked_1
    // .//GEN-LAST:_do_CreateFromCriteria_Clicked_1
    // .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_2_be
    FormDefinitionFinderForm myForm = (FormDefinitionFinderForm) form;
    FormDefinitionFinderComponent myComp = (FormDefinitionFinderComponent) myForm.getComponent();
    if (myForm.doValidate(request)) {
        try {
            // .//GEN-END:_do_CreateFromCriteria_Clicked_2_be
            // Add custom code before invoking the component //GEN-FIRST:_do_CreateFromCriteria_Clicked_2
            // .//GEN-LAST:_do_CreateFromCriteria_Clicked_2
            // .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_3_be
            fk = myComp.createFromCriteria();
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Create Failed");
            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.getCriteriaFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 24 with FormKey

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

the class FormDefinitionFinderAction method do_CreateFromResults_Clicked.

// .//GEN-END:_do_CreateFromCriteria_Clicked_4_be
// .//GEN-BEGIN:_do_CreateFromResults_Clicked_1_be
/**
 * Invokes the createFromResults() method on the component.
 * @return The FormKey for the Create screen.
 */
public FormKey do_CreateFromResults_Clicked() {
    FormKey fk = null;
    // .//GEN-END:_do_CreateFromResults_Clicked_1_be
    // Add custom code before processing the action //GEN-FIRST:_do_CreateFromResults_Clicked_1
    // .//GEN-LAST:_do_CreateFromResults_Clicked_1
    // .//GEN-BEGIN:_do_CreateFromResults_Clicked_2_be
    FormDefinitionFinderForm myForm = (FormDefinitionFinderForm) form;
    FormDefinitionFinderComponent myComp = (FormDefinitionFinderComponent) myForm.getComponent();
    try {
        // .//GEN-END:_do_CreateFromResults_Clicked_2_be
        // Add custom code before invoking the component //GEN-FIRST:_do_CreateFromResults_Clicked_2
        // .//GEN-LAST:_do_CreateFromResults_Clicked_2
        // .//GEN-BEGIN:_do_CreateFromResults_Clicked_3_be
        fk = myComp.createFromResults();
    } catch (ApplicationExceptions e) {
        if (log.isDebugEnabled())
            log.debug("Create Failed");
        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.getResultsFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 25 with FormKey

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

the class FormDefinitionLookupAction method do_CreateFromCriteria_Clicked.

// .//GEN-END:_2_be
// .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_1_be
/**
 * Invokes the createFromCriteria() method on the component.
 * @return The FormKey for the Create screen.
 */
public FormKey do_CreateFromCriteria_Clicked() {
    FormKey fk = null;
    // .//GEN-END:_do_CreateFromCriteria_Clicked_1_be
    // Add custom code before processing the action //GEN-FIRST:_do_CreateFromCriteria_Clicked_1
    // .//GEN-LAST:_do_CreateFromCriteria_Clicked_1
    // .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_2_be
    FormDefinitionLookupForm myForm = (FormDefinitionLookupForm) form;
    FormDefinitionLookupComponent myComp = (FormDefinitionLookupComponent) myForm.getComponent();
    if (myForm.doValidate(request)) {
        try {
            // .//GEN-END:_do_CreateFromCriteria_Clicked_2_be
            // Add custom code before invoking the component //GEN-FIRST:_do_CreateFromCriteria_Clicked_2
            // .//GEN-LAST:_do_CreateFromCriteria_Clicked_2
            // .//GEN-BEGIN:_do_CreateFromCriteria_Clicked_3_be
            fk = myComp.createFromCriteria();
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Create Failed");
            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.getCriteriaFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

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