Search in sources :

Example 1 with PrinterDefinitionViewerOutDto

use of org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterDefinitionViewerTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private PrinterDefinitionViewerOutDto buildDto(UOW uow, Collection results) throws UOWException {
    PrinterDefinitionViewerOutDto output = null;
    Iterator itr = results.iterator();
    if (itr.hasNext()) {
        // just return the details for the 1st record retrieved.
        PrinterDefinition printerDefinition = (PrinterDefinition) itr.next();
        output = new PrinterDefinitionViewerOutDto();
        // .//GEN-END:_buildDto_1_be
        // Add custom code before all the setters //GEN-FIRST:_buildDto_1
        // .//GEN-LAST:_buildDto_1
        // .//GEN-BEGIN:_buildDto_PrinterId_1_be
        output.setPrinterId(printerDefinition.getPrinterId());
        // .//GEN-END:_buildDto_PrinterId_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        output.setDescription(printerDefinition.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_SiteCode_1_be
        output.setSiteCode(printerDefinition.getSiteCode());
        // .//GEN-END:_buildDto_SiteCode_1_be
        // .//GEN-BEGIN:_buildDto_LocationCode_1_be
        output.setLocationCode(printerDefinition.getLocationCode());
        // .//GEN-END:_buildDto_LocationCode_1_be
        // .//GEN-BEGIN:_buildDto_Remote_1_be
        output.setRemote(printerDefinition.getRemote());
        // .//GEN-END:_buildDto_Remote_1_be
        // .//GEN-BEGIN:_buildDto_RealPrinterName_1_be
        output.setRealPrinterName(printerDefinition.getRealPrinterName());
        // .//GEN-END:_buildDto_RealPrinterName_1_be
        // .//GEN-BEGIN:_buildDto_PrinterOption1_1_be
        output.setPrinterOption1(printerDefinition.getPrinterOption1());
        // .//GEN-END:_buildDto_PrinterOption1_1_be
        // .//GEN-BEGIN:_buildDto_PrinterOption2_1_be
        output.setPrinterOption2(printerDefinition.getPrinterOption2());
        // .//GEN-END:_buildDto_PrinterOption2_1_be
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        output.setOutputType(printerDefinition.getOutputType());
        // .//GEN-END:_buildDto_OutputType_1_be
        // .//GEN-BEGIN:_buildDto_ScaleToPageSize_1_be
        output.setScaleToPageSize(printerDefinition.getScaleToPageSize());
        // .//GEN-END:_buildDto_ScaleToPageSize_1_be
        // .//GEN-BEGIN:_buildDto_2_be
        // Add related objects, if required
        addRelatedDtos(uow, output, printerDefinition);
    // .//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 : PrinterDefinitionViewerOutDto(org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto) PrinterDefinition(org.jaffa.modules.printing.domain.PrinterDefinition)

Example 2 with PrinterDefinitionViewerOutDto

use of org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterDefinitionViewerTx method read.

// .//GEN-END:_destroy_2_be
// .//GEN-BEGIN:_read_1_be
/**
 * Returns the details for PrinterDefinition.
 * @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 PrinterDefinitionViewerOutDto read(PrinterDefinitionViewerInDto 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
        PrinterDefinitionViewerOutDto 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 : PrinterDefinitionViewerOutDto(org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto) Criteria(org.jaffa.persistence.Criteria) UOW(org.jaffa.persistence.UOW)

Example 3 with PrinterDefinitionViewerOutDto

use of org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto in project jaffa-framework by jaffa-projects.

the class PrinterDefinitionViewerForm method getRemoteWM.

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

Aggregations

PrinterDefinitionViewerOutDto (org.jaffa.modules.printing.components.printerdefinitionviewer.dto.PrinterDefinitionViewerOutDto)3 PrinterDefinition (org.jaffa.modules.printing.domain.PrinterDefinition)1 Criteria (org.jaffa.persistence.Criteria)1 UOW (org.jaffa.persistence.UOW)1 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)1