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

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


        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;
               
                Criterion filter = ReportUtils.buildFilter(filterToUse, specItem.getFilter());
               
                List<ReportLineItem> reportData = profileInstanceManager.getReportData(
                        filter, specItem.getField(), specItem.getGroupByFields());
   
                for (ReportLineItem reportLineItem : reportData) {
                    final List<String> groupByValues = reportLineItem.getGroupByValues();
                    final String groupKey = getStringListKey(groupByValues);
                    if (!groups.containsKey(groupKey)) {
                        GroupedFieldItem newGroup = new GroupedFieldItem();
                        newGroup.setValues(groupByValues);
                        item.addGroupedFieldItem(newGroup);
                        groups.put(groupKey, newGroup);
                    }
                   
                    GroupedFieldItem groupedFieldItem = groups.get(groupKey);
                    groupedFieldItem.addProfileData(
View Full Code Here

TOP

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

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.