use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class AttachmentMaintenanceTx method load.
// .//GEN-END:_preprocessRetrieve_2_be
// .//GEN-BEGIN:_loadRetrieve_1_be
/**
* Retrieve the domain object.
*/
private Attachment load(UOW uow, AttachmentMaintenanceRetrieveInDto input) throws FrameworkException, ApplicationExceptions {
Attachment domain = null;
Criteria criteria = new Criteria();
criteria.setTable(AttachmentMeta.getName());
// .//GEN-END:_loadRetrieve_1_be
// Add custom criteria //GEN-FIRST:_loadRetrieve_1
// .//GEN-LAST:_loadRetrieve_1
// .//GEN-BEGIN:_loadRetrieve_2_be
criteria.addCriteria(AttachmentMeta.ATTACHMENT_ID, input.getAttachmentId());
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (Attachment) itr.next();
// .//GEN-BEGIN:_loadRetrieve_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(AttachmentMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class AttachmentMaintenanceTx method load.
// .//GEN-END:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private Attachment load(UOW uow, AttachmentMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
Attachment domain = null;
Criteria criteria = new Criteria();
criteria.setTable(AttachmentMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria //GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_2_be
criteria.addCriteria(AttachmentMeta.ATTACHMENT_ID, input.getAttachmentId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (Attachment) itr.next();
// .//GEN-BEGIN:_loadDelete_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(AttachmentMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class AttachmentViewerComponent method doInquiry.
// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
AttachmentViewerInDto inputDto = new AttachmentViewerInDto();
// .//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.setAttachmentId(m_attachmentId);
inputDto.setHeaderDto(createHeaderDto());
// create the Tx
if (m_tx == null)
m_tx = (IAttachmentViewer) Factory.createObject(IAttachmentViewer.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(AttachmentMeta.getLabelToken()));
throw appExps;
}
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class RequestPasswordForm method doValidate0.
/**
* This method should be invoked to ensure a valid state of the FormBean. It will validate the data in the models and set the corresponding properties.
* Errors will be raised in the FormBean, if any validation fails.
* @param request The request stream
* @return A true indicates validations went through successfully.
*/
public boolean doValidate0(HttpServletRequest request) {
boolean valid = true;
String htmlString = null;
htmlString = getUserNameWM().getValue();
if (htmlString != null && htmlString.length() == 0)
htmlString = null;
java.lang.String userNameValue = Parser.parseString(htmlString);
setUserName(userNameValue);
htmlString = getEmailWM().getValue();
if (htmlString != null && htmlString.length() == 0)
htmlString = null;
java.lang.String emailValue = Parser.parseString(htmlString);
setEmail(emailValue);
java.lang.String securityQuestionValue = getSecurityQuestionWM().getValue();
setSecurityQuestion(securityQuestionValue);
htmlString = getSecurityAnswerWM().getValue();
if (htmlString != null && htmlString.length() == 0)
htmlString = null;
java.lang.String securityAnswerValue = Parser.parseString(htmlString);
setSecurityAnswer(securityAnswerValue);
if (this.getEmail() == null && this.getSecurityAnswer() == null && this.getSecurityQuestion().equalsIgnoreCase("none") && this.getEmail() == null) {
raiseError(request, "User", new DomainObjectNotFoundException(UserMeta.getLabelToken()));
valid = false;
}
return valid;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class UserRequestMaintenanceTx method load.
// .//GEN-END:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private UserRequest load(UOW uow, UserRequestMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
UserRequest domain = null;
Criteria criteria = new Criteria();
criteria.setTable(UserRequestMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria //GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_2_be
criteria.addCriteria(UserRequestMeta.REQUEST_ID, input.getRequestId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (UserRequest) itr.next();
// .//GEN-BEGIN:_loadDelete_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(UserRequestMeta.getLabelToken()));
throw appExps;
}
return domain;
}
Aggregations