Search in sources :

Example 1 with AggregatedPortletMapping

use of org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping in project uPortal by Jasig.

the class BasePortletLayoutStatisticsController method createColumnDiscriminatorMap.

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

Example 2 with AggregatedPortletMapping

use of org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping in project uPortal by Jasig.

the class PortletExecutionStatisticsController method createColumnDiscriminatorMap.

@Override
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 3 with AggregatedPortletMapping

use of org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping in project uPortal by Jasig.

the class PortletExecutionEventConverter method getLrsObject.

@Override
protected LrsObject getLrsObject(PortalEvent event) {
    final String fname = ((PortletExecutionEvent) event).getFname();
    final AggregatedPortletMapping mappedPortletForFname = this.aggregatedPortletLookupDao.getMappedPortletForFname(fname);
    final Builder<String, LocalizedString> definitionBuilder = ImmutableMap.builder();
    definitionBuilder.put("name", new LocalizedString(Locale.US, mappedPortletForFname.getName()));
    return new LrsObject(buildUrn("portlet", fname), getDefaultObjectType(), definitionBuilder.build());
}
Also used : PortletExecutionEvent(org.apereo.portal.events.PortletExecutionEvent) LrsObject(org.apereo.portal.events.tincan.om.LrsObject) AggregatedPortletMapping(org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping) LocalizedString(org.apereo.portal.events.tincan.om.LocalizedString) LocalizedString(org.apereo.portal.events.tincan.om.LocalizedString)

Example 4 with AggregatedPortletMapping

use of org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping in project uPortal by Jasig.

the class PortletExecutionAggregator method createAggregationKey.

@Override
protected PortletExecutionAggregationKey createAggregationKey(PortletExecutionEvent e, EventAggregationContext eventAggregationContext, AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
    final TimeDimension timeDimension = intervalInfo.getTimeDimension();
    final DateDimension dateDimension = intervalInfo.getDateDimension();
    final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
    Map<String, AggregatedPortletMapping> mappedPortlets = eventAggregationContext.getAttribute(MAPPED_PORTLETS_CACHE_KEY);
    if (mappedPortlets == null) {
        mappedPortlets = new HashMap<String, AggregatedPortletMapping>();
        eventAggregationContext.setAttribute(MAPPED_PORTLETS_CACHE_KEY, mappedPortlets);
    }
    final String fname = e.getFname();
    AggregatedPortletMapping mappedPortlet = mappedPortlets.get(fname);
    if (mappedPortlet == null) {
        mappedPortlet = this.aggregatedPortletLookupDao.getMappedPortletForFname(fname);
        mappedPortlets.put(fname, mappedPortlet);
    }
    return new PortletExecutionAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedPortlet, executionType);
}
Also used : AggregatedPortletMapping(org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping) TimeDimension(org.apereo.portal.events.aggr.TimeDimension) DateDimension(org.apereo.portal.events.aggr.DateDimension) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval)

Example 5 with AggregatedPortletMapping

use of org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping in project uPortal by Jasig.

the class JpaPortletExecutionAggregationDao method createAggregationInstance.

@Override
protected PortletExecutionAggregationImpl createAggregationInstance(PortletExecutionAggregationKey key) {
    final TimeDimension timeDimension = key.getTimeDimension();
    final DateDimension dateDimension = key.getDateDimension();
    final AggregationInterval interval = key.getInterval();
    final AggregatedGroupMapping aggregatedGroup = key.getAggregatedGroup();
    final AggregatedPortletMapping portletMapping = key.getPortletMapping();
    final ExecutionType executionType = key.getExecutionType();
    return new PortletExecutionAggregationImpl(timeDimension, dateDimension, interval, aggregatedGroup, portletMapping, executionType);
}
Also used : AggregatedGroupMapping(org.apereo.portal.events.aggr.groups.AggregatedGroupMapping) ExecutionType(org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKey.ExecutionType) AggregatedPortletMapping(org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping) TimeDimension(org.apereo.portal.events.aggr.TimeDimension) DateDimension(org.apereo.portal.events.aggr.DateDimension) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval)

Aggregations

AggregatedPortletMapping (org.apereo.portal.events.aggr.portlets.AggregatedPortletMapping)10 AggregationInterval (org.apereo.portal.events.aggr.AggregationInterval)6 DateDimension (org.apereo.portal.events.aggr.DateDimension)6 TimeDimension (org.apereo.portal.events.aggr.TimeDimension)6 AggregatedGroupMapping (org.apereo.portal.events.aggr.groups.AggregatedGroupMapping)5 SortedSet (java.util.SortedSet)2 TreeMap (java.util.TreeMap)2 TreeSet (java.util.TreeSet)2 PortletLayoutAggregation (org.apereo.portal.events.aggr.portletlayout.PortletLayoutAggregation)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 EntityIdentifier (org.apereo.portal.EntityIdentifier)1 PortletExecutionEvent (org.apereo.portal.events.PortletExecutionEvent)1 PortletExecutionAggregation (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregation)1 PortletExecutionAggregationDiscriminator (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminator)1 PortletExecutionAggregationDiscriminatorImpl (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationDiscriminatorImpl)1 ExecutionType (org.apereo.portal.events.aggr.portletexec.PortletExecutionAggregationKey.ExecutionType)1 PortletLayoutAggregationDiscriminator (org.apereo.portal.events.aggr.portletlayout.PortletLayoutAggregationDiscriminator)1 PortletLayoutAggregationDiscriminatorImpl (org.apereo.portal.events.aggr.portletlayout.PortletLayoutAggregationDiscriminatorImpl)1 LocalizedString (org.apereo.portal.events.tincan.om.LocalizedString)1