Search in sources :

Example 91 with FrameworkException

use of org.jaffa.exceptions.FrameworkException in project jaffa-framework by jaffa-projects.

the class AttachmentViewerAction method do_Update_Clicked.

// .//GEN-END:_do_Close_Clicked_2_be
// .//GEN-BEGIN:_do_Update_Clicked_1_be
/**
 * Invokes the updateObject() method on the component.
 * @return The FormKey for the Update screen.
 */
public FormKey do_Update_Clicked() {
    FormKey fk = null;
    // .//GEN-END:_do_Update_Clicked_1_be
    // Add custom code before processing the action//GEN-FIRST:_do_Update_Clicked_1
    // .//GEN-LAST:_do_Update_Clicked_1
    // .//GEN-BEGIN:_do_Update_Clicked_2_be
    AttachmentViewerForm myForm = (AttachmentViewerForm) form;
    AttachmentViewerComponent myComp = (AttachmentViewerComponent) myForm.getComponent();
    try {
        // .//GEN-END:_do_Update_Clicked_2_be
        // Add custom code before invoking the component//GEN-FIRST:_do_Update_Clicked_2
        // .//GEN-LAST:_do_Update_Clicked_2
        // .//GEN-BEGIN:_do_Update_Clicked_3_be
        fk = myComp.updateObject();
    } 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.getViewerFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 92 with FrameworkException

use of org.jaffa.exceptions.FrameworkException in project jaffa-framework by jaffa-projects.

the class AuditTransactionViewService method query.

/**
 * Query domain objects, returning an array of Graphs in the response.
 * By default no related objects are returned, and any foreign objects will only
 * contain key information. Use the <code>setResultGraphRules()</code> method on
 * the criteria to change this.
 * When an error occurs, one or more instances of ServiceError, indicating
 * some kind of internal system error (like a problem accessing the database),
 * or listing the business logic errors will be returned in the response.
 * @param criteria This specified the criteria for the records to be retrieved.
 * @return An array of Graphs, the content of this graph is based on the result filter 'rules', as provided in the criteria object.
 * while processing. When an error occurs, an array of ServiceError instances will be returned
 * with details about the root cause of the problem.
 */
public AuditTransactionViewQueryResponse query(AuditTransactionCriteria criteria) {
    criteria.queryView(true);
    AuditTransactionViewQueryResponse response = super._query(criteria);
    try {
        super.handler.removeHiddenFields(response);
    } catch (FrameworkException e) {
        log.error("Exception thrown while removing hidden fields from the response", e);
        response = super.createGraphQueryResponse(null, e);
    }
    return response;
}
Also used : AuditTransactionViewQueryResponse(org.jaffa.components.audit.apis.data.AuditTransactionViewQueryResponse) FrameworkException(org.jaffa.exceptions.FrameworkException)

Example 93 with FrameworkException

use of org.jaffa.exceptions.FrameworkException in project jaffa-framework by jaffa-projects.

the class TaskMaintenanceAction method do_RelatedBusinessEventLog_View_Clicked.

/**
 * 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_RelatedBusinessEventLog_View_Clicked(String rowNum) {
    FormKey fk = null;
    TaskMaintenanceForm myForm = (TaskMaintenanceForm) form;
    TaskMaintenanceComponent myComp = (TaskMaintenanceComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRelatedBusinessEventLogWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            fk = myComp.displayBusinessEventLogViewer((String) selectedRow.get("logId"));
        } 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");
        }
    }
    // 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.determineFormKey();
    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 94 with FrameworkException

use of org.jaffa.exceptions.FrameworkException in project jaffa-framework by jaffa-projects.

the class UserFinderAction 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
    UserFinderForm myForm = (UserFinderForm) form;
    UserFinderComponent myComp = (UserFinderComponent) 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 95 with FrameworkException

use of org.jaffa.exceptions.FrameworkException in project jaffa-framework by jaffa-projects.

the class UserFinderAction 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
    UserFinderForm myForm = (UserFinderForm) form;
    UserFinderComponent myComp = (UserFinderComponent) 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.String) selectedRow.get("userName"));
        } 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)

Aggregations

FrameworkException (org.jaffa.exceptions.FrameworkException)348 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)293 FormKey (org.jaffa.presentation.portlet.FormKey)204 ApplicationException (org.jaffa.exceptions.ApplicationException)101 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)100 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)99 UOW (org.jaffa.persistence.UOW)87 InvocationTargetException (java.lang.reflect.InvocationTargetException)16 Method (java.lang.reflect.Method)14 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)12 Iterator (java.util.Iterator)11 IPersistent (org.jaffa.persistence.IPersistent)10 Map (java.util.Map)9 FormTemplate (org.jaffa.modules.printing.domain.FormTemplate)9 Criteria (org.jaffa.persistence.Criteria)9 LinkedHashMap (java.util.LinkedHashMap)7 Attachment (org.jaffa.components.attachment.domain.Attachment)6 InvalidForeignKeyException (org.jaffa.datatypes.exceptions.InvalidForeignKeyException)6 MultipleDomainObjectsFoundException (org.jaffa.exceptions.MultipleDomainObjectsFoundException)6 FormDefinition (org.jaffa.modules.printing.domain.FormDefinition)6