use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.
the class FormEventFinderComponent method initializeCriteriaScreen.
// .//GEN-END:_addListeners_1_be
// .//GEN-BEGIN:_initializeCriteriaScreen_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
* @throws FrameworkException Indicates some system error.
*/
protected void initializeCriteriaScreen() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
}
use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.
the class FormEventLookupAction method do_Rows_Update_Clicked.
// .//GEN-END:_do_CreateFromResults_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
FormEventLookupForm myForm = (FormEventLookupForm) form;
FormEventLookupComponent myComp = (FormEventLookupComponent) 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("eventName"));
} 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;
}
use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.
the class FormEventLookupAction method do_Rows_Delete_Clicked.
// .//GEN-END:_do_Rows_Update_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_1_be
/**
* Invokes the deleteObject() method on the component.
* @param rowNum The selected row on the Results screen.
* @return The FormKey for the Delete screen.
*/
public FormKey do_Rows_Delete_Clicked(String rowNum) {
FormKey fk = null;
// .//GEN-END:_do_Rows_Delete_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_Delete_Clicked_1
// .//GEN-LAST:_do_Rows_Delete_Clicked_1
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_2_be
FormEventLookupForm myForm = (FormEventLookupForm) form;
FormEventLookupComponent myComp = (FormEventLookupComponent) myForm.getComponent();
try {
// This will stop double submits
performTokenValidation(request);
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
// .//GEN-END:_do_Rows_Delete_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_Delete_Clicked_2
// .//GEN-LAST:_do_Rows_Delete_Clicked_2
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_3_be
fk = myComp.deleteObject((java.lang.String) selectedRow.get("eventName"));
}
} catch (ApplicationExceptions e) {
if (log.isDebugEnabled())
log.debug("Delete 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;
}
use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.
the class FormEventLookupComponent method initializeCriteriaScreen.
// .//GEN-END:_addListeners_1_be
// .//GEN-BEGIN:_initializeCriteriaScreen_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
* @throws FrameworkException Indicates some system error.
*/
protected void initializeCriteriaScreen() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
}
use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.
the class FormEventMaintenanceTx method deleteRelatedObjects.
// .//GEN-END:_addRelatedDtosToRetrieveOut_2_be
// .//GEN-BEGIN:_deleteRelatedObjects_1_be
/**
* Delete the related domain objects if the 'Cascading' constraint is specified. Throw an exception in case 'Restricted' constraint is specified.
*/
private void deleteRelatedObjects(UOW uow, FormEventMaintenanceDeleteInDto input, FormEvent formEvent) throws FrameworkException, ApplicationExceptions {
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_deleteRelatedObjects_FormUsage_1_be
if (formEvent.getEventName() != null) {
Criteria criteria = new Criteria();
criteria.setTable(FormUsageMeta.getName());
criteria.addCriteria(FormUsageMeta.EVENT_NAME, formEvent.getEventName());
// .//GEN-END:_deleteRelatedObjects_FormUsage_1_be
// Add custom code to set the criteria before the query//GEN-FIRST:_deleteRelatedObjects_FormUsage_1
// .//GEN-LAST:_deleteRelatedObjects_FormUsage_1
// .//GEN-BEGIN:_deleteRelatedObjects_FormUsage_5_be
Collection col = uow.query(criteria);
Iterator itr = col.iterator();
if (itr.hasNext()) {
col.clear();
if (log.isDebugEnabled())
log.debug("The related formUsage object having 'Restricted Delete Constraint' was found. Delete cannot be performed");
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(new RelatedDomainObjectFoundException(FormUsageMeta.getLabelToken()));
}
// .//GEN-END:_deleteRelatedObjects_FormUsage_5_be
// .//GEN-BEGIN:_deleteRelatedObjects_FormUsage_6_be
}
// .//GEN-BEGIN:_deleteRelatedObjects_2_be
if (appExps != null)
throw appExps;
}
Aggregations