Package uk.gov.nationalarchives.droid.report.interfaces

Examples of uk.gov.nationalarchives.droid.report.interfaces.Report


        request.setProfileIds(profileIds);

        FileWriter fileWriter = null;
        try {
            targetFile = File.createTempFile("report~", ".xml", config.getTempDir());
            Report report = reportManager.generateReport(request, null, backgroundProgressObserver);
            fileWriter = new FileWriter(targetFile);
            reportXmlWriter.writeReport(report, fileWriter);
        } catch (IOException e) {
            log.error(e);
            throw new RuntimeException(e);
View Full Code Here


        throws ReportCancelledException {
        log.info(String.format("Generating report: %s", request.getReportSpec().getName()));
        final int totalSteps = request.getProfileIds().size() * request.getReportSpec().getItems().size();
        int stepCount = 0;

        Report report = new Report();
        report.setTitle(request.getReportSpec().getName());
        for (ReportSpecItem specItem : request.getReportSpec().getItems()) {
            ReportItem item = new ReportItem();
            item.setReportSpecItem(specItem);
            report.addItem(item);
           
            Map<String, GroupedFieldItem> groups = new LinkedHashMap<String, GroupedFieldItem>();
           
            for (String profileId : request.getProfileIds()) {
                ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
                report.addProfile(profile);
               
                ProfileInstanceManager profileInstanceManager =
                    profileContextLocator.openProfileInstanceManager(profile);
               
                Filter filterToUse = optionalFilter == null ? profile.getFilter() : optionalFilter;
View Full Code Here

       
        final ReportSpec reportSpec = new ReportSpec();
        reportSpec.setName("MyCustomReport");
       
        when(reportManager.listReportSpecs()).thenReturn(Arrays.asList(new ReportSpec[] {reportSpec}));
        Report report = new Report();
       
        ArgumentCaptor<ReportRequest> requestCaptor = ArgumentCaptor.forClass(ReportRequest.class);
        when(reportManager.generateReport(requestCaptor.capture(), (Filter) isNull(), (CancellableProgressObserver) isNull()))
            .thenReturn(report);
       
View Full Code Here

    }

    private void writeReport(ReportRequest request, Filter optionalFilter) throws CommandExecutionException {
        try {
            // Build the report
            Report report = reportManager.generateReport(request, optionalFilter, null);
            //FIXME: the report transformer is defined as a singleton bean in the export report
            // action configured through spring.  Here we are instantiating a new specific
            // transformer - there was a bug in that this one did not have the droid config
            // object configured.  For the time being, just set up this transformer correctly.
            ReportTransformerImpl transformer = new ReportTransformerImpl();
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.report.interfaces.Report

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.