use of org.jaffa.modules.printing.domain.OutputCommand in project jaffa-framework by jaffa-projects.
the class OutputCommandViewerTx method buildDto.
// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private OutputCommandViewerOutDto buildDto(UOW uow, Collection results) throws UOWException {
OutputCommandViewerOutDto output = null;
Iterator itr = results.iterator();
if (itr.hasNext()) {
// just return the details for the 1st record retrieved.
OutputCommand outputCommand = (OutputCommand) itr.next();
output = new OutputCommandViewerOutDto();
// .//GEN-END:_buildDto_1_be
// Add custom code before all the setters //GEN-FIRST:_buildDto_1
// .//GEN-LAST:_buildDto_1
// .//GEN-BEGIN:_buildDto_OutputCommandId_1_be
output.setOutputCommandId(outputCommand.getOutputCommandId());
// .//GEN-END:_buildDto_OutputCommandId_1_be
// .//GEN-BEGIN:_buildDto_OutputType_1_be
output.setOutputType(outputCommand.getOutputType());
// .//GEN-END:_buildDto_OutputType_1_be
// .//GEN-BEGIN:_buildDto_SequenceNo_1_be
output.setSequenceNo(outputCommand.getSequenceNo());
// .//GEN-END:_buildDto_SequenceNo_1_be
// .//GEN-BEGIN:_buildDto_OsPattern_1_be
output.setOsPattern(outputCommand.getOsPattern());
// .//GEN-END:_buildDto_OsPattern_1_be
// .//GEN-BEGIN:_buildDto_CommandLine_1_be
output.setCommandLine(outputCommand.getCommandLine());
// .//GEN-END:_buildDto_CommandLine_1_be
// .//GEN-BEGIN:_buildDto_CreatedOn_1_be
output.setCreatedOn(outputCommand.getCreatedOn());
// .//GEN-END:_buildDto_CreatedOn_1_be
// .//GEN-BEGIN:_buildDto_CreatedBy_1_be
output.setCreatedBy(outputCommand.getCreatedBy());
// .//GEN-END:_buildDto_CreatedBy_1_be
// .//GEN-BEGIN:_buildDto_LastChangedOn_1_be
output.setLastChangedOn(outputCommand.getLastChangedOn());
// .//GEN-END:_buildDto_LastChangedOn_1_be
// .//GEN-BEGIN:_buildDto_LastChangedBy_1_be
output.setLastChangedBy(outputCommand.getLastChangedBy());
// .//GEN-END:_buildDto_LastChangedBy_1_be
// .//GEN-BEGIN:_buildDto_2_be
// Add related objects, if required
addRelatedDtos(uow, output, outputCommand);
// .//GEN-END:_buildDto_2_be
// Add custom code to pass values to the dto //GEN-FIRST:_buildDto_2
// .//GEN-LAST:_buildDto_2
// .//GEN-BEGIN:_buildDto_3_be
}
return output;
}
use of org.jaffa.modules.printing.domain.OutputCommand in project jaffa-framework by jaffa-projects.
the class PrinterOutputTypeMaintenanceTx method addRelatedDtosToRetrieveOut.
// .//GEN-END:_createPrevalidateOutDto_2_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_1_be
/**
* Add related objects to PrinterOutputTypeMaintenanceRetrieveOutDto
*/
private void addRelatedDtosToRetrieveOut(UOW uow, PrinterOutputType printerOutputType, PrinterOutputTypeMaintenanceRetrieveOutDto output) throws FrameworkException, ApplicationExceptions {
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_1_be
if (printerOutputType.getOutputType() != null) {
Criteria criteria = new Criteria();
criteria.setTable(OutputCommandMeta.getName());
criteria.addCriteria(OutputCommandMeta.OUTPUT_TYPE, printerOutputType.getOutputType());
criteria.addOrderBy("SequenceNo", Criteria.ORDER_BY_ASC);
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_1_be
// Add custom code to set the criteria before the query //GEN-FIRST:_addRelatedDtosToRetrieveOut_OutputCommand_1
// .//GEN-LAST:_addRelatedDtosToRetrieveOut_OutputCommand_1
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_2_be
Iterator itrMany = uow.query(criteria).iterator();
while (itrMany.hasNext()) {
OutputCommand outputCommand = (OutputCommand) itrMany.next();
OutputCommandDto dto = new OutputCommandDto();
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_2_be
// Add custom code before all the setters //GEN-FIRST:_addRelatedDtosToRetrieveOut_OutputCommand_2
// .//GEN-LAST:_addRelatedDtosToRetrieveOut_OutputCommand_2
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_OutputCommandId_1_be
dto.setOutputCommandId(outputCommand.getOutputCommandId());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_OutputCommandId_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_OutputType_1_be
dto.setOutputType(outputCommand.getOutputType());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_OutputType_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_SequenceNo_1_be
dto.setSequenceNo(outputCommand.getSequenceNo());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_SequenceNo_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_OsPattern_1_be
dto.setOsPattern(outputCommand.getOsPattern());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_OsPattern_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_CommandLine_1_be
dto.setCommandLine(outputCommand.getCommandLine());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_CommandLine_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_CreatedOn_1_be
dto.setCreatedOn(outputCommand.getCreatedOn());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_CreatedOn_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_CreatedBy_1_be
dto.setCreatedBy(outputCommand.getCreatedBy());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_CreatedBy_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_LastChangedOn_1_be
dto.setLastChangedOn(outputCommand.getLastChangedOn());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_LastChangedOn_1_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_LastChangedBy_1_be
dto.setLastChangedBy(outputCommand.getLastChangedBy());
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_LastChangedBy_1_be
// Add custom code to pass values to the dto //GEN-FIRST:_addRelatedDtosToRetrieveOut_OutputCommand_3
// .//GEN-LAST:_addRelatedDtosToRetrieveOut_OutputCommand_3
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_3_be
output.addOutputCommand(dto);
}
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_3_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_OutputCommand_6_be
}
// .//GEN-END:_addRelatedDtosToRetrieveOut_OutputCommand_6_be
// .//GEN-BEGIN:_addRelatedDtosToRetrieveOut_2_be
}
use of org.jaffa.modules.printing.domain.OutputCommand in project jaffa-framework by jaffa-projects.
the class PrinterOutputType method performPreDeleteReferentialIntegrity.
// .//GEN-END:performForeignKeyValidations_1_be
// .//GEN-BEGIN:performPreDeleteReferentialIntegrity_1_be
/**
* This method is triggered by the UOW, before adding this object to the Delete-Store.
* This will raise an exception if any associated/aggregated objects exist.
* This will cascade delete all composite objects.
* @throws PreDeleteFailedException if any error occurs during the process.
*/
public void performPreDeleteReferentialIntegrity() throws PreDeleteFailedException {
OutputCommand[] outputCommandArray = null;
try {
outputCommandArray = getOutputCommandArray();
} catch (FrameworkException e) {
throw new PreDeleteFailedException(null, e);
}
if (outputCommandArray != null && outputCommandArray.length > 0) {
try {
// Perform cascade deletes
for (int i = 0; i < outputCommandArray.length; i++) getUOW().delete(outputCommandArray[i]);
} catch (Exception e) {
throw new PreDeleteFailedException(null, e);
}
}
PrinterDefinition[] printerDefinitionArray = null;
try {
printerDefinitionArray = getPrinterDefinitionArray();
} catch (FrameworkException e) {
throw new PreDeleteFailedException(null, e);
}
if (printerDefinitionArray != null && printerDefinitionArray.length > 0) {
// Stop the deletion !!
throw new PreDeleteFailedException(null, new RelatedDomainObjectFoundException(PrinterDefinitionMeta.getLabelToken()));
}
}
use of org.jaffa.modules.printing.domain.OutputCommand in project jaffa-framework by jaffa-projects.
the class PrinterOutputType method newOutputCommandObject.
/**
* Creates a new OutputCommand object and initializes the related fields.
* This will uncache the related OutputCommand objects.
* @throws ValidationException if an invalid value is passed.
* @throws FrameworkException Indicates some system error
* @return the related OutputCommand object with the initialized related fields.
*/
public OutputCommand newOutputCommandObject() throws ValidationException, FrameworkException {
m_outputCommandCollection = null;
OutputCommand outputCommand = new OutputCommand();
outputCommand.setOutputType(getOutputType());
// .//GEN-BEGIN:outputCommandArray_3_be
return outputCommand;
}
Aggregations