當前位置: 首頁>>代碼示例>>Java>>正文


Java ColumnBuilderException類代碼示例

本文整理匯總了Java中ar.com.fdvs.dj.domain.builders.ColumnBuilderException的典型用法代碼示例。如果您正苦於以下問題:Java ColumnBuilderException類的具體用法?Java ColumnBuilderException怎麽用?Java ColumnBuilderException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ColumnBuilderException類屬於ar.com.fdvs.dj.domain.builders包,在下文中一共展示了ColumnBuilderException類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getElementColumn

import ar.com.fdvs.dj.domain.builders.ColumnBuilderException; //導入依賴的package包/類
@Override
public AbstractColumn getElementColumn(Locale locale) {
    ColumnBuilder columnBuilder = ColumnBuilder.getNew();
    columnBuilder.setWidth(columnWidth);
    if (propertyName != null && valueClassName != null) {
        columnBuilder.setColumnProperty(propertyName, valueClassName);
    }
    if (customExpressionBuilder != null) {
        columnBuilder.setCustomExpression(customExpressionBuilder.build(locale));
    }
    if (style != null) {
        columnBuilder.setStyle(style);
    }
    if (headerStyle != null) {
        columnBuilder.setHeaderStyle(headerStyle);
    }
    if (columnTitleBundleName != null) {
        ResourceBundle bundle = ResourceBundle.getBundle(columnTitleBundleName, locale);
        if (columnTitleKey != null) {
            columnBuilder.setTitle(StringEscapeUtils.unescapeHtml4(bundle.getString(columnTitleKey)));
        }
    }
    if (conditionalStyleBuilderList != null &&
            !conditionalStyleBuilderList.isEmpty()) {
        columnBuilder.addConditionalStyles(buildConditionStyleList(locale));
    }
    AbstractColumn elementColumn = null;
    try {
        elementColumn = columnBuilder.build();
    } catch (ColumnBuilderException ex) {
        LOGGER.error(ex);
    }
    return elementColumn;
}
 
開發者ID:Tanaguru,項目名稱:Tanaguru,代碼行數:35,代碼來源:ElementColumnBuilderImpl.java

示例2: prepareSuccessfullAuditDataToExport

import ar.com.fdvs.dj.domain.builders.ColumnBuilderException; //導入依賴的package包/類
/**
 * 
 * @param page
 * @param model
 * @param locale
 * @param exportFormat
 * @param request
 * @param response
 * @return
 * @throws IOException
 */
private void prepareSuccessfullAuditDataToExport(
        WebResource webResource,
        Model model,
        Locale locale,
        String exportFormat,
        HttpServletRequest request,
        HttpServletResponse response) throws NotSupportedExportFormatException {

    model.addAttribute(TgolKeyStore.LOCALE_KEY,locale);
    Scope scope = getSiteScope();
    if (webResource instanceof Page) {
        scope = getPageScope();
    }
    List<TestResult> testResultList = TestResultFactory.getInstance().getTestResultList(
                webResource,
                scope,
                getLocaleResolver().resolveLocale(request));
    
    AuditStatistics auditStatistics = getAuditStatistics(
                webResource, 
                model, 
                TgolKeyStore.TEST_DISPLAY_SCOPE_VALUE, false);//TODO a revoir dans le cas manuel 
    model.addAttribute(TgolKeyStore.STATISTICS_KEY, auditStatistics);

    try {
        exportService.export(
                response,
                webResource.getId(),
                auditStatistics,
                testResultList,
                locale,
                exportFormat);
    } catch (ColumnBuilderException | ClassNotFoundException | JRException ex) {
        LOGGER.error(ex);
    }
}
 
開發者ID:Tanaguru,項目名稱:Tanaguru,代碼行數:48,代碼來源:AuditExportResultController.java

示例3: buildColumns

import ar.com.fdvs.dj.domain.builders.ColumnBuilderException; //導入依賴的package包/類
public void buildColumns(DynamicReportBuilder reportBuilder) {
	try {
		String[] title = getColumnTitles();
		String[] property = getColumnProperties();
		Class<?>[] clazz = getColumnClasses();
		Integer[] width = getColumnWidths();
		
		for(int i = 0; i < property.length; i++) {
			
			if(columnsCheckBoxes[i].booleanValue()) {
				ColumnBuilder columnBuilder = ColumnBuilder.getNew();
				columnBuilder.setColumnProperty(property[i], clazz[i]);
				columnBuilder.setTitle(title[i]);
				
				if(width != null && width[i] != null) {
					columnBuilder.setWidth(width[i]);
				}
				
				String columnPattern = getColumnPattern(property[i]);
				if(columnPattern != null) {
					columnBuilder.setPattern(columnPattern);
				}
				
				Style columnStyle = null;
				
				if(groupingCheckBoxes[i].booleanValue()) {
					columnStyle = new StyleBuilder(true).setHorizontalAlign(HorizontalAlign.LEFT).setFont(Font.ARIAL_MEDIUM_BOLD).setPaddingBottom(mmToPoints(5)).setPaddingTop(mmToPoints(10)).build();
				} else {
					columnStyle = getColumnStyle(property[i]);
				}
				
				if(columnStyle == null) {
					columnStyle = new StyleBuilder(true).setStretchWithOverflow(stretchWithOverflowCheckBox.booleanValue()).build();
					columnBuilder.setTruncateSuffix("...");
				}
				
				columnBuilder.setStyle(columnStyle);
				
				List<ConditionalStyle> conditionalStyle = getColumnConditionalStyle(property[i]);
				if(conditionalStyle != null) {
					columnBuilder.addConditionalStyles(conditionalStyle);
				}
				
				configureColumnBuilder(property[i], columnBuilder, reportBuilder);
				
				AbstractColumn column = columnBuilder.build();
				reportBuilder.addColumn(column);
				
				configureColumn(property[i], column, reportBuilder);
				
				if(groupingCheckBoxes[i].booleanValue()) {
					GroupBuilder groupBuilder = new GroupBuilder();
					groupBuilder.setCriteriaColumn((PropertyColumn) column);
					groupBuilder.setGroupLayout(GroupLayout.VALUE_IN_HEADER);
					reportBuilder.addGroup(groupBuilder.build());
				}
			}
			
		}
		
	} catch (ColumnBuilderException e) {
		throw new RuntimeException(e);
	}
}
 
開發者ID:alejandro-du,項目名稱:enterprise-app,代碼行數:65,代碼來源:AbstractReport.java

示例4: export

import ar.com.fdvs.dj.domain.builders.ColumnBuilderException; //導入依賴的package包/類
/**
 * Processes the download for Excel format
 *
 * @param response
 * @param resourceId
 * @param auditStatistics
 * @param dataSource
 * @param locale
 * @param format
 * @throws ColumnBuilderException
 * @throws ClassNotFoundException
 * @throws JRException
 * @throws NotSupportedExportFormatException
 */
@SuppressWarnings("unchecked")
public void export(
        HttpServletResponse response,
        long resourceId,
        AuditStatistics auditStatistics,
        Collection<?> dataSource,
        Locale locale,
        String format)
        throws ColumnBuilderException, ClassNotFoundException, JRException, NotSupportedExportFormatException {

    if (!exportFormatMap.containsKey(format)) {
        throw new NotSupportedExportFormatException(format);
    }
    ExportFormat exportFormat = exportFormatMap.get(format);

    DynamicReport dr = LayoutFactory.getInstance().buildReportLayout(locale, auditStatistics, format);
    // Retrieve our data source
    JRDataSource ds = new JRBeanCollectionDataSource(dataSource);

    // params is used for passing extra parameters
    JasperPrint jp
            = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    // Create our output byte stream
    // This is the stream where the data will be written
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    JRExporter exporter = null;
    try {
        exporter = (JRExporter) Class.forName(exportFormat.getExporterClassName()).newInstance();
        exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
        if (exportFormat.getFileType().equals("text/csv")) {
            exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, GENERAL_SEPARATOR_KEY);
        }
        exporter.exportReport();
        response.setHeader(CONTENT_DISPOSITION, INLINE_FILENAME
                + getFileName(resourceId, exportFormat.getFileExtension()));
        // Make sure to set the correct content type
        // Each format has its own content type
        response.setContentType(exportFormat.getFileType());
        response.setContentLength(baos.size());
        // Write to reponse stream
        writeReportToResponseStream(response, baos);
    } catch (InstantiationException | IllegalAccessException ex) {
        LOGGER.warn(ex);
    }

}
 
開發者ID:Tanaguru,項目名稱:Tanaguru,代碼行數:64,代碼來源:ExportService.java

示例5: buildReportLayout

import ar.com.fdvs.dj.domain.builders.ColumnBuilderException; //導入依賴的package包/類
/**
 * 
 * @param locale
 * @param auditStatistics
 * @param format
 * @return
 * @throws ColumnBuilderException
 * @throws ClassNotFoundException
 */
public DynamicReport buildReportLayout(Locale locale, AuditStatistics auditStatistics, String format)
        throws ColumnBuilderException, ClassNotFoundException {
    // Build an empty layout and return it
    return layoutBuilder.getDynamicReportBuilder(auditStatistics, locale, format).build();
}
 
開發者ID:Tanaguru,項目名稱:Tanaguru,代碼行數:15,代碼來源:LayoutFactory.java


注:本文中的ar.com.fdvs.dj.domain.builders.ColumnBuilderException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。