use of org.jaffa.datatypes.ValidationException in project jaffa-framework by jaffa-projects.
the class FormUsageMaintenanceTx method createDomain.
// .//GEN-END:_duplicateCheck_4_be
// .//GEN-BEGIN:_createDomain_1_be
/**
* Create the domain object.
*/
private FormUsage createDomain(UOW uow, FormUsageMaintenanceCreateInDto input, boolean fromPrevalidate) throws FrameworkException, ApplicationExceptions {
FormUsage domain = new FormUsage();
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_createDomain_2_be
try {
domain.updateFormAlternate(input.getFormAlternate());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateCopies(input.getCopies());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
if (!fromPrevalidate)
domain.updateCreatedOn(new DateTime());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
if (!fromPrevalidate && input.getHeaderDto() != null && input.getHeaderDto().getUserId() != null)
domain.updateCreatedBy(input.getHeaderDto().getUserId());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateEventName(input.getEventName());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateFormName(input.getFormName());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
// .//GEN-BEGIN:_createDomain_3_be
if (appExps != null && appExps.size() > 0)
throw appExps;
return domain;
}
use of org.jaffa.datatypes.ValidationException in project jaffa-framework by jaffa-projects.
the class PrinterOutputTypeMaintenanceTx method createDomain.
// .//GEN-END:_duplicateCheck_4_be
// .//GEN-BEGIN:_createDomain_1_be
/**
* Create the domain object.
*/
private PrinterOutputType createDomain(UOW uow, PrinterOutputTypeMaintenanceCreateInDto input, boolean fromPrevalidate) throws FrameworkException, ApplicationExceptions {
PrinterOutputType domain = new PrinterOutputType();
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_createDomain_2_be
try {
domain.updateOutputType(input.getOutputType());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateDescription(input.getDescription());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateDirectPrinting(input.getDirectPrinting());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
if (!fromPrevalidate)
domain.updateCreatedOn(new DateTime());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
if (!fromPrevalidate && input.getHeaderDto() != null && input.getHeaderDto().getUserId() != null)
domain.updateCreatedBy(input.getHeaderDto().getUserId());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
// .//GEN-BEGIN:_createDomain_3_be
if (appExps != null && appExps.size() > 0)
throw appExps;
return domain;
}
use of org.jaffa.datatypes.ValidationException in project jaffa-framework by jaffa-projects.
the class AuditLogger method createAuditTransactionObject.
/**
* Creates an AuditTransactionObject instance, adds it to the UOW and returns it's id.
*/
private String createAuditTransactionObject(String objectName, ChangeType changeType) throws ApplicationExceptions, FrameworkException {
try {
AuditTransactionObject ato = new AuditTransactionObject();
ato.generateKey();
ato.setTransactionId(m_transactionId);
ato.setObjectName(objectName);
ato.setChangeType(changeType == ChangeType.INSERT ? "I" : (changeType == ChangeType.UPDATE ? "U" : "D"));
m_uow.addSpecial(ato);
if (log.isDebugEnabled())
log.debug("Created AuditTransactionObject: " + ato);
return ato.getObjectId();
} catch (ValidationException e) {
if (log.isDebugEnabled())
log.debug("Exception thrown during creation of AuditTransactionObject", e);
throw new ApplicationExceptions(e);
}
}
use of org.jaffa.datatypes.ValidationException in project jaffa-framework by jaffa-projects.
the class AuditLogger method createAuditTransaction.
/**
* Creates an AuditTransaction instance, if not already created, and adds it to the UOW.
*/
private void createAuditTransaction() throws ApplicationExceptions, FrameworkException {
if (m_transactionId == null) {
try {
AuditTransaction at = new AuditTransaction();
at.generateKey();
at.setProcessName((String) MDC.get(AuditTransactionMeta.PROCESS_NAME));
at.setSubProcessName((String) MDC.get(AuditTransactionMeta.SUB_PROCESS_NAME));
at.setReason((String) MDC.get(AuditTransactionMeta.REASON));
if (SecurityManager.getPrincipal() != null && SecurityManager.getPrincipal().getName() != null)
at.setCreatedBy(SecurityManager.getPrincipal().getName());
at.setCreatedOn(new DateTime());
m_uow.addSpecial(at);
m_transactionId = at.getTransactionId();
if (log.isDebugEnabled())
log.debug("Created AuditTransaction: " + at);
} catch (ValidationException e) {
if (log.isDebugEnabled())
log.debug("Exception thrown during creation of AuditTransaction", e);
throw new ApplicationExceptions(e);
}
}
}
use of org.jaffa.datatypes.ValidationException in project jaffa-framework by jaffa-projects.
the class UserTimeEntryMaintenanceTx method createDomain.
// .//GEN-END:_duplicateCheck_4_be
// .//GEN-BEGIN:_createDomain_1_be
/**
* Create the domain object.
*/
private UserTimeEntry createDomain(UOW uow, UserTimeEntryMaintenanceCreateInDto input, boolean fromPrevalidate) throws FrameworkException, ApplicationExceptions {
UserTimeEntry domain = new UserTimeEntry();
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_createDomain_2_be
try {
domain.updateUserName(input.getUserName());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateProjectCode(input.getProjectCode());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateActivity(input.getActivity());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updateTask(input.getTask());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updatePeriodStart(input.getPeriodStart());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
try {
domain.updatePeriodEnd(input.getPeriodEnd());
} catch (ValidationException e) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(e);
}
// .//GEN-BEGIN:_createDomain_3_be
if (appExps != null && appExps.size() > 0)
throw appExps;
return domain;
}
Aggregations