use of org.jaffa.datatypes.exceptions.MandatoryFieldException in project jaffa-framework by jaffa-projects.
the class FormGroupMaintenanceComponent method doUpdate.
// .//GEN-END:_doCreate_3_be
// .//GEN-BEGIN:_doUpdate_1_be
/**
* This will invoke the update method on the transaction to update an existing domain object.
* @param performDirtyReadCheck this will determine if the Dirty Read check if to be performed prior to an update.
* @throws ApplicationExceptions Indicates some functional error.
* @throws FrameworkException Indicates some system error.
*/
protected void doUpdate(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException {
FormGroupMaintenanceUpdateInDto input = new FormGroupMaintenanceUpdateInDto();
if (getFormType() == null || getFormType().trim().equals("")) {
throw new ApplicationExceptions(new MandatoryFieldException(FormGroupMeta.META_FORM_TYPE.getLabelToken()));
}
if (m_relatedObjectFormUsageDto != null)
input.setFormUsage(m_relatedObjectFormUsageDto);
// .//GEN-LAST:_doUpdate_1
// .//GEN-BEGIN:_doUpdate_2_be
input.setHeaderDto(getHeaderDto());
input.setPerformDirtyReadCheck(new Boolean(performDirtyReadCheck));
input.setFormName(getFormName());
input.setDescription(getDescription());
input.setFormType(getFormType());
FormGroupMaintenanceRetrieveOutDto output = createTx().update(input);
loadRetrieveOutDto(output);
// .//GEN-END:_doUpdate_2_be
// Add custom code//GEN-FIRST:_doUpdate_2
// .//GEN-LAST:_doUpdate_2
// .//GEN-BEGIN:_doUpdate_3_be
}
use of org.jaffa.datatypes.exceptions.MandatoryFieldException in project jaffa-framework by jaffa-projects.
the class FormSelectionMaintenanceComponent method print.
/**
* Generates all forms and/or labels for the current Event and Keyset.
* This method should be used when a User Interface is not needed.
* Prior to calling this method, set the Event and Keyset using
* setEvent(), setKey1(), setValue1(), setKey2(), setValue2(),setKey3(), setValue3(),
* setKey4(), setValue4(), setKey5(), setValue5(), setKey6(), setValue6().
* The forms and/or labels that match the current
* Event and Keyset will be printed and/or emailed.
* @throws ApplicationExceptions - When an exception occurs for a given
* Form or Label, the exception will be caught and added to the
* ApplicationExceptions.ApplicationExceptionArray. Therefore multiple
* exceptions may be caught and finally thrown at the end of this method.
* Forms and/or Labels that do not experience an exception will be
* generated successfully.
*/
public void print() throws ApplicationExceptions, Exception {
if (log.isDebugEnabled()) {
log.debug(" Begin generating forms and labels. ");
log.debug("Event = " + getEvent() + ".");
log.debug("Key 1 " + getKey1() + " = " + getValue1() + ".");
log.debug("Key 2 " + getKey2() + " = " + getValue2() + ".");
log.debug("Key 3 " + getKey3() + " = " + getValue3() + ".");
log.debug("Key 4 " + getKey4() + " = " + getValue4() + ".");
log.debug("Key 5 " + getKey5() + " = " + getValue5() + ".");
log.debug("Key 6 " + getKey6() + " = " + getValue6() + ".");
}
ApplicationExceptions appExps = new ApplicationExceptions();
GridModel gridModelRows = new GridModel();
FormSelectionMaintenanceOutDto finderOutDto = null;
setFormUserId(SecurityManager.getPrincipal() != null ? SecurityManager.getPrincipal().getName() : null);
// Validate that Event and Key1 are populated at a minimum.
if (getEvent() == null) {
throw new ApplicationExceptions(new MandatoryFieldException("[label.Jaffa.Printing.FormSelection.Event]"));
}
if (getKey1() == null || getValue1() == null) {
throw new ApplicationExceptions(new MandatoryFieldException("[label.Jaffa.Printing.FormSelection.Key1]"));
}
try {
finderOutDto = (FormSelectionMaintenanceOutDto) doInquiry2();
} catch (Exception ex) {
throw new ApplicationExceptions(new ApplicationException(ex.getMessage()));
}
if (finderOutDto != null && finderOutDto.getRowsCount() > 0) {
EditBoxModel printerModel = null;
GridModelRow gridModelRow = null;
FormSelectionMaintenanceOutRowDto[] rows = finderOutDto.getRows();
for (FormSelectionMaintenanceOutRowDto row : rows) {
gridModelRow = gridModelRows.newRow();
gridModelRow.addElement("select", new CheckBoxModel(Boolean.TRUE));
gridModelRow.addElement("formName", row.getFormName());
gridModelRow.addElement("formAlternateName", row.getFormAlternateName());
gridModelRow.addElement("formVariation", row.getFormVariation());
gridModelRow.addElement("event", row.getEvent());
gridModelRow.addElement("key1", row.getKey1());
gridModelRow.addElement("key2", row.getKey2());
gridModelRow.addElement("key3", row.getKey3());
gridModelRow.addElement("key4", row.getKey4());
gridModelRow.addElement("key5", row.getKey5());
gridModelRow.addElement("key6", row.getKey6());
gridModelRow.addElement("value1", row.getValue1());
gridModelRow.addElement("value2", row.getValue2());
gridModelRow.addElement("value3", row.getValue3());
gridModelRow.addElement("value4", row.getValue4());
gridModelRow.addElement("value5", row.getValue5());
gridModelRow.addElement("value6", row.getValue6());
printerModel = new EditBoxModel(row.getPrinter(), PrinterDefinitionMeta.META_PRINTER_ID);
printerModel.setMandatory(false);
gridModelRow.addElement("printer", printerModel);
gridModelRow.addElement("email", new EditBoxModel(getEmailAddress()));
gridModelRow.addElement("publish", new CheckBoxModel(Boolean.FALSE));
gridModelRow.addElement("copies", new EditBoxModel(row.getCopies()));
gridModelRow.addElement("object", row);
try {
ApplicationExceptions aes = new ApplicationExceptions();
validateFields(gridModelRow, aes, false);
if (aes != null && aes.size() > 0) {
for (Iterator i = aes.iterator(); i.hasNext(); ) {
ApplicationException appEx = (ApplicationException) i.next();
appExps.add(appEx);
}
} else {
m_tx.dispatchPrintRequest(createPrintRequestObject(gridModelRow, false));
}
} catch (Exception ex) {
appExps.add(new ApplicationException(ex.getMessage()));
}
}
} else {
if (appExps.size() == 0) {
appExps.add(new FormSelectionException(FormSelectionException.NO_FORM_DEFINED_FOR_EVENT, getEvent()));
}
}
if (appExps != null && appExps.size() > 0) {
throw appExps;
}
if (log.isDebugEnabled()) {
log.debug(" Finished generating forms and labels. ");
}
}
use of org.jaffa.datatypes.exceptions.MandatoryFieldException in project jaffa-framework by jaffa-projects.
the class FormEventViewerComponent method display.
// .//GEN-END:_FormEventViewerOutDto_1_be
// .//GEN-BEGIN:_display_1_be
/**
* This retrieves the details for the FormEvent.
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set, or if no data has been set.
* @throws FrameworkException Indicates some system error.
* @return The FormKey for the View screen.
*/
public FormKey display() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_display_2_be
if (getEventName() == null) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(new MandatoryFieldException(FormEventMeta.META_EVENT_NAME.getLabelToken()));
}
if (appExps != null && appExps.size() > 0)
throw appExps;
doInquiry();
return getViewerFormKey();
}
use of org.jaffa.datatypes.exceptions.MandatoryFieldException in project jaffa-framework by jaffa-projects.
the class FormDefinitionViewerComponent method display.
// .//GEN-END:_FormDefinitionViewerOutDto_1_be
// .//GEN-BEGIN:_display_1_be
/**
* This retrieves the details for the FormDefinition.
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set, or if no data has been set.
* @throws FrameworkException Indicates some system error.
* @return The FormKey for the View screen.
*/
public FormKey display() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_display_2_be
if (getFormId() == null) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(new MandatoryFieldException(FormDefinitionMeta.META_FORM_ID.getLabelToken()));
}
if (appExps != null && appExps.size() > 0)
throw appExps;
doInquiry();
return getViewerFormKey();
}
use of org.jaffa.datatypes.exceptions.MandatoryFieldException in project jaffa-framework by jaffa-projects.
the class BusinessEventLogViewerComponent method display.
// .//GEN-END:_BusinessEventLogViewerOutDto_1_be
// .//GEN-BEGIN:_display_1_be
/**
* This retrieves the details for the BusinessEventLog.
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set, or if no data has been set.
* @throws FrameworkException Indicates some system error.
* @return The FormKey for the View screen.
*/
public FormKey display() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
// .//GEN-BEGIN:_display_2_be
if (getLogId() == null) {
if (appExps == null)
appExps = new ApplicationExceptions();
appExps.add(new MandatoryFieldException(BusinessEventLogMeta.META_LOG_ID.getLabelToken()));
}
if (appExps != null && appExps.size() > 0)
throw appExps;
doInquiry();
return getViewerFormKey();
}
Aggregations