Search in sources :

Example 1 with PortletExecutionAggregationDiscriminator

use of org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator in project uPortal by Jasig.

the class PortletExecutionStatisticsController method createColumnDiscriminatorMap.

protected Map<PortletExecutionAggregationDiscriminator, SortedSet<PortletExecutionAggregation>> createColumnDiscriminatorMap(PortletExecutionReportForm form) {
    // Collections used to track the queried groups and the results
    final Map<PortletExecutionAggregationDiscriminator, SortedSet<PortletExecutionAggregation>> groupedAggregations = new TreeMap<PortletExecutionAggregationDiscriminator, SortedSet<PortletExecutionAggregation>>(PortletExecutionAggregationDiscriminatorImpl.Comparator.INSTANCE);
    // Get concrete group mapping objects that are being queried for
    List<Long> groups = form.getGroups();
    Set<String> portletFNames = form.getPortlets();
    Set<String> executionTypes = form.getExecutionTypeNames();
    for (final Long queryGroupId : groups) {
        AggregatedGroupMapping groupMapping = this.aggregatedGroupLookupDao.getGroupMapping(queryGroupId);
        for (final String portletFName : portletFNames) {
            AggregatedPortletMapping tabMapping = this.aggregatedPortletLookupDao.getMappedPortletForFname(portletFName);
            for (String executionType : executionTypes) {
                final PortletExecutionAggregationDiscriminator mapping = new PortletExecutionAggregationDiscriminatorImpl(groupMapping, tabMapping, ExecutionType.valueOf(executionType));
                // Create the set the aggregations for this report column will be stored in,
                // sorted chronologically
                final SortedSet<PortletExecutionAggregation> aggregations = new TreeSet<PortletExecutionAggregation>(BaseAggregationDateTimeComparator.INSTANCE);
                // Map the group to the set
                groupedAggregations.put(mapping, aggregations);
            }
        }
    }
    return groupedAggregations;
}
Also used : PortletExecutionAggregation(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregation) AggregatedPortletMapping(org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping) TreeMap(java.util.TreeMap) SortedSet(java.util.SortedSet) PortletExecutionAggregationDiscriminator(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator) AggregatedGroupMapping(org.apereo.portal.events.aggr.groups.AggregatedGroupMapping) TreeSet(java.util.TreeSet) PortletExecutionAggregationDiscriminatorImpl(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminatorImpl)

Example 2 with PortletExecutionAggregationDiscriminator

use of org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator in project uPortal by Jasig.

the class PortletExecutionStatisticsController method createAggregationsQueryKeyset.

@Override
protected Set<PortletExecutionAggregationKey> createAggregationsQueryKeyset(Set<PortletExecutionAggregationDiscriminator> columnDiscriminators, PortletExecutionReportForm form) {
    // Create keys (that exclude the temporal date/time information) from the interval
    // and the data in the column discriminators.
    final AggregationInterval interval = form.getInterval();
    final HashSet<PortletExecutionAggregationKey> keys = new HashSet<PortletExecutionAggregationKey>();
    for (PortletExecutionAggregationDiscriminator discriminator : columnDiscriminators) {
        keys.add(new PortletExecutionAggregationKeyImpl(interval, discriminator.getAggregatedGroup(), discriminator.getPortletMapping(), discriminator.getExecutionType()));
    }
    return keys;
}
Also used : PortletExecutionAggregationDiscriminator(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator) PortletExecutionAggregationKeyImpl(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKeyImpl) PortletExecutionAggregationKey(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKey) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval) HashSet(java.util.HashSet)

Aggregations

PortletExecutionAggregationDiscriminator (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator)2 HashSet (java.util.HashSet)1 SortedSet (java.util.SortedSet)1 TreeMap (java.util.TreeMap)1 TreeSet (java.util.TreeSet)1 AggregationInterval (org.apereo.portal.events.aggr.AggregationInterval)1 AggregatedGroupMapping (org.apereo.portal.events.aggr.groups.AggregatedGroupMapping)1 PortletExecutionAggregation (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregation)1 PortletExecutionAggregationDiscriminatorImpl (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminatorImpl)1 PortletExecutionAggregationKey (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKey)1 PortletExecutionAggregationKeyImpl (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKeyImpl)1 AggregatedPortletMapping (org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping)1