当前位置: 首页>>代码示例>>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;未经允许,请勿转载。