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;
}
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;
}
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());
}
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);
}
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);
}
Aggregations