use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormTemplateViewerComponent method doInquiry.
// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
FormTemplateViewerInDto inputDto = new FormTemplateViewerInDto();
// .//GEN-END:_inquiry_1_be
// Add custom code before building the input dto //GEN-FIRST:_inquiry_1
// .//GEN-LAST:_inquiry_1
// .//GEN-BEGIN:_inquiry_2_be
inputDto.setFormId(m_formId);
inputDto.setHeaderDto(createHeaderDto());
// create the Tx
if (m_tx == null)
m_tx = (IFormTemplateViewer) Factory.createObject(IFormTemplateViewer.class);
// .//GEN-END:_inquiry_2_be
// Add custom code before invoking the Tx //GEN-FIRST:_inquiry_2
// .//GEN-LAST:_inquiry_2
// .//GEN-BEGIN:_inquiry_3_be
// now get the details
m_outputDto = m_tx.read(inputDto);
// uncache the widgets
getUserSession().getWidgetCache(getComponentId()).clear();
// throw an exception if the output is null
if (m_outputDto == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormTemplateMeta.getLabelToken()));
throw appExps;
}
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormUsageMaintenanceTx method load.
// .//GEN-END:_preprocessRetrieve_2_be
// .//GEN-BEGIN:_loadRetrieve_1_be
/**
* Retrieve the domain object.
*/
private FormUsage load(UOW uow, FormUsageMaintenanceRetrieveInDto input) throws FrameworkException, ApplicationExceptions {
FormUsage domain = null;
Criteria criteria = new Criteria();
criteria.setTable(FormUsageMeta.getName());
// .//GEN-END:_loadRetrieve_1_be
// Add custom criteria //GEN-FIRST:_loadRetrieve_1
// .//GEN-LAST:_loadRetrieve_1
// .//GEN-BEGIN:_loadRetrieve_2_be
criteria.addCriteria(FormUsageMeta.FORM_NAME, input.getFormName());
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (FormUsage) itr.next();
// .//GEN-BEGIN:_loadRetrieve_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormUsageMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormUsageViewerComponent method doInquiry.
// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
FormUsageViewerInDto inputDto = new FormUsageViewerInDto();
// .//GEN-END:_inquiry_1_be
// Add custom code before building the input dto //GEN-FIRST:_inquiry_1
// .//GEN-LAST:_inquiry_1
// .//GEN-BEGIN:_inquiry_2_be
inputDto.setFormName(m_formName);
inputDto.setHeaderDto(createHeaderDto());
// create the Tx
if (m_tx == null)
m_tx = (IFormUsageViewer) Factory.createObject(IFormUsageViewer.class);
// .//GEN-END:_inquiry_2_be
// Add custom code before invoking the Tx //GEN-FIRST:_inquiry_2
// .//GEN-LAST:_inquiry_2
// .//GEN-BEGIN:_inquiry_3_be
// now get the details
m_outputDto = m_tx.read(inputDto);
// uncache the widgets
getUserSession().getWidgetCache(getComponentId()).clear();
// throw an exception if the output is null
if (m_outputDto == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormUsageMeta.getLabelToken()));
throw appExps;
}
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class OutputCommandMaintenanceTx method load.
// .//GEN-END:_preprocessRetrieve_2_be
// .//GEN-BEGIN:_loadRetrieve_1_be
/**
* Retrieve the domain object.
*/
private OutputCommand load(UOW uow, OutputCommandMaintenanceRetrieveInDto input) throws FrameworkException, ApplicationExceptions {
OutputCommand domain = null;
Criteria criteria = new Criteria();
criteria.setTable(OutputCommandMeta.getName());
// .//GEN-END:_loadRetrieve_1_be
// Add custom criteria//GEN-FIRST:_loadRetrieve_1
// .//GEN-LAST:_loadRetrieve_1
// .//GEN-BEGIN:_loadRetrieve_2_be
criteria.addCriteria(OutputCommandMeta.OUTPUT_COMMAND_ID, input.getOutputCommandId());
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (OutputCommand) itr.next();
// .//GEN-BEGIN:_loadRetrieve_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(OutputCommandMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionMaintenanceTx method load.
// .//GEN-END:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private PrinterDefinition load(UOW uow, PrinterDefinitionMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
PrinterDefinition domain = null;
Criteria criteria = new Criteria();
criteria.setTable(PrinterDefinitionMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria//GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_2_be
criteria.addCriteria(PrinterDefinitionMeta.PRINTER_ID, input.getPrinterId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (PrinterDefinition) itr.next();
// .//GEN-BEGIN:_loadDelete_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(PrinterDefinitionMeta.getLabelToken()));
throw appExps;
}
return domain;
}
Aggregations