Search in sources :

Example 1 with PrinterOutputTypeViewerOutDto

use of org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeViewerTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private PrinterOutputTypeViewerOutDto buildDto(UOW uow, Collection results) throws UOWException {
    PrinterOutputTypeViewerOutDto output = null;
    Iterator itr = results.iterator();
    if (itr.hasNext()) {
        // just return the details for the 1st record retrieved.
        PrinterOutputType printerOutputType = (PrinterOutputType) itr.next();
        output = new PrinterOutputTypeViewerOutDto();
        // .//GEN-END:_buildDto_1_be
        // Add custom code before all the setters //GEN-FIRST:_buildDto_1
        // .//GEN-LAST:_buildDto_1
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        output.setOutputType(printerOutputType.getOutputType());
        // .//GEN-END:_buildDto_OutputType_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        output.setDescription(printerOutputType.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_DirectPrinting_1_be
        output.setDirectPrinting(printerOutputType.getDirectPrinting());
        // .//GEN-END:_buildDto_DirectPrinting_1_be
        // .//GEN-BEGIN:_buildDto_CreatedOn_1_be
        output.setCreatedOn(printerOutputType.getCreatedOn());
        // .//GEN-END:_buildDto_CreatedOn_1_be
        // .//GEN-BEGIN:_buildDto_CreatedBy_1_be
        output.setCreatedBy(printerOutputType.getCreatedBy());
        // .//GEN-END:_buildDto_CreatedBy_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedOn_1_be
        output.setLastChangedOn(printerOutputType.getLastChangedOn());
        // .//GEN-END:_buildDto_LastChangedOn_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedBy_1_be
        output.setLastChangedBy(printerOutputType.getLastChangedBy());
        // .//GEN-END:_buildDto_LastChangedBy_1_be
        // .//GEN-BEGIN:_buildDto_2_be
        // Add related objects, if required
        addRelatedDtos(uow, output, printerOutputType);
    // .//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;
}
Also used : PrinterOutputTypeViewerOutDto(org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto) PrinterOutputType(org.jaffa.modules.printing.domain.PrinterOutputType)

Example 2 with PrinterOutputTypeViewerOutDto

use of org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeViewerForm method populateRelatedOutputCommand.

private void populateRelatedOutputCommand(GridModel rows) {
    rows.clearRows();
    PrinterOutputTypeViewerOutDto outputDto = ((PrinterOutputTypeViewerComponent) getComponent()).getPrinterOutputTypeViewerOutDto();
    if (outputDto != null) {
        GridModelRow row = null;
        OutputCommandDto[] outputCommand = outputDto.getOutputCommand();
        for (int i = 0; i < outputCommand.length; i++) {
            OutputCommandDto rowDto = outputCommand[i];
            row = rows.newRow();
            row.addElement("outputCommandId", rowDto.getOutputCommandId());
            row.addElement("outputType", rowDto.getOutputType());
            row.addElement("sequenceNo", rowDto.getSequenceNo());
            row.addElement("osPattern", rowDto.getOsPattern());
            row.addElement("commandLine", rowDto.getCommandLine());
            row.addElement("createdOn", rowDto.getCreatedOn());
            row.addElement("createdBy", rowDto.getCreatedBy());
            row.addElement("lastChangedOn", rowDto.getLastChangedOn());
            row.addElement("lastChangedBy", rowDto.getLastChangedBy());
        // .//GEN-END:RelatedOutputCommand_1_be
        // Add custom code for the row //GEN-FIRST:RelatedOutputCommand_1
        // .//GEN-LAST:RelatedOutputCommand_1
        // .//GEN-BEGIN:RelatedOutputCommand_2_be
        }
    }
}
Also used : PrinterOutputTypeViewerOutDto(org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto) OutputCommandDto(org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.OutputCommandDto) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 3 with PrinterOutputTypeViewerOutDto

use of org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeViewerTx method read.

// .//GEN-END:_destroy_2_be
// .//GEN-BEGIN:_read_1_be
/**
 * Returns the details for PrinterOutputType.
 * @param input The criteria based on which an object will be retrieved.
 * @throws ApplicationExceptions This will be thrown if the criteria contains invalid data.
 * @throws FrameworkException Indicates some system error.
 * @return The object details. A null indicates, the object was not found.
 */
public PrinterOutputTypeViewerOutDto read(PrinterOutputTypeViewerInDto input) throws FrameworkException, ApplicationExceptions {
    UOW uow = null;
    try {
        // Print Debug Information for the input
        if (log.isDebugEnabled()) {
            log.debug("Input: " + (input != null ? input.toString() : null));
        }
        // create the UOW
        uow = new UOW();
        // Build the Criteria Object
        Criteria criteria = buildCriteria(input, uow);
        // .//GEN-END:_read_1_be
        // Add custom code before the query //GEN-FIRST:_read_1
        // .//GEN-LAST:_read_1
        // .//GEN-BEGIN:_read_2_be
        // Execute The Query
        Collection results = uow.query(criteria);
        // .//GEN-END:_read_2_be
        // Add custom code after the query //GEN-FIRST:_read_2
        // .//GEN-LAST:_read_2
        // .//GEN-BEGIN:_read_3_be
        // Convert the domain objects into the outbound dto
        PrinterOutputTypeViewerOutDto output = buildDto(uow, results);
        // Print Debug Information for the output
        if (log.isDebugEnabled()) {
            log.debug("Output: " + (output != null ? output.toString() : null));
        }
        return output;
    } finally {
        if (uow != null)
            uow.rollback();
    }
}
Also used : PrinterOutputTypeViewerOutDto(org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto) Criteria(org.jaffa.persistence.Criteria) UOW(org.jaffa.persistence.UOW)

Example 4 with PrinterOutputTypeViewerOutDto

use of org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeViewerForm method getDirectPrintingWM.

/**
 * Getter for property directPrinting. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property directPrinting.
 */
public CheckBoxModel getDirectPrintingWM() {
    CheckBoxModel directPrinting = (CheckBoxModel) getWidgetCache().getModel("directPrinting");
    if (directPrinting == null) {
        PrinterOutputTypeViewerOutDto outputDto = ((PrinterOutputTypeViewerComponent) getComponent()).getPrinterOutputTypeViewerOutDto();
        directPrinting = new CheckBoxModel(outputDto != null && outputDto.getDirectPrinting() != null ? outputDto.getDirectPrinting() : Boolean.FALSE);
        getWidgetCache().addModel("directPrinting", directPrinting);
    }
    return directPrinting;
}
Also used : PrinterOutputTypeViewerOutDto(org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Aggregations

PrinterOutputTypeViewerOutDto (org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto)4 OutputCommandDto (org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.OutputCommandDto)1 PrinterOutputType (org.jaffa.modules.printing.domain.PrinterOutputType)1 Criteria (org.jaffa.persistence.Criteria)1 UOW (org.jaffa.persistence.UOW)1 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)1 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)1